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/qt $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 dnl should check it's not Qt2, so it will fail now, rather than in KDE check
634 SAVE_CXXFLAGS="$CXXFLAGS"
635 CXXFLAGS="$CXXFLAGS -I$qt_includes -L$qt_libraries"
636 dnl specify we are definitely C++ compiling first
642 #if (QT_VERSION >= 200)
649 test "$ac_qt_ok" = no && AC_MSG_ERROR([Found Qt 2 - you must specify the path to the Qt 1 headers and libraries])
650 CXXFLAGS="$SAVE_CXXFLAGS"
652 AC_SUBST(qt_libraries)
653 AC_SUBST(qt_includes)
655 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
658 QT_INCLUDES="-I$qt_includes"
659 all_includes="$QT_INCLUDES $all_includes"
662 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
665 QT_LDFLAGS="-L$qt_libraries"
666 all_libraries="$QT_LDFLAGS $all_libraries"
669 AC_SUBST(QT_INCLUDES)
679 ## ------------------------------------------------------------------------
680 ## Now, the same with KDE
681 ## $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
682 ## and $(kde_includes) will be the kdehdrlocation (if needed)
683 ## ------------------------------------------------------------------------
685 AC_DEFUN(AC_BASE_PATH_KDE,
687 AC_REQUIRE([KDE_MISC_TESTS])
688 AC_REQUIRE([AC_PATH_QT])dnl
689 AC_MSG_CHECKING([for KDE])
692 [ --with-kde-dir where the KDE root is ],
693 [ export KDEDIR="$withval" ])
695 if test "${prefix}" != NONE; then
696 kde_includes=${prefix}/include
697 ac_kde_includes=$prefix/include
699 if test "${exec_prefix}" != NONE; then
700 kde_libraries=${exec_prefix}/lib
701 ac_kde_libraries=$exec_prefix/lib
703 kde_libraries=${prefix}/lib
704 ac_kde_libraries=$prefix/lib
713 if test ! -z "$KDEDIR"; then
714 ac_kde_includes="$KDEDIR/include"
715 kde_includes="$KDEDIR/include"
716 ac_kde_libraries="$KDEDIR/lib"
717 kde_libraries="$KDEDIR/lib"
720 AC_ARG_WITH(kde-includes,
721 [ --with-kde-includes where the KDE includes are installed. ],
722 [ ac_kde_includes="$withval" ])
724 AC_ARG_WITH(kde-libraries,
725 [ --with-kde-libraries where the KDE libraries are installed.],
726 [ ac_kde_libraries="$withval" ])
728 AC_CACHE_VAL(ac_cv_have_kde,
729 [#try to guess kde locations
731 if test -z "$1"; then
733 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde/include $x_includes $qt_includes"
734 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include/kde $KDEDIR/include $KDEDIR $kde_incdirs"
735 kde_incdirs="$ac_kde_includes $kde_incdirs"
736 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
737 ac_kde_includes="$kde_incdir"
739 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
741 in the prefix, you've chosen, are no kde headers installed. This will fail.
742 So, check this please and use another prefix!])
745 kde_libdirs="/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"
746 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
747 kde_libdirs="$ac_kde_libraries $kde_libdirs"
748 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
749 ac_kde_libraries="$kde_libdir"
751 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
753 in the prefix, you've chosen $ac_kde_libraries, are no kde libraries installed. This will fail.
754 So, check this please and use another prefix!])
757 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
758 ac_cv_have_kde="have_kde=no"
760 ac_cv_have_kde="have_kde=yes \
761 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
766 ac_cv_have_kde="have_kde=no"
771 eval "$ac_cv_have_kde"
773 if test "$have_kde" != "yes"; then
774 if test "${prefix}" = NONE; then
775 ac_kde_prefix="$ac_default_prefix"
777 ac_kde_prefix="$prefix"
779 if test "$exec_prefix" = NONE; then
780 ac_kde_exec_prefix="$ac_kde_prefix"
781 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
783 ac_kde_exec_prefix="$exec_prefix"
784 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
787 kde_libraries="${ac_kde_exec_prefix}/lib"
788 kde_includes=${ac_kde_prefix}/include
791 ac_cv_have_kde="have_kde=yes \
792 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
793 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
795 kde_libraries="$ac_kde_libraries"
796 kde_includes="$ac_kde_includes"
798 AC_SUBST(kde_libraries)
799 AC_SUBST(kde_includes)
801 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
804 KDE_INCLUDES="-I$kde_includes"
805 all_includes="$KDE_INCLUDES $all_includes"
808 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
811 KDE_LDFLAGS="-L$kde_libraries"
812 all_libraries="$KDE_LDFLAGS $all_libraries"
815 AC_SUBST(KDE_LDFLAGS)
816 AC_SUBST(KDE_INCLUDES)
818 AC_SUBST(all_includes)
819 AC_SUBST(all_libraries)
823 AC_DEFUN(KDE_CHECK_KIMGIO,
825 AC_REQUIRE([AC_FIND_TIFF])
826 AC_REQUIRE([AC_FIND_JPEG])
827 AC_REQUIRE([AC_FIND_PNG])
829 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) -lm'
831 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
833 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
837 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
839 AC_REQUIRE([KDE_MISC_TESTS])
841 KDE_LIBS='-lkfile -lkfm -lkdeui -lkdecore -lqt'
843 # LIB_X11='-lX11 $(LIBSOCKET)'
845 # LIB_QT='-lqt $(LIB_X11)'
847 # LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
848 # AC_SUBST(LIB_KDECORE)
849 # LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
850 # AC_SUBST(LIB_KDEUI)
851 # LIB_KFM='-lkfm $(LIB_KDECORE)'
853 # LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
854 # AC_SUBST(LIB_KFILE)
857 AC_DEFUN(AC_PATH_KDE,
860 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
862 if test "$enableval" = "no";
863 then ac_use_path_checking="default"
864 else ac_use_path_checking=""
866 ], [ac_use_path_checking=""]
869 AC_ARG_WITH(install-root, [ --with-install-root the root, where to install to [default=/]],
871 if test "$withval" = "no";
872 then kde_install_root="";
873 else kde_install_root=$withval;
875 ], [kde_install_root=""]
878 if test -n "$kde_install_root"; then
879 install_root="$kde_install_root"
884 AC_CREATE_KFSSTND($ac_use_path_checking)
887 KDE_CREATE_LIBS_ALIASES
890 dnl slightly changed version of AC_CHECK_FUNC(setenv)
891 AC_DEFUN(AC_CHECK_SETENV,
892 [AC_MSG_CHECKING([for setenv])
893 AC_CACHE_VAL(ac_cv_func_setenv,
896 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
897 dnl which includes <sys/select.h> which contains a prototype for
898 dnl select. Similarly for bzero.
900 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
904 [/* We use char because int might match the return type of a gcc2
905 builtin and then its argument prototype would still apply. */
908 /* The GNU C library defines this for functions which it implements
909 to always fail with ENOSYS. Some functions are actually named
910 something starting with __ and the normal name is an alias. */
911 #if defined (__stub_$1) || defined (__stub___$1)
914 setenv("TEST", "alle", 1);
916 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
918 if test "$ac_cv_func_setenv" = "yes"; then
920 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
926 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
929 save_CXXFLAGS="$CXXFLAGS"
930 if test "$GCC" = "yes"; then
931 CXXFLAGS="$CXXFLAGS -pedantic-errors"
933 AC_MSG_CHECKING(for getdomainname)
934 AC_CACHE_VAL(ac_cv_func_getdomainname,
942 getdomainname(buffer, 200);
944 ac_cv_func_getdomainname=yes,
945 ac_cv_func_getdomainname=no)
947 AC_MSG_RESULT($ac_cv_func_getdomainname)
948 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
949 AC_DEFINE(HAVE_GETDOMAINNAME)
951 CXXFLAGS="$save_CXXFLAGS"
954 AC_DEFUN(AC_CHECK_GETHOSTNAME,
957 save_CXXFLAGS="$CXXFLAGS"
958 if test "$GCC" = "yes"; then
959 CXXFLAGS="$CXXFLAGS -pedantic-errors"
962 AC_MSG_CHECKING([for gethostname])
963 AC_CACHE_VAL(ac_cv_func_gethostname,
971 gethostname(buffer, 200);
973 ac_cv_func_gethostname=yes,
974 ac_cv_func_gethostname=no)
976 AC_MSG_RESULT($ac_cv_func_gethostname)
977 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
978 AC_DEFINE(HAVE_GETHOSTNAME)
980 CXXFLAGS="$save_CXXFLAGS"
983 AC_DEFUN(AC_CHECK_USLEEP,
987 AC_MSG_CHECKING([for usleep])
988 AC_CACHE_VAL(ac_cv_func_usleep,
999 ac_cv_func_usleep=yes,
1000 ac_cv_func_usleep=no)
1002 AC_MSG_RESULT($ac_cv_func_usleep)
1003 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
1004 AC_DEFINE(HAVE_USLEEP)
1006 LIBS="$ac_libs_safe"
1009 AC_DEFUN(AC_FIND_GIF,
1010 [AC_MSG_CHECKING([for giflib])
1011 AC_CACHE_VAL(ac_cv_lib_gif,
1012 [ac_save_LIBS="$LIBS"
1013 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1019 int GifLastError(void);
1023 /* We use char because int might match the return type of a gcc2
1024 builtin and then its argument prototype would still apply. */
1026 [return GifLastError();],
1027 eval "ac_cv_lib_gif=yes",
1028 eval "ac_cv_lib_gif=no")
1029 LIBS="$ac_save_LIBS"
1031 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1033 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
1035 AC_MSG_ERROR(You need giflib23. Please install the kdesupport package)
1039 AC_DEFUN(AC_FIND_JPEG,
1040 [AC_MSG_CHECKING([for jpeglib])
1041 AC_CACHE_VAL(ac_cv_lib_jpeg,
1042 [ac_save_LIBS="$LIBS"
1043 LIBS="$all_libraries -ljpeg -lm"
1045 [/* Override any gcc2 internal prototype to avoid an error. */
1046 struct jpeg_decompress_struct;
1047 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1052 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1053 int version, size_t structsize);
1057 /* We use char because int might match the return type of a gcc2
1058 builtin and then its argument prototype would still apply. */
1060 [jpeg_CreateDecompress(0L, 0, 0);],
1061 eval "ac_cv_lib_jpeg=-ljpeg",
1062 eval "ac_cv_lib_jpeg=no")
1063 LIBS="$ac_save_LIBS"
1065 dnl what to do, if the normal way fails:
1066 if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then
1067 if test -f "$kde_libraries/libjpeg.so"; then
1068 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1069 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1070 else if test -f "$kde_libraries/libjpeg.sl"; then
1071 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1072 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1073 else if test -f "$kde_libraries/libjpeg.a"; then
1074 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1075 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1078 You need jpeglib6a. Please install the kdesupport package.
1079 If you have already installed kdesupport, you may have an
1080 old libjpeg somewhere.
1081 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
1088 if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then
1089 LIBJPEG="$ac_cv_lib_jpeg"
1091 AC_MSG_RESULT($ac_cv_lib_jpeg)
1092 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
1096 AC_DEFUN(AC_FIND_ZLIB,
1098 AC_MSG_CHECKING([for libz])
1099 AC_CACHE_VAL(ac_cv_lib_z,
1100 [ac_save_LIBS="$LIBS"
1101 LIBS="$all_libraries -lz $LIBSOCKET"
1106 [return (zlibVersion() == ZLIB_VERSION); ],
1107 eval "ac_cv_lib_z='-lz'",
1108 eval "ac_cv_lib_z=no")
1109 LIBS="$ac_save_LIBS"
1111 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1112 dnl AC_DEFINE_UNQUOTED(HAVE_LIBZ)
1115 AC_MSG_RESULT($ac_cv_lib_z)
1123 AC_DEFUN(AC_FIND_TIFF,
1125 AC_REQUIRE([AC_FIND_ZLIB])
1126 AC_REQUIRE([AC_FIND_JPEG])
1127 AC_MSG_CHECKING([for libtiff])
1128 AC_CACHE_VAL(ac_cv_lib_tiff,
1129 [ac_save_LIBS="$LIBS"
1130 LIBS="$all_libraries -ltiff $LIBJPEG $LIBZ -lX11 $LIBSOCKET"
1135 [return (TIFFOpen( "", "r") == 0); ],
1136 eval "ac_cv_lib_tiff='-ltiff $LIBJPEG $LIBZ'",
1137 eval "ac_cv_lib_tiff=no")
1138 LIBS="$ac_save_LIBS"
1140 if eval "test ! \"`echo $ac_cv_lib_tiff`\" = no"; then
1141 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
1142 LIBTIFF="$ac_cv_lib_tiff"
1144 AC_MSG_RESULT($ac_cv_lib_tiff)
1153 AC_DEFUN(AC_FIND_PNG,
1155 AC_REQUIRE([AC_FIND_ZLIB])
1156 AC_MSG_CHECKING([for libpng])
1157 AC_CACHE_VAL(ac_cv_lib_png,
1158 [ac_save_LIBS="$LIBS"
1159 LIBS="$all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1166 png_structp png_ptr = png_create_read_struct( // image ptr
1167 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1168 return( png_ptr != 0 );
1170 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1171 eval "ac_cv_lib_png=no")
1172 LIBS="$ac_save_LIBS"
1174 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1175 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
1176 LIBPNG="$ac_cv_lib_png"
1178 AC_MSG_RESULT($ac_cv_lib_png)
1186 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1188 AC_MSG_CHECKING(if you need GNU extensions)
1189 AC_CACHE_VAL(ac_cv_gnu_extensions,
1191 cat > conftest.c << EOF
1192 #include <features.h>
1194 #ifdef __GNU_LIBRARY__
1199 if (eval "$ac_cpp conftest.c") 2>&5 |
1200 egrep "yes" >/dev/null 2>&1; then
1202 ac_cv_gnu_extensions=yes
1204 ac_cv_gnu_extensions=no
1208 AC_MSG_RESULT($ac_cv_gnu_extensions)
1209 if test "$ac_cv_gnu_extensions" = "yes"; then
1210 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
1214 dnl just a wrapper to clean up configure.in
1215 AC_DEFUN(KDE_PROG_LIBTOOL,
1217 AC_REQUIRE([AM_ENABLE_SHARED])
1218 AC_REQUIRE([AM_ENABLE_STATIC])
1219 dnl libtool is only for C, so I must force him
1220 dnl to find the correct flags for C++
1222 ac_save_cflags="$CFLAGS"
1225 AM_PROG_LIBTOOL dnl for libraries
1227 CFLAGS="$ac_save_cflags"
1230 AC_DEFUN(KDE_DO_IT_ALL,
1232 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1235 AC_PATH_PROG(QTARCH, "qtarch",qtarch-notinstalled)
1238 AC_DEFUN(AC_CHECK_RPATH,
1240 AC_MSG_CHECKING(for rpath)
1241 AC_ARG_ENABLE(rpath,
1242 [ --disable-rpath do not use the rpath feature of ld],
1243 USE_RPATH=$enableval, USE_RPATH=yes)
1244 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1246 KDE_RPATH="-rpath \$(kde_libraries)"
1248 if test -n "$qt_libraries"; then
1249 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1251 dnl $x_libraries is set to /usr/lib in case
1252 if test -n "$X_LDFLAGS"; then
1253 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1255 if test -n "$KDE_EXTRA_RPATH"; then
1256 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1259 AC_SUBST(KDE_EXTRA_RPATH)
1261 AC_MSG_RESULT($USE_RPATH)
1264 # Search path for a program which passes the given test.
1265 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1268 # Stephan Kulow: I appended a _KDE against name conflicts
1270 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1271 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1272 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1273 [# Extract the first word of "$2", so it can be a program name with args.
1274 set dummy $2; ac_word=[$]2
1275 AC_MSG_CHECKING([for $ac_word])
1276 AC_CACHE_VAL(ac_cv_path_$1,
1279 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1282 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1283 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1284 test -z "$ac_dir" && ac_dir=.
1285 if test -f $ac_dir/$ac_word; then
1287 ac_cv_path_$1="$ac_dir/$ac_word"
1293 dnl If no 4th arg is given, leave the cache variable unset,
1294 dnl so AC_PATH_PROGS will keep looking.
1295 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1300 if test -n "[$]$1"; then
1301 AC_MSG_RESULT([$]$1)
1309 dnl From Jim Meyering.
1310 dnl FIXME: migrate into libit.
1312 AC_DEFUN(AM_FUNC_OBSTACK,
1313 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
1314 [AC_TRY_LINK([#include "obstack.h"],
1315 [struct obstack *mem;obstack_free(mem,(char *) 0)],
1316 am_cv_func_obstack=yes,
1317 am_cv_func_obstack=no)])
1318 if test $am_cv_func_obstack = yes; then
1319 AC_DEFINE(HAVE_OBSTACK)
1321 LIBOBJS="$LIBOBJS obstack.o"
1325 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
1326 dnl FIXME: Migrate into libit
1328 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
1329 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
1330 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
1331 am_cv_lib_error_at_line=yes,
1332 am_cv_lib_error_at_line=no)])
1333 if test $am_cv_lib_error_at_line = no; then
1334 LIBOBJS="$LIBOBJS error.o"
1336 AC_SUBST(LIBOBJS)dnl
1339 # Macro to add for using GNU gettext.
1340 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1343 # Stephan Kulow: I put a KDE in it to avoid name conflicts
1345 AC_DEFUN(AM_KDE_GNU_GETTEXT,
1346 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1347 AC_REQUIRE([AC_PROG_RANLIB])dnl
1348 AC_REQUIRE([AC_HEADER_STDC])dnl
1349 AC_REQUIRE([AC_C_INLINE])dnl
1350 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1351 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1352 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1353 AC_REQUIRE([AC_FUNC_MMAP])dnl
1354 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1355 unistd.h values.h alloca.h])
1356 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1357 __argz_count __argz_stringify __argz_next stpcpy])
1361 if test "x$CATOBJEXT" != "x"; then
1362 if test "x$ALL_LINGUAS" = "x"; then
1365 AC_MSG_CHECKING(for catalogs to be installed)
1367 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1368 case "$ALL_LINGUAS" in
1369 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1372 LINGUAS=$NEW_LINGUAS
1373 AC_MSG_RESULT($LINGUAS)
1376 dnl Construct list of names of catalog files to be constructed.
1377 if test -n "$LINGUAS"; then
1378 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1384 AC_DEFUN(AC_HAVE_XPM,
1385 [AC_REQUIRE_CPP()dnl
1387 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
1388 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
1390 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
1391 xpm_test=$withval, xpm_test="yes")
1392 if test "x$xpm_test" = xno; then
1395 AC_MSG_CHECKING(for XPM)
1396 AC_CACHE_VAL(ac_cv_have_xpm,
1399 ac_save_ldflags="$LDFLAGS"
1400 ac_save_cflags="$CFLAGS"
1401 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
1402 CFLAGS="$CFLAGS $X_INCLUDES"
1403 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
1404 AC_TRY_LINK([#include <X11/xpm.h>],[],
1405 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
1406 LDFLAGS="$ac_save_ldflags"
1407 CFLAGS="$ac_save_cflags"
1410 if test "$ac_cv_have_xpm" = no; then
1417 if test "$XPM_LDFLAGS" = ""; then
1420 XPMLIB="-L$XPM_LDFLAGS -lXpm"
1422 if test "$XPM_INCLUDE" = ""; then
1425 XPMINC="-I$XPM_INCLUDE"
1435 AC_DEFUN(AC_HAVE_GL,
1436 [AC_REQUIRE_CPP()dnl
1438 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
1439 test -z "$GL_INCLUDE" && GL_INCLUDE=
1441 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
1442 gl_test=$withval, gl_test="yes")
1443 if test "x$gl_test" = xno; then
1446 AC_MSG_CHECKING(for GL)
1447 AC_CACHE_VAL(ac_cv_have_gl,
1450 ac_save_ldflags="$LDFLAGS"
1451 ac_save_cflags="$CFLAGS"
1452 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
1453 CFLAGS="$CFLAGS $X_INCLUDES"
1454 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
1456 ac_cv_have_gl="yes",ac_cv_have_gl="no")
1457 LDFLAGS="$ac_save_ldflags"
1458 CFLAGS="$ac_save_cflags"
1461 if test "$ac_cv_have_gl" = no; then
1468 if test "$GL_LDFLAGS" = ""; then
1469 GLLIB="-lMesaGL -lMesaGLU"
1471 GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU"
1473 if test "$GL_INCLUDE" = ""; then
1476 GLINC="-I$GL_INCLUDE"
1488 dnl Should test for PAM (Pluggable Authentication Modules)
1489 AC_DEFUN(AC_PATH_PAM_DIRECT,
1491 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
1492 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
1496 /usr/local/include \
1498 /usr/unsupported/include \
1501 /usr/local/pam/include \
1502 /usr/lib/pam/include \
1507 if test -r "$ac_dir/$pam_direct_test_include"; then
1508 no_pam= ac_pam_includes=$ac_dir
1513 # First see if replacing the include by lib works.
1514 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
1519 /usr/unsupported/lib \
1525 for ac_extension in a so sl; do
1526 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
1527 no_pam= ac_pam_libraries=$ac_dir
1534 AC_DEFUN(AC_PATH_PAM,
1535 [AC_REQUIRE_CPP()dnl
1537 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"], [], [-lpam -ldl])
1539 AC_MSG_CHECKING(for PAM)
1541 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
1543 if test "x$withval" = "xyes"; then
1546 elif test "x$withval" = "xno"; then
1550 pam_service="$withval"
1551 if test -z "$pam_service"; then
1560 if test ! "$no_pam" = yes; then
1562 AC_CACHE_VAL(ac_cv_path_pam,
1564 ac_pam_includes=NONE
1565 ac_pam_libraries=NONE
1566 if test -z "$pam_libraries"; then
1569 if test -z "$pam_includes"; then
1575 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1576 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1578 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
1579 ac_pam_libs="-lpam $PAM_MISC_LIB -ldl"
1580 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
1582 ac_cv_path_pam="no_pam=yes"
1586 eval "$ac_cv_path_pam"
1590 if test "$no_pam" = yes; then
1594 PAMLIBS="$ac_pam_libs"
1595 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1596 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1597 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
1598 if test "$default_pam" = yes; then
1599 AC_MSG_RESULT(["default pam service name will be used"])
1601 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service")
1602 AC_MSG_RESULT(["pam service name will be: " $pam_service])
1604 dnl test whether struct pam_message is const (Linux) or not (Sun)
1605 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
1606 AC_MSG_CHECKING(for const pam_message)
1607 AC_EGREP_HEADER([struct pam_message],
1609 [ AC_EGREP_HEADER([const struct pam_message],
1611 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
1612 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
1613 AC_DEFINE(PAM_MESSAGE_NONCONST)]
1615 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
1619 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
1620 PAMLIBPATHS="-L$pam_libraries"
1622 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
1623 PAMINC="-I$pam_includes"
1628 AC_SUBST(PAMLIBPATHS)
1632 AC_DEFUN(KDE_CHECK_LIBDL,
1634 AC_CHECK_LIB(dl, dlopen, [
1636 ac_cv_have_dlfcn=yes
1639 AC_CHECK_LIB(dld, shl_unload, [
1641 ac_cv_have_shload=yes
1647 AC_DEFUN(KDE_CHECK_DLOPEN,
1650 AC_CHECK_HEADERS(dlfcn.h dl.h)
1651 if test "$ac_cv_header_dlfcn_h" = "no"; then
1655 if test "$ac_cv_header_dl_h" = "no"; then
1656 ac_cv_have_shload=no
1660 AC_ARG_ENABLE(dlopen,
1661 [ --disable-dlopen link staticly [default=no]] ,
1662 [if test "$enableval" = yes; then
1667 # override the user's opinion, if we know it better ;)
1668 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
1672 if test "$ac_cv_have_dlfcn" = "yes"; then
1673 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
1676 if test "$ac_cv_have_shload" = "yes"; then
1677 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
1680 if test "$enable_dlopen" = no ; then
1681 test -n "$1" && eval $1
1683 test -n "$2" && eval $2
1688 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
1690 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
1692 AC_MSG_CHECKING([dynamic loading])
1693 eval "`egrep '^build_libtool_libs=' libtool`"
1694 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
1696 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
1700 AC_MSG_RESULT($dynamic_loading)
1701 if test "$dynamic_loading" = "yes"; then
1708 AC_DEFUN(KDE_ADD_INCLUDES,
1710 if test -z "$1"; then
1711 test_include="Pix.h"
1716 AC_MSG_CHECKING([for libg++ ($test_include)])
1718 AC_CACHE_VAL(kde_cv_libgpp_includes,
1720 kde_cv_libgpp_includes=no
1726 /usr/unsupported/include \
1731 if test -r "$ac_dir/$test_include"; then
1732 kde_cv_libgpp_includes=$ac_dir
1738 AC_MSG_RESULT($kde_cv_libgpp_includes)
1739 if test "$kde_cv_libgpp_includes" != "no"; then
1740 all_includes="-I$kde_cv_libgpp_includes $all_includes"
1746 AC_DEFUN(KDE_CHECK_MICO,
1748 AC_REQUIRE([KDE_CHECK_LIBDL])
1749 AC_MSG_CHECKING(for MICO)
1750 AC_ARG_WITH(micodir,
1751 [ --with-micodir=micodir where mico is installed ],
1752 kde_micodir=$withval,
1753 kde_micodir=/usr/local
1755 AC_MSG_RESULT($kde_micodir)
1756 if test ! -r $kde_micodir/include/CORBA.h; then
1757 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
1760 MICO_INCLUDES=-I$kde_micodir/include
1761 AC_SUBST(MICO_INCLUDES)
1762 MICO_LDFLAGS=-L$kde_micodir/lib
1763 AC_SUBST(MICO_LDFLAGS)
1765 AC_MSG_CHECKING([for MICO version])
1766 AC_CACHE_VAL(kde_cv_mico_version,
1769 cat >conftest.$ac_ext <<EOF
1771 #include <mico/version.h>
1774 printf("MICO_VERSION=%s\n",MICO_VERSION);
1778 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
1779 if AC_TRY_EVAL(ac_compile); then
1780 if eval `./conftest 2>&5`; then
1781 kde_cv_mico_version=$MICO_VERSION
1783 AC_MSG_ERROR([your system is not able to execute a small application to
1784 find MICO version! Check $kde_micodir/include/mico/version.h])
1787 AC_MSG_ERROR([your system is not able to compile a small application to
1788 find MICO version! Check $kde_micodir/include/mico/version.h])
1792 dnl installed MICO version
1793 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
1794 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
1795 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
1797 dnl required MICO version
1798 req_v_maj=`echo $1 | sed -e 's/^\(.*\)\..*\..*$/\1/'`
1799 req_v_mid=`echo $1 | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
1800 req_v_min=`echo $1 | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
1802 if test "$mico_v_maj" -lt "$req_v_maj" || \
1803 ( test "$mico_v_maj" -eq "$req_v_maj" && \
1804 test "$mico_v_mid" -lt "$req_v_mid" ) || \
1805 ( test "$mico_v_mid" -eq "$req_v_mid" && \
1806 test "$mico_v_min" -lt "$req_v_min" )
1809 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $1 \
1810 at least is required. You should upgrade MICO.])
1812 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $1, ok)])
1815 LIBMICO="-lmico$kde_cv_mico_version $LIBDL"
1817 IDL=$kde_micodir/bin/idl
1822 AC_DEFUN(KDE_CHECK_MINI_STL,
1824 AC_REQUIRE([KDE_CHECK_MICO])
1826 AC_MSG_CHECKING(if we use mico's mini-STL)
1827 AC_CACHE_VAL(kde_cv_have_mini_stl,
1830 kde_save_cxxflags="$CXXFLAGS"
1831 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
1834 #include <mico/config.h>
1837 #ifdef HAVE_MINI_STL
1841 kde_cv_have_mini_stl=no,
1842 kde_cv_have_mini_stl=yes)
1843 CXXFLAGS="$kde_save_cxxflags"
1847 AC_MSG_RESULT($kde_cv_have_mini_stl)
1848 if test "$kde_cv_have_mini_stl" = "yes"; then
1849 AC_DEFINE_UNQUOTED(HAVE_MINI_STL)
1856 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
1858 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
1859 AC_SUBST(LIBPTHREAD)
1862 AC_DEFUN(KDE_TRY_LINK_PYTHON,
1864 AC_CACHE_VAL(kde_cv_try_link_python_$1,
1866 kde_save_cxxflags="$CXXFLAGS"
1867 CXXFLAGS="$CXXFLAGS $PYTHONINC"
1868 kde_save_libs="$LIBS"
1869 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
1870 kde_save_ldflags="$LDFLAGS"
1871 LDFLAGS="$LDFLAGS $PYTHONLIB"
1877 PySys_SetArgv(1, 0);
1879 [kde_cv_try_link_python_$1=yes],
1880 [kde_cv_try_link_python_$1=no]
1882 CXXFLAGS="$kde_save_cxxflags"
1883 LIBS="$kde_save_libs"
1884 LDFLAGS="$kde_save_ldflags"
1887 if test "$kde_cv_try_link_python_$1" = "yes"; then
1895 AC_DEFUN(KDE_CHECK_PYTHON,
1897 AC_REQUIRE([KDE_CHECK_LIBDL])
1898 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
1899 if test -z "$1"; then
1905 AC_MSG_CHECKING([for Python$version])
1907 AC_ARG_WITH(pythondir,
1908 [ --with-pythondir=pythondir use python installed in pythondir ],
1910 ac_python_dir=$withval
1911 ], ac_python_dir=/usr/local
1914 python_incdirs="$ac_python_dir/include/python$version /usr/include/python$version /usr/local/include/python$version /usr/local/include"
1915 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
1916 if test ! -r $python_incdir/Python.h; then
1917 AC_MSG_ERROR(Python.h not found.)
1920 PYTHONINC=-I$python_incdir
1922 python_libdirs="$ac_python_dir/lib/python$version/config /usr/lib/python$version/config /usr/local/python$version/config"
1923 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
1924 if test ! -r $python_libdir/libpython$version.a; then
1925 AC_MSG_ERROR(libpython$version.a not found.)
1928 PYTHONLIB=-L$python_libdir
1929 LIBPYTHON=-lpython$version
1931 AC_MSG_RESULT(header $python_incdir library $python_libdir)
1933 dnl Note: this test is very weak
1934 AC_MSG_CHECKING(if an Python application links)
1935 KDE_TRY_LINK_PYTHON(normal, "", AC_MSG_RESULT(yes),
1938 AC_MSG_CHECKING(if Python depends on -lpthread)
1939 KDE_TRY_LINK_PYTHON(pthread, "$LIBPTHREAD",
1942 LIBPYTHON="$LIBPYTHON $LIBPTHREAD $LIBDL"
1946 AC_MSG_CHECKING(if Python depeds on -ltcl)
1947 KDE_TRY_LINK_PYTHON(tcl, "-ltcl",
1950 LIBPYTHON="$LIBPYTHON -ltcl"
1954 AC_MSG_WARN([it seems, Python depends on another library.
1955 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
1956 and contact the authors to let them know about this problem])
1968 AC_DEFUN(KDE_CHECK_STL_SGI,
1970 AC_MSG_CHECKING([if STL implementation is SGI like])
1971 AC_CACHE_VAL(kde_cv_stl_type_sgi,
1976 string astring="Hallo Welt.";
1977 astring.erase(0, 6); // now astring is "Welt"
1979 ], kde_cv_stl_type_sgi=yes,
1980 kde_cv_stl_type_sgi=no)
1983 AC_MSG_RESULT($kde_cv_stl_type_sgi)
1985 if test "$kde_cv_stl_type_sgi" = "yes"; then
1986 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
1990 AC_DEFUN(KDE_CHECK_STL_HP,
1992 AC_MSG_CHECKING([if STL implementation is HP like])
1993 AC_CACHE_VAL(kde_cv_stl_type_hp,
1998 string astring="Hello World";
1999 astring.remove(0, 6); // now astring is "World"
2001 ], kde_cv_stl_type_hp=yes,
2002 kde_cv_stl_type_hp=no)
2004 AC_MSG_RESULT($kde_cv_stl_type_hp)
2006 if test "$kde_cv_stl_type_hp" = "yes"; then
2007 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
2011 AC_DEFUN(KDE_CHECK_STL,
2015 if test "$kde_cv_stl_type_sgi" = "no"; then
2018 if test "$kde_cv_stl_type_hp" = "no"; then
2019 AC_MSG_ERROR("no known STL type found")
2025 AC_DEFUN(AC_FIND_QIMGIO,
2026 [AC_REQUIRE([AC_FIND_JPEG])
2027 AC_MSG_CHECKING([for qimgio])
2028 AC_CACHE_VAL(ac_cv_lib_qimgio,
2029 [ac_save_LIBS="$LIBS"
2030 LIBS="$all_libraries -lqimgio -lpng -lz -lqt $LIBJPEG -lX11 $LIBSOCKET"
2033 void qInitImageIO ();
2036 eval "ac_cv_lib_qimgio=yes",
2037 eval "ac_cv_lib_qimgio=no")
2038 LIBS="$ac_save_LIBS"
2040 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
2041 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
2043 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
2046 AC_MSG_RESULT(not found)
2050 AC_DEFUN(KDE_CHECK_ANSI,
2052 AC_MSG_CHECKING([for strdup])
2054 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2057 save_CXXFLAGS="$CXXFLAGS"
2058 if test "$GCC" = "yes"; then
2059 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2065 char buffer[] = "Hallo";
2067 ], kde_cv_has_strdup=yes,
2068 kde_cv_has_strdup=no)
2069 CXXFLAGS="$save_CXXFLAGS"
2071 AC_MSG_RESULT($kde_cv_has_strdup)
2073 if test "$kde_cv_has_strdup" = "yes"; then
2074 AC_DEFINE_UNQUOTED(HAVE_STRDUP)
2079 AC_DEFUN(KDE_CHECK_INSURE,
2081 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
2083 if test $enableval = "no"; dnl
2084 then ac_use_insure="no"
2085 else ac_use_insure="yes"
2087 ], [ac_use_insure="no"])
2089 AC_MSG_CHECKING(if we will use Insure++ to debug)
2090 AC_MSG_RESULT($ac_use_insure)
2091 if test "$ac_use_insure" = "yes"; dnl
2092 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
2096 dnl this is for kdm:
2098 AC_DEFUN(AC_CHECK_KDM,
2100 AC_CHECK_FUNCS(getsecretkey)
2101 dnl checks for X server
2103 AC_PATH_PROG(X_SERVER, X)
2104 if test ! -z "$X_SERVER"; then
2105 X_SERVER=`echo $X_SERVER | sed -e 's+/X$++'`
2106 AC_DEFINE_UNQUOTED(XBINDIR,$X_SERVER)
2111 dnl This one tries to find XDMDIR for config files
2113 [ --with-xdmdir If the xdm config dir can't be found automaticly],
2114 [ ac_xdmdir=$withval],
2117 AC_MSG_CHECKING([for xdm configuration dir])
2118 if test "$ac_xdmdir" = "no"; then
2120 if mkdir conftestdir; then
2122 cat > Imakefile <<'EOF'
2124 @echo 'ac_xdmdir="$(XDMDIR)";'
2126 if (xmkmf) > /dev/null 2> /dev/null && test -f Makefile; then
2127 eval `${MAKE-make} acfindxdm 2>/dev/null 2>/dev/null | grep -v make`
2131 dnl Check if Imake was right
2132 if test -f $ac_xdmdir/xdm-config; then
2133 AC_MSG_RESULT($ac_xdmdir)
2135 dnl Here we must do something else
2136 dnl Maybe look for xdm-config in standard places, and
2137 dnl if that fails use a fresh copy in $KDEDIR/config/kdm/
2138 AC_FIND_FILE(xdm-config,/etc/X11/xdm /var/X11/xdm /usr/openwin/xdm /usr/X11R6/lib/X11/xdm,ac_xdmdir)
2139 if test -f $ac_xdmdir/xdm-config; then
2140 AC_MSG_RESULT($ac_xdmdir)
2142 if test "${prefix}" = NONE; then
2143 ac_xdmdir=$ac_default_prefix/config/kdm
2145 ac_xdmdir=$prefix/config/kdm
2147 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2148 xdmconfigsubdir=xdmconfig
2149 AC_SUBST(xdmconfigsubdir)
2154 if test -f $ac_xdmdir/xdm-config; then
2155 AC_MSG_RESULT($ac_xdmdir)
2158 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2159 xdmconfigsubdir=xdmconfig
2160 AC_SUBST(xdmconfigsubdir)
2163 AC_DEFINE_UNQUOTED(XDMDIR,"$ac_xdmdir")
2167 if test "x$no_pam" = "xyes"; then
2171 shadow_support="no" # if pam is installed, use it. We can't savely
2172 # test, if it works *sigh*
2176 [ --with-shadow If you want shadow password support ],
2177 [ if test "$withval" = "yes"; then
2178 shadow_support="yes"
2182 if test "$pam_support" = "yes" && test "$shadow_support=yes"; then
2183 AC_MSG_WARN("You can not define both pam AND shadow")
2186 [ if test -z "$shadow_support"; then shadow_support="no"; fi ] )
2188 if test "$pam_support" = "yes"; then
2189 AC_CHECK_LIB(pam, main, [PASSWDLIB="-lpam -ldl"
2190 AC_DEFINE_UNQUOTED(HAVE_PAM_LIB)],
2194 if test -z "$PASSWDLIB" && test "$shadow_support" = "yes"; then
2195 AC_CHECK_LIB(shadow, main,
2196 [ PASSWDLIB="-lshadow"
2197 AC_DEFINE_UNQUOTED(HAVE_SHADOW_LIB)
2201 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
2203 AC_CHECK_LIB(s, main, [LIB_LIBS="-ls"]) dnl for AIX
2205 AC_CHECK_LIB(Xdmcp, main, [LIBXDMCP="-lXdmcp"], , $X_LDFLAGS -lX11) dnl for Unixware
2208 if test -n "$LIBXDMCP"; then
2210 ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
2211 AC_CHECK_HEADERS(X11/Xdmcp.h)