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 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"
640 #if (QT_VERSION >= 200)
647 test "$ac_qt_ok" = no && AC_MSG_ERROR([Found Qt 2 - you must specify the path to the Qt 1 headers and libraries])
648 CXXFLAGS="$SAVE_CXXFLAGS"
650 AC_SUBST(qt_libraries)
651 AC_SUBST(qt_includes)
653 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
656 QT_INCLUDES="-I$qt_includes"
657 all_includes="$QT_INCLUDES $all_includes"
660 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
663 QT_LDFLAGS="-L$qt_libraries"
664 all_libraries="$QT_LDFLAGS $all_libraries"
667 AC_SUBST(QT_INCLUDES)
677 ## ------------------------------------------------------------------------
678 ## Now, the same with KDE
679 ## $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
680 ## and $(kde_includes) will be the kdehdrlocation (if needed)
681 ## ------------------------------------------------------------------------
683 AC_DEFUN(AC_BASE_PATH_KDE,
685 AC_REQUIRE([KDE_MISC_TESTS])
686 AC_REQUIRE([AC_PATH_QT])dnl
687 AC_MSG_CHECKING([for KDE])
689 if test "${prefix}" != NONE; then
690 kde_includes=${prefix}/include
691 ac_kde_includes=$prefix/include
693 if test "${exec_prefix}" != NONE; then
694 kde_libraries=${exec_prefix}/lib
695 ac_kde_libraries=$exec_prefix/lib
697 kde_libraries=${prefix}/lib
698 ac_kde_libraries=$prefix/lib
708 [ --with-kde-dir where the KDE root is ],
710 ac_kde_includes="$withval"/include
711 ac_kde_libraries="$withval"/lib
714 AC_ARG_WITH(kde-includes,
715 [ --with-kde-includes where the KDE includes are. ],
717 ac_kde_includes="$withval"
720 AC_ARG_WITH(kde-libraries,
721 [ --with-kde-libraries where the KDE library is installed.],
723 ac_kde_libraries="$withval"
726 AC_CACHE_VAL(ac_cv_have_kde,
727 [#try to guess kde locations
729 if test -z "$1"; then
731 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"
732 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
733 kde_incdirs="$ac_kde_includes $kde_incdirs"
734 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
735 ac_kde_includes="$kde_incdir"
737 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
739 in the prefix, you've chosen, are no kde headers installed. This will fail.
740 So, check this please and use another prefix!])
743 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"
744 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
745 kde_libdirs="$ac_kde_libraries $kde_libdirs"
746 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
747 ac_kde_libraries="$kde_libdir"
749 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
751 in the prefix, you've chosen $ac_kde_libraries, are no kde libraries installed. This will fail.
752 So, check this please and use another prefix!])
755 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
756 ac_cv_have_kde="have_kde=no"
758 ac_cv_have_kde="have_kde=yes \
759 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
764 ac_cv_have_kde="have_kde=no"
769 eval "$ac_cv_have_kde"
771 if test "$have_kde" != "yes"; then
772 if test "${prefix}" = NONE; then
773 ac_kde_prefix="$ac_default_prefix"
775 ac_kde_prefix="$prefix"
777 if test "$exec_prefix" = NONE; then
778 ac_kde_exec_prefix="$ac_kde_prefix"
779 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
781 ac_kde_exec_prefix="$exec_prefix"
782 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
785 kde_libraries="${ac_kde_exec_prefix}/lib"
786 kde_includes=${ac_kde_prefix}/include
789 ac_cv_have_kde="have_kde=yes \
790 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
791 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
793 kde_libraries="$ac_kde_libraries"
794 kde_includes="$ac_kde_includes"
796 AC_SUBST(kde_libraries)
797 AC_SUBST(kde_includes)
799 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
802 KDE_INCLUDES="-I$kde_includes"
803 all_includes="$KDE_INCLUDES $all_includes"
806 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
809 KDE_LDFLAGS="-L$kde_libraries"
810 all_libraries="$KDE_LDFLAGS $all_libraries"
813 AC_SUBST(KDE_LDFLAGS)
814 AC_SUBST(KDE_INCLUDES)
816 AC_SUBST(all_includes)
817 AC_SUBST(all_libraries)
821 AC_DEFUN(KDE_CHECK_KIMGIO,
823 AC_REQUIRE([AC_FIND_TIFF])
824 AC_REQUIRE([AC_FIND_JPEG])
825 AC_REQUIRE([AC_FIND_PNG])
827 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) -lm'
829 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
831 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
835 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
837 AC_REQUIRE([KDE_MISC_TESTS])
839 KDE_LIBS='-lqt -lkdecore -lkdeui -lkfm -lkfile'
841 # LIB_X11='-lX11 $(LIBSOCKET)'
843 # LIB_QT='-lqt $(LIB_X11)'
845 # LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
846 # AC_SUBST(LIB_KDECORE)
847 # LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
848 # AC_SUBST(LIB_KDEUI)
849 # LIB_KFM='-lkfm $(LIB_KDECORE)'
851 # LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
852 # AC_SUBST(LIB_KFILE)
855 AC_DEFUN(AC_PATH_KDE,
858 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
860 if test "$enableval" = "no";
861 then ac_use_path_checking="default"
862 else ac_use_path_checking=""
864 ], [ac_use_path_checking=""]
867 AC_ARG_WITH(install-root, [ --with-install-root the root, where to install to [default=/]],
869 if test "$withval" = "no";
870 then kde_install_root="";
871 else kde_install_root=$withval;
873 ], [kde_install_root=""]
876 if test -n "$kde_install_root"; then
877 install_root="$kde_install_root"
882 AC_CREATE_KFSSTND($ac_use_path_checking)
885 KDE_CREATE_LIBS_ALIASES
888 dnl slightly changed version of AC_CHECK_FUNC(setenv)
889 AC_DEFUN(AC_CHECK_SETENV,
890 [AC_MSG_CHECKING([for setenv])
891 AC_CACHE_VAL(ac_cv_func_setenv,
894 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
895 dnl which includes <sys/select.h> which contains a prototype for
896 dnl select. Similarly for bzero.
898 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
902 [/* We use char because int might match the return type of a gcc2
903 builtin and then its argument prototype would still apply. */
906 /* The GNU C library defines this for functions which it implements
907 to always fail with ENOSYS. Some functions are actually named
908 something starting with __ and the normal name is an alias. */
909 #if defined (__stub_$1) || defined (__stub___$1)
912 setenv("TEST", "alle", 1);
914 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
916 if test "$ac_cv_func_setenv" = "yes"; then
918 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
924 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
927 save_CXXFLAGS="$CXXFLAGS"
928 if test "$GCC" = "yes"; then
929 CXXFLAGS="$CXXFLAGS -pedantic-errors"
931 AC_MSG_CHECKING(for getdomainname)
932 AC_CACHE_VAL(ac_cv_func_getdomainname,
940 getdomainname(buffer, 200);
942 ac_cv_func_getdomainname=yes,
943 ac_cv_func_getdomainname=no)
945 AC_MSG_RESULT($ac_cv_func_getdomainname)
946 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
947 AC_DEFINE(HAVE_GETDOMAINNAME)
949 CXXFLAGS="$save_CXXFLAGS"
952 AC_DEFUN(AC_CHECK_GETHOSTNAME,
955 save_CXXFLAGS="$CXXFLAGS"
956 if test "$GCC" = "yes"; then
957 CXXFLAGS="$CXXFLAGS -pedantic-errors"
960 AC_MSG_CHECKING([for gethostname])
961 AC_CACHE_VAL(ac_cv_func_gethostname,
969 gethostname(buffer, 200);
971 ac_cv_func_gethostname=yes,
972 ac_cv_func_gethostname=no)
974 AC_MSG_RESULT($ac_cv_func_gethostname)
975 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
976 AC_DEFINE(HAVE_GETHOSTNAME)
978 CXXFLAGS="$save_CXXFLAGS"
981 AC_DEFUN(AC_CHECK_USLEEP,
985 AC_MSG_CHECKING([for usleep])
986 AC_CACHE_VAL(ac_cv_func_usleep,
997 ac_cv_func_usleep=yes,
998 ac_cv_func_usleep=no)
1000 AC_MSG_RESULT($ac_cv_func_usleep)
1001 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
1002 AC_DEFINE(HAVE_USLEEP)
1004 LIBS="$ac_libs_safe"
1007 AC_DEFUN(AC_FIND_GIF,
1008 [AC_MSG_CHECKING([for giflib])
1009 AC_CACHE_VAL(ac_cv_lib_gif,
1010 [ac_save_LIBS="$LIBS"
1011 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1017 int GifLastError(void);
1021 /* We use char because int might match the return type of a gcc2
1022 builtin and then its argument prototype would still apply. */
1024 [return GifLastError();],
1025 eval "ac_cv_lib_gif=yes",
1026 eval "ac_cv_lib_gif=no")
1027 LIBS="$ac_save_LIBS"
1029 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1031 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
1033 AC_MSG_ERROR(You need giflib23. Please install the kdesupport package)
1037 AC_DEFUN(AC_FIND_JPEG,
1038 [AC_MSG_CHECKING([for jpeglib])
1039 AC_CACHE_VAL(ac_cv_lib_jpeg,
1040 [ac_save_LIBS="$LIBS"
1041 LIBS="$all_libraries -ljpeg -lm"
1043 [/* Override any gcc2 internal prototype to avoid an error. */
1044 struct jpeg_decompress_struct;
1045 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1050 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1051 int version, size_t structsize);
1055 /* We use char because int might match the return type of a gcc2
1056 builtin and then its argument prototype would still apply. */
1058 [jpeg_CreateDecompress(0L, 0, 0);],
1059 eval "ac_cv_lib_jpeg=-ljpeg",
1060 eval "ac_cv_lib_jpeg=no")
1061 LIBS="$ac_save_LIBS"
1063 dnl what to do, if the normal way fails:
1064 if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then
1065 if test -f "$kde_libraries/libjpeg.so"; then
1066 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1067 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1068 else if test -f "$kde_libraries/libjpeg.sl"; then
1069 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1070 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1071 else if test -f "$kde_libraries/libjpeg.a"; then
1072 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1073 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1076 You need jpeglib6a. Please install the kdesupport package.
1077 If you have already installed kdesupport, you may have an
1078 old libjpeg somewhere.
1079 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
1086 if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then
1087 LIBJPEG="$ac_cv_lib_jpeg"
1089 AC_MSG_RESULT($ac_cv_lib_jpeg)
1090 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
1094 AC_DEFUN(AC_FIND_ZLIB,
1096 AC_MSG_CHECKING([for libz])
1097 AC_CACHE_VAL(ac_cv_lib_z,
1098 [ac_save_LIBS="$LIBS"
1099 LIBS="$all_libraries -lz $LIBSOCKET"
1104 [return (zlibVersion() == ZLIB_VERSION); ],
1105 eval "ac_cv_lib_z='-lz'",
1106 eval "ac_cv_lib_z=no")
1107 LIBS="$ac_save_LIBS"
1109 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1110 dnl AC_DEFINE_UNQUOTED(HAVE_LIBZ)
1113 AC_MSG_RESULT($ac_cv_lib_z)
1121 AC_DEFUN(AC_FIND_TIFF,
1123 AC_REQUIRE([AC_FIND_ZLIB])
1124 AC_REQUIRE([AC_FIND_JPEG])
1125 AC_MSG_CHECKING([for libtiff])
1126 AC_CACHE_VAL(ac_cv_lib_tiff,
1127 [ac_save_LIBS="$LIBS"
1128 LIBS="$all_libraries -ltiff $LIBJPEG $LIBZ -lX11 $LIBSOCKET"
1133 [return (TIFFOpen( "", "r") == 0); ],
1134 eval "ac_cv_lib_tiff='-ltiff $LIBJPEG $LIBZ'",
1135 eval "ac_cv_lib_tiff=no")
1136 LIBS="$ac_save_LIBS"
1138 if eval "test ! \"`echo $ac_cv_lib_tiff`\" = no"; then
1139 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
1140 LIBTIFF="$ac_cv_lib_tiff"
1142 AC_MSG_RESULT($ac_cv_lib_tiff)
1151 AC_DEFUN(AC_FIND_PNG,
1153 AC_REQUIRE([AC_FIND_ZLIB])
1154 AC_MSG_CHECKING([for libpng])
1155 AC_CACHE_VAL(ac_cv_lib_png,
1156 [ac_save_LIBS="$LIBS"
1157 LIBS="$all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1164 png_structp png_ptr = png_create_read_struct( // image ptr
1165 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1166 return( png_ptr != 0 );
1168 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1169 eval "ac_cv_lib_png=no")
1170 LIBS="$ac_save_LIBS"
1172 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1173 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
1174 LIBPNG="$ac_cv_lib_png"
1176 AC_MSG_RESULT($ac_cv_lib_png)
1184 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1186 AC_MSG_CHECKING(if you need GNU extensions)
1187 AC_CACHE_VAL(ac_cv_gnu_extensions,
1189 cat > conftest.c << EOF
1190 #include <features.h>
1192 #ifdef __GNU_LIBRARY__
1197 if (eval "$ac_cpp conftest.c") 2>&5 |
1198 egrep "yes" >/dev/null 2>&1; then
1200 ac_cv_gnu_extensions=yes
1202 ac_cv_gnu_extensions=no
1206 AC_MSG_RESULT($ac_cv_gnu_extensions)
1207 if test "$ac_cv_gnu_extensions" = "yes"; then
1208 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
1212 dnl just a wrapper to clean up configure.in
1213 AC_DEFUN(KDE_PROG_LIBTOOL,
1215 AC_REQUIRE([AM_ENABLE_SHARED])
1216 AC_REQUIRE([AM_ENABLE_STATIC])
1217 dnl libtool is only for C, so I must force him
1218 dnl to find the correct flags for C++
1220 ac_save_cflags="$CFLAGS"
1223 AM_PROG_LIBTOOL dnl for libraries
1225 CFLAGS="$ac_save_cflags"
1228 AC_DEFUN(KDE_DO_IT_ALL,
1230 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1235 AC_DEFUN(AC_CHECK_RPATH,
1237 AC_MSG_CHECKING(for rpath)
1238 AC_ARG_ENABLE(rpath,
1239 [ --disable-rpath do not use the rpath feature of ld],
1240 USE_RPATH=$enableval, USE_RPATH=yes)
1241 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1243 KDE_RPATH="-rpath \$(kde_libraries)"
1245 if test -n "$qt_libraries"; then
1246 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1248 dnl $x_libraries is set to /usr/lib in case
1249 if test -n "$X_LDFLAGS"; then
1250 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1252 if test -n "$KDE_EXTRA_RPATH"; then
1253 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1256 AC_SUBST(KDE_EXTRA_RPATH)
1258 AC_MSG_RESULT($USE_RPATH)
1261 # Search path for a program which passes the given test.
1262 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1265 # Stephan Kulow: I appended a _KDE against name conflicts
1267 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1268 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1269 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1270 [# Extract the first word of "$2", so it can be a program name with args.
1271 set dummy $2; ac_word=[$]2
1272 AC_MSG_CHECKING([for $ac_word])
1273 AC_CACHE_VAL(ac_cv_path_$1,
1276 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1279 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1280 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1281 test -z "$ac_dir" && ac_dir=.
1282 if test -f $ac_dir/$ac_word; then
1284 ac_cv_path_$1="$ac_dir/$ac_word"
1290 dnl If no 4th arg is given, leave the cache variable unset,
1291 dnl so AC_PATH_PROGS will keep looking.
1292 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1297 if test -n "[$]$1"; then
1298 AC_MSG_RESULT([$]$1)
1306 dnl From Jim Meyering.
1307 dnl FIXME: migrate into libit.
1309 AC_DEFUN(AM_FUNC_OBSTACK,
1310 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
1311 [AC_TRY_LINK([#include "obstack.h"],
1312 [struct obstack *mem;obstack_free(mem,(char *) 0)],
1313 am_cv_func_obstack=yes,
1314 am_cv_func_obstack=no)])
1315 if test $am_cv_func_obstack = yes; then
1316 AC_DEFINE(HAVE_OBSTACK)
1318 LIBOBJS="$LIBOBJS obstack.o"
1322 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
1323 dnl FIXME: Migrate into libit
1325 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
1326 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
1327 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
1328 am_cv_lib_error_at_line=yes,
1329 am_cv_lib_error_at_line=no)])
1330 if test $am_cv_lib_error_at_line = no; then
1331 LIBOBJS="$LIBOBJS error.o"
1333 AC_SUBST(LIBOBJS)dnl
1336 # Macro to add for using GNU gettext.
1337 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1340 # Stephan Kulow: I put a KDE in it to avoid name conflicts
1342 AC_DEFUN(AM_KDE_GNU_GETTEXT,
1343 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1344 AC_REQUIRE([AC_PROG_RANLIB])dnl
1345 AC_REQUIRE([AC_HEADER_STDC])dnl
1346 AC_REQUIRE([AC_C_INLINE])dnl
1347 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1348 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1349 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1350 AC_REQUIRE([AC_FUNC_MMAP])dnl
1351 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1352 unistd.h values.h alloca.h])
1353 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1354 __argz_count __argz_stringify __argz_next stpcpy])
1358 if test "x$CATOBJEXT" != "x"; then
1359 if test "x$ALL_LINGUAS" = "x"; then
1362 AC_MSG_CHECKING(for catalogs to be installed)
1364 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1365 case "$ALL_LINGUAS" in
1366 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1369 LINGUAS=$NEW_LINGUAS
1370 AC_MSG_RESULT($LINGUAS)
1373 dnl Construct list of names of catalog files to be constructed.
1374 if test -n "$LINGUAS"; then
1375 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1381 AC_DEFUN(AC_HAVE_XPM,
1382 [AC_REQUIRE_CPP()dnl
1384 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
1385 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
1387 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
1388 xpm_test=$withval, xpm_test="yes")
1389 if test "x$xpm_test" = xno; then
1392 AC_MSG_CHECKING(for XPM)
1393 AC_CACHE_VAL(ac_cv_have_xpm,
1396 ac_save_ldflags="$LDFLAGS"
1397 ac_save_cflags="$CFLAGS"
1398 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
1399 CFLAGS="$CFLAGS $X_INCLUDES"
1400 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
1401 AC_TRY_LINK([#include <X11/xpm.h>],[],
1402 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
1403 LDFLAGS="$ac_save_ldflags"
1404 CFLAGS="$ac_save_cflags"
1407 if test "$ac_cv_have_xpm" = no; then
1414 if test "$XPM_LDFLAGS" = ""; then
1417 XPMLIB="-L$XPM_LDFLAGS -lXpm"
1419 if test "$XPM_INCLUDE" = ""; then
1422 XPMINC="-I$XPM_INCLUDE"
1432 AC_DEFUN(AC_HAVE_GL,
1433 [AC_REQUIRE_CPP()dnl
1435 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
1436 test -z "$GL_INCLUDE" && GL_INCLUDE=
1438 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
1439 gl_test=$withval, gl_test="yes")
1440 if test "x$gl_test" = xno; then
1443 AC_MSG_CHECKING(for GL)
1444 AC_CACHE_VAL(ac_cv_have_gl,
1447 ac_save_ldflags="$LDFLAGS"
1448 ac_save_cflags="$CFLAGS"
1449 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
1450 CFLAGS="$CFLAGS $X_INCLUDES"
1451 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
1453 ac_cv_have_gl="yes",ac_cv_have_gl="no")
1454 LDFLAGS="$ac_save_ldflags"
1455 CFLAGS="$ac_save_cflags"
1458 if test "$ac_cv_have_gl" = no; then
1465 if test "$GL_LDFLAGS" = ""; then
1466 GLLIB="-lMesaGL -lMesaGLU"
1468 GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU"
1470 if test "$GL_INCLUDE" = ""; then
1473 GLINC="-I$GL_INCLUDE"
1485 dnl Should test for PAM (Pluggable Authentication Modules)
1486 AC_DEFUN(AC_PATH_PAM_DIRECT,
1488 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
1489 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
1493 /usr/local/include \
1495 /usr/unsupported/include \
1498 /usr/local/pam/include \
1499 /usr/lib/pam/include \
1504 if test -r "$ac_dir/$pam_direct_test_include"; then
1505 no_pam= ac_pam_includes=$ac_dir
1510 # First see if replacing the include by lib works.
1511 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
1516 /usr/unsupported/lib \
1522 for ac_extension in a so sl; do
1523 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
1524 no_pam= ac_pam_libraries=$ac_dir
1531 AC_DEFUN(AC_PATH_PAM,
1532 [AC_REQUIRE_CPP()dnl
1534 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"], [], [-lpam -ldl])
1536 AC_MSG_CHECKING(for PAM)
1538 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
1540 if test "x$withval" = "xyes"; then
1543 elif test "x$withval" = "xno"; then
1547 pam_service="$withval"
1548 if test -z "$pam_service"; then
1557 if test ! "$no_pam" = yes; then
1559 AC_CACHE_VAL(ac_cv_path_pam,
1561 ac_pam_includes=NONE
1562 ac_pam_libraries=NONE
1563 if test -z "$pam_libraries"; then
1566 if test -z "$pam_includes"; then
1572 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1573 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1575 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
1576 ac_pam_libs="-lpam $PAM_MISC_LIB -ldl"
1577 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
1579 ac_cv_path_pam="no_pam=yes"
1583 eval "$ac_cv_path_pam"
1587 if test "$no_pam" = yes; then
1591 PAMLIBS="$ac_pam_libs"
1592 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1593 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1594 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
1595 if test "$default_pam" = yes; then
1596 AC_MSG_RESULT(["default pam service name will be used"])
1598 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service")
1599 AC_MSG_RESULT(["pam service name will be: " $pam_service])
1601 dnl test whether struct pam_message is const (Linux) or not (Sun)
1602 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
1603 AC_MSG_CHECKING(for const pam_message)
1604 AC_EGREP_HEADER([struct pam_message],
1606 [ AC_EGREP_HEADER([const struct pam_message],
1608 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
1609 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
1610 AC_DEFINE(PAM_MESSAGE_NONCONST)]
1612 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
1616 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
1617 PAMLIBPATHS="-L$pam_libraries"
1619 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
1620 PAMINC="-I$pam_includes"
1625 AC_SUBST(PAMLIBPATHS)
1629 AC_DEFUN(KDE_CHECK_LIBDL,
1631 AC_CHECK_LIB(dl, dlopen, [
1633 ac_cv_have_dlfcn=yes
1636 AC_CHECK_LIB(dld, shl_unload, [
1638 ac_cv_have_shload=yes
1644 AC_DEFUN(KDE_CHECK_DLOPEN,
1647 AC_CHECK_HEADERS(dlfcn.h dl.h)
1648 if test "$ac_cv_header_dlfcn_h" = "no"; then
1652 if test "$ac_cv_header_dl_h" = "no"; then
1653 ac_cv_have_shload=no
1657 AC_ARG_ENABLE(dlopen,
1658 [ --disable-dlopen link staticly [default=no]] ,
1659 [if test "$enableval" = yes; then
1664 # override the user's opinion, if we know it better ;)
1665 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
1669 if test "$ac_cv_have_dlfcn" = "yes"; then
1670 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
1673 if test "$ac_cv_have_shload" = "yes"; then
1674 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
1677 if test "$enable_dlopen" = no ; then
1678 test -n "$1" && eval $1
1680 test -n "$2" && eval $2
1685 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
1687 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
1689 AC_MSG_CHECKING([dynamic loading])
1690 eval "`egrep '^build_libtool_libs=' libtool`"
1691 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
1693 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
1697 AC_MSG_RESULT($dynamic_loading)
1698 if test "$dynamic_loading" = "yes"; then
1705 AC_DEFUN(KDE_ADD_INCLUDES,
1707 if test -z "$1"; then
1708 test_include="Pix.h"
1713 AC_MSG_CHECKING([for libg++ ($test_include)])
1715 AC_CACHE_VAL(kde_cv_libgpp_includes,
1717 kde_cv_libgpp_includes=no
1723 /usr/unsupported/include \
1728 if test -r "$ac_dir/$test_include"; then
1729 kde_cv_libgpp_includes=$ac_dir
1735 AC_MSG_RESULT($kde_cv_libgpp_includes)
1736 if test "$kde_cv_libgpp_includes" != "no"; then
1737 all_includes="-I$kde_cv_libgpp_includes $all_includes"
1743 AC_DEFUN(KDE_CHECK_MICO,
1745 AC_REQUIRE([KDE_CHECK_LIBDL])
1746 AC_MSG_CHECKING(for MICO)
1747 AC_ARG_WITH(micodir,
1748 [ --with-micodir=micodir where mico is installed ],
1749 kde_micodir=$withval,
1750 kde_micodir=/usr/local
1752 AC_MSG_RESULT($kde_micodir)
1753 if test ! -r $kde_micodir/include/CORBA.h; then
1754 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
1757 MICO_INCLUDES=-I$kde_micodir/include
1758 AC_SUBST(MICO_INCLUDES)
1759 MICO_LDFLAGS=-L$kde_micodir/lib
1760 AC_SUBST(MICO_LDFLAGS)
1762 AC_MSG_CHECKING([for MICO version])
1763 AC_CACHE_VAL(kde_cv_mico_version,
1766 cat >conftest.$ac_ext <<EOF
1768 #include <mico/version.h>
1771 printf("MICO_VERSION=%s\n",MICO_VERSION);
1775 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
1776 if AC_TRY_EVAL(ac_compile); then
1777 if eval `./conftest 2>&5`; then
1778 kde_cv_mico_version=$MICO_VERSION
1780 AC_MSG_ERROR([your system is not able to execute a small application to
1781 find MICO version! Check $kde_micodir/include/mico/version.h])
1784 AC_MSG_ERROR([your system is not able to compile a small application to
1785 find MICO version! Check $kde_micodir/include/mico/version.h])
1789 dnl installed MICO version
1790 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
1791 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
1792 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
1794 dnl required MICO version
1795 req_v_maj=`echo $1 | sed -e 's/^\(.*\)\..*\..*$/\1/'`
1796 req_v_mid=`echo $1 | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
1797 req_v_min=`echo $1 | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
1799 if test "$mico_v_maj" -lt "$req_v_maj" || \
1800 ( test "$mico_v_maj" -eq "$req_v_maj" && \
1801 test "$mico_v_mid" -lt "$req_v_mid" ) || \
1802 ( test "$mico_v_mid" -eq "$req_v_mid" && \
1803 test "$mico_v_min" -lt "$req_v_min" )
1806 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $1 \
1807 at least is required. You should upgrade MICO.])
1809 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $1, ok)])
1812 LIBMICO="-lmico$kde_cv_mico_version $LIBDL"
1814 IDL=$kde_micodir/bin/idl
1819 AC_DEFUN(KDE_CHECK_MINI_STL,
1821 AC_REQUIRE([KDE_CHECK_MICO])
1823 AC_MSG_CHECKING(if we use mico's mini-STL)
1824 AC_CACHE_VAL(kde_cv_have_mini_stl,
1827 kde_save_cxxflags="$CXXFLAGS"
1828 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
1831 #include <mico/config.h>
1834 #ifdef HAVE_MINI_STL
1838 kde_cv_have_mini_stl=no,
1839 kde_cv_have_mini_stl=yes)
1840 CXXFLAGS="$kde_save_cxxflags"
1844 AC_MSG_RESULT($kde_cv_have_mini_stl)
1845 if test "$kde_cv_have_mini_stl" = "yes"; then
1846 AC_DEFINE_UNQUOTED(HAVE_MINI_STL)
1853 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
1855 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
1856 AC_SUBST(LIBPTHREAD)
1859 AC_DEFUN(KDE_TRY_LINK_PYTHON,
1861 AC_CACHE_VAL(kde_cv_try_link_python_$1,
1863 kde_save_cxxflags="$CXXFLAGS"
1864 CXXFLAGS="$CXXFLAGS $PYTHONINC"
1865 kde_save_libs="$LIBS"
1866 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
1867 kde_save_ldflags="$LDFLAGS"
1868 LDFLAGS="$LDFLAGS $PYTHONLIB"
1874 PySys_SetArgv(1, 0);
1876 [kde_cv_try_link_python_$1=yes],
1877 [kde_cv_try_link_python_$1=no]
1879 CXXFLAGS="$kde_save_cxxflags"
1880 LIBS="$kde_save_libs"
1881 LDFLAGS="$kde_save_ldflags"
1884 if test "$kde_cv_try_link_python_$1" = "yes"; then
1892 AC_DEFUN(KDE_CHECK_PYTHON,
1894 AC_REQUIRE([KDE_CHECK_LIBDL])
1895 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
1896 if test -z "$1"; then
1902 AC_MSG_CHECKING([for Python$version])
1904 AC_ARG_WITH(pythondir,
1905 [ --with-pythondir=pythondir use python installed in pythondir ],
1907 ac_python_dir=$withval
1908 ], ac_python_dir=/usr/local
1911 python_incdirs="$ac_python_dir/include/python$version /usr/include/python$version /usr/local/include/python$version /usr/local/include"
1912 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
1913 if test ! -r $python_incdir/Python.h; then
1914 AC_MSG_ERROR(Python.h not found.)
1917 PYTHONINC=-I$python_incdir
1919 python_libdirs="$ac_python_dir/lib/python$version/config /usr/lib/python$version/config /usr/local/python$version/config"
1920 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
1921 if test ! -r $python_libdir/libpython$version.a; then
1922 AC_MSG_ERROR(libpython$version.a not found.)
1925 PYTHONLIB=-L$python_libdir
1926 LIBPYTHON=-lpython$version
1928 AC_MSG_RESULT(header $python_incdir library $python_libdir)
1930 dnl Note: this test is very weak
1931 AC_MSG_CHECKING(if an Python application links)
1932 KDE_TRY_LINK_PYTHON(normal, "", AC_MSG_RESULT(yes),
1935 AC_MSG_CHECKING(if Python depends on -lpthread)
1936 KDE_TRY_LINK_PYTHON(pthread, "$LIBPTHREAD",
1939 LIBPYTHON="$LIBPYTHON $LIBPTHREAD $LIBDL"
1943 AC_MSG_CHECKING(if Python depeds on -ltcl)
1944 KDE_TRY_LINK_PYTHON(tcl, "-ltcl",
1947 LIBPYTHON="$LIBPYTHON -ltcl"
1951 AC_MSG_WARN([it seems, Python depends on another library.
1952 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
1953 and contact the authors to let them know about this problem])
1965 AC_DEFUN(KDE_CHECK_STL_SGI,
1967 AC_MSG_CHECKING([if STL implementation is SGI like])
1968 AC_CACHE_VAL(kde_cv_stl_type_sgi,
1973 string astring="Hallo Welt.";
1974 astring.erase(0, 6); // now astring is "Welt"
1976 ], kde_cv_stl_type_sgi=yes,
1977 kde_cv_stl_type_sgi=no)
1980 AC_MSG_RESULT($kde_cv_stl_type_sgi)
1982 if test "$kde_cv_stl_type_sgi" = "yes"; then
1983 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
1987 AC_DEFUN(KDE_CHECK_STL_HP,
1989 AC_MSG_CHECKING([if STL implementation is HP like])
1990 AC_CACHE_VAL(kde_cv_stl_type_hp,
1995 string astring="Hello World";
1996 astring.remove(0, 6); // now astring is "World"
1998 ], kde_cv_stl_type_hp=yes,
1999 kde_cv_stl_type_hp=no)
2001 AC_MSG_RESULT($kde_cv_stl_type_hp)
2003 if test "$kde_cv_stl_type_hp" = "yes"; then
2004 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
2008 AC_DEFUN(KDE_CHECK_STL,
2012 if test "$kde_cv_stl_type_sgi" = "no"; then
2015 if test "$kde_cv_stl_type_hp" = "no"; then
2016 AC_MSG_ERROR("no known STL type found")
2022 AC_DEFUN(AC_FIND_QIMGIO,
2023 [AC_REQUIRE([AC_FIND_JPEG])
2024 AC_MSG_CHECKING([for qimgio])
2025 AC_CACHE_VAL(ac_cv_lib_qimgio,
2026 [ac_save_LIBS="$LIBS"
2027 LIBS="$all_libraries -lqimgio -lpng -lz -lqt $LIBJPEG -lX11 $LIBSOCKET"
2030 void qInitImageIO ();
2033 eval "ac_cv_lib_qimgio=yes",
2034 eval "ac_cv_lib_qimgio=no")
2035 LIBS="$ac_save_LIBS"
2037 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
2038 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
2040 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
2043 AC_MSG_RESULT(not found)
2047 AC_DEFUN(KDE_CHECK_ANSI,
2049 AC_MSG_CHECKING([for strdup])
2051 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2054 save_CXXFLAGS="$CXXFLAGS"
2055 if test "$GCC" = "yes"; then
2056 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2062 char buffer[] = "Hallo";
2064 ], kde_cv_has_strdup=yes,
2065 kde_cv_has_strdup=no)
2066 CXXFLAGS="$save_CXXFLAGS"
2068 AC_MSG_RESULT($kde_cv_has_strdup)
2070 if test "$kde_cv_has_strdup" = "yes"; then
2071 AC_DEFINE_UNQUOTED(HAVE_STRDUP)
2076 AC_DEFUN(KDE_CHECK_INSURE,
2078 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
2080 if test $enableval = "no"; dnl
2081 then ac_use_insure="no"
2082 else ac_use_insure="yes"
2084 ], [ac_use_insure="no"])
2086 AC_MSG_CHECKING(if we will use Insure++ to debug)
2087 AC_MSG_RESULT($ac_use_insure)
2088 if test "$ac_use_insure" = "yes"; dnl
2089 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
2093 dnl this is for kdm:
2095 AC_DEFUN(AC_CHECK_KDM,
2097 AC_CHECK_FUNCS(getsecretkey)
2098 dnl checks for X server
2100 AC_PATH_PROG(X_SERVER, X)
2101 if test ! -z "$X_SERVER"; then
2102 X_SERVER=`echo $X_SERVER | sed -e 's+/X$++'`
2103 AC_DEFINE_UNQUOTED(XBINDIR,$X_SERVER)
2108 dnl This one tries to find XDMDIR for config files
2110 [ --with-xdmdir If the xdm config dir can't be found automaticly],
2111 [ ac_xdmdir=$withval],
2114 AC_MSG_CHECKING([for xdm configuration dir])
2115 if test "$ac_xdmdir" = "no"; then
2117 if mkdir conftestdir; then
2119 cat > Imakefile <<'EOF'
2121 @echo 'ac_xdmdir="$(XDMDIR)";'
2123 if (xmkmf) > /dev/null 2> /dev/null && test -f Makefile; then
2124 eval `${MAKE-make} acfindxdm 2>/dev/null 2>/dev/null | grep -v make`
2128 dnl Check if Imake was right
2129 if test -f $ac_xdmdir/xdm-config; then
2130 AC_MSG_RESULT($ac_xdmdir)
2132 dnl Here we must do something else
2133 dnl Maybe look for xdm-config in standard places, and
2134 dnl if that fails use a fresh copy in $KDEDIR/config/kdm/
2135 AC_FIND_FILE(xdm-config,/etc/X11/xdm /var/X11/xdm /usr/openwin/xdm /usr/X11R6/lib/X11/xdm,ac_xdmdir)
2136 if test -f $ac_xdmdir/xdm-config; then
2137 AC_MSG_RESULT($ac_xdmdir)
2139 if test "${prefix}" = NONE; then
2140 ac_xdmdir=$ac_default_prefix/config/kdm
2142 ac_xdmdir=$prefix/config/kdm
2144 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2145 xdmconfigsubdir=xdmconfig
2146 AC_SUBST(xdmconfigsubdir)
2151 if test -f $ac_xdmdir/xdm-config; then
2152 AC_MSG_RESULT($ac_xdmdir)
2155 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2156 xdmconfigsubdir=xdmconfig
2157 AC_SUBST(xdmconfigsubdir)
2160 AC_DEFINE_UNQUOTED(XDMDIR,"$ac_xdmdir")
2164 if test "x$no_pam" = "xyes"; then
2168 shadow_support="no" # if pam is installed, use it. We can't savely
2169 # test, if it works *sigh*
2173 [ --with-shadow If you want shadow password support ],
2174 [ if test "$withval" = "yes"; then
2175 shadow_support="yes"
2179 if test "$pam_support" = "yes" && test "$shadow_support=yes"; then
2180 AC_MSG_WARN("You can not define both pam AND shadow")
2183 [ if test -z "$shadow_support"; then shadow_support="no"; fi ] )
2185 if test "$pam_support" = "yes"; then
2186 AC_CHECK_LIB(pam, main, [PASSWDLIB="-lpam -ldl"
2187 AC_DEFINE_UNQUOTED(HAVE_PAM_LIB)],
2191 if test -z "$PASSWDLIB" && test "$shadow_support" = "yes"; then
2192 AC_CHECK_LIB(shadow, main,
2193 [ PASSWDLIB="-lshadow"
2194 AC_DEFINE_UNQUOTED(HAVE_SHADOW_LIB)
2198 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
2200 AC_CHECK_LIB(s, main, [LIB_LIBS="-ls"]) dnl for AIX
2202 AC_CHECK_LIB(Xdmcp, main, [LIBXDMCP="-lXdmcp"], , $X_LDFLAGS -lX11) dnl for Unixware
2205 if test -n "$LIBXDMCP"; then
2207 ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
2208 AC_CHECK_HEADERS(X11/Xdmcp.h)