3 dnl This file is part of the KDE libraries/packages
4 dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5 dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
7 dnl This file is free software; you can redistribute it and/or
8 dnl modify it under the terms of the GNU Library General Public
9 dnl License as published by the Free Software Foundation; either
10 dnl version 2 of the License, or (at your option) any later version.
12 dnl This library is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 dnl Library General Public License for more details.
17 dnl You should have received a copy of the GNU Library General Public License
18 dnl along with this library; see the file COPYING.LIB. If not, write to
19 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 dnl Boston, MA 02111-1307, USA.
23 dnl Please do not modify this file unless you expect your modifications to be
24 dnl carried into every other module in the repository. If you decide that you
25 dnl really want to modify it, contact coolo@kde.org mentioning that you have
26 dnl and that the modified file should be committed to every module.
28 dnl Single-module modifications are best placed in configure.in for kdelibs
29 dnl and kdebase or configure.in.in if present.
32 dnl ------------------------------------------------------------------------
33 dnl Find a file (or one of more files in a list of dirs)
34 dnl ------------------------------------------------------------------------
36 AC_DEFUN(AC_FIND_FILE,
43 if test -r "$i/$j"; then
51 AC_DEFUN(KDE_FIND_PATH,
53 AC_MSG_CHECKING([for $1])
54 AC_CACHE_VAL(kde_cv_path_$1,
57 if test -n "$$2"; then
69 if test -x "$dir/$1"; then
72 evalstr="$dir/$1 $5 2>&1 "
73 if eval $evalstr; then
74 kde_cv_path_$1="$dir/$1"
78 kde_cv_path_$1="$dir/$1"
88 if test -z "$kde_cv_path_$1" || test "$kde_cv_path_$1" = "NONE"; then
89 AC_MSG_RESULT(not found)
92 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 $QTDIR/src/moc \
117 /usr/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/lib/qt2/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 dnl get KDE pathnames from kdelibs
136 AC_DEFUN(KDE_GET_KDE_1_X_PATHS,
141 ac_cxxflags_safe="$CXXFLAGS"
142 ac_ldflags_safe="$LDFLAGS"
145 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
146 LDFLAGS="-L$qt_libdir $all_libraries"
147 LIBS="$LIBS $LIBQT -lkdecore"
149 cat > conftest.$ac_ext <<EOF
151 #include "confdefs.h"
155 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
156 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
157 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
158 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
159 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
160 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
161 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
162 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
163 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
164 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
165 printf("kde_wallpaperdir=\\"%s\\"\n",
166 KApplication::kde_wallpaperdir().data());
167 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
168 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
173 if AC_TRY_EVAL(ac_link) && test -s conftest; then
174 eval `KDEDIR= ./conftest 2>&5`
175 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
177 AC_MSG_ERROR([your system is not able to compile a small KDE application!
178 Check, if you installed the KDE header and library files correctly.])
182 CXXFLAGS="$ac_cxxflags_safe"
183 LDFLAGS="$ac_ldflags_safe"
188 AC_DEFUN(AC_CREATE_KFSSTND,
190 AC_REQUIRE([AC_CHECK_RPATH])
191 AC_REQUIRE([AC_CHECK_BOOL])
192 AC_MSG_CHECKING([for KDE paths])
195 dnl get paths from kde installed on netbsd
196 dnl until now it's only valid for KDE 1.x
197 if test "$kde_qtver" = "1"; then
198 case $host in dnl this *is* NetBSD specific
200 KDE_GET_KDE_1_X_PATHS
205 AC_CACHE_VAL(kde_cv_all_paths,
207 if test -z "$kde_htmldir"; then
208 kde_htmldir='\$(prefix)/share/doc/HTML'
210 if test -z "$kde_appsdir"; then
211 kde_appsdir='\$(prefix)/share/applnk'
213 if test -z "$kde_icondir"; then
214 kde_icondir='\$(prefix)/share/icons'
216 if test -z "$kde_sounddir"; then
217 kde_sounddir='\$(prefix)/share/sounds'
219 if test -z "$kde_datadir"; then
220 kde_datadir='\$(prefix)/share/apps'
222 if test -z "$kde_locale"; then
223 kde_locale='\$(prefix)/share/locale'
225 if test -z "$kde_cgidir"; then
226 kde_cgidir='\$(exec_prefix)/cgi-bin'
228 if test -z "$kde_confdir"; then
229 kde_confdir='\$(prefix)/share/config'
231 if test -z "$kde_mimedir"; then
232 kde_mimedir='\$(prefix)/share/mimelnk'
234 if test -z "$kde_toolbardir"; then
235 kde_toolbardir='\$(prefix)/share/toolbar'
237 if test -z "$kde_wallpaperdir"; then
238 kde_wallpaperdir='\$(prefix)/share/wallpapers'
240 if test -z "$kde_bindir"; then
241 kde_bindir='\$(exec_prefix)/bin'
243 if test -z "$kde_servicesdir"; then
244 kde_servicesdir='\$(prefix)/share/services'
246 if test -z "$kde_servicetypesdir"; then
247 kde_servicetypesdir='\$(prefix)/share/servicetypes'
250 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
251 kde_htmldir=\"$kde_htmldir\" \
252 kde_appsdir=\"$kde_appsdir\" \
253 kde_icondir=\"$kde_icondir\" \
254 kde_sounddir=\"$kde_sounddir\" \
255 kde_datadir=\"$kde_datadir\" \
256 kde_locale=\"$kde_locale\" \
257 kde_cgidir=\"$kde_cgidir\" \
258 kde_confdir=\"$kde_confdir\" \
259 kde_mimedir=\"$kde_mimedir\" \
260 kde_toolbardir=\"$kde_toolbardir\" \
261 kde_wallpaperdir=\"$kde_wallpaperdir\" \
262 kde_bindir=\"$kde_bindir\" \
263 kde_servicesdir=\"$kde_servicesdir\" \
264 kde_servicetypesdir=\"$kde_servicetypesdir\" \
269 eval "$kde_cv_all_paths"
271 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
272 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
273 test -z "$kde_datadir" || test -z "$kde_locale" ||
274 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
275 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
276 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
277 test -z "$kde_servicesdir" ||
278 test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then
279 kde_have_all_paths=no
280 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
281 Since it had compiled and linked before, it must be a strange problem on your system.
282 Look at config.log for details. If you are not able to fix this, look at
283 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
284 (If you're using an egcs version on Linux, you may update binutils!)
288 AC_MSG_RESULT($kde_result)
295 AC_DEFUN(AC_SUBST_KFSSTND,
297 AC_SUBST(kde_htmldir)
298 AC_SUBST(kde_appsdir)
299 AC_SUBST(kde_icondir)
300 AC_SUBST(kde_sounddir)
301 AC_SUBST(kde_datadir)
304 AC_SUBST(kde_confdir)
305 AC_SUBST(kde_mimedir)
306 AC_SUBST(kde_toolbardir)
307 AC_SUBST(kde_wallpaperdir)
309 AC_SUBST(kde_servicesdir)
310 AC_SUBST(kde_servicetypesdir)
313 AC_DEFUN(KDE_MISC_TESTS,
316 dnl Checks for libraries.
317 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
320 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
321 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
322 AC_MSG_WARN([you have no crypt in either libcrypt or libc.
323 You should install libcrypt from another source or configure with PAM
328 if test $kde_have_crypt = yes; then
329 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
333 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
334 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
335 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
336 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
338 AC_CHECK_FUNC(inet_ntoa)
339 if test $ac_cv_func_inet_ntoa = no; then
340 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
342 AC_CHECK_FUNC(connect)
343 if test $ac_cv_func_connect = no; then
344 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
348 AC_CHECK_FUNC(remove)
349 if test $ac_cv_func_remove = no; then
350 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
353 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
355 if test $ac_cv_func_shmat = no; then
356 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
359 LIBSOCKET="$X_EXTRA_LIBS"
361 AC_SUBST(X_EXTRA_LIBS)
362 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
365 case $host in dnl this *is* LynxOS specific
367 AC_MSG_CHECKING([LynxOS header file wrappers])
368 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
369 AC_MSG_RESULT(disabled)
370 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
374 AC_REQUIRE([KDE_CHECK_LIBDL])
377 dnl ------------------------------------------------------------------------
378 dnl Find the header files and libraries for X-Windows. Extended the
380 dnl ------------------------------------------------------------------------
384 AC_REQUIRE([AC_PROG_CPP])
385 AC_MSG_CHECKING(for X)
388 AC_CACHE_VAL(ac_cv_have_x,
389 [# One or both of the vars are not set, and there is no cached value.
390 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
393 kde_x_includes=$x_includes
395 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
398 kde_x_libraries=$x_libraries
401 # below we use the standard autoconf calls
402 ac_x_libraries=$kde_x_libraries
403 ac_x_includes=$kde_x_includes
407 if test -z "$ac_x_includes"; then
410 if test -z "$ac_x_libraries"; then
411 ac_x_libraries="/usr/lib"
413 #from now on we use our own again
415 # when the user already gave --x-includes, we ignore
416 # what the standard autoconf macros told us.
417 if test "$kde_x_includes" = NO; then
418 kde_x_includes=$ac_x_includes
421 if test "$kde_x_includes" = NO; then
422 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
425 if test "$ac_x_libraries" = NO; then
426 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
429 # Record where we found X for the cache.
430 ac_cv_have_x="have_x=yes \
431 kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries"
435 if test "$have_x" != yes; then
436 AC_MSG_RESULT($have_x)
439 AC_MSG_RESULT([libraries $ac_x_libraries, headers $kde_x_includes])
442 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
444 x_includes="."; dnl better than nothing :-
446 x_includes=$kde_x_includes
447 X_INCLUDES="-I$x_includes"
450 if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then
452 x_libraries="/usr/lib"; dnl better than nothing :-
454 x_libraries=$ac_x_libraries
455 X_LDFLAGS="-L$x_libraries"
457 all_includes="$all_includes $X_INCLUDES"
458 all_libraries="$all_libraries $X_LDFLAGS"
462 AC_SUBST(x_libraries)
465 # Check for libraries that X11R6 Xt/Xaw programs need.
466 ac_save_LDFLAGS="$LDFLAGS"
467 test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
468 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
469 # check for ICE first), but we must link in the order -lSM -lICE or
470 # we get undefined symbols. So assume we have SM if we have ICE.
471 # These have to be linked with before -lX11, unlike the other
472 # libraries we check for below, so use a different variable.
473 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
474 AC_CHECK_LIB(ICE, IceConnectionNumber,
475 [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS)
476 LDFLAGS="$ac_save_LDFLAGS"
480 LIB_X11='-lX11 $(LIBSOCKET)'
483 AC_MSG_CHECKING(for libXext)
484 AC_CACHE_VAL(kde_cv_have_libXext,
486 kde_ldflags_safe="$LDFLAGS"
487 kde_libs_safe="$LIBS"
489 LDFLAGS="$X_LDFLAGS $USER_LDFLAGS"
490 LIBS="-lXext -lX11 $LIBSOCKET"
496 printf("hello Xext\n");
498 kde_cv_have_libXext=yes,
499 kde_cv_have_libXext=no
502 LDFLAGS=$kde_ldflags_safe
506 AC_MSG_RESULT($kde_cv_have_libXext)
508 if test "kde_cv_have_libXext" = "no"; then
509 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
510 can't find it itself, we stop here assuming that make wouldn't find
519 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
521 AC_REQUIRE([KDE_USE_QT])
522 cat > conftest.$ac_ext <<EOF
523 #include "confdefs.h"
525 #include <qapplication.h>
527 #include <qobjcoll.h>
529 if test "$kde_qtver" = "2"; then
530 cat >> conftest.$ac_ext <<EOF
535 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
536 cat >> conftest.$ac_ext <<EOF
542 if test "$kde_qtver" = "2"; then
543 cat >> conftest.$ac_ext <<EOF
544 QStringList *t = new QStringList();
547 cat >> conftest.$ac_ext <<EOF
555 if test -z "$1"; then
561 if test -z "$2"; then
562 if test $kde_qtver = 2; then
563 kde_qt_minversion=">= 2.0"
565 kde_qt_minversion=">= 1.42 and < 2.0"
571 if test -z "$3"; then
572 if test $kde_qtver = 2; then
573 kde_qt_verstring="QT_VERSION >= 200"
575 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
582 AC_DEFUN(KDE_CHECK_QT_DIRECT,
584 AC_REQUIRE([KDE_USE_QT])
585 AC_MSG_CHECKING([if Qt compiles without flags])
586 AC_CACHE_VAL(kde_cv_qt_direct,
590 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
591 ac_LIBRARY_PATH="$LIBRARY_PATH"
592 ac_cxxflags_safe="$CXXFLAGS"
593 ac_ldflags_safe="$LDFLAGS"
596 CXXFLAGS="$CXXFLAGS -I$qt_includes"
598 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
600 export LD_LIBRARY_PATH
606 if AC_TRY_EVAL(ac_link) && test -s conftest; then
607 kde_cv_qt_direct="yes"
609 kde_cv_qt_direct="no"
610 echo "configure: failed program was:" >&AC_FD_CC
611 cat conftest.$ac_ext >&AC_FD_CC
615 CXXFLAGS="$ac_cxxflags_safe"
616 LDFLAGS="$ac_ldflags_safe"
619 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
620 export LD_LIBRARY_PATH
621 LIBRARY_PATH="$ac_LIBRARY_PATH"
626 if test "$kde_cv_qt_direct" = "yes"; then
635 dnl ------------------------------------------------------------------------
636 dnl Try to find the Qt headers and libraries.
637 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
638 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
639 dnl ------------------------------------------------------------------------
641 AC_DEFUN(AC_PATH_QT_1_3,
643 AC_REQUIRE([K_PATH_X])
644 AC_REQUIRE([KDE_USE_QT])
646 if test $kde_qtver = 2; then
648 AC_REQUIRE([AC_FIND_PNG])
649 LIBQT="$LIBQT $LIBPNG"
651 AC_MSG_CHECKING([for Qt])
653 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSOCKET"
654 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
658 [ --with-qt-dir=DIR where the root of Qt is installed ],
659 [ ac_qt_includes="$withval"/include
660 ac_qt_libraries="$withval"/lib
661 ac_qt_bindir="$withval"/bin
664 AC_ARG_WITH(qt-includes,
665 [ --with-qt-includes=DIR where the Qt includes are. ],
667 ac_qt_includes="$withval"
672 AC_ARG_WITH(qt-libraries,
673 [ --with-qt-libraries=DIR where the Qt library is installed.],
674 [ ac_qt_libraries="$withval"
675 kde_qt_libs_given=yes
678 AC_CACHE_VAL(ac_cv_have_qt,
679 [#try to guess Qt locations
681 qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/lib/qt2/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
682 test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs"
683 qt_incdirs="$ac_qt_includes $qt_incdirs"
684 AC_FIND_FILE(qmovie.h, $qt_incdirs, qt_incdir)
685 ac_qt_includes="$qt_incdir"
687 qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt /usr/lib/qt2/lib $x_libraries"
688 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
689 if test ! "$ac_qt_libraries" = "NO"; then
690 qt_libdirs="$ac_qt_libraries $qt_libdirs"
695 for dir in $qt_libdirs; do
696 try="ls -1 $dir/libqt*"
697 if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
700 ac_qt_libraries="$qt_libdir"
705 ac_cxxflags_safe="$CXXFLAGS"
706 ac_ldflags_safe="$LDFLAGS"
709 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
710 LDFLAGS="-L$qt_libdir $all_libraries"
715 if AC_TRY_EVAL(ac_link) && test -s conftest; then
718 echo "configure: failed program was:" >&AC_FD_CC
719 cat conftest.$ac_ext >&AC_FD_CC
723 CXXFLAGS="$ac_cxxflags_safe"
724 LDFLAGS="$ac_ldflags_safe"
728 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
729 ac_cv_have_qt="have_qt=no"
731 if test "$ac_qt_includes" = NO; then
732 if test "$ac_qt_libraries" = NO; then
733 ac_qt_notfound="(headers and libraries)";
735 ac_qt_notfound="(headers)";
738 ac_qt_notfound="(libraries)";
741 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! ]);
747 eval "$ac_cv_have_qt"
749 if test "$have_qt" != yes; then
750 AC_MSG_RESULT([$have_qt]);
752 ac_cv_have_qt="have_qt=yes \
753 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
754 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
756 qt_libraries="$ac_qt_libraries"
757 qt_includes="$ac_qt_includes"
760 if test ! "$kde_qt_libs_given" = "yes"; then
761 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
764 AC_SUBST(qt_libraries)
765 AC_SUBST(qt_includes)
767 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
770 QT_INCLUDES="-I$qt_includes"
771 all_includes="$QT_INCLUDES $all_includes"
774 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
777 QT_LDFLAGS="-L$qt_libraries"
778 all_libraries="$QT_LDFLAGS $all_libraries"
781 AC_SUBST(QT_INCLUDES)
785 LIB_QT='-lqt $(LIBPNG) -lXext $(LIB_X11) $(X_PRE_LIBS)'
795 dnl ------------------------------------------------------------------------
796 dnl Now, the same with KDE
797 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
798 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
799 dnl ------------------------------------------------------------------------
801 AC_DEFUN(AC_BASE_PATH_KDE,
804 AC_REQUIRE([KDE_MISC_TESTS])
805 AC_REQUIRE([AC_PATH_QT])dnl
807 AC_MSG_CHECKING([for KDE])
809 if test "${prefix}" != NONE; then
810 kde_includes=${prefix}/include
811 ac_kde_includes=$prefix/include
813 if test "${exec_prefix}" != NONE; then
814 kde_libraries=${exec_prefix}/lib
815 ac_kde_libraries=$exec_prefix/lib
817 kde_libraries=${prefix}/lib
818 ac_kde_libraries=$prefix/lib
827 AC_CACHE_VAL(ac_cv_have_kde,
828 [#try to guess kde locations
830 if test -z "$1"; then
832 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"
833 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
834 kde_incdirs="$ac_kde_includes $kde_incdirs"
835 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
836 ac_kde_includes="$kde_incdir"
838 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
840 in the prefix, you've chosen, are no KDE headers installed. This will fail.
841 So, check this please and use another prefix!])
844 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"
845 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
846 kde_libdirs="$ac_kde_libraries $kde_libdirs"
847 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
848 ac_kde_libraries="$kde_libdir"
850 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
852 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
853 So, check this please and use another prefix!])
855 ac_kde_libraries="$kde_libdir"
857 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
858 ac_cv_have_kde="have_kde=no"
860 ac_cv_have_kde="have_kde=yes \
861 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
866 ac_cv_have_kde="have_kde=no"
871 eval "$ac_cv_have_kde"
873 if test "$have_kde" != "yes"; then
874 if test "${prefix}" = NONE; then
875 ac_kde_prefix="$ac_default_prefix"
877 ac_kde_prefix="$prefix"
879 if test "$exec_prefix" = NONE; then
880 ac_kde_exec_prefix="$ac_kde_prefix"
881 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
883 ac_kde_exec_prefix="$exec_prefix"
884 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
887 kde_libraries="${ac_kde_exec_prefix}/lib"
888 kde_includes=${ac_kde_prefix}/include
891 ac_cv_have_kde="have_kde=yes \
892 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
893 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
895 kde_libraries="$ac_kde_libraries"
896 kde_includes="$ac_kde_includes"
898 AC_SUBST(kde_libraries)
899 AC_SUBST(kde_includes)
901 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
904 KDE_INCLUDES="-I$kde_includes"
905 all_includes="$KDE_INCLUDES $all_includes"
908 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
911 KDE_LDFLAGS="-L$kde_libraries"
912 all_libraries="$KDE_LDFLAGS $all_libraries"
915 AC_SUBST(KDE_LDFLAGS)
916 AC_SUBST(KDE_INCLUDES)
918 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
920 AC_SUBST(all_includes)
921 AC_SUBST(all_libraries)
925 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
927 AC_MSG_CHECKING(for extra includes)
928 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
929 adds non standard include paths],
930 kde_use_extra_includes="$withval",
931 kde_use_extra_includes=NONE
934 if test -n "$kde_use_extra_includes" && \
935 test "$kde_use_extra_includes" != "NONE"; then
939 for dir in $kde_use_extra_includes; do
940 kde_extra_includes="$kde_extra_includes $dir"
941 all_includes="$all_includes -I$dir"
942 USER_INCLUDES="$USER_INCLUDES -I$dir"
945 kde_use_extra_includes="added"
947 kde_use_extra_includes="no"
949 AC_SUBST(USER_INCLUDES)
951 AC_MSG_RESULT($kde_use_extra_includes)
954 AC_MSG_CHECKING(for extra libs)
955 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
956 kde_use_extra_libs=$withval,
957 kde_use_extra_libs=NONE
959 if test -n "$kde_use_extra_libs" && \
960 test "$kde_use_extra_libs" != "NONE"; then
964 for dir in $kde_use_extra_libs; do
965 kde_extra_libs="$kde_extra_libs $dir"
966 all_libraries="$all_libraries -L$dir"
967 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir"
968 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
971 kde_use_extra_libs="added"
973 kde_use_extra_libs="no"
976 AC_SUBST(USER_LDFLAGS)
978 AC_MSG_RESULT($kde_use_extra_libs)
982 AC_DEFUN(KDE_CHECK_KIMGIO,
984 AC_REQUIRE([AC_BASE_PATH_KDE])
985 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
986 AC_REQUIRE([AC_FIND_TIFF])
987 AC_REQUIRE([AC_FIND_JPEG])
988 AC_REQUIRE([AC_FIND_PNG])
989 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
991 if test "$1" = "existance"; then
994 kde_save_LIBS="$LIBS"
995 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
996 AC_CHECK_LIB(kimgio, kimgioRegister, [
997 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
998 LIBS="$kde_save_LIBS"
1001 LIBKIMGIO_EXISTS=yes
1004 if test "$LIBKIMGIO_EXISTS" = "yes"; then
1005 LIB_KIMGIO='-lkimgio'
1009 AC_SUBST(LIB_KIMGIO)
1015 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1017 AC_REQUIRE([KDE_MISC_TESTS])
1018 AC_REQUIRE([KDE_CHECK_LIBDL])
1019 AC_REQUIRE([K_PATH_X])
1021 if test $kde_qtver = 2; then
1022 LIB_KDECORE='-lkdecore'
1023 AC_SUBST(LIB_KDECORE)
1026 LIB_KFORMULA='-lformula'
1027 AC_SUBST(LIB_KFORMULA)
1036 LIB_MEDIATOOL='-lmediatool'
1037 AC_SUBST(LIB_MEDIATOOL)
1039 LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1040 AC_SUBST(LIB_KDECORE)
1041 LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1043 LIB_KFM='-lkfm $(LIB_KDECORE)'
1045 LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1047 LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1049 LIB_MEDIATOOL='-lmediatool $(LIB_KDECORE)'
1050 AC_SUBST(LIB_MEDIATOOL)
1054 AC_DEFUN(AC_PATH_KDE,
1057 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1059 if test "$enableval" = "no";
1060 then ac_use_path_checking="default"
1061 else ac_use_path_checking=""
1063 ], [ac_use_path_checking="default"]
1066 AC_CREATE_KFSSTND($ac_use_path_checking)
1069 KDE_CREATE_LIBS_ALIASES
1072 dnl slightly changed version of AC_CHECK_FUNC(setenv)
1073 AC_DEFUN(AC_CHECK_SETENV,
1074 [AC_MSG_CHECKING([for setenv])
1075 AC_CACHE_VAL(ac_cv_func_setenv,
1078 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
1079 dnl which includes <sys/select.h> which contains a prototype for
1080 dnl select. Similarly for bzero.
1081 [#include <assert.h>
1082 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
1086 [/* We use char because int might match the return type of a gcc2
1087 builtin and then its argument prototype would still apply. */
1090 /* The GNU C library defines this for functions which it implements
1091 to always fail with ENOSYS. Some functions are actually named
1092 something starting with __ and the normal name is an alias. */
1093 #if defined (__stub_$1) || defined (__stub___$1)
1096 setenv("TEST", "alle", 1);
1098 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
1100 if test "$ac_cv_func_setenv" = "yes"; then
1102 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV, 1, [Define if you have setenv])
1108 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1111 save_CXXFLAGS="$CXXFLAGS"
1112 if test "$GCC" = "yes"; then
1113 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1115 AC_MSG_CHECKING(for getdomainname)
1116 AC_CACHE_VAL(ac_cv_func_getdomainname,
1124 getdomainname(buffer, 200);
1126 ac_cv_func_getdomainname=yes,
1127 ac_cv_func_getdomainname=no)
1129 AC_MSG_RESULT($ac_cv_func_getdomainname)
1130 if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1131 AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1133 CXXFLAGS="$save_CXXFLAGS"
1136 AC_DEFUN(AC_CHECK_GETHOSTNAME,
1139 save_CXXFLAGS="$CXXFLAGS"
1140 if test "$GCC" = "yes"; then
1141 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1144 AC_MSG_CHECKING([for gethostname])
1145 AC_CACHE_VAL(ac_cv_func_gethostname,
1153 gethostname(buffer, 200);
1155 ac_cv_func_gethostname=yes,
1156 ac_cv_func_gethostname=no)
1158 AC_MSG_RESULT($ac_cv_func_gethostname)
1159 if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1160 AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have getdomainname])
1162 CXXFLAGS="$save_CXXFLAGS"
1165 AC_DEFUN(AC_CHECK_USLEEP,
1169 AC_MSG_CHECKING([for usleep])
1170 AC_CACHE_VAL(ac_cv_func_usleep,
1172 ac_libs_safe="$LIBS"
1173 LIBS="$LIBS $LIBUCB"
1181 ac_cv_func_usleep=yes,
1182 ac_cv_func_usleep=no)
1184 AC_MSG_RESULT($ac_cv_func_usleep)
1185 if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1186 AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1188 LIBS="$ac_libs_safe"
1191 AC_DEFUN(AC_CHECK_RANDOM,
1195 AC_MSG_CHECKING([for random])
1196 AC_CACHE_VAL(ac_cv_func_random,
1198 ac_libs_safe="$LIBS"
1199 LIBS="$LIBS $LIBUCB"
1206 ac_cv_func_random=yes,
1207 ac_cv_func_random=no)
1209 AC_MSG_RESULT($ac_cv_func_random)
1210 if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1211 AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1213 LIBS="$ac_libs_safe"
1216 AC_DEFUN(AC_CHECK_FGETPWENT,
1219 save_CXXFLAGS="$CXXFLAGS"
1220 if test "$GCC" = "yes"; then
1221 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1223 AC_MSG_CHECKING(for fgetpwent)
1224 AC_CACHE_VAL(ac_cv_func_fgetpwent,
1236 ac_cv_func_fgetpwent=yes,
1237 ac_cv_func_fgetpwent=no)
1239 AC_MSG_RESULT($ac_cv_func_fgetpwent)
1240 if eval "test \"`echo $ac_cv_func_fgetpwent`\" = yes"; then
1241 AC_DEFINE(HAVE_FGETPWENT)
1243 CXXFLAGS="$save_CXXFLAGS"
1246 AC_DEFUN(AC_CHECK_FGETGRENT,
1249 save_CXXFLAGS="$CXXFLAGS"
1250 if test "$GCC" = "yes"; then
1251 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1253 AC_MSG_CHECKING(for fgetgrent)
1254 AC_CACHE_VAL(ac_cv_func_fgetgrent,
1266 ac_cv_func_fgetgrent=yes,
1267 ac_cv_func_fgetgrent=no)
1269 AC_MSG_RESULT($ac_cv_func_fgetgrent)
1270 if eval "test \"`echo $ac_cv_func_fgetgrent`\" = yes"; then
1271 AC_DEFINE(HAVE_FGETGRENT)
1273 CXXFLAGS="$save_CXXFLAGS"
1276 AC_DEFUN(AC_FIND_GIF,
1277 [AC_MSG_CHECKING([for giflib])
1278 AC_CACHE_VAL(ac_cv_lib_gif,
1279 [ac_save_LIBS="$LIBS"
1280 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1286 int GifLastError(void);
1290 /* We use char because int might match the return type of a gcc2
1291 builtin and then its argument prototype would still apply. */
1293 [return GifLastError();],
1294 eval "ac_cv_lib_gif=yes",
1295 eval "ac_cv_lib_gif=no")
1296 LIBS="$ac_save_LIBS"
1298 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1300 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
1302 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1307 AC_DEFUN(KDE_FIND_JPEG_HELPER,
1309 AC_MSG_CHECKING([for libjpeg$2])
1310 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1313 ac_save_LIBS="$LIBS"
1314 LIBS="$all_libraries -ljpeg$2 -lm"
1316 [/* Override any gcc2 internal prototype to avoid an error. */
1317 struct jpeg_decompress_struct;
1318 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1323 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1324 int version, size_t structsize);
1328 /* We use char because int might match the return type of a gcc2
1329 builtin and then its argument prototype would still apply. */
1331 [jpeg_CreateDecompress(0L, 0, 0);],
1332 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1333 eval "ac_cv_lib_jpeg_$1=no")
1334 LIBS="$ac_save_LIBS"
1337 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1338 LIBJPEG="$ac_cv_lib_jpeg_$1"
1339 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1347 AC_DEFUN(AC_FIND_JPEG,
1349 KDE_FIND_JPEG_HELPER(6b, 6b,
1350 KDE_FIND_JPEG_HELPER(normal, [],
1352 dnl what to do, if the normal way fails:
1353 if test -f "$kde_libraries/libjpeg.so"; then
1354 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1355 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1356 else if test -f "$kde_libraries/libjpeg.sl"; then
1357 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1358 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1359 else if test -f "$kde_libraries/libjpeg.a"; then
1360 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1361 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1364 You need the development package of libjpeg6b. You can get
1365 a source package of libjpeg from http://www.ijg.org/
1371 LIBJPEG=$ac_cv_lib_jpeg
1375 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
1379 AC_DEFUN(AC_FIND_ZLIB,
1381 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1382 AC_MSG_CHECKING([for libz])
1383 AC_CACHE_VAL(ac_cv_lib_z,
1386 kde_save_LIBS="$LIBS"
1387 LIBS="$all_libraries -lz $LIBSOCKET"
1388 kde_save_CFLAGS="$CFLAGS"
1389 CFLAGS="$CFLAGS $all_includes"
1394 [return (zlibVersion() == ZLIB_VERSION); ],
1395 eval "ac_cv_lib_z='-lz'",
1396 eval "ac_cv_lib_z=no")
1397 LIBS="$kde_save_LIBS"
1398 CFLAGS="$kde_save_CFLAGS"
1400 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1401 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
1404 AC_MSG_RESULT($ac_cv_lib_z)
1412 AC_DEFUN(KDE_TRY_TIFFLIB,
1414 AC_MSG_CHECKING([for libtiff $1])
1416 AC_CACHE_VAL(kde_cv_libtiff_$1,
1419 kde_save_LIBS="$LIBS"
1420 LIBS="$all_libraries -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
1421 kde_save_CFLAGS="$CFLAGS"
1422 CFLAGS="$CFLAGS $all_includes"
1428 [return (TIFFOpen( "", "r") == 0); ],
1430 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
1432 kde_cv_libtiff_$1=no
1435 LIBS="$kde_save_LIBS"
1436 CFLAGS="$kde_save_CFLAGS"
1440 if test "$kde_cv_libtiff_$1" = "no"; then
1445 LIBTIFF="$kde_cv_libtiff_$1"
1447 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
1453 AC_DEFUN(AC_FIND_TIFF,
1455 AC_REQUIRE([K_PATH_X])
1456 AC_REQUIRE([AC_FIND_ZLIB])
1457 AC_REQUIRE([AC_FIND_JPEG])
1458 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1460 KDE_TRY_TIFFLIB(tiff, [],
1461 KDE_TRY_TIFFLIB(tiff34))
1467 AC_DEFUN(AC_FIND_PNG,
1469 AC_REQUIRE([AC_FIND_ZLIB])
1470 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1471 AC_MSG_CHECKING([for libpng])
1472 AC_CACHE_VAL(ac_cv_lib_png,
1474 kde_save_LIBS="$LIBS"
1475 LIBS="$LIBS $all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1476 kde_save_CFLAGS="$CFLAGS"
1477 CFLAGS="$CFLAGS $all_includes"
1484 png_structp png_ptr = png_create_read_struct( /* image ptr */
1485 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1486 return( png_ptr != 0 );
1488 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1489 eval "ac_cv_lib_png=no"
1491 LIBS="$kde_save_LIBS"
1492 CFLAGS="$kde_save_CFLAGS"
1494 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1495 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
1496 LIBPNG="$ac_cv_lib_png"
1498 AC_MSG_RESULT($ac_cv_lib_png)
1506 AC_DEFUN(AC_CHECK_BOOL,
1508 AC_MSG_CHECKING([for bool])
1509 AC_CACHE_VAL(ac_cv_have_bool,
1513 [bool aBool = true;],
1514 [ac_cv_have_bool="yes"],
1515 [ac_cv_have_bool="no"])
1516 ]) dnl end AC_CHECK_VAL
1517 AC_MSG_RESULT($ac_cv_have_bool)
1518 if test "$ac_cv_have_bool" = "yes"; then
1519 AC_DEFINE(HAVE_BOOL, 1, [Define if the C++ compiler supports BOOL])
1523 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1525 AC_MSG_CHECKING(if you need GNU extensions)
1526 AC_CACHE_VAL(ac_cv_gnu_extensions,
1528 cat > conftest.c << EOF
1529 #include <features.h>
1531 #ifdef __GNU_LIBRARY__
1536 if (eval "$ac_cpp conftest.c") 2>&5 |
1537 egrep "yes" >/dev/null 2>&1; then
1539 ac_cv_gnu_extensions=yes
1541 ac_cv_gnu_extensions=no
1545 AC_MSG_RESULT($ac_cv_gnu_extensions)
1546 if test "$ac_cv_gnu_extensions" = "yes"; then
1547 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
1551 AC_DEFUN(AC_CHECK_COMPILERS,
1553 dnl this is somehow a fat lie, but prevents other macros from double checking
1554 AC_PROVIDE([AC_PROG_CC])
1555 AC_PROVIDE([AC_PROG_CPP])
1556 AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
1558 if test $enableval = "no"; dnl
1560 kde_use_debug_code="no"
1561 kde_use_debug_define=yes
1563 kde_use_debug_code="yes"
1564 kde_use_debug_define=no
1566 ], [kde_use_debug_code="no"
1567 kde_use_debug_define=no
1570 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
1572 if test $enableval = "no"; then
1573 kde_use_strict_options="no"
1575 kde_use_strict_options="yes"
1577 ], [kde_use_strict_options="no"])
1579 dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
1580 AC_MSG_CHECKING(for a C-Compiler)
1581 dnl if there is one, print out. if not, don't matter
1584 if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
1585 if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
1586 if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
1587 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
1592 if test $ac_cv_prog_gcc = yes; then
1598 if test -z "$CFLAGS"; then
1599 if test "$kde_use_debug_code" = "yes"; then
1601 if test $ac_cv_prog_cc_g = yes; then
1605 if test "$GCC" = "yes"; then
1610 if test "$kde_use_debug_define" = "yes"; then
1611 CFLAGS="$CFLAGS -DNDEBUG"
1615 if test "$GCC" = "yes"; then
1618 if test "$kde_use_strict_options" = "yes"; then
1619 CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
1626 *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
1629 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
1634 dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
1635 dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
1637 AC_MSG_CHECKING(how to run the C preprocessor)
1638 # On Suns, sometimes $CPP names a directory.
1639 if test -n "$CPP" && test -d "$CPP"; then
1642 if test -z "$CPP"; then
1643 AC_CACHE_VAL(ac_cv_prog_CPP,
1644 [ # This must be in double quotes, not single quotes, because CPP may get
1645 # substituted into the Makefile and "${CC-cc}" will confuse make.
1647 # On the NeXT, cc -E runs the code through the compiler's parser,
1648 # not just through cpp.
1649 dnl Use a header file that comes with gcc, so configuring glibc
1650 dnl with a fresh cross-compiler works.
1651 AC_TRY_CPP([#include <assert.h>
1653 CPP="${CC-cc} -E -traditional-cpp"
1654 AC_TRY_CPP([#include <assert.h>
1655 Syntax Error], , CPP=/lib/cpp))
1656 ac_cv_prog_CPP="$CPP"])dnl
1657 CPP="$ac_cv_prog_CPP"
1659 ac_cv_prog_CPP="$CPP"
1665 AC_MSG_CHECKING(for a C++-Compiler)
1666 dnl if there is one, print out. if not, don't matter
1669 if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
1670 if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
1671 if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
1672 if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
1673 test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
1678 if test $ac_cv_prog_gxx = yes; then
1681 AC_MSG_CHECKING(whether we are using SPARC CC)
1683 cat > conftest.C << EOF
1689 ac_try="$CXX -E conftest.C"
1690 if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then
1695 AC_MSG_RESULT($ac_cv_prog_CC)
1696 if test "$ac_cv_prog_CC" = "yes"; then
1697 AC_MSG_ERROR([Sparc CC doesn't work on KDE sources at least til version
1698 4.2. This compiler has several problems accepting legal C++ code
1699 including the builtin C++ type bool. Since KDE is a freeware project,
1700 we decided, that we don't want to support that broken compilers.
1702 If you really want to see support for Sparc CC within KDE, make reasonable
1703 patches and join the KDE project. More information about KDE can be found
1708 if test -z "$CXXFLAGS"; then
1709 if test "$kde_use_debug_code" = "yes"; then
1711 if test $ac_cv_prog_cxx_g = yes; then
1714 if test "$ac_cv_prog_CC" = "yes"; then
1715 CXXFLAGS="$CXXFLAGS -pto"
1718 if test "$GXX" = "yes"; then
1721 if test "$ac_cv_prog_CC" = "yes"; then
1727 if test "$kde_use_debug_define" = "yes"; then
1728 CXXFLAGS="$CXXFLAGS -DNDEBUG"
1732 if test "$GXX" = "yes"; then
1733 CXXFLAGS="$CXXFLAGS"
1735 if test "$kde_use_debug_code" = "yes"; then
1736 CXXFLAGS="$CXXFLAGS -Wall -Wno-long-long -Wpointer-arith -Wmissing-prototypes"
1739 if test "$kde_use_strict_options" = "yes"; then
1740 CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align -Woverloaded-virtual"
1743 if test "$kde_very_strict" = "yes"; then
1744 CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
1750 *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
1753 AC_PROVIDE(AC_PROG_CXXCPP)
1755 AC_MSG_CHECKING(how to run the C++ preprocessor)
1756 if test -z "$CXXCPP"; then
1757 AC_CACHE_VAL(ac_cv_prog_CXXCPP,
1760 AC_LANG_CPLUSPLUS[]dnl
1761 CXXCPP="${CXX-g++} -E"
1762 AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
1763 ac_cv_prog_CXXCPP="$CXXCPP"
1764 AC_LANG_RESTORE[]dnl
1766 CXXCPP="$ac_cv_prog_CXXCPP"
1768 AC_MSG_RESULT($CXXCPP)
1772 dnl just a wrapper to clean up configure.in
1773 AC_DEFUN(KDE_PROG_LIBTOOL,
1775 AC_REQUIRE([AC_CHECK_COMPILERS])
1776 AC_REQUIRE([AC_ENABLE_SHARED])
1777 AC_REQUIRE([AC_ENABLE_STATIC])
1778 dnl libtool is only for C, so I must force him
1779 dnl to find the correct flags for C++
1781 kde_save_cflags="$CFLAGS"
1786 AM_PROG_LIBTOOL dnl for libraries
1787 AC_REQUIRE([AC_PROG_LIBTOOL]) dnl faking :=/
1788 LIBTOOL="$LIBTOOL --silent"
1789 dnl AC_SUBST(LIBTOOL)
1792 CFLAGS="$kde_save_cflags"
1795 AC_DEFUN(KDE_DO_IT_ALL,
1799 AM_INIT_AUTOMAKE($1, $2)
1800 AM_DISABLE_LIBRARIES
1801 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1808 AC_DEFUN(AC_CHECK_RPATH,
1810 AC_MSG_CHECKING(for rpath)
1811 AC_ARG_ENABLE(rpath,
1812 [ --disable-rpath do not use the rpath feature of ld],
1813 USE_RPATH=$enableval, USE_RPATH=yes)
1815 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1817 KDE_RPATH="-rpath \$(kde_libraries)"
1819 if test -n "$qt_libraries"; then
1820 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1822 dnl $x_libraries is set to /usr/lib in case
1823 if test -n "$X_LDFLAGS"; then
1824 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1826 if test -n "$KDE_EXTRA_RPATH"; then
1827 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1830 AC_SUBST(KDE_EXTRA_RPATH)
1832 AC_MSG_RESULT($USE_RPATH)
1835 dnl Check for the type of the third argument of getsockname
1836 AC_DEFUN(AC_CHECK_KSIZE_T,
1837 [AC_MSG_CHECKING(for the third argument of getsockname)
1838 AC_CACHE_VAL(ac_cv_ksize_t,
1842 #include <sys/types.h>
1843 #include <sys/socket.h>
1846 getsockname(0,(struct sockaddr*)0, &a);
1848 ac_cv_ksize_t=socklen_t,
1850 if test -z "$ac_cv_ksize_t"; then
1851 ac_safe_cxxflags="$CXXFLAGS"
1852 if test "$GCC" = "yes"; then
1853 CXXFLAGS="-Werror $CXXFLAGS"
1856 #include <sys/types.h>
1857 #include <sys/socket.h>
1860 getsockname(0,(struct sockaddr*)0, &a);
1863 ac_cv_ksize_t=size_t)
1864 CXXFLAGS="$ac_safe_cxxflags"
1869 if test -z "$ac_cv_ksize_t"; then
1873 AC_MSG_RESULT($ac_cv_ksize_t)
1874 AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t,
1875 [Define the type of the third argument for getsockname]
1880 dnl This is a merge of some macros out of the gettext aclocal.m4
1881 dnl since we don't need anything, I took the things we need
1882 dnl the copyright for them is:
1884 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
1885 dnl This Makefile.in is free software; the Free Software Foundation
1886 dnl gives unlimited permission to copy and/or distribute it,
1887 dnl with or without modifications, as long as this notice is preserved.
1889 dnl This program is distributed in the hope that it will be useful,
1890 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1891 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1892 dnl PARTICULAR PURPOSE.
1894 dnl for this file it is relicensed under LGPL
1896 AC_DEFUN(AM_KDE_WITH_NLS,
1897 [AC_MSG_CHECKING([whether NLS is requested])
1898 dnl Default is enabled NLS
1900 [ --disable-nls do not use Native Language Support],
1901 USE_NLS=$enableval, USE_NLS=yes)
1902 AC_MSG_RESULT($USE_NLS)
1905 dnl If we use NLS figure out what method
1906 if test "$USE_NLS" = "yes"; then
1907 AC_DEFINE(ENABLE_NLS, 1, [Define if NLS is requested])
1909 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
1910 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
1911 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1913 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
1914 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
1921 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
1922 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1924 dnl Test whether we really found GNU xgettext.
1925 if test "$XGETTEXT" != ":"; then
1926 dnl If it is no GNU xgettext we define it as : so that the
1927 dnl Makefiles still can work.
1928 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1932 [found xgettext programs is not GNU xgettext; ignore it])
1941 # Search path for a program which passes the given test.
1942 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1945 # Stephan Kulow: I appended a _KDE against name conflicts
1947 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1948 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1949 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1950 [# Extract the first word of "$2", so it can be a program name with args.
1951 set dummy $2; ac_word=[$]2
1952 AC_MSG_CHECKING([for $ac_word])
1953 AC_CACHE_VAL(ac_cv_path_$1,
1956 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1959 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1960 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1961 test -z "$ac_dir" && ac_dir=.
1962 if test -f $ac_dir/$ac_word; then
1964 ac_cv_path_$1="$ac_dir/$ac_word"
1970 dnl If no 4th arg is given, leave the cache variable unset,
1971 dnl so AC_PATH_PROGS will keep looking.
1972 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1977 if test -n "[$]$1"; then
1978 AC_MSG_RESULT([$]$1)
1986 # Check whether LC_MESSAGES is available in <locale.h>.
1987 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1991 AC_DEFUN(AM_LC_MESSAGES,
1992 [if test $ac_cv_header_locale_h = yes; then
1993 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1994 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1995 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1996 if test $am_cv_val_LC_MESSAGES = yes; then
1997 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2001 dnl From Jim Meyering.
2002 dnl FIXME: migrate into libit.
2004 AC_DEFUN(AM_FUNC_OBSTACK,
2005 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
2006 [AC_TRY_LINK([#include "obstack.h"],
2007 [struct obstack *mem;obstack_free(mem,(char *) 0)],
2008 am_cv_func_obstack=yes,
2009 am_cv_func_obstack=no)])
2010 if test $am_cv_func_obstack = yes; then
2011 AC_DEFINE(HAVE_OBSTACK)
2013 LIBOBJS="$LIBOBJS obstack.o"
2017 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
2018 dnl FIXME: Migrate into libit
2020 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
2021 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
2022 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
2023 am_cv_lib_error_at_line=yes,
2024 am_cv_lib_error_at_line=no)])
2025 if test $am_cv_lib_error_at_line = no; then
2026 LIBOBJS="$LIBOBJS error.o"
2028 AC_SUBST(LIBOBJS)dnl
2031 # Macro to add for using GNU gettext.
2032 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2035 # Stephan Kulow: I put a KDE in it to avoid name conflicts
2037 AC_DEFUN(AM_KDE_GNU_GETTEXT,
2038 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2039 AC_REQUIRE([AC_PROG_RANLIB])dnl
2040 AC_REQUIRE([AC_HEADER_STDC])dnl
2041 AC_REQUIRE([AC_C_INLINE])dnl
2042 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2043 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2044 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2045 AC_REQUIRE([AC_FUNC_MMAP])dnl
2046 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2047 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
2048 unistd.h values.h alloca.h])
2049 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2050 __argz_count __argz_stringify __argz_next])
2052 AC_MSG_CHECKING(for stpcpy)
2053 AC_CACHE_VAL(kde_cv_func_stpcpy,
2055 kde_safe_cxxflags=$CXXFLAGS
2056 CXXFLAGS="-Wmissing-prototypes -Werror"
2064 stpcpy(buffer, buffer);
2066 kde_cv_func_stpcpy=yes,
2067 kde_cv_func_stpcpy=no)
2069 CXXFLAGS=$kde_safe_cxxflags
2071 AC_MSG_RESULT($kde_cv_func_stpcpy)
2072 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
2073 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
2078 if test "x$CATOBJEXT" != "x"; then
2079 if test "x$ALL_LINGUAS" = "x"; then
2082 AC_MSG_CHECKING(for catalogs to be installed)
2084 for lang in ${LINGUAS=$ALL_LINGUAS}; do
2085 case "$ALL_LINGUAS" in
2086 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2089 LINGUAS=$NEW_LINGUAS
2090 AC_MSG_RESULT($LINGUAS)
2093 dnl Construct list of names of catalog files to be constructed.
2094 if test -n "$LINGUAS"; then
2095 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2101 AC_DEFUN(AC_HAVE_XPM,
2102 [AC_REQUIRE_CPP()dnl
2103 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2105 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
2106 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
2108 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
2109 xpm_test=$withval, xpm_test="yes")
2110 if test "x$xpm_test" = xno; then
2113 AC_MSG_CHECKING(for XPM)
2114 AC_CACHE_VAL(ac_cv_have_xpm,
2117 ac_save_ldflags="$LDFLAGS"
2118 ac_save_cflags="$CFLAGS"
2119 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
2120 CFLAGS="$CFLAGS $X_INCLUDES"
2121 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
2122 AC_TRY_LINK([#include <X11/xpm.h>],[],
2123 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
2124 LDFLAGS="$ac_save_ldflags"
2125 CFLAGS="$ac_save_cflags"
2128 if test "$ac_cv_have_xpm" = no; then
2134 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
2135 if test "$XPM_LDFLAGS" = ""; then
2136 XPMLIB='-lXpm $(LIB_X11)'
2138 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
2140 if test "$XPM_INCLUDE" = ""; then
2143 XPMINC="-I$XPM_INCLUDE"
2153 AC_DEFUN(KDE_CHECK_LIBDL,
2155 AC_CHECK_LIB(dl, dlopen, [
2157 ac_cv_have_dlfcn=yes
2160 AC_CHECK_LIB(dld, shl_unload, [
2162 ac_cv_have_shload=yes
2168 AC_DEFUN(KDE_CHECK_DLOPEN,
2171 AC_CHECK_HEADERS(dlfcn.h dl.h)
2172 if test "$ac_cv_header_dlfcn_h" = "no"; then
2176 if test "$ac_cv_header_dl_h" = "no"; then
2177 ac_cv_have_shload=no
2181 AC_ARG_ENABLE(dlopen,
2182 [ --disable-dlopen link staticly [default=no]] ,
2183 [if test "$enableval" = yes; then
2188 # override the user's opinion, if we know it better ;)
2189 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
2193 if test "$ac_cv_have_dlfcn" = "yes"; then
2194 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
2197 if test "$ac_cv_have_shload" = "yes"; then
2198 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
2201 if test "$enable_dlopen" = no ; then
2202 test -n "$1" && eval $1
2204 test -n "$2" && eval $2
2209 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
2211 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
2213 AC_MSG_CHECKING([dynamic loading])
2214 eval "`egrep '^build_libtool_libs=' libtool`"
2215 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
2217 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
2221 AC_MSG_RESULT($dynamic_loading)
2222 if test "$dynamic_loading" = "yes"; then
2229 AC_DEFUN(KDE_ADD_INCLUDES,
2231 if test -z "$1"; then
2232 test_include="Pix.h"
2237 AC_MSG_CHECKING([for libg++ ($test_include)])
2239 AC_CACHE_VAL(kde_cv_libgpp_includes,
2241 kde_cv_libgpp_includes=no
2247 /usr/unsupported/include \
2252 if test -r "$ac_dir/$test_include"; then
2253 kde_cv_libgpp_includes=$ac_dir
2259 AC_MSG_RESULT($kde_cv_libgpp_includes)
2260 if test "$kde_cv_libgpp_includes" != "no"; then
2261 all_includes="-I$kde_cv_libgpp_includes $all_includes"
2271 AC_DEFUN(AC_FIND_QIMGIO,
2272 [AC_REQUIRE([AC_FIND_JPEG])
2273 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2274 AC_MSG_CHECKING([for qimgio])
2275 AC_CACHE_VAL(ac_cv_lib_qimgio,
2279 ac_save_LIBS="$LIBS"
2280 ac_save_CXXFLAGS="$CXXFLAGS"
2281 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
2282 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
2285 #include <qimageio.h>
2286 #include <qstring.h>
2288 QString t = "hallo";
2293 eval "ac_cv_lib_qimgio=yes",
2294 eval "ac_cv_lib_qimgio=no")
2295 LIBS="$ac_save_LIBS"
2296 CXXFLAGS="$ac_save_CXXFLAGS"
2299 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
2300 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
2302 AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
2305 AC_MSG_RESULT(not found)
2309 AC_DEFUN(AM_DISABLE_LIBRARIES,
2311 AC_PROVIDE([AM_ENABLE_STATIC])
2312 AC_PROVIDE([AM_ENABLE_SHARED])
2319 AC_DEFUN(KDE_CHECK_NAMESPACES,
2321 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
2335 int Foo::Bar::i = 1;
2338 AC_DEFINE(HAVE_NAMESPACES)
2345 AC_DEFUN(KDE_CHECK_NEWLIBS,
2350 dnl ------------------------------------------------------------------------
2351 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
2352 dnl ------------------------------------------------------------------------
2354 AC_DEFUN(AC_CHECK_S_ISSOCK,
2356 AC_MSG_CHECKING(for S_ISSOCK)
2357 AC_CACHE_VAL(ac_cv_have_s_issock,
2363 #include <sys/stat.h>
2367 int b = S_ISSOCK( buff.st_mode );
2369 ac_cv_have_s_issock=yes,
2370 ac_cv_have_s_issock=no)
2373 AC_MSG_RESULT($ac_cv_have_s_issock)
2374 if test "$ac_cv_have_s_issock" = "yes"; then
2375 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
2379 dnl ------------------------------------------------------------------------
2380 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
2381 dnl ------------------------------------------------------------------------
2383 AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
2385 AC_MSG_CHECKING(for MAXPATHLEN)
2386 AC_CACHE_VAL(ac_cv_maxpathlen,
2389 cat > conftest.$ac_ext <<EOF
2391 #include <sys/param.h>
2393 #define MAXPATHLEN 1024
2396 KDE_HELLO MAXPATHLEN
2400 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
2402 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
2403 ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
2405 ac_cv_maxpathlen=1024
2411 AC_MSG_RESULT($ac_cv_maxpathlen)
2412 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXLENPATH] )
2415 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
2416 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
2417 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2419 ## This program is free software; you can redistribute it and/or modify
2420 ## it under the terms of the GNU General Public License as published by
2421 ## the Free Software Foundation; either version 2 of the License, or
2422 ## (at your option) any later version.
2424 ## This program is distributed in the hope that it will be useful, but
2425 ## WITHOUT ANY WARRANTY; without even the implied warranty of
2426 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2427 ## General Public License for more details.
2429 ## You should have received a copy of the GNU General Public License
2430 ## along with this program; if not, write to the Free Software
2431 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2433 ## As a special exception to the GNU General Public License, if you
2434 ## distribute this file as part of a program that contains a
2435 ## configuration script generated by Autoconf, you may include it under
2436 ## the same distribution terms that you use for the rest of that program.
2438 # serial 40 AC_PROG_LIBTOOL
2439 AC_DEFUN(AC_PROG_LIBTOOL,
2440 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
2442 # Save cache, so that ltconfig can load it
2445 # Actually configure libtool. ac_aux_dir is where install-sh is found.
2446 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2447 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
2448 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
2449 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
2450 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
2451 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2452 || AC_MSG_ERROR([libtool configure failed])
2454 # Reload cache, that may have been modified by ltconfig
2457 # This can be used to rebuild libtool when needed
2458 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
2460 # Use our own libtool, if env variable LIBTOOL isn't defined
2461 AC_MSG_CHECKING(for libtool)
2462 ac_save_LIBTOOL=${LIBTOOL:=no.LIBTOOL}
2463 if test -f $ac_save_LIBTOOL; then
2464 LIBTOOL="$ac_save_LIBTOOL $1"
2466 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2468 AC_SUBST(LIBTOOL)dnl
2469 AC_MSG_RESULT($LIBTOOL)
2471 # Redirect the config.log output again, so that the ltconfig log is not
2472 # clobbered by the next message.
2473 exec 5>>./config.log
2476 AC_DEFUN(AC_LIBTOOL_SETUP,
2478 AC_REQUIRE([AC_ENABLE_SHARED])dnl
2479 AC_REQUIRE([AC_ENABLE_STATIC])dnl
2480 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
2481 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2482 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2483 AC_REQUIRE([AC_PROG_RANLIB])dnl
2484 AC_REQUIRE([AC_PROG_CC])dnl
2485 AC_REQUIRE([AC_PROG_LD])dnl
2486 AC_REQUIRE([AC_PROG_NM])dnl
2487 AC_REQUIRE([AC_PROG_LN_S])dnl
2490 # Check for any special flags to pass to ltconfig.
2491 libtool_flags="--cache-file=$cache_file"
2492 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2493 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2494 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2495 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2496 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2497 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
2498 [libtool_flags="$libtool_flags --enable-dlopen"])
2499 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
2500 [libtool_flags="$libtool_flags --enable-win32-dll"])
2501 AC_ARG_ENABLE(libtool-lock,
2502 [ --disable-libtool-lock avoid locking (might break parallel builds)])
2503 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2504 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2506 # Some flags need to be propagated to the compiler or linker for good
2510 # Find out which ABI we are using.
2511 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
2512 if AC_TRY_EVAL(ac_compile); then
2513 case "`/usr/bin/file conftest.o`" in
2529 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2530 SAVE_CFLAGS="$CFLAGS"
2531 CFLAGS="$CFLAGS -belf"
2532 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2533 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
2534 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2535 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2536 CFLAGS="$SAVE_CFLAGS"
2540 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
2541 [*-*-cygwin* | *-*-mingw*)
2542 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
2543 AC_CHECK_TOOL(AS, as, false)
2544 AC_CHECK_TOOL(OBJDUMP, objdump, false)
2550 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
2551 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
2553 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
2554 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
2556 # AC_ENABLE_SHARED - implement the --enable-shared flag
2557 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
2558 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
2560 AC_DEFUN(AC_ENABLE_SHARED, [dnl
2561 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2562 AC_ARG_ENABLE(shared,
2563 changequote(<<, >>)dnl
2564 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
2565 changequote([, ])dnl
2566 [p=${PACKAGE-default}
2567 case "$enableval" in
2568 yes) enable_shared=yes ;;
2569 no) enable_shared=no ;;
2572 # Look at the argument we got. We use all the common list separators.
2573 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2574 for pkg in $enableval; do
2575 if test "X$pkg" = "X$p"; then
2582 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
2585 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
2586 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2587 AC_ENABLE_SHARED(no)])
2589 # AC_ENABLE_STATIC - implement the --enable-static flag
2590 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
2591 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
2593 AC_DEFUN(AC_ENABLE_STATIC, [dnl
2594 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2595 AC_ARG_ENABLE(static,
2596 changequote(<<, >>)dnl
2597 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
2598 changequote([, ])dnl
2599 [p=${PACKAGE-default}
2600 case "$enableval" in
2601 yes) enable_static=yes ;;
2602 no) enable_static=no ;;
2605 # Look at the argument we got. We use all the common list separators.
2606 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2607 for pkg in $enableval; do
2608 if test "X$pkg" = "X$p"; then
2615 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
2618 # AC_DISABLE_STATIC - set the default static flag to --disable-static
2619 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2620 AC_ENABLE_STATIC(no)])
2623 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
2624 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
2625 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
2627 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
2628 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2629 AC_ARG_ENABLE(fast-install,
2630 changequote(<<, >>)dnl
2631 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
2632 changequote([, ])dnl
2633 [p=${PACKAGE-default}
2634 case "$enableval" in
2635 yes) enable_fast_install=yes ;;
2636 no) enable_fast_install=no ;;
2638 enable_fast_install=no
2639 # Look at the argument we got. We use all the common list separators.
2640 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2641 for pkg in $enableval; do
2642 if test "X$pkg" = "X$p"; then
2643 enable_fast_install=yes
2649 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
2652 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
2653 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2654 AC_ENABLE_FAST_INSTALL(no)])
2656 # AC_PROG_LD - find the path to the GNU or non-GNU linker
2657 AC_DEFUN(AC_PROG_LD,
2658 [AC_ARG_WITH(gnu-ld,
2659 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2660 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2661 AC_REQUIRE([AC_PROG_CC])dnl
2662 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2663 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2665 if test "$ac_cv_prog_gcc" = yes; then
2666 # Check if gcc -print-prog-name=ld gives a path.
2667 AC_MSG_CHECKING([for ld used by GCC])
2668 ac_prog=`($CC -print-prog-name=ld) 2>&5`
2670 # Accept absolute paths.
2672 [\\/]* | [A-Za-z]:[\\/]*)
2673 re_direlt='/[^/][^/]*/\.\./'
2675 # Canonicalize the path of ld
2676 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2677 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2678 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2680 test -z "$LD" && LD="$ac_prog"
2683 # If it fails, then pretend we aren't using GCC.
2687 # If it is relative, then search for the first ld in PATH.
2691 elif test "$with_gnu_ld" = yes; then
2692 AC_MSG_CHECKING([for GNU ld])
2694 AC_MSG_CHECKING([for non-GNU ld])
2696 AC_CACHE_VAL(ac_cv_path_LD,
2697 [if test -z "$LD"; then
2698 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2699 for ac_dir in $PATH; do
2700 test -z "$ac_dir" && ac_dir=.
2701 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2702 ac_cv_path_LD="$ac_dir/$ac_prog"
2703 # Check to see if the program is GNU ld. I'd rather use --version,
2704 # but apparently some GNU ld's only accept -v.
2705 # Break only if it was the GNU/non-GNU ld that we prefer.
2706 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2707 test "$with_gnu_ld" != no && break
2709 test "$with_gnu_ld" != yes && break
2715 ac_cv_path_LD="$LD" # Let the user override the test with a path.
2718 if test -n "$LD"; then
2723 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2728 AC_DEFUN(AC_PROG_LD_GNU,
2729 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
2730 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2731 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2732 ac_cv_prog_gnu_ld=yes
2734 ac_cv_prog_gnu_ld=no
2738 # AC_PROG_NM - find the path to a BSD-compatible name lister
2739 AC_DEFUN(AC_PROG_NM,
2740 [AC_MSG_CHECKING([for BSD-compatible nm])
2741 AC_CACHE_VAL(ac_cv_path_NM,
2742 [if test -n "$NM"; then
2743 # Let the user override the test.
2746 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2747 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2748 test -z "$ac_dir" && ac_dir=.
2749 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2750 # Check to see if the nm accepts a BSD-compat flag.
2751 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2752 # nm: unknown option "B" ignored
2753 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2754 ac_cv_path_NM="$ac_dir/nm -B"
2756 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2757 ac_cv_path_NM="$ac_dir/nm -p"
2760 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2761 continue # so that we can try to find one that supports BSD flags
2766 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2769 AC_MSG_RESULT([$NM])
2773 # AC_CHECK_LIBM - check for math library
2774 AC_DEFUN(AC_CHECK_LIBM,
2775 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2778 *-*-beos* | *-*-cygwin*)
2779 # These system don't have libm
2782 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2783 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
2786 AC_CHECK_LIB(m, main, LIBM="-lm")
2791 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
2792 # the libltdl convenience library, adds --enable-ltdl-convenience to
2793 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
2794 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
2795 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
2796 # '${top_builddir}/' (note the single quotes!) if your package is not
2797 # flat, and, if you're not using automake, define top_builddir as
2798 # appropriate in the Makefiles.
2799 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2800 case "$enable_ltdl_convenience" in
2801 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2802 "") enable_ltdl_convenience=yes
2803 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2805 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
2806 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
2809 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
2810 # the libltdl installable library, and adds --enable-ltdl-install to
2811 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
2812 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
2813 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
2814 # '${top_builddir}/' (note the single quotes!) if your package is not
2815 # flat, and, if you're not using automake, define top_builddir as
2816 # appropriate in the Makefiles.
2817 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2818 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2819 AC_CHECK_LIB(ltdl, main,
2820 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2821 [if test x"$enable_ltdl_install" = xno; then
2822 AC_MSG_WARN([libltdl not installed, but installation disabled])
2824 enable_ltdl_install=yes
2827 if test x"$enable_ltdl_install" = x"yes"; then
2828 ac_configure_args="$ac_configure_args --enable-ltdl-install"
2829 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
2830 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
2832 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2839 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
2840 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
2841 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
2842 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
2843 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
2844 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
2845 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
2847 dnl This is just to silence aclocal about the macro not being used
2848 ifelse([AC_DISABLE_FAST_INSTALL])dnl