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)
98 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
100 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
101 Please check whether you installed Qt correctly.
102 You need to have a running moc binary.
103 configure tried to run $ac_cv_path_moc and the test didn't
104 succeed. If configure shouldn't have tried this one, set
105 the environment variable MOC to the right one before running
110 dnl ------------------------------------------------------------------------
111 dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and some
112 dnl more usual places
113 dnl ------------------------------------------------------------------------
115 AC_DEFUN(AC_PATH_QT_MOC,
117 KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin \
118 /usr/bin /usr/X11R6/bin /usr/lib/qt/bin \
119 /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE])
121 if test -z "$MOC"; then
122 if test -n "$ac_cv_path_moc"; then
123 output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"`
125 echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC
126 echo "configure:__oline__: moc output: $output" >&AC_FD_CC
128 if test -z "$output"; then
129 KDE_MOC_ERROR_MESSAGE
136 AC_DEFUN(KDE_REPLACE_ROOT,
137 $1=`echo "$$1" | sed -e "s#^/#\$\{install_root\}/#"`
140 AC_DEFUN(AC_CREATE_KFSSTND,
142 AC_REQUIRE([AC_CHECK_RPATH])
144 if test "$1" = "default"; then
146 AC_MSG_CHECKING(for KDE paths)
148 if test -z "$kde_htmldir"; then
149 kde_htmldir="\$(prefix)/share/doc/HTML"
151 if test -z "$kde_appsdir"; then
152 kde_appsdir="\$(prefix)/share/applnk"
154 if test -z "$kde_icondir"; then
155 kde_icondir="\$(prefix)/share/icons"
157 if test -z "$kde_sounddir"; then
158 kde_sounddir="\$(prefix)/share/sounds"
160 if test -z "$kde_datadir"; then
161 kde_datadir="\$(prefix)/share/apps"
163 if test -z "$kde_locale"; then
164 kde_locale="\$(prefix)/share/locale"
166 if test -z "$kde_cgidir"; then
167 kde_cgidir="\$(exec_prefix)/cgi-bin"
169 if test -z "$kde_confdir"; then
170 kde_confdir="\$(prefix)/share/config"
172 if test -z "$kde_mimedir"; then
173 kde_mimedir="\$(prefix)/share/mimelnk"
175 if test -z "$kde_toolbardir"; then
176 kde_toolbardir="\$(prefix)/share/toolbar"
178 if test -z "$kde_wallpaperdir"; then
179 kde_wallpaperdir="\$(prefix)/share/wallpapers"
181 if test -z "$kde_bindir"; then
182 kde_bindir="\$(exec_prefix)/bin"
184 if test -z "$kde_partsdir"; then
185 kde_partsdir="\$(exec_prefix)/parts"
187 AC_MSG_RESULT(defaults)
191 AC_CACHE_VAL(kde_cv_all_paths,
193 AC_MSG_CHECKING([for kde headers installed])
195 cat > conftest.$ac_ext <<EOF
197 #include "confdefs.h"
201 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
202 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
203 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
204 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
205 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
206 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
207 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
208 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
209 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
210 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
211 printf("kde_wallpaperdir=\\"%s\\"\n", KApplication::kde_wallpaperdir().data());
212 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
213 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
218 if test -n "$kde_libraries"; then
219 KDE_TEST_RPATH="-rpath $kde_libraries"
222 if test -n "$qt_libraries"; then
223 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
226 if test -n "$x_libraries"; then
227 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
230 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
232 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
233 if AC_TRY_EVAL(ac_compile); then
236 AC_MSG_ERROR([your system is not able to compile a small KDE application!
237 Check, if you installed the KDE header files correctly.])
240 AC_MSG_CHECKING([for kde libraries installed])
241 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'
243 if AC_TRY_EVAL(ac_link) && test -s conftest; then
246 AC_MSG_ERROR([your system fails at linking a small KDE application!
247 Check if your compiler is installed correctly and if you have used the
248 same compiler to compile Qt and kdelibs as you did use now])
251 AC_MSG_CHECKING([for KDE paths])
252 if eval `./conftest 2>&5`; then
255 AC_MSG_RESULT(problems)
258 ./conftest 2> /dev/null >&5 # make an echo for config.log
259 kde_have_all_paths=yes
262 if test "$kde_have_all_paths" = "yes"; then
263 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
264 kde_htmldir=\"$kde_htmldir\" \
265 kde_appsdir=\"$kde_appsdir\" \
266 kde_icondir=\"$kde_icondir\" \
267 kde_sounddir=\"$kde_sounddir\" \
268 kde_datadir=\"$kde_datadir\" \
269 kde_locale=\"$kde_locale\" \
270 kde_cgidir=\"$kde_cgidir\" \
271 kde_confdir=\"$kde_confdir\" \
272 kde_mimedir=\"$kde_mimedir\" \
273 kde_toolbardir=\"$kde_toolbardir\" \
274 kde_wallpaperdir=\"$kde_wallpaperdir\" \
275 kde_bindir=\"$kde_bindir\" \
276 kde_partsdir=\"$kde_partsdir\""
282 eval "$kde_cv_all_paths"
284 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
285 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
286 test -z "$kde_datadir" || test -z "$kde_locale" ||
287 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
288 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
289 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
290 test -z "$kde_partsdir" || test "$kde_have_all_paths" != "yes"; then
291 kde_have_all_paths=no
292 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
293 Since it had compiled and linked before, it must be a strange problem on your system.
294 Look at config.log for details. If you are not able to fix this, please contact Stephan Kulow <coolo@kde.org>.])
297 if test -n "$install_root"; then
298 KDE_REPLACE_ROOT(kde_htmldir)
299 KDE_REPLACE_ROOT(kde_appsdir)
300 KDE_REPLACE_ROOT(kde_icondir)
301 KDE_REPLACE_ROOT(kde_sounddir)
302 KDE_REPLACE_ROOT(kde_datadir)
303 KDE_REPLACE_ROOT(kde_locale)
304 KDE_REPLACE_ROOT(kde_cgidir)
305 KDE_REPLACE_ROOT(kde_confdir)
306 KDE_REPLACE_ROOT(kde_mimedir)
307 KDE_REPLACE_ROOT(kde_toolbardir)
308 KDE_REPLACE_ROOT(kde_wallpaperdir)
309 KDE_REPLACE_ROOT(kde_bindir)
310 KDE_REPLACE_ROOT(kde_partsdir)
311 AC_SUBST(install_root)
318 AC_DEFUN(AC_SUBST_KFSSTND,
320 AC_SUBST(kde_htmldir)
321 AC_SUBST(kde_appsdir)
322 AC_SUBST(kde_icondir)
323 AC_SUBST(kde_sounddir)
324 kde_minidir="$kde_icondir/mini"
325 AC_SUBST(kde_minidir)
326 AC_SUBST(kde_datadir)
329 AC_SUBST(kde_confdir)
330 AC_SUBST(kde_mimedir)
331 AC_SUBST(kde_toolbardir)
332 AC_SUBST(kde_wallpaperdir)
334 AC_SUBST(kde_partsdir)
337 AC_DEFUN(KDE_MISC_TESTS,
340 dnl Checks for libraries.
341 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
343 AC_CHECK_LIB(crypt, main, [LIBCRYPT="-lcrypt"]) dnl for BSD
345 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
346 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
347 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
348 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
350 AC_CHECK_FUNC(gethostbyname)
351 if test $ac_cv_func_gethostbyname = no; then
352 AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
354 AC_CHECK_FUNC(connect)
355 if test $ac_cv_func_connect = no; then
356 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
360 AC_CHECK_FUNC(remove)
361 if test $ac_cv_func_remove = no; then
362 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
365 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
367 if test $ac_cv_func_shmat = no; then
368 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
371 LIBSOCKET=$X_EXTRA_LIBS
373 AC_SUBST(X_EXTRA_LIBS)
374 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
377 case $host in dnl this *is* LynxOS specific
379 AC_MSG_CHECKING([LynxOS header file wrappers])
380 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
381 AC_MSG_RESULT(disabled)
382 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
388 ## ------------------------------------------------------------------------
389 ## Find the header files and libraries for X-Windows. Extended the
391 ## ------------------------------------------------------------------------
395 AC_MSG_CHECKING(for X)
396 AC_CACHE_VAL(ac_cv_have_x,
397 [# One or both of the vars are not set, and there is no cached value.
398 ac_x_includes=NO ac_x_libraries=NO
401 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
402 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
404 # Record where we found X for the cache.
405 ac_cv_have_x="have_x=yes \
406 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
410 if test "$have_x" != yes; then
411 AC_MSG_RESULT($have_x)
414 # If each of the values was on the command line, it overrides each guess.
415 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
416 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
417 # Update the cache value to reflect the command line values.
418 ac_cv_have_x="have_x=yes \
419 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
420 AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
423 if test -z "$x_includes" || test "x$x_includes" = xNONE; then
425 x_includes="."; dnl better than nothing :-
427 X_INCLUDES="-I$x_includes"
430 if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then
432 x_libraries="/usr/lib"; dnl better than nothing :-
434 X_LDFLAGS="-L$x_libraries"
436 all_includes="$all_includes $X_INCLUDES"
437 all_libraries="$all_libraries $X_LDFLAGS"
441 AC_SUBST(x_libraries)
445 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
448 cat > conftest.$ac_ext <<EOF
449 #include "confdefs.h"
451 #include <qapplication.h>
460 AC_DEFUN(KDE_CHECK_QT_DIRECT,
462 AC_MSG_CHECKING([if Qt compiles without flags])
463 AC_CACHE_VAL(kde_cv_qt_direct,
465 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
466 ac_LIBRARY_PATH="$LIBRARY_PATH"
467 ac_cxxflags_safe="$CXXFLAGS"
468 ac_ldflags_safe="$LDFLAGS"
471 CXXFLAGS="$CXXFLAGS -I$qt_includes"
473 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
475 export LD_LIBRARY_PATH
481 if AC_TRY_EVAL(ac_link) && test -s conftest; then
482 kde_cv_qt_direct="yes"
484 kde_cv_qt_direct="no"
485 echo "configure: failed program was:" >&AC_FD_CC
486 cat conftest.$ac_ext >&AC_FD_CC
489 CXXFLAGS="$ac_cxxflags_safe"
490 LDFLAGS="$ac_ldflags_safe"
493 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
494 export LD_LIBRARY_PATH
495 LIBRARY_PATH="$ac_LIBRARY_PATH"
499 if test "$kde_cv_qt_direct" = "yes"; then
508 ## ------------------------------------------------------------------------
509 ## Try to find the Qt headers and libraries.
510 ## $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
511 ## and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
512 ## ------------------------------------------------------------------------
514 AC_DEFUN(AC_PATH_QT_1_3,
516 AC_REQUIRE([K_PATH_X])
518 AC_MSG_CHECKING([for Qt])
519 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
523 [ --with-qt-dir where the root of qt is installed ],
524 [ ac_qt_includes="$withval"/include
525 ac_qt_libraries="$withval"/lib
526 ac_qt_bindir="$withval"/bin
529 AC_ARG_WITH(qt-includes,
530 [ --with-qt-includes where the Qt includes are. ],
532 ac_qt_includes="$withval"
537 AC_ARG_WITH(qt-libraries,
538 [ --with-qt-libraries where the Qt library is installed.],
539 [ ac_qt_libraries="$withval"
540 kde_qt_libs_given=yes
543 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
545 AC_CACHE_VAL(ac_cv_have_qt,
546 [#try to guess Qt locations
548 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"
549 test -n "$QTDIR" && qt_incdirs="$QTDIR/include/qt $QTDIR/include $QTDIR $qt_incdirs"
550 AC_FIND_FILE(qmovie.h, $qt_incdirs, qt_incdir)
551 ac_qt_includes="$qt_incdir"
553 if test ! "$ac_qt_libraries" = "NO"; then
554 qt_libdirs="$ac_qt_libraries"
557 qt_libdirs="$qt_libdirs /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt $x_libraries $QTLIB"
558 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
562 for dir in $qt_libdirs; do
563 try="ls -1 $dir/libqt*"
564 if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
567 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)
568 ac_qt_libraries="$qt_libdir"
570 ac_cxxflags_safe="$CXXFLAGS"
571 ac_ldflags_safe="$LDFLAGS"
574 CXXFLAGS="$CXXFLAGS -I$qt_incdir"
575 LDFLAGS="-L$qt_libdir $X_LDFLAGS"
576 LIBS="$LIBS -lqt -lXext -lX11 $LIBSOCKET"
580 if AC_TRY_EVAL(ac_link) && test -s conftest; then
583 echo "configure: failed program was:" >&AC_FD_CC
584 cat conftest.$ac_ext >&AC_FD_CC
588 CXXFLAGS="$ac_cxxflags_safe"
589 LDFLAGS="$ac_ldflags_safe"
592 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
593 ac_cv_have_qt="have_qt=no"
595 if test "$ac_qt_includes" = NO; then
596 if test "$ac_qt_libraries" = NO; then
597 ac_qt_notfound="(headers and libraries)";
599 ac_qt_notfound="(headers)";
602 ac_qt_notfound="(libraries)";
605 AC_MSG_ERROR([Qt-1.4 $ac_qt_notfound not found. Please check your installation! ]);
614 eval "$ac_cv_have_qt"
616 if test "$have_qt" != yes; then
617 AC_MSG_RESULT([$have_qt]);
619 ac_cv_have_qt="have_qt=yes \
620 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
621 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
623 qt_libraries="$ac_qt_libraries"
624 qt_includes="$ac_qt_includes"
627 if test ! "$kde_qt_libs_given" = "yes"; then
628 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
631 dnl should check it's not Qt2, so it will fail now, rather than in KDE check
633 SAVE_CXXFLAGS="$CXXFLAGS"
634 CXXFLAGS="$CXXFLAGS -I$qt_includes -L$qt_libraries"
635 dnl specify we are definitely C++ compiling first
641 #if (QT_VERSION >= 200)
648 test "$ac_qt_ok" = no && AC_MSG_ERROR([Found Qt 2 - you must specify the path to the Qt 1 headers and libraries])
649 CXXFLAGS="$SAVE_CXXFLAGS"
651 AC_SUBST(qt_libraries)
652 AC_SUBST(qt_includes)
654 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
657 QT_INCLUDES="-I$qt_includes"
658 all_includes="$QT_INCLUDES $all_includes"
661 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
664 QT_LDFLAGS="-L$qt_libraries"
665 all_libraries="$QT_LDFLAGS $all_libraries"
668 AC_SUBST(QT_INCLUDES)
678 ## ------------------------------------------------------------------------
679 ## Now, the same with KDE
680 ## $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
681 ## and $(kde_includes) will be the kdehdrlocation (if needed)
682 ## ------------------------------------------------------------------------
684 AC_DEFUN(AC_BASE_PATH_KDE,
686 AC_REQUIRE([KDE_MISC_TESTS])
687 AC_REQUIRE([AC_PATH_QT])dnl
688 AC_MSG_CHECKING([for KDE])
691 [ --with-kde-dir where the KDE root is ],
692 [ export KDEDIR="$withval" ])
694 if test "${prefix}" != NONE; then
695 kde_includes=${prefix}/include
696 ac_kde_includes=$prefix/include
698 if test "${exec_prefix}" != NONE; then
699 kde_libraries=${exec_prefix}/lib
700 ac_kde_libraries=$exec_prefix/lib
702 kde_libraries=${prefix}/lib
703 ac_kde_libraries=$prefix/lib
712 if test ! -z "$KDEDIR"; then
713 ac_kde_includes="$KDEDIR/include"
714 kde_includes="$KDEDIR/include"
715 ac_kde_libraries="$KDEDIR/lib"
716 kde_libraries="$KDEDIR/lib"
719 AC_ARG_WITH(kde-includes,
720 [ --with-kde-includes where the KDE includes are installed. ],
721 [ ac_kde_includes="$withval" ])
723 AC_ARG_WITH(kde-libraries,
724 [ --with-kde-libraries where the KDE libraries are installed.],
725 [ ac_kde_libraries="$withval" ])
727 AC_CACHE_VAL(ac_cv_have_kde,
728 [#try to guess kde locations
730 if test -z "$1"; then
732 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"
733 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include/kde $KDEDIR/include $KDEDIR $kde_incdirs"
734 kde_incdirs="$ac_kde_includes $kde_incdirs"
735 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
736 ac_kde_includes="$kde_incdir"
738 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
740 in the prefix, you've chosen, are no kde headers installed. This will fail.
741 So, check this please and use another prefix!])
744 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"
745 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
746 kde_libdirs="$ac_kde_libraries $kde_libdirs"
747 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
748 ac_kde_libraries="$kde_libdir"
750 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
752 in the prefix, you've chosen $ac_kde_libraries, are no kde libraries installed. This will fail.
753 So, check this please and use another prefix!])
756 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
757 ac_cv_have_kde="have_kde=no"
759 ac_cv_have_kde="have_kde=yes \
760 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
765 ac_cv_have_kde="have_kde=no"
770 eval "$ac_cv_have_kde"
772 if test "$have_kde" != "yes"; then
773 if test "${prefix}" = NONE; then
774 ac_kde_prefix="$ac_default_prefix"
776 ac_kde_prefix="$prefix"
778 if test "$exec_prefix" = NONE; then
779 ac_kde_exec_prefix="$ac_kde_prefix"
780 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
782 ac_kde_exec_prefix="$exec_prefix"
783 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
786 kde_libraries="${ac_kde_exec_prefix}/lib"
787 kde_includes=${ac_kde_prefix}/include
790 ac_cv_have_kde="have_kde=yes \
791 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
792 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
794 kde_libraries="$ac_kde_libraries"
795 kde_includes="$ac_kde_includes"
797 AC_SUBST(kde_libraries)
798 AC_SUBST(kde_includes)
800 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
803 KDE_INCLUDES="-I$kde_includes"
804 all_includes="$KDE_INCLUDES $all_includes"
807 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
810 KDE_LDFLAGS="-L$kde_libraries"
811 all_libraries="$KDE_LDFLAGS $all_libraries"
814 AC_SUBST(KDE_LDFLAGS)
815 AC_SUBST(KDE_INCLUDES)
817 AC_SUBST(all_includes)
818 AC_SUBST(all_libraries)
822 AC_DEFUN(KDE_CHECK_KIMGIO,
824 AC_REQUIRE([AC_FIND_TIFF])
825 AC_REQUIRE([AC_FIND_JPEG])
826 AC_REQUIRE([AC_FIND_PNG])
828 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) -lm'
830 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
832 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
836 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
838 AC_REQUIRE([KDE_MISC_TESTS])
840 KDE_LIBS='-lkfile -lkfm -lkdeui -lkdecore -lqt'
842 # LIB_X11='-lX11 $(LIBSOCKET)'
844 # LIB_QT='-lqt $(LIB_X11)'
846 # LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
847 # AC_SUBST(LIB_KDECORE)
848 # LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
849 # AC_SUBST(LIB_KDEUI)
850 # LIB_KFM='-lkfm $(LIB_KDECORE)'
852 # LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
853 # AC_SUBST(LIB_KFILE)
856 AC_DEFUN(AC_PATH_KDE,
859 ac_use_path_checking=""
862 AC_CREATE_KFSSTND($ac_use_path_checking)
865 KDE_CREATE_LIBS_ALIASES
868 dnl slightly changed version of AC_CHECK_FUNC(setenv)
869 AC_DEFUN(AC_CHECK_SETENV,
870 [AC_MSG_CHECKING([for setenv])
871 AC_CACHE_VAL(ac_cv_func_setenv,
874 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
875 dnl which includes <sys/select.h> which contains a prototype for
876 dnl select. Similarly for bzero.
878 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
882 [/* We use char because int might match the return type of a gcc2
883 builtin and then its argument prototype would still apply. */
886 /* The GNU C library defines this for functions which it implements
887 to always fail with ENOSYS. Some functions are actually named
888 something starting with __ and the normal name is an alias. */
889 #if defined (__stub_$1) || defined (__stub___$1)
892 setenv("TEST", "alle", 1);
894 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
896 if test "$ac_cv_func_setenv" = "yes"; then
898 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
904 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
907 save_CXXFLAGS="$CXXFLAGS"
908 if test "$GCC" = "yes"; then
909 CXXFLAGS="$CXXFLAGS -pedantic-errors"
911 AC_MSG_CHECKING(for getdomainname)
912 AC_CACHE_VAL(ac_cv_func_getdomainname,
920 getdomainname(buffer, 200);
922 ac_cv_func_getdomainname=yes,
923 ac_cv_func_getdomainname=no)
925 AC_MSG_RESULT($ac_cv_func_getdomainname)
926 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
927 AC_DEFINE(HAVE_GETDOMAINNAME)
929 CXXFLAGS="$save_CXXFLAGS"
932 AC_DEFUN(AC_CHECK_GETHOSTNAME,
935 save_CXXFLAGS="$CXXFLAGS"
936 if test "$GCC" = "yes"; then
937 CXXFLAGS="$CXXFLAGS -pedantic-errors"
940 AC_MSG_CHECKING([for gethostname])
941 AC_CACHE_VAL(ac_cv_func_gethostname,
949 gethostname(buffer, 200);
951 ac_cv_func_gethostname=yes,
952 ac_cv_func_gethostname=no)
954 AC_MSG_RESULT($ac_cv_func_gethostname)
955 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
956 AC_DEFINE(HAVE_GETHOSTNAME)
958 CXXFLAGS="$save_CXXFLAGS"
961 AC_DEFUN(AC_CHECK_USLEEP,
965 AC_MSG_CHECKING([for usleep])
966 AC_CACHE_VAL(ac_cv_func_usleep,
977 ac_cv_func_usleep=yes,
978 ac_cv_func_usleep=no)
980 AC_MSG_RESULT($ac_cv_func_usleep)
981 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
982 AC_DEFINE(HAVE_USLEEP)
987 AC_DEFUN(AC_FIND_GIF,
988 [AC_MSG_CHECKING([for giflib])
989 AC_CACHE_VAL(ac_cv_lib_gif,
990 [ac_save_LIBS="$LIBS"
991 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
997 int GifLastError(void);
1001 /* We use char because int might match the return type of a gcc2
1002 builtin and then its argument prototype would still apply. */
1004 [return GifLastError();],
1005 eval "ac_cv_lib_gif=yes",
1006 eval "ac_cv_lib_gif=no")
1007 LIBS="$ac_save_LIBS"
1009 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1011 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
1013 AC_MSG_ERROR(You need giflib23. Please install the kdesupport package)
1017 AC_DEFUN(AC_FIND_JPEG,
1018 [AC_MSG_CHECKING([for jpeglib])
1019 AC_CACHE_VAL(ac_cv_lib_jpeg,
1020 [ac_save_LIBS="$LIBS"
1021 LIBS="$all_libraries -ljpeg -lm"
1023 [/* Override any gcc2 internal prototype to avoid an error. */
1024 struct jpeg_decompress_struct;
1025 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1030 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1031 int version, size_t structsize);
1035 /* We use char because int might match the return type of a gcc2
1036 builtin and then its argument prototype would still apply. */
1038 [jpeg_CreateDecompress(0L, 0, 0);],
1039 eval "ac_cv_lib_jpeg=-ljpeg",
1040 eval "ac_cv_lib_jpeg=no")
1041 LIBS="$ac_save_LIBS"
1043 dnl what to do, if the normal way fails:
1044 if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then
1045 if test -f "$kde_libraries/libjpeg.so"; then
1046 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1047 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1048 else if test -f "$kde_libraries/libjpeg.sl"; then
1049 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1050 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1051 else if test -f "$kde_libraries/libjpeg.a"; then
1052 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1053 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1056 You need jpeglib6a. Please install the kdesupport package.
1057 If you have already installed kdesupport, you may have an
1058 old libjpeg somewhere.
1059 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
1066 if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then
1067 LIBJPEG="$ac_cv_lib_jpeg"
1069 AC_MSG_RESULT($ac_cv_lib_jpeg)
1070 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
1074 AC_DEFUN(AC_FIND_ZLIB,
1076 AC_MSG_CHECKING([for libz])
1077 AC_CACHE_VAL(ac_cv_lib_z,
1078 [ac_save_LIBS="$LIBS"
1079 LIBS="$all_libraries -lz $LIBSOCKET"
1084 [return (zlibVersion() == ZLIB_VERSION); ],
1085 eval "ac_cv_lib_z='-lz'",
1086 eval "ac_cv_lib_z=no")
1087 LIBS="$ac_save_LIBS"
1089 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1090 dnl AC_DEFINE_UNQUOTED(HAVE_LIBZ)
1093 AC_MSG_RESULT($ac_cv_lib_z)
1101 AC_DEFUN(AC_FIND_TIFF,
1103 AC_REQUIRE([AC_FIND_ZLIB])
1104 AC_REQUIRE([AC_FIND_JPEG])
1105 AC_MSG_CHECKING([for libtiff])
1106 AC_CACHE_VAL(ac_cv_lib_tiff,
1107 [ac_save_LIBS="$LIBS"
1108 LIBS="$all_libraries -ltiff $LIBJPEG $LIBZ -lX11 $LIBSOCKET"
1113 [return (TIFFOpen( "", "r") == 0); ],
1114 eval "ac_cv_lib_tiff='-ltiff $LIBJPEG $LIBZ'",
1115 eval "ac_cv_lib_tiff=no")
1116 LIBS="$ac_save_LIBS"
1118 if eval "test ! \"`echo $ac_cv_lib_tiff`\" = no"; then
1119 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
1120 LIBTIFF="$ac_cv_lib_tiff"
1122 AC_MSG_RESULT($ac_cv_lib_tiff)
1131 AC_DEFUN(AC_FIND_PNG,
1133 AC_REQUIRE([AC_FIND_ZLIB])
1134 AC_MSG_CHECKING([for libpng])
1135 AC_CACHE_VAL(ac_cv_lib_png,
1136 [ac_save_LIBS="$LIBS"
1137 LIBS="$all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1144 png_structp png_ptr = png_create_read_struct( // image ptr
1145 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1146 return( png_ptr != 0 );
1148 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1149 eval "ac_cv_lib_png=no")
1150 LIBS="$ac_save_LIBS"
1152 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1153 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
1154 LIBPNG="$ac_cv_lib_png"
1156 AC_MSG_RESULT($ac_cv_lib_png)
1164 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1166 AC_MSG_CHECKING(if you need GNU extensions)
1167 AC_CACHE_VAL(ac_cv_gnu_extensions,
1169 cat > conftest.c << EOF
1170 #include <features.h>
1172 #ifdef __GNU_LIBRARY__
1177 if (eval "$ac_cpp conftest.c") 2>&5 |
1178 egrep "yes" >/dev/null 2>&1; then
1180 ac_cv_gnu_extensions=yes
1182 ac_cv_gnu_extensions=no
1186 AC_MSG_RESULT($ac_cv_gnu_extensions)
1187 if test "$ac_cv_gnu_extensions" = "yes"; then
1188 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
1192 dnl just a wrapper to clean up configure.in
1193 AC_DEFUN(KDE_PROG_LIBTOOL,
1195 AC_REQUIRE([AM_ENABLE_SHARED])
1196 AC_REQUIRE([AM_ENABLE_STATIC])
1197 dnl libtool is only for C, so I must force him
1198 dnl to find the correct flags for C++
1200 ac_save_cflags="$CFLAGS"
1203 AM_PROG_LIBTOOL dnl for libraries
1205 CFLAGS="$ac_save_cflags"
1208 AC_DEFUN(KDE_DO_IT_ALL,
1212 AC_PATH_PROG(QTARCH, "qtarch",qtarch-notinstalled)
1215 AC_DEFUN(AC_CHECK_RPATH,
1217 AC_MSG_CHECKING(for rpath)
1218 AC_ARG_ENABLE(rpath,
1219 [ --disable-rpath do not use the rpath feature of ld],
1220 USE_RPATH=$enableval, USE_RPATH=yes)
1221 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1223 KDE_RPATH="-rpath \$(kde_libraries)"
1225 if test -n "$qt_libraries"; then
1226 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1228 dnl $x_libraries is set to /usr/lib in case
1229 if test -n "$X_LDFLAGS"; then
1230 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1232 if test -n "$KDE_EXTRA_RPATH"; then
1233 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1236 AC_SUBST(KDE_EXTRA_RPATH)
1238 AC_MSG_RESULT($USE_RPATH)
1241 # Search path for a program which passes the given test.
1242 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1245 # Stephan Kulow: I appended a _KDE against name conflicts
1247 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1248 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1249 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1250 [# Extract the first word of "$2", so it can be a program name with args.
1251 set dummy $2; ac_word=[$]2
1252 AC_MSG_CHECKING([for $ac_word])
1253 AC_CACHE_VAL(ac_cv_path_$1,
1256 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1259 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1260 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1261 test -z "$ac_dir" && ac_dir=.
1262 if test -f $ac_dir/$ac_word; then
1264 ac_cv_path_$1="$ac_dir/$ac_word"
1270 dnl If no 4th arg is given, leave the cache variable unset,
1271 dnl so AC_PATH_PROGS will keep looking.
1272 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1277 if test -n "[$]$1"; then
1278 AC_MSG_RESULT([$]$1)
1286 dnl From Jim Meyering.
1287 dnl FIXME: migrate into libit.
1289 AC_DEFUN(AM_FUNC_OBSTACK,
1290 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
1291 [AC_TRY_LINK([#include "obstack.h"],
1292 [struct obstack *mem;obstack_free(mem,(char *) 0)],
1293 am_cv_func_obstack=yes,
1294 am_cv_func_obstack=no)])
1295 if test $am_cv_func_obstack = yes; then
1296 AC_DEFINE(HAVE_OBSTACK)
1298 LIBOBJS="$LIBOBJS obstack.o"
1302 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
1303 dnl FIXME: Migrate into libit
1305 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
1306 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
1307 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
1308 am_cv_lib_error_at_line=yes,
1309 am_cv_lib_error_at_line=no)])
1310 if test $am_cv_lib_error_at_line = no; then
1311 LIBOBJS="$LIBOBJS error.o"
1313 AC_SUBST(LIBOBJS)dnl
1316 # Macro to add for using GNU gettext.
1317 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1320 # Stephan Kulow: I put a KDE in it to avoid name conflicts
1322 AC_DEFUN(AM_KDE_GNU_GETTEXT,
1323 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1324 AC_REQUIRE([AC_PROG_RANLIB])dnl
1325 AC_REQUIRE([AC_HEADER_STDC])dnl
1326 AC_REQUIRE([AC_C_INLINE])dnl
1327 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1328 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1329 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1330 AC_REQUIRE([AC_FUNC_MMAP])dnl
1331 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1332 unistd.h values.h alloca.h])
1333 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1334 __argz_count __argz_stringify __argz_next stpcpy])
1338 if test "x$CATOBJEXT" != "x"; then
1339 if test "x$ALL_LINGUAS" = "x"; then
1342 AC_MSG_CHECKING(for catalogs to be installed)
1344 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1345 case "$ALL_LINGUAS" in
1346 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1349 LINGUAS=$NEW_LINGUAS
1350 AC_MSG_RESULT($LINGUAS)
1353 dnl Construct list of names of catalog files to be constructed.
1354 if test -n "$LINGUAS"; then
1355 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1361 AC_DEFUN(AC_HAVE_XPM,
1362 [AC_REQUIRE_CPP()dnl
1364 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
1365 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
1367 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
1368 xpm_test=$withval, xpm_test="yes")
1369 if test "x$xpm_test" = xno; then
1372 AC_MSG_CHECKING(for XPM)
1373 AC_CACHE_VAL(ac_cv_have_xpm,
1376 ac_save_ldflags="$LDFLAGS"
1377 ac_save_cflags="$CFLAGS"
1378 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
1379 CFLAGS="$CFLAGS $X_INCLUDES"
1380 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
1381 AC_TRY_LINK([#include <X11/xpm.h>],[],
1382 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
1383 LDFLAGS="$ac_save_ldflags"
1384 CFLAGS="$ac_save_cflags"
1387 if test "$ac_cv_have_xpm" = no; then
1394 if test "$XPM_LDFLAGS" = ""; then
1397 XPMLIB="-L$XPM_LDFLAGS -lXpm"
1399 if test "$XPM_INCLUDE" = ""; then
1402 XPMINC="-I$XPM_INCLUDE"
1412 AC_DEFUN(AC_HAVE_GL,
1413 [AC_REQUIRE_CPP()dnl
1415 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
1416 test -z "$GL_INCLUDE" && GL_INCLUDE=
1418 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
1419 gl_test=$withval, gl_test="yes")
1420 if test "x$gl_test" = xno; then
1423 AC_MSG_CHECKING(for GL)
1424 AC_CACHE_VAL(ac_cv_have_gl,
1427 ac_save_ldflags="$LDFLAGS"
1428 ac_save_cflags="$CFLAGS"
1429 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
1430 CFLAGS="$CFLAGS $X_INCLUDES"
1431 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
1433 ac_cv_have_gl="yes",ac_cv_have_gl="no")
1434 LDFLAGS="$ac_save_ldflags"
1435 CFLAGS="$ac_save_cflags"
1438 if test "$ac_cv_have_gl" = no; then
1445 if test "$GL_LDFLAGS" = ""; then
1446 GLLIB="-lMesaGL -lMesaGLU"
1448 GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU"
1450 if test "$GL_INCLUDE" = ""; then
1453 GLINC="-I$GL_INCLUDE"
1465 dnl Should test for PAM (Pluggable Authentication Modules)
1466 AC_DEFUN(KDE_CHECK_LIBDL,
1468 AC_CHECK_LIB(dl, dlopen, [
1470 ac_cv_have_dlfcn=yes
1473 AC_CHECK_LIB(dld, shl_unload, [
1475 ac_cv_have_shload=yes
1481 AC_DEFUN(KDE_CHECK_DLOPEN,
1484 AC_CHECK_HEADERS(dlfcn.h dl.h)
1485 if test "$ac_cv_header_dlfcn_h" = "no"; then
1489 if test "$ac_cv_header_dl_h" = "no"; then
1490 ac_cv_have_shload=no
1494 AC_ARG_ENABLE(dlopen,
1495 [ --disable-dlopen link staticly [default=no]] ,
1496 [if test "$enableval" = yes; then
1501 # override the user's opinion, if we know it better ;)
1502 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
1506 if test "$ac_cv_have_dlfcn" = "yes"; then
1507 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
1510 if test "$ac_cv_have_shload" = "yes"; then
1511 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
1514 if test "$enable_dlopen" = no ; then
1515 test -n "$1" && eval $1
1517 test -n "$2" && eval $2
1522 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
1524 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
1526 AC_MSG_CHECKING([dynamic loading])
1527 eval "`egrep '^build_libtool_libs=' libtool`"
1528 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
1530 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
1534 AC_MSG_RESULT($dynamic_loading)
1535 if test "$dynamic_loading" = "yes"; then
1542 AC_DEFUN(KDE_ADD_INCLUDES,
1544 if test -z "$1"; then
1545 test_include="Pix.h"
1550 AC_MSG_CHECKING([for libg++ ($test_include)])
1552 AC_CACHE_VAL(kde_cv_libgpp_includes,
1554 kde_cv_libgpp_includes=no
1560 /usr/unsupported/include \
1565 if test -r "$ac_dir/$test_include"; then
1566 kde_cv_libgpp_includes=$ac_dir
1572 AC_MSG_RESULT($kde_cv_libgpp_includes)
1573 if test "$kde_cv_libgpp_includes" != "no"; then
1574 all_includes="-I$kde_cv_libgpp_includes $all_includes"
1579 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
1581 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
1582 AC_SUBST(LIBPTHREAD)
1585 AC_DEFUN(KDE_CHECK_STL_SGI,
1587 AC_MSG_CHECKING([if STL implementation is SGI like])
1588 AC_CACHE_VAL(kde_cv_stl_type_sgi,
1593 string astring="Hallo Welt.";
1594 astring.erase(0, 6); // now astring is "Welt"
1596 ], kde_cv_stl_type_sgi=yes,
1597 kde_cv_stl_type_sgi=no)
1600 AC_MSG_RESULT($kde_cv_stl_type_sgi)
1602 if test "$kde_cv_stl_type_sgi" = "yes"; then
1603 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
1607 AC_DEFUN(KDE_CHECK_STL_HP,
1609 AC_MSG_CHECKING([if STL implementation is HP like])
1610 AC_CACHE_VAL(kde_cv_stl_type_hp,
1615 string astring="Hello World";
1616 astring.remove(0, 6); // now astring is "World"
1618 ], kde_cv_stl_type_hp=yes,
1619 kde_cv_stl_type_hp=no)
1621 AC_MSG_RESULT($kde_cv_stl_type_hp)
1623 if test "$kde_cv_stl_type_hp" = "yes"; then
1624 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
1628 AC_DEFUN(KDE_CHECK_STL,
1632 if test "$kde_cv_stl_type_sgi" = "no"; then
1635 if test "$kde_cv_stl_type_hp" = "no"; then
1636 AC_MSG_ERROR("no known STL type found")
1642 AC_DEFUN(AC_FIND_QIMGIO,
1643 [AC_REQUIRE([AC_FIND_JPEG])
1644 AC_MSG_CHECKING([for qimgio])
1645 AC_CACHE_VAL(ac_cv_lib_qimgio,
1646 [ac_save_LIBS="$LIBS"
1647 LIBS="$all_libraries -lqimgio -lpng -lz -lqt $LIBJPEG -lX11 $LIBSOCKET"
1650 void qInitImageIO ();
1653 eval "ac_cv_lib_qimgio=yes",
1654 eval "ac_cv_lib_qimgio=no")
1655 LIBS="$ac_save_LIBS"
1657 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
1658 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
1660 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
1663 AC_MSG_RESULT(not found)