1 ## -*- shell-script -*-
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 \
118 /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE])
120 if test -z "$MOC"; then
121 if test -n "$ac_cv_path_moc"; then
122 output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"`
124 echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC
125 echo "configure:__oline__: moc output: $output" >&AC_FD_CC
127 if test -z "$output"; then
128 KDE_MOC_ERROR_MESSAGE
135 AC_DEFUN(KDE_CHECK_PATH_HEADERS,
137 AC_MSG_CHECKING([for KDE headers installed])
139 cat > conftest.$ac_ext <<EOF
141 #include "confdefs.h"
145 printf("kde_qt_used_ver=\"" QT_VERSION_STR "\"\n");
146 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
147 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
148 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
149 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
150 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
151 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
152 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
153 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
154 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
155 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
156 printf("kde_wallpaperdir=\\"%s\\"\n",
157 KApplication::kde_wallpaperdir().data());
158 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
159 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
164 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
165 if AC_TRY_EVAL(ac_compile); then
168 AC_MSG_ERROR([your system is not able to compile a small KDE application!
169 Check, if you installed the KDE header files correctly.])
173 AC_DEFUN(AC_CREATE_KFSSTND,
175 AC_REQUIRE([AC_CHECK_RPATH])
176 AC_REQUIRE([AC_CHECK_BOOL])
177 AC_REQUIRE([KDE_CHECK_LIBDL])
179 AC_MSG_CHECKING([for KDE paths])
182 AC_CACHE_VAL(kde_cv_all_paths,
184 if test "$1" = "default"; then
186 if test -z "$kde_htmldir"; then
187 kde_htmldir='\$(prefix)/share/doc/HTML'
189 if test -z "$kde_appsdir"; then
190 kde_appsdir='\$(prefix)/share/applnk'
192 if test -z "$kde_icondir"; then
193 kde_icondir='\$(prefix)/share/icons'
195 if test -z "$kde_sounddir"; then
196 kde_sounddir='\$(prefix)/share/sounds'
198 if test -z "$kde_datadir"; then
199 kde_datadir='\$(prefix)/share/apps'
201 if test -z "$kde_locale"; then
202 kde_locale='\$(prefix)/share/locale'
204 if test -z "$kde_cgidir"; then
205 kde_cgidir='\$(exec_prefix)/cgi-bin'
207 if test -z "$kde_confdir"; then
208 kde_confdir='\$(prefix)/share/config'
210 if test -z "$kde_mimedir"; then
211 kde_mimedir='\$(prefix)/share/mimelnk'
213 if test -z "$kde_toolbardir"; then
214 kde_toolbardir='\$(prefix)/share/toolbar'
216 if test -z "$kde_wallpaperdir"; then
217 kde_wallpaperdir='\$(prefix)/share/wallpapers'
219 if test -z "$kde_bindir"; then
220 kde_bindir='\$(exec_prefix)/bin'
222 if test -z "$kde_partsdir"; then
223 kde_partsdir='\$(exec_prefix)/parts'
226 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
227 kde_htmldir=\"$kde_htmldir\" \
228 kde_appsdir=\"$kde_appsdir\" \
229 kde_icondir=\"$kde_icondir\" \
230 kde_sounddir=\"$kde_sounddir\" \
231 kde_datadir=\"$kde_datadir\" \
232 kde_locale=\"$kde_locale\" \
233 kde_cgidir=\"$kde_cgidir\" \
234 kde_confdir=\"$kde_confdir\" \
235 kde_mimedir=\"$kde_mimedir\" \
236 kde_toolbardir=\"$kde_toolbardir\" \
237 kde_wallpaperdir=\"$kde_wallpaperdir\" \
238 kde_bindir=\"$kde_bindir\" \
239 kde_partsdir=\"$kde_partsdir\" \
244 AC_MSG_RESULT([compiling])
246 KDE_CHECK_PATH_HEADERS
250 if test -n "$USE_RPATH"; then
252 if test -n "$kde_libraries"; then
253 KDE_TEST_RPATH="-rpath $kde_libraries"
256 if test -n "$qt_libraries"; then
257 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
260 if test -n "$x_libraries"; then
261 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
264 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
267 AC_MSG_CHECKING([for KDE libraries installed])
268 ac_link='/bin/sh ./libtool --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBDL $LIBQT $KDE_TEST_RPATH 1>&5'
270 if AC_TRY_EVAL(ac_link) && test -s conftest; then
273 AC_MSG_ERROR([your system fails at linking a small KDE application!
274 Check, if your compiler is installed correctly and if you have used the
275 same compiler to compile Qt and kdelibs as you did use now])
278 if eval `KDEDIR= ./conftest 2>&5`; then
284 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
285 echo "found Qt $kde_qt_used_ver" >&5 # also log Qt version
286 kde_have_all_paths=yes
289 if test "$kde_have_all_paths" = "yes"; then
290 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
291 kde_htmldir=\"$kde_htmldir\" \
292 kde_appsdir=\"$kde_appsdir\" \
293 kde_icondir=\"$kde_icondir\" \
294 kde_sounddir=\"$kde_sounddir\" \
295 kde_datadir=\"$kde_datadir\" \
296 kde_locale=\"$kde_locale\" \
297 kde_cgidir=\"$kde_cgidir\" \
298 kde_confdir=\"$kde_confdir\" \
299 kde_mimedir=\"$kde_mimedir\" \
300 kde_toolbardir=\"$kde_toolbardir\" \
301 kde_wallpaperdir=\"$kde_wallpaperdir\" \
302 kde_bindir=\"$kde_bindir\" \
303 kde_partsdir=\"$kde_partsdir\" \
304 kde_result=$kde_result"
310 eval "$kde_cv_all_paths"
312 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
313 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
314 test -z "$kde_datadir" || test -z "$kde_locale" ||
315 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
316 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
317 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
318 test -z "$kde_partsdir" || test "$kde_have_all_paths" != "yes"; then
319 kde_have_all_paths=no
320 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
321 Since it had compiled and linked before, it must be a strange problem on your system.
322 Look at config.log for details. If you are not able to fix this, look at
323 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
324 (If you're using an egcs version on Linux, you may update binutils!)
328 AC_MSG_RESULT($kde_result)
335 AC_DEFUN(AC_SUBST_KFSSTND,
337 AC_SUBST(kde_htmldir)
338 AC_SUBST(kde_appsdir)
339 AC_SUBST(kde_icondir)
340 AC_SUBST(kde_sounddir)
341 kde_minidir="$kde_icondir/mini"
342 AC_SUBST(kde_minidir)
343 AC_SUBST(kde_datadir)
346 AC_SUBST(kde_confdir)
347 AC_SUBST(kde_mimedir)
348 AC_SUBST(kde_toolbardir)
349 AC_SUBST(kde_wallpaperdir)
351 AC_SUBST(kde_partsdir)
354 AC_DEFUN(KDE_MISC_TESTS,
357 dnl Checks for libraries.
358 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
360 AC_CHECK_LIB(crypt, main, [LIBCRYPT="-lcrypt"]) dnl for BSD
364 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
365 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
366 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
367 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
369 AC_CHECK_FUNC(inet_ntoa)
370 if test $ac_cv_func_inet_ntoa = no; then
371 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
373 AC_CHECK_FUNC(connect)
374 if test $ac_cv_func_connect = no; then
375 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
379 AC_CHECK_FUNC(remove)
380 if test $ac_cv_func_remove = no; then
381 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
384 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
386 if test $ac_cv_func_shmat = no; then
387 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
390 LIBSOCKET="$X_EXTRA_LIBS"
392 AC_SUBST(X_EXTRA_LIBS)
393 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
396 case $host in dnl this *is* LynxOS specific
398 AC_MSG_CHECKING([LynxOS header file wrappers])
399 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
400 AC_MSG_RESULT(disabled)
401 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
405 AC_REQUIRE([KDE_CHECK_LIBDL])
408 dnl ------------------------------------------------------------------------
409 dnl Find the header files and libraries for X-Windows. Extended the
411 dnl ------------------------------------------------------------------------
415 AC_REQUIRE([AC_PROG_CPP])
416 AC_MSG_CHECKING(for X)
419 AC_CACHE_VAL(ac_cv_have_x,
420 [# One or both of the vars are not set, and there is no cached value.
421 if test "{$x_includes+set}" = set; then
424 if test "{$x_libraries+set}" = set; then
429 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
430 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
432 # Record where we found X for the cache.
433 ac_cv_have_x="have_x=yes \
434 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
438 if test "$have_x" != yes; then
439 AC_MSG_RESULT($have_x)
442 # If each of the values was on the command line, it overrides each guess.
443 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
444 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
445 # Update the cache value to reflect the command line values.
446 ac_cv_have_x="have_x=yes \
447 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
448 AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
451 if test -z "$x_includes" || test "x$x_includes" = xNONE; then
453 x_includes="."; dnl better than nothing :-
455 X_INCLUDES="-I$x_includes"
458 if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then
460 x_libraries="/usr/lib"; dnl better than nothing :-
462 X_LDFLAGS="-L$x_libraries"
464 all_includes="$all_includes $X_INCLUDES"
465 all_libraries="$all_libraries $X_LDFLAGS"
469 AC_SUBST(x_libraries)
472 LIB_X11='-lX11 $(LIBSOCKET)'
475 AC_MSG_CHECKING(for libXext)
476 AC_CACHE_VAL(kde_cv_have_libXext,
478 kde_ldflags_safe="$LDFLAGS"
479 kde_libs_safe="$LIBS"
481 LDFLAGS="$X_LDFLAGS $USER_LDFLAGS"
482 LIBS="-lXext -lX11 $LIBSOCKET"
488 printf("hello Xext\n");
490 kde_cv_have_libXext=yes,
491 kde_cv_have_libXext=no
494 LDFLAGS=$kde_ldflags_safe
498 AC_MSG_RESULT($kde_cv_have_libXext)
500 if test "kde_cv_have_libXext" = "no"; then
501 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
502 can't find it itself, we stop here assuming that make wouldn't find
511 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
513 AC_REQUIRE([KDE_USE_QT])
517 cat > conftest.$ac_ext <<EOF
518 #include "confdefs.h"
520 #include <qapplication.h>
521 #include <qobjcoll.h>
523 echo "#if ! ($1)" >> conftest.$ac_ext
524 cat >> conftest.$ac_ext <<EOF
536 if test -z "$1"; then
542 if test -z "$2"; then
543 if test $kde_qtver = 2; then
544 kde_qt_minversion=">= 2.0"
546 kde_qt_minversion=">= 1.42 and < 2.0"
549 kde_qt_minversion="$2"
552 if test -z "$3"; then
553 if test $kde_qtver = 2; then
554 kde_qt_verstring="QT_VERSION >= 200"
556 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
559 kde_qt_verstring="$3"
563 AC_DEFUN(KDE_CHECK_QT_DIRECT,
565 AC_REQUIRE([KDE_USE_QT])
566 AC_MSG_CHECKING([if Qt compiles without flags])
567 AC_CACHE_VAL(kde_cv_qt_direct,
569 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
570 ac_LIBRARY_PATH="$LIBRARY_PATH"
571 ac_cxxflags_safe="$CXXFLAGS"
572 ac_ldflags_safe="$LDFLAGS"
575 CXXFLAGS="$CXXFLAGS -I$qt_includes"
577 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
579 export LD_LIBRARY_PATH
583 KDE_PRINT_QT_PROGRAM($kde_qt_verstring)
585 if AC_TRY_EVAL(ac_link) && test -s conftest; then
586 kde_cv_qt_direct="yes"
588 kde_cv_qt_direct="no"
589 echo "configure: failed program was:" >&AC_FD_CC
590 cat conftest.$ac_ext >&AC_FD_CC
593 CXXFLAGS="$ac_cxxflags_safe"
594 LDFLAGS="$ac_ldflags_safe"
597 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
598 export LD_LIBRARY_PATH
599 LIBRARY_PATH="$ac_LIBRARY_PATH"
603 if test "$kde_cv_qt_direct" = "yes"; then
612 dnl ------------------------------------------------------------------------
613 dnl Try to find the Qt headers and libraries.
614 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
615 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
616 dnl ------------------------------------------------------------------------
618 AC_DEFUN(AC_PATH_QT_1_3,
620 AC_REQUIRE([K_PATH_X])
621 AC_REQUIRE([KDE_USE_QT])
623 if test $kde_qtver = 2; then
625 AC_REQUIRE([AC_FIND_PNG])
626 LIBQT="$LIBQT $LIBPNG"
628 AC_MSG_CHECKING([for Qt])
630 LIBQT="$LIBQT -lXext -lX11 $LIBSOCKET"
631 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
635 [ --with-qt-dir=DIR where the root of Qt is installed ],
636 [ ac_qt_includes="$withval"/include
637 ac_qt_libraries="$withval"/lib
638 ac_qt_bindir="$withval"/bin
641 AC_ARG_WITH(qt-includes,
642 [ --with-qt-includes=DIR where the Qt includes are. ],
644 ac_qt_includes="$withval"
649 AC_ARG_WITH(qt-libraries,
650 [ --with-qt-libraries=DIR where the Qt library is installed.],
651 [ ac_qt_libraries="$withval"
652 kde_qt_libs_given=yes
655 AC_CACHE_VAL(ac_cv_have_qt,
656 [#try to guess Qt locations
658 qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes"
659 test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs"
660 qt_incdirs="$ac_qt_includes $qt_incdirs"
661 AC_FIND_FILE(qmovie.h, $qt_incdirs, qt_incdir)
662 ac_qt_includes="$qt_incdir"
664 qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt $x_libraries"
665 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
666 if test ! "$ac_qt_libraries" = "NO"; then
667 qt_libdirs="$ac_qt_libraries $qt_libdirs"
672 for dir in $qt_libdirs; do
673 try="ls -1 $dir/libqt*"
674 if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
677 ac_qt_libraries="$qt_libdir"
679 ac_cxxflags_safe="$CXXFLAGS"
680 ac_ldflags_safe="$LDFLAGS"
683 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
684 LDFLAGS="-L$qt_libdir $all_libraries"
687 KDE_PRINT_QT_PROGRAM($kde_qt_verstring)
689 if AC_TRY_EVAL(ac_link) && test -s conftest; then
692 echo "configure: failed program was:" >&AC_FD_CC
693 cat conftest.$ac_ext >&AC_FD_CC
697 CXXFLAGS="$ac_cxxflags_safe"
698 LDFLAGS="$ac_ldflags_safe"
701 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
702 ac_cv_have_qt="have_qt=no"
704 if test "$ac_qt_includes" = NO; then
705 if test "$ac_qt_libraries" = NO; then
706 ac_qt_notfound="(headers and libraries)";
708 ac_qt_notfound="(headers)";
711 ac_qt_notfound="(libraries)";
714 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! ]);
720 eval "$ac_cv_have_qt"
722 if test "$have_qt" != yes; then
723 AC_MSG_RESULT([$have_qt]);
725 ac_cv_have_qt="have_qt=yes \
726 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
727 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
729 qt_libraries="$ac_qt_libraries"
730 qt_includes="$ac_qt_includes"
733 if test ! "$kde_qt_libs_given" = "yes"; then
734 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
737 AC_SUBST(qt_libraries)
738 AC_SUBST(qt_includes)
740 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
743 QT_INCLUDES="-I$qt_includes"
744 all_includes="$QT_INCLUDES $all_includes"
747 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
750 QT_LDFLAGS="-L$qt_libraries"
751 all_libraries="$QT_LDFLAGS $all_libraries"
754 AC_SUBST(QT_INCLUDES)
758 LIB_QT='-lqt $(LIBPNG) $(LIB_X11)'
768 dnl ------------------------------------------------------------------------
769 dnl Now, the same with KDE
770 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
771 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
772 dnl ------------------------------------------------------------------------
774 AC_DEFUN(AC_BASE_PATH_KDE,
777 AC_REQUIRE([KDE_MISC_TESTS])
778 AC_REQUIRE([AC_PATH_QT])dnl
779 AC_MSG_CHECKING([for KDE])
781 if test "${prefix}" != NONE; then
782 kde_includes=${prefix}/include
783 ac_kde_includes=$prefix/include
785 if test "${exec_prefix}" != NONE; then
786 kde_libraries=${exec_prefix}/lib
787 ac_kde_libraries=$exec_prefix/lib
789 kde_libraries=${prefix}/lib
790 ac_kde_libraries=$prefix/lib
799 AC_CACHE_VAL(ac_cv_have_kde,
800 [#try to guess kde locations
802 if test -z "$1"; then
804 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"
805 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
806 kde_incdirs="$ac_kde_includes $kde_incdirs"
807 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
808 ac_kde_includes="$kde_incdir"
810 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
812 in the prefix, you've chosen, are no KDE headers installed. This will fail.
813 So, check this please and use another prefix!])
816 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"
817 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
818 kde_libdirs="$ac_kde_libraries $kde_libdirs"
819 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
820 ac_kde_libraries="$kde_libdir"
822 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
824 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
825 So, check this please and use another prefix!])
827 ac_kde_libraries="$kde_libdir"
829 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
830 ac_cv_have_kde="have_kde=no"
832 ac_cv_have_kde="have_kde=yes \
833 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
838 ac_cv_have_kde="have_kde=no"
843 eval "$ac_cv_have_kde"
845 if test "$have_kde" != "yes"; then
846 if test "${prefix}" = NONE; then
847 ac_kde_prefix="$ac_default_prefix"
849 ac_kde_prefix="$prefix"
851 if test "$exec_prefix" = NONE; then
852 ac_kde_exec_prefix="$ac_kde_prefix"
853 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
855 ac_kde_exec_prefix="$exec_prefix"
856 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
859 kde_libraries="${ac_kde_exec_prefix}/lib"
860 kde_includes=${ac_kde_prefix}/include
863 ac_cv_have_kde="have_kde=yes \
864 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
865 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
867 kde_libraries="$ac_kde_libraries"
868 kde_includes="$ac_kde_includes"
870 AC_SUBST(kde_libraries)
871 AC_SUBST(kde_includes)
873 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
876 KDE_INCLUDES="-I$kde_includes"
877 all_includes="$KDE_INCLUDES $all_includes"
880 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
883 KDE_LDFLAGS="-L$kde_libraries"
884 all_libraries="$KDE_LDFLAGS $all_libraries"
887 AC_SUBST(KDE_LDFLAGS)
888 AC_SUBST(KDE_INCLUDES)
890 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
892 AC_SUBST(all_includes)
893 AC_SUBST(all_libraries)
897 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
899 AC_MSG_CHECKING(for extra includes)
900 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
901 adds non standard include paths],
902 kde_use_extra_includes="$withval",
903 kde_use_extra_includes=NONE
905 if test -n "$kde_use_extra_includes" && \
906 test "$kde_use_extra_includes" != "NONE"; then
910 for dir in $kde_use_extra_includes; do
911 all_includes="$all_includes -I$dir"
912 USER_INCLUDES="$USER_INCLUDES -I$dir"
915 kde_use_extra_includes="added"
917 kde_use_extra_includes="no"
919 AC_SUBST(USER_INCLUDES)
921 AC_MSG_RESULT($kde_use_extra_includes)
923 AC_MSG_CHECKING(for extra libs)
924 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
925 kde_use_extra_libs=$withval,
926 kde_use_extra_libs=NONE
928 if test -n "$kde_use_extra_libs" && \
929 test "$kde_use_extra_libs" != "NONE"; then
933 for dir in $kde_use_extra_libs; do
934 all_libraries="$all_libraries -L$dir"
935 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir"
936 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
939 kde_use_extra_libs="added"
941 kde_use_extra_libs="no"
944 AC_SUBST(USER_LDFLAGS)
946 AC_MSG_RESULT($kde_use_extra_libs)
950 AC_DEFUN(KDE_CHECK_KIMGIO,
952 AC_REQUIRE([AC_BASE_PATH_KDE])
953 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
954 AC_REQUIRE([AC_FIND_TIFF])
955 AC_REQUIRE([AC_FIND_JPEG])
956 AC_REQUIRE([AC_FIND_PNG])
957 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
959 if test "$1" = "existance"; then
962 kde_save_LIBS="$LIBS"
963 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
964 AC_CHECK_LIB(kimgio, kimgioRegister, [
965 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
966 LIBS="$kde_save_LIBS"
972 if test "$LIBKIMGIO_EXISTS" = "yes"; then
973 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) $(LIB_QT) -lm'
974 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
977 LIB_KHTMLW='-lkhtmlw $(LIBJPEG) -ljscript $(LIB_QT)'
982 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
986 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
988 AC_REQUIRE([KDE_MISC_TESTS])
989 AC_REQUIRE([KDE_CHECK_LIBDL])
990 AC_REQUIRE([K_PATH_X])
992 dnl Check for KDE version (derived from Qt version)
993 if test "`echo $kde_qt_used_ver | sed -e 's/\..*//'`" = "2"; then
995 LIB_KDEUTIL='-lkdeutil'
1001 LIB_KDECORE='-lkdecore -lXext $(LIB_QT) $(LIBDL)'
1002 AC_SUBST(LIB_KDECORE)
1003 LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1005 LIB_KFORMULA='-lformula $(LIB_QT)'
1006 AC_SUBST(LIB_KFORMULA)
1007 LIB_KFM='-lkfm $(LIB_KDECORE)'
1009 AC_SUBST(LIB_KDEUTIL)
1010 LIB_KIO="$LIB_KIO_LINK"' $(LIB_KDEUI) $(LIB_KDEUTIL)'
1012 LIB_KFILE='-lkfile $(LIB_KIO)'
1014 LIB_KAB='-lkab $(LIB_KFM) $(LIB_KIMGIO)'
1016 LIB_MEDIATOOL='-lmediatool $(LIB_KDECORE)'
1017 AC_SUBST(LIB_MEDIATOOL)
1020 AC_DEFUN(AC_PATH_KDE,
1023 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1025 if test "$enableval" = "no";
1026 then ac_use_path_checking="default"
1027 else ac_use_path_checking=""
1029 ], [ac_use_path_checking=""]
1032 AC_CREATE_KFSSTND($ac_use_path_checking)
1035 KDE_CREATE_LIBS_ALIASES
1038 dnl slightly changed version of AC_CHECK_FUNC(setenv)
1039 AC_DEFUN(AC_CHECK_SETENV,
1040 [AC_MSG_CHECKING([for setenv])
1041 AC_CACHE_VAL(ac_cv_func_setenv,
1044 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
1045 dnl which includes <sys/select.h> which contains a prototype for
1046 dnl select. Similarly for bzero.
1047 [#include <assert.h>
1048 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
1052 [/* We use char because int might match the return type of a gcc2
1053 builtin and then its argument prototype would still apply. */
1056 /* The GNU C library defines this for functions which it implements
1057 to always fail with ENOSYS. Some functions are actually named
1058 something starting with __ and the normal name is an alias. */
1059 #if defined (__stub_$1) || defined (__stub___$1)
1062 setenv("TEST", "alle", 1);
1064 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
1066 if test "$ac_cv_func_setenv" = "yes"; then
1068 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
1074 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1077 save_CXXFLAGS="$CXXFLAGS"
1078 if test "$GCC" = "yes"; then
1079 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1081 AC_MSG_CHECKING(for getdomainname)
1082 AC_CACHE_VAL(ac_cv_func_getdomainname,
1090 getdomainname(buffer, 200);
1092 ac_cv_func_getdomainname=yes,
1093 ac_cv_func_getdomainname=no)
1095 AC_MSG_RESULT($ac_cv_func_getdomainname)
1096 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
1097 AC_DEFINE(HAVE_GETDOMAINNAME)
1099 CXXFLAGS="$save_CXXFLAGS"
1102 AC_DEFUN(AC_CHECK_GETHOSTNAME,
1105 save_CXXFLAGS="$CXXFLAGS"
1106 if test "$GCC" = "yes"; then
1107 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1110 AC_MSG_CHECKING([for gethostname])
1111 AC_CACHE_VAL(ac_cv_func_gethostname,
1119 gethostname(buffer, 200);
1121 ac_cv_func_gethostname=yes,
1122 ac_cv_func_gethostname=no)
1124 AC_MSG_RESULT($ac_cv_func_gethostname)
1125 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
1126 AC_DEFINE(HAVE_GETHOSTNAME)
1128 CXXFLAGS="$save_CXXFLAGS"
1131 AC_DEFUN(AC_CHECK_USLEEP,
1135 AC_MSG_CHECKING([for usleep])
1136 AC_CACHE_VAL(ac_cv_func_usleep,
1138 ac_libs_safe="$LIBS"
1139 LIBS="$LIBS $LIBUCB"
1147 ac_cv_func_usleep=yes,
1148 ac_cv_func_usleep=no)
1150 AC_MSG_RESULT($ac_cv_func_usleep)
1151 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
1152 AC_DEFINE(HAVE_USLEEP)
1154 LIBS="$ac_libs_safe"
1157 AC_DEFUN(AC_CHECK_RANDOM,
1161 AC_MSG_CHECKING([for random])
1162 AC_CACHE_VAL(ac_cv_func_random,
1164 ac_libs_safe="$LIBS"
1165 LIBS="$LIBS $LIBUCB"
1172 ac_cv_func_random=yes,
1173 ac_cv_func_random=no)
1175 AC_MSG_RESULT($ac_cv_func_random)
1176 if eval "test \"`echo `$ac_cv_func_random\" = yes"; then
1177 AC_DEFINE(HAVE_RANDOM)
1179 LIBS="$ac_libs_safe"
1182 AC_DEFUN(AC_FIND_GIF,
1183 [AC_MSG_CHECKING([for giflib])
1184 AC_CACHE_VAL(ac_cv_lib_gif,
1185 [ac_save_LIBS="$LIBS"
1186 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1192 int GifLastError(void);
1196 /* We use char because int might match the return type of a gcc2
1197 builtin and then its argument prototype would still apply. */
1199 [return GifLastError();],
1200 eval "ac_cv_lib_gif=yes",
1201 eval "ac_cv_lib_gif=no")
1202 LIBS="$ac_save_LIBS"
1204 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1206 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
1208 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1212 AC_DEFUN(KDE_FIND_JPEG_HELPER,
1214 AC_MSG_CHECKING([for libjpeg$2])
1215 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1217 ac_save_LIBS="$LIBS"
1218 LIBS="$all_libraries -ljpeg$2 -lm"
1220 [/* Override any gcc2 internal prototype to avoid an error. */
1221 struct jpeg_decompress_struct;
1222 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1227 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1228 int version, size_t structsize);
1232 /* We use char because int might match the return type of a gcc2
1233 builtin and then its argument prototype would still apply. */
1235 [jpeg_CreateDecompress(0L, 0, 0);],
1236 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1237 eval "ac_cv_lib_jpeg_$1=no")
1238 LIBS="$ac_save_LIBS"
1241 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1242 LIBJPEG="$ac_cv_lib_jpeg_$1"
1243 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1251 AC_DEFUN(AC_FIND_JPEG,
1253 KDE_FIND_JPEG_HELPER(6b, 6b,
1254 KDE_FIND_JPEG_HELPER(normal, [],
1256 dnl what to do, if the normal way fails:
1257 if test -f "$kde_libraries/libjpeg.so"; then
1258 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1259 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1260 else if test -f "$kde_libraries/libjpeg.sl"; then
1261 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1262 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1263 else if test -f "$kde_libraries/libjpeg.a"; then
1264 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1265 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1268 You need jpeglib6b. Please install the kdesupport package.
1269 If you have already installed kdesupport you may have an
1270 old libjpeg somewhere.
1271 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
1277 LIBJPEG=$ac_cv_lib_jpeg
1281 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
1285 AC_DEFUN(AC_FIND_ZLIB,
1287 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1288 AC_MSG_CHECKING([for libz])
1289 AC_CACHE_VAL(ac_cv_lib_z,
1292 kde_save_LIBS="$LIBS"
1293 LIBS="$all_libraries -lz $LIBSOCKET"
1294 kde_save_CFLAGS="$CFLAGS"
1295 CFLAGS="$CFLAGS $all_includes"
1300 [return (zlibVersion() == ZLIB_VERSION); ],
1301 eval "ac_cv_lib_z='-lz'",
1302 eval "ac_cv_lib_z=no")
1303 LIBS="$kde_save_LIBS"
1304 CFLAGS="$kde_save_CFLAGS"
1306 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1307 AC_DEFINE_UNQUOTED(HAVE_LIBZ)
1310 AC_MSG_RESULT($ac_cv_lib_z)
1318 AC_DEFUN(KDE_TRY_TIFFLIB,
1320 AC_MSG_CHECKING([for libtiff $1])
1322 AC_CACHE_VAL(kde_cv_libtiff_$1,
1325 kde_save_LIBS="$LIBS"
1326 LIBS="$all_libraries -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
1327 kde_save_CFLAGS="$CFLAGS"
1328 CFLAGS="$CFLAGS $all_includes"
1334 [return (TIFFOpen( "", "r") == 0); ],
1336 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
1338 kde_cv_libtiff_$1=no
1341 LIBS="$kde_save_LIBS"
1342 CFLAGS="$kde_save_CFLAGS"
1346 if test "$kde_cv_libtiff_$1" = "no"; then
1351 LIBTIFF="$kde_cv_libtiff_$1"
1353 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
1359 AC_DEFUN(AC_FIND_TIFF,
1361 AC_REQUIRE([K_PATH_X])
1362 AC_REQUIRE([AC_FIND_ZLIB])
1363 AC_REQUIRE([AC_FIND_JPEG])
1364 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1366 KDE_TRY_TIFFLIB(tiff, [],
1367 KDE_TRY_TIFFLIB(tiff34))
1373 AC_DEFUN(AC_FIND_PNG,
1375 AC_REQUIRE([AC_FIND_ZLIB])
1376 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1377 AC_MSG_CHECKING([for libpng])
1378 AC_CACHE_VAL(ac_cv_lib_png,
1380 kde_save_LIBS="$LIBS"
1381 LIBS="$LIBS $all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1382 kde_save_CFLAGS="$CFLAGS"
1383 CFLAGS="$CFLAGS $all_includes"
1390 png_structp png_ptr = png_create_read_struct( /* image ptr */
1391 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1392 return( png_ptr != 0 );
1394 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1395 eval "ac_cv_lib_png=no"
1397 LIBS="$kde_save_LIBS"
1398 CFLAGS="$kde_save_CFLAGS"
1400 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1401 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
1402 LIBPNG="$ac_cv_lib_png"
1404 AC_MSG_RESULT($ac_cv_lib_png)
1412 AC_DEFUN(AC_CHECK_BOOL,
1414 AC_MSG_CHECKING([for bool])
1415 AC_CACHE_VAL(ac_cv_have_bool,
1419 [bool aBool = true;],
1420 [ac_cv_have_bool="yes"],
1421 [ac_cv_have_bool="no"])
1422 ]) dnl end AC_CHECK_VAL
1423 AC_MSG_RESULT($ac_cv_have_bool)
1424 if test "$ac_cv_have_bool" = "yes"; then
1425 AC_DEFINE(HAVE_BOOL)
1429 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1431 AC_MSG_CHECKING(if you need GNU extensions)
1432 AC_CACHE_VAL(ac_cv_gnu_extensions,
1434 cat > conftest.c << EOF
1435 #include <features.h>
1437 #ifdef __GNU_LIBRARY__
1442 if (eval "$ac_cpp conftest.c") 2>&5 |
1443 egrep "yes" >/dev/null 2>&1; then
1445 ac_cv_gnu_extensions=yes
1447 ac_cv_gnu_extensions=no
1451 AC_MSG_RESULT($ac_cv_gnu_extensions)
1452 if test "$ac_cv_gnu_extensions" = "yes"; then
1453 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
1457 AC_DEFUN(AC_CHECK_COMPILERS,
1459 dnl this is somehow a fat lie, but prevents other macros from double checking
1460 AC_PROVIDE([AC_PROG_CC])
1461 AC_PROVIDE([AC_PROG_CPP])
1462 AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
1464 if test $enableval = "no"; dnl
1465 then ac_use_debug_code="no"
1466 else ac_use_debug_code="yes"
1468 ], [ac_use_debug_code="no"])
1470 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
1472 if test $enableval = "no"; then
1473 ac_use_strict_options="no"
1475 ac_use_strict_options="yes"
1477 ], [ac_use_strict_options="no"])
1479 dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
1480 AC_MSG_CHECKING(for a C-Compiler)
1481 dnl if there is one, print out. if not, don't matter
1484 if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
1485 if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
1486 if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
1487 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
1492 if test $ac_cv_prog_gcc = yes; then
1498 if test -z "$CFLAGS"; then
1499 if test "$ac_use_debug_code" = "yes"; then
1501 if test $ac_cv_prog_cc_g = yes; then
1505 if test "$GCC" = "yes"; then
1512 if test "$GCC" = "yes"; then
1513 CFLAGS="$CFLAGS -Wall"
1515 if test "$ac_use_strict_options" = "yes"; then
1516 CFLAGS="$CFLAGS -W -ansi -pedantic"
1523 *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
1526 if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then
1531 dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
1532 dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
1534 AC_MSG_CHECKING(how to run the C preprocessor)
1535 # On Suns, sometimes $CPP names a directory.
1536 if test -n "$CPP" && test -d "$CPP"; then
1539 if test -z "$CPP"; then
1540 AC_CACHE_VAL(ac_cv_prog_CPP,
1541 [ # This must be in double quotes, not single quotes, because CPP may get
1542 # substituted into the Makefile and "${CC-cc}" will confuse make.
1544 # On the NeXT, cc -E runs the code through the compiler's parser,
1545 # not just through cpp.
1546 dnl Use a header file that comes with gcc, so configuring glibc
1547 dnl with a fresh cross-compiler works.
1548 AC_TRY_CPP([#include <assert.h>
1550 CPP="${CC-cc} -E -traditional-cpp"
1551 AC_TRY_CPP([#include <assert.h>
1552 Syntax Error], , CPP=/lib/cpp))
1553 ac_cv_prog_CPP="$CPP"])dnl
1554 CPP="$ac_cv_prog_CPP"
1556 ac_cv_prog_CPP="$CPP"
1562 AC_MSG_CHECKING(for a C++-Compiler)
1563 dnl if there is one, print out. if not, don't matter
1566 if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
1567 if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
1568 if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
1569 if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
1570 test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
1575 if test $ac_cv_prog_gxx = yes; then
1578 AC_MSG_CHECKING(whether we are using SPARC CC)
1580 cat > conftest.C << EOF
1586 ac_try="$CXX -E conftest.C"
1587 if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then
1592 AC_MSG_RESULT($ac_cv_prog_CC)
1593 if test "$ac_cv_prog_CC" = "yes"; then
1594 AC_MSG_ERROR([Sparc CC doesn't work on KDE sources at least til version
1595 4.2. This compiler has several problems accepting legal C++ code
1596 including the builtin C++ type bool. Since KDE is a freeware project,
1597 we decided, that we don't want to support that broken compilers.
1599 If you really want to see support for Sparc CC within KDE, make reasonable
1600 patches and join the KDE project. More information about KDE can be found
1605 if test -z "$CXXFLAGS"; then
1606 if test "$ac_use_debug_code" = "yes"; then
1608 if test $ac_cv_prog_cxx_g = yes; then
1611 if test "$ac_cv_prog_CC" = "yes"; then
1612 CXXFLAGS="$CXXFLAGS -pto"
1615 if test "$GXX" = "yes"; then
1618 if test "$ac_cv_prog_CC" = "yes"; then
1626 if test "$GXX" = "yes"; then
1627 CXXFLAGS="$CXXFLAGS -Wall"
1629 if test "$ac_use_strict_options" = "yes"; then
1630 CXXFLAGS="$CXXFLAGS -W -ansi -Wtraditional -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wbad-function-cast -Wsynth"
1633 if test "$kde_very_strict" = "yes"; then
1634 CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wshadow -Wredundant-decls -Wconversion"
1640 *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
1643 AC_PROVIDE(AC_PROG_CXXCPP)
1645 AC_MSG_CHECKING(how to run the C++ preprocessor)
1646 if test -z "$CXXCPP"; then
1647 AC_CACHE_VAL(ac_cv_prog_CXXCPP,
1650 AC_LANG_CPLUSPLUS[]dnl
1651 CXXCPP="${CXX-g++} -E"
1652 AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
1653 ac_cv_prog_CXXCPP="$CXXCPP"
1654 AC_LANG_RESTORE[]dnl
1656 CXXCPP="$ac_cv_prog_CXXCPP"
1658 AC_MSG_RESULT($CXXCPP)
1663 dnl just a wrapper to clean up configure.in
1664 AC_DEFUN(KDE_PROG_LIBTOOL,
1666 AC_REQUIRE([AC_ENABLE_SHARED])
1667 AC_REQUIRE([AC_ENABLE_STATIC])
1668 dnl libtool is only for C, so I must force him
1669 dnl to find the correct flags for C++
1671 kde_save_cflags="$CFLAGS"
1674 AM_PROG_LIBTOOL dnl for libraries
1675 LIBTOOL="$LIBTOOL --silent"
1678 CFLAGS="$kde_save_cflags"
1681 AC_DEFUN(KDE_DO_IT_ALL,
1685 AM_INIT_AUTOMAKE($1, $2)
1686 AM_DISABLE_LIBRARIES
1687 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1694 AC_DEFUN(AC_CHECK_RPATH,
1696 AC_MSG_CHECKING(for rpath)
1697 AC_ARG_ENABLE(rpath,
1698 [ --disable-rpath do not use the rpath feature of ld],
1699 USE_RPATH=$enableval, USE_RPATH=yes)
1701 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1703 KDE_RPATH="-rpath \$(kde_libraries)"
1705 if test -n "$qt_libraries"; then
1706 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1708 dnl $x_libraries is set to /usr/lib in case
1709 if test -n "$X_LDFLAGS"; then
1710 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1712 if test -n "$KDE_EXTRA_RPATH"; then
1713 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1716 AC_SUBST(KDE_EXTRA_RPATH)
1718 AC_MSG_RESULT($USE_RPATH)
1721 dnl Check for the type of the third argument of getsockname
1722 AC_DEFUN(AC_CHECK_KSIZE_T,
1723 [AC_MSG_CHECKING(for the third argument of getsockname)
1725 AC_CACHE_VAL(ac_cv_ksize_t,
1727 #include <sys/types.h>
1728 #include <sys/socket.h>
1731 getsockname(0,(struct sockaddr*)0, &a);
1733 ac_cv_ksize_t=socklen_t,
1735 if test -z "$ac_cv_ksize_t"; then
1736 ac_safe_cxxflags="$CXXFLAGS"
1737 if test "$GCC" = "yes"; then
1738 CXXFLAGS="-Werror $CXXFLAGS"
1741 #include <sys/types.h>
1742 #include <sys/socket.h>
1745 getsockname(0,(struct sockaddr*)0, &a);
1748 ac_cv_ksize_t=size_t)
1749 CXXFLAGS="$ac_safe_cxxflags"
1753 if test -z "$ac_cv_ksize_t"; then
1757 AC_MSG_RESULT($ac_cv_ksize_t)
1758 AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t)
1762 dnl This is a merge of some macros out of the gettext aclocal.m4
1763 dnl since we don't need anything, I took the things we need
1764 dnl the copyright for them is:
1766 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
1767 dnl This Makefile.in is free software; the Free Software Foundation
1768 dnl gives unlimited permission to copy and/or distribute it,
1769 dnl with or without modifications, as long as this notice is preserved.
1771 dnl This program is distributed in the hope that it will be useful,
1772 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1773 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1774 dnl PARTICULAR PURPOSE.
1776 dnl for this file it is relicensed under LGPL
1778 AC_DEFUN(AM_KDE_WITH_NLS,
1779 [AC_MSG_CHECKING([whether NLS is requested])
1781 dnl Default is enabled NLS
1783 [ --disable-nls do not use Native Language Support],
1784 USE_NLS=$enableval, USE_NLS=yes)
1785 AC_MSG_RESULT($USE_NLS)
1788 dnl If we use NLS figure out what method
1789 if test "$USE_NLS" = "yes"; then
1790 AC_DEFINE(ENABLE_NLS)
1792 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
1793 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
1794 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1796 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
1797 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
1804 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
1805 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1807 dnl Test whether we really found GNU xgettext.
1808 if test "$XGETTEXT" != ":"; then
1809 dnl If it is no GNU xgettext we define it as : so that the
1810 dnl Makefiles still can work.
1811 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1815 [found xgettext programs is not GNU xgettext; ignore it])
1824 # Search path for a program which passes the given test.
1825 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1828 # Stephan Kulow: I appended a _KDE against name conflicts
1830 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1831 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1832 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1833 [# Extract the first word of "$2", so it can be a program name with args.
1834 set dummy $2; ac_word=[$]2
1835 AC_MSG_CHECKING([for $ac_word])
1836 AC_CACHE_VAL(ac_cv_path_$1,
1839 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1842 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1843 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1844 test -z "$ac_dir" && ac_dir=.
1845 if test -f $ac_dir/$ac_word; then
1847 ac_cv_path_$1="$ac_dir/$ac_word"
1853 dnl If no 4th arg is given, leave the cache variable unset,
1854 dnl so AC_PATH_PROGS will keep looking.
1855 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1860 if test -n "[$]$1"; then
1861 AC_MSG_RESULT([$]$1)
1869 # Check whether LC_MESSAGES is available in <locale.h>.
1870 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1874 AC_DEFUN(AM_LC_MESSAGES,
1875 [if test $ac_cv_header_locale_h = yes; then
1876 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1877 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1878 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1879 if test $am_cv_val_LC_MESSAGES = yes; then
1880 AC_DEFINE(HAVE_LC_MESSAGES)
1884 dnl From Jim Meyering.
1885 dnl FIXME: migrate into libit.
1887 AC_DEFUN(AM_FUNC_OBSTACK,
1888 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
1889 [AC_TRY_LINK([#include "obstack.h"],
1890 [struct obstack *mem;obstack_free(mem,(char *) 0)],
1891 am_cv_func_obstack=yes,
1892 am_cv_func_obstack=no)])
1893 if test $am_cv_func_obstack = yes; then
1894 AC_DEFINE(HAVE_OBSTACK)
1896 LIBOBJS="$LIBOBJS obstack.o"
1900 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
1901 dnl FIXME: Migrate into libit
1903 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
1904 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
1905 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
1906 am_cv_lib_error_at_line=yes,
1907 am_cv_lib_error_at_line=no)])
1908 if test $am_cv_lib_error_at_line = no; then
1909 LIBOBJS="$LIBOBJS error.o"
1911 AC_SUBST(LIBOBJS)dnl
1914 # Macro to add for using GNU gettext.
1915 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1918 # Stephan Kulow: I put a KDE in it to avoid name conflicts
1920 AC_DEFUN(AM_KDE_GNU_GETTEXT,
1921 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1922 AC_REQUIRE([AC_PROG_RANLIB])dnl
1923 AC_REQUIRE([AC_HEADER_STDC])dnl
1924 AC_REQUIRE([AC_C_INLINE])dnl
1925 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1926 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1927 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1928 AC_REQUIRE([AC_FUNC_MMAP])dnl
1929 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
1930 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1931 unistd.h values.h alloca.h])
1932 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1933 __argz_count __argz_stringify __argz_next stpcpy])
1937 if test "x$CATOBJEXT" != "x"; then
1938 if test "x$ALL_LINGUAS" = "x"; then
1941 AC_MSG_CHECKING(for catalogs to be installed)
1943 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1944 case "$ALL_LINGUAS" in
1945 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1948 LINGUAS=$NEW_LINGUAS
1949 AC_MSG_RESULT($LINGUAS)
1952 dnl Construct list of names of catalog files to be constructed.
1953 if test -n "$LINGUAS"; then
1954 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1960 AC_DEFUN(AC_HAVE_XPM,
1961 [AC_REQUIRE_CPP()dnl
1962 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1964 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
1965 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
1967 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
1968 xpm_test=$withval, xpm_test="yes")
1969 if test "x$xpm_test" = xno; then
1972 AC_MSG_CHECKING(for XPM)
1973 AC_CACHE_VAL(ac_cv_have_xpm,
1976 ac_save_ldflags="$LDFLAGS"
1977 ac_save_cflags="$CFLAGS"
1978 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
1979 CFLAGS="$CFLAGS $X_INCLUDES"
1980 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
1981 AC_TRY_LINK([#include <X11/xpm.h>],[],
1982 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
1983 LDFLAGS="$ac_save_ldflags"
1984 CFLAGS="$ac_save_cflags"
1987 if test "$ac_cv_have_xpm" = no; then
1994 if test "$XPM_LDFLAGS" = ""; then
1997 XPMLIB="-L$XPM_LDFLAGS -lXpm"
1999 if test "$XPM_INCLUDE" = ""; then
2002 XPMINC="-I$XPM_INCLUDE"
2012 AC_DEFUN(AC_HAVE_GL,
2013 [AC_REQUIRE_CPP()dnl
2014 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2016 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
2017 test -z "$GL_INCLUDE" && GL_INCLUDE=
2019 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
2020 gl_test=$withval, gl_test="yes")
2021 if test "x$gl_test" = xno; then
2024 AC_MSG_CHECKING(for GL)
2025 AC_CACHE_VAL(ac_cv_have_gl,
2028 ac_save_ldflags="$LDFLAGS"
2029 ac_save_cflags="$CFLAGS"
2030 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
2031 CFLAGS="$CFLAGS $X_INCLUDES"
2032 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2034 ac_cv_have_gl="yes",ac_cv_have_gl="no")
2035 LDFLAGS="$ac_save_ldflags"
2036 CFLAGS="$ac_save_cflags"
2039 if test "$ac_cv_have_gl" = no; then
2046 if test "$GL_LDFLAGS" = ""; then
2047 GLLIB="-lMesaGL -lMesaGLU"
2049 GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU"
2051 if test "$GL_INCLUDE" = ""; then
2054 GLINC="-I$GL_INCLUDE"
2066 dnl Should test for PAM (Pluggable Authentication Modules)
2067 AC_DEFUN(AC_PATH_PAM_DIRECT,
2069 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
2070 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
2074 /usr/local/include \
2076 /usr/unsupported/include \
2079 /usr/local/pam/include \
2080 /usr/lib/pam/include \
2085 if test -r "$ac_dir/$pam_direct_test_include"; then
2086 no_pam= ac_pam_includes=$ac_dir
2091 # First see if replacing the include by lib works.
2092 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
2097 /usr/unsupported/lib \
2103 for ac_extension in a so sl; do
2104 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
2105 no_pam= ac_pam_libraries=$ac_dir
2112 AC_DEFUN(AC_PATH_PAM,
2114 AC_REQUIRE([KDE_CHECK_LIBDL])
2117 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"], [], [-lpam $LIBDL])
2119 AC_MSG_CHECKING(for PAM)
2121 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
2123 if test "x$withval" = "xyes"; then
2126 elif test "x$withval" = "xno"; then
2130 pam_service="$withval"
2131 if test -z "$pam_service"; then
2140 if test ! "$no_pam" = yes; then
2142 AC_CACHE_VAL(ac_cv_path_pam,
2144 ac_pam_includes=NONE
2145 ac_pam_libraries=NONE
2146 if test -z "$pam_libraries"; then
2149 if test -z "$pam_includes"; then
2155 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
2156 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
2158 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
2159 ac_pam_libs="-lpam $PAM_MISC_LIB $LIBDL"
2160 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
2162 ac_cv_path_pam="no_pam=yes"
2166 eval "$ac_cv_path_pam"
2170 if test "$no_pam" = yes; then
2174 PAMLIBS="$ac_pam_libs"
2175 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
2176 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
2177 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
2178 if test "$default_pam" = yes; then
2179 AC_MSG_RESULT(["default pam service name will be used"])
2181 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service")
2182 AC_MSG_RESULT(["pam service name will be: " $pam_service])
2184 dnl test whether struct pam_message is const (Linux) or not (Sun)
2185 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
2186 AC_MSG_CHECKING(for const pam_message)
2187 AC_EGREP_HEADER([struct pam_message],
2189 [ AC_EGREP_HEADER([const struct pam_message],
2191 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
2192 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
2193 AC_DEFINE(PAM_MESSAGE_NONCONST)]
2195 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
2199 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
2200 PAMLIBPATHS="-L$pam_libraries"
2202 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
2203 PAMINC="-I$pam_includes"
2208 AC_SUBST(PAMLIBPATHS)
2212 AC_DEFUN(KDE_CHECK_LIBDL,
2214 AC_CHECK_LIB(dl, dlopen, [
2216 ac_cv_have_dlfcn=yes
2219 AC_CHECK_LIB(dld, shl_unload, [
2221 ac_cv_have_shload=yes
2227 AC_DEFUN(KDE_CHECK_DLOPEN,
2230 AC_CHECK_HEADERS(dlfcn.h dl.h)
2231 if test "$ac_cv_header_dlfcn_h" = "no"; then
2235 if test "$ac_cv_header_dl_h" = "no"; then
2236 ac_cv_have_shload=no
2240 AC_ARG_ENABLE(dlopen,
2241 [ --disable-dlopen link staticly [default=no]] ,
2242 [if test "$enableval" = yes; then
2247 # override the user's opinion, if we know it better ;)
2248 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
2252 if test "$ac_cv_have_dlfcn" = "yes"; then
2253 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
2256 if test "$ac_cv_have_shload" = "yes"; then
2257 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
2260 if test "$enable_dlopen" = no ; then
2261 test -n "$1" && eval $1
2263 test -n "$2" && eval $2
2268 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
2270 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
2272 AC_MSG_CHECKING([dynamic loading])
2273 eval "`egrep '^build_libtool_libs=' libtool`"
2274 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
2276 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
2280 AC_MSG_RESULT($dynamic_loading)
2281 if test "$dynamic_loading" = "yes"; then
2288 AC_DEFUN(KDE_ADD_INCLUDES,
2290 if test -z "$1"; then
2291 test_include="Pix.h"
2296 AC_MSG_CHECKING([for libg++ ($test_include)])
2298 AC_CACHE_VAL(kde_cv_libgpp_includes,
2300 kde_cv_libgpp_includes=no
2306 /usr/unsupported/include \
2311 if test -r "$ac_dir/$test_include"; then
2312 kde_cv_libgpp_includes=$ac_dir
2318 AC_MSG_RESULT($kde_cv_libgpp_includes)
2319 if test "$kde_cv_libgpp_includes" != "no"; then
2320 all_includes="-I$kde_cv_libgpp_includes $all_includes"
2326 AC_DEFUN(KDE_CHECK_MICO,
2328 AC_REQUIRE([KDE_CHECK_LIBDL])
2329 AC_REQUIRE([KDE_MISC_TESTS])
2330 AC_MSG_CHECKING(for MICO)
2332 if test -z "$MICODIR"; then
2333 kde_micodir=/usr/local
2335 kde_micodir="$MICODIR"
2338 AC_ARG_WITH(micodir,
2339 [ --with-micodir=micodir where mico is installed ],
2340 kde_micodir=$withval,
2341 kde_micodir=$kde_micodir
2344 AC_CACHE_VAL(kde_cv_mico_incdir,
2346 mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include"
2347 AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
2350 kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
2352 if test ! -r $kde_micodir/include/CORBA.h; then
2353 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
2356 AC_MSG_RESULT($kde_micodir)
2358 MICO_INCLUDES=-I$kde_micodir/include
2359 AC_SUBST(MICO_INCLUDES)
2360 MICO_LDFLAGS=-L$kde_micodir/lib
2361 AC_SUBST(MICO_LDFLAGS)
2363 AC_MSG_CHECKING([for MICO version])
2364 AC_CACHE_VAL(kde_cv_mico_version,
2367 cat >conftest.$ac_ext <<EOF
2369 #include <mico/version.h>
2372 printf("MICO_VERSION=%s\n",MICO_VERSION);
2376 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
2377 if AC_TRY_EVAL(ac_compile); then
2378 if eval `./conftest 2>&5`; then
2379 kde_cv_mico_version=$MICO_VERSION
2381 AC_MSG_ERROR([your system is not able to execute a small application to
2382 find MICO version! Check $kde_micodir/include/mico/version.h])
2385 AC_MSG_ERROR([your system is not able to compile a small application to
2386 find MICO version! Check $kde_micodir/include/mico/version.h])
2390 dnl installed MICO version
2391 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2392 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2393 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2395 dnl required MICO version
2396 req_v_maj=`echo $1 | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2397 req_v_mid=`echo $1 | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2398 req_v_min=`echo $1 | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2400 if test "$mico_v_maj" -lt "$req_v_maj" || \
2401 ( test "$mico_v_maj" -eq "$req_v_maj" && \
2402 test "$mico_v_mid" -lt "$req_v_mid" ) || \
2403 ( test "$mico_v_mid" -eq "$req_v_mid" && \
2404 test "$mico_v_min" -lt "$req_v_min" )
2407 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $1 \
2408 at least is required. You should upgrade MICO.])
2410 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $1, ok)])
2413 LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBDL"
2415 IDL=$kde_micodir/bin/idl
2420 if test "$kde_cv_have_mini_stl" = "yes"; then
2421 AC_MSG_ERROR([compile mico with --disable-mini-stl])
2424 idldir="\$(includedir)/idl"
2429 AC_DEFUN(KDE_CHECK_MINI_STL,
2431 AC_REQUIRE([KDE_CHECK_MICO])
2433 AC_MSG_CHECKING(if we use mico's mini-STL)
2434 AC_CACHE_VAL(kde_cv_have_mini_stl,
2437 kde_save_cxxflags="$CXXFLAGS"
2438 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
2441 #include <mico/config.h>
2444 #ifdef HAVE_MINI_STL
2448 kde_cv_have_mini_stl=no,
2449 kde_cv_have_mini_stl=yes)
2450 CXXFLAGS="$kde_save_cxxflags"
2454 AC_MSG_RESULT($kde_cv_have_mini_stl)
2460 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
2462 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
2463 AC_SUBST(LIBPTHREAD)
2466 AC_DEFUN(KDE_TRY_LINK_PYTHON,
2468 AC_CACHE_VAL(kde_cv_try_link_python_$1,
2470 kde_save_cxxflags="$CXXFLAGS"
2471 CXXFLAGS="$CXXFLAGS $PYTHONINC"
2472 kde_save_libs="$LIBS"
2473 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
2474 kde_save_ldflags="$LDFLAGS"
2475 LDFLAGS="$LDFLAGS $PYTHONLIB"
2481 PySys_SetArgv(1, 0);
2483 [kde_cv_try_link_python_$1=yes],
2484 [kde_cv_try_link_python_$1=no]
2486 CXXFLAGS="$kde_save_cxxflags"
2487 LIBS="$kde_save_libs"
2488 LDFLAGS="$kde_save_ldflags"
2491 if test "$kde_cv_try_link_python_$1" = "yes"; then
2499 AC_DEFUN(KDE_CHECK_PYTHON,
2501 AC_REQUIRE([KDE_CHECK_LIBDL])
2502 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
2504 AC_MSG_CHECKING([for Python directory])
2506 AC_CACHE_VAL(kde_cv_pythondir,
2508 if test -z "$PYTHONDIR"; then
2509 kde_cv_pythondir=/usr/local
2511 kde_cv_pythondir="$PYTHONDIR"
2515 AC_ARG_WITH(pythondir,
2516 [ --with-pythondir=pythondir use python installed in pythondir ],
2518 ac_python_dir=$withval
2519 ], ac_python_dir=$kde_cv_pythondir
2522 AC_MSG_RESULT($ac_python_dir)
2524 if test -z "$1"; then
2530 AC_MSG_CHECKING([for Python$version])
2532 python_incdirs="$ac_python_dir/include/python$version /usr/include/python$version /usr/local/include/python$version /usr/local/include"
2533 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
2534 if test ! -r $python_incdir/Python.h; then
2535 AC_MSG_ERROR(Python.h not found.)
2538 PYTHONINC=-I$python_incdir
2540 python_libdirs="$ac_python_dir/lib/python$version/config /usr/lib/python$version/config /usr/local/python$version/config /usr/lib"
2541 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
2542 if test ! -r $python_libdir/libpython$version.a; then
2543 AC_MSG_ERROR(libpython$version.a not found.)
2546 PYTHONLIB=-L$python_libdir
2547 LIBPYTHON=-lpython$version
2549 AC_MSG_RESULT(header $python_incdir library $python_libdir)
2551 dnl Note: this test is very weak
2552 AC_MSG_CHECKING(if an Python application links)
2553 KDE_TRY_LINK_PYTHON(normal, "",
2555 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
2559 AC_MSG_CHECKING(if Python depends on -lpthread)
2560 KDE_TRY_LINK_PYTHON(pthread, "$LIBPTHREAD",
2563 LIBPYTHON="$LIBPYTHON $LIBPTHREAD $LIBDL $LIBSOCKET"
2567 AC_MSG_CHECKING(if Python depeds on -ltcl)
2568 KDE_TRY_LINK_PYTHON(tcl, "-ltcl",
2571 LIBPYTHON="$LIBPYTHON -ltcl $LIBDL $LIBSOCKET"
2575 AC_MSG_WARN([it seems, Python depends on another library.
2576 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
2577 and contact the authors to let them know about this problem])
2589 AC_DEFUN(KDE_CHECK_STL_SGI,
2591 AC_MSG_CHECKING([if STL implementation is SGI like])
2592 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2597 string astring="Hallo Welt.";
2598 astring.erase(0, 6); // now astring is "Welt"
2600 ], kde_cv_stl_type_sgi=yes,
2601 kde_cv_stl_type_sgi=no)
2604 AC_MSG_RESULT($kde_cv_stl_type_sgi)
2606 if test "$kde_cv_stl_type_sgi" = "yes"; then
2607 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
2611 AC_DEFUN(KDE_CHECK_STL_HP,
2613 AC_MSG_CHECKING([if STL implementation is HP like])
2614 AC_CACHE_VAL(kde_cv_stl_type_hp,
2619 string astring="Hello World";
2620 astring.remove(0, 6); // now astring is "World"
2622 ], kde_cv_stl_type_hp=yes,
2623 kde_cv_stl_type_hp=no)
2625 AC_MSG_RESULT($kde_cv_stl_type_hp)
2627 if test "$kde_cv_stl_type_hp" = "yes"; then
2628 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
2632 AC_DEFUN(KDE_CHECK_STL,
2636 if test "$kde_cv_stl_type_sgi" = "no"; then
2639 if test "$kde_cv_stl_type_hp" = "no"; then
2640 AC_MSG_ERROR("no known STL type found")
2646 AC_DEFUN(AC_FIND_QIMGIO,
2647 [AC_REQUIRE([AC_FIND_JPEG])
2648 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2649 AC_MSG_CHECKING([for qimgio])
2650 AC_CACHE_VAL(ac_cv_lib_qimgio,
2654 ac_save_LIBS="$LIBS"
2655 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
2658 void qInitImageIO ();
2661 eval "ac_cv_lib_qimgio=yes",
2662 eval "ac_cv_lib_qimgio=no")
2663 LIBS="$ac_save_LIBS"
2666 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
2667 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
2669 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
2672 AC_MSG_RESULT(not found)
2676 AC_DEFUN(KDE_CHECK_ANSI,
2680 AC_DEFUN(KDE_CHECK_INSURE,
2682 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
2684 if test $enableval = "no"; dnl
2685 then ac_use_insure="no"
2686 else ac_use_insure="yes"
2688 ], [ac_use_insure="no"])
2690 AC_MSG_CHECKING(if we will use Insure++ to debug)
2691 AC_MSG_RESULT($ac_use_insure)
2692 if test "$ac_use_insure" = "yes"; dnl
2693 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
2697 AC_DEFUN(AM_DISABLE_LIBRARIES,
2699 AC_PROVIDE([AM_ENABLE_STATIC])
2700 AC_PROVIDE([AM_ENABLE_SHARED])
2706 AC_DEFUN(AC_CHECK_UTMP_FILE,
2708 AC_MSG_CHECKING([for utmp file])
2710 AC_CACHE_VAL(kde_cv_utmp_file,
2721 if test -r "$ac_file"; then
2722 kde_cv_utmp_file=$ac_file
2728 AC_MSG_RESULT($kde_cv_utmp_file)
2729 if test "$kde_cv_utmp_file" != "no"; then
2730 AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file")
2735 AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
2738 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
2740 if test ! -s $srcdir/inst-apps && test -s $srcdir/subdirs; then
2741 cp $srcdir/subdirs $srcdir/inst-apps
2744 if test ! -s $srcdir/inst-apps; then
2746 files=`cd $srcdir && ls -1`
2747 dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
2749 echo $i >> $srcdir/subdirs
2751 cp $srcdir/subdirs $srcdir/inst-apps
2754 if test -s $srcdir/inst-apps; then
2755 ac_topsubdirs="`cat $srcdir/inst-apps`"
2758 for i in $ac_topsubdirs; do
2759 AC_MSG_CHECKING([if $i should be compiled])
2760 if test -d $srcdir/$i; then
2762 for j in $DO_NOT_COMPILE; do
2763 if test $i = $j; then
2770 AC_MSG_RESULT($install_it)
2771 if test $install_it = "yes"; then
2772 TOPSUBDIRS="$TOPSUBDIRS $i"
2776 AC_SUBST(TOPSUBDIRS)
2779 AC_DEFUN(KDE_CHECK_NAMESPACES,
2781 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
2794 int Foo::Bar::i = 1;
2797 AC_DEFINE(HAVE_NAMESPACES)
2803 AC_DEFUN(KDE_CHECK_NEWLIBS,
2808 dnl ------------------------------------------------------------------------
2809 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
2810 dnl ------------------------------------------------------------------------
2812 AC_DEFUN(AC_CHECK_S_ISSOCK,
2814 AC_MSG_CHECKING(for S_ISSOCK)
2815 AC_CACHE_VAL(ac_cv_have_s_issock,
2821 #include <sys/stat.h>
2825 int b = S_ISSOCK( buff.st_mode );
2827 ac_cv_have_s_issock=yes,
2828 ac_cv_have_s_issock=no)
2831 AC_MSG_RESULT($ac_cv_have_s_issock)
2832 if test "$ac_cv_have_s_issock" = "yes"; then
2833 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK)
2836 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
2837 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
2838 ## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2840 ## This program is free software; you can redistribute it and/or modify
2841 ## it under the terms of the GNU General Public License as published by
2842 ## the Free Software Foundation; either version 2 of the License, or
2843 ## (at your option) any later version.
2845 ## This program is distributed in the hope that it will be useful, but
2846 ## WITHOUT ANY WARRANTY; without even the implied warranty of
2847 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2848 ## General Public License for more details.
2850 ## You should have received a copy of the GNU General Public License
2851 ## along with this program; if not, write to the Free Software
2852 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2854 ## As a special exception to the GNU General Public License, if you
2855 ## distribute this file as part of a program that contains a
2856 ## configuration script generated by Autoconf, you may include it under
2857 ## the same distribution terms that you use for the rest of that program.
2859 # serial 35 AC_PROG_LIBTOOL
2860 AC_DEFUN(AC_PROG_LIBTOOL,
2861 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
2863 # Save cache, so that ltconfig can load it
2866 # Actually configure libtool. ac_aux_dir is where install-sh is found.
2867 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2868 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2869 DLLTOOL="$DLLTOOL" AS="$AS" \
2870 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
2871 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2872 || AC_MSG_ERROR([libtool configure failed])
2874 # Reload cache, that may have been modified by ltconfig
2877 # This can be used to rebuild libtool when needed
2878 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
2880 # Always use our own libtool.
2881 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2882 AC_SUBST(LIBTOOL)dnl
2884 # Redirect the config.log output again, so that the ltconfig log is not
2885 # clobbered by the next message.
2886 exec 5>>./config.log
2889 AC_DEFUN(AC_LIBTOOL_SETUP,
2891 AC_REQUIRE([AC_ENABLE_SHARED])dnl
2892 AC_REQUIRE([AC_ENABLE_STATIC])dnl
2893 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
2894 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2895 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2896 AC_REQUIRE([AC_PROG_RANLIB])dnl
2897 AC_REQUIRE([AC_PROG_CC])dnl
2898 AC_REQUIRE([AC_PROG_LD])dnl
2899 AC_REQUIRE([AC_PROG_NM])dnl
2900 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
2901 AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
2902 AC_REQUIRE([AC_PROG_LN_S])dnl
2905 # Check for any special flags to pass to ltconfig.
2906 libtool_flags="--cache-file=$cache_file"
2907 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2908 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2909 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2910 test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
2911 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2912 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2913 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2915 # Some flags need to be propagated to the compiler or linker for good
2919 # Find out which ABI we are using.
2920 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
2921 if AC_TRY_EVAL(ac_compile); then
2922 case "`/usr/bin/file conftest.o`" in
2938 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2939 SAVE_CFLAGS="$CFLAGS"
2940 CFLAGS="$CFLAGS -belf"
2941 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2942 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
2943 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2944 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2945 CFLAGS="$SAVE_CFLAGS"
2950 AC_SYS_LIBTOOL_CYGWIN
2955 # enable the --disable-libtool-lock switch
2957 AC_ARG_ENABLE(libtool-lock,
2958 [ --disable-libtool-lock force libtool not to do file locking],
2959 need_locks=$enableval,
2962 if test x"$need_locks" = xno; then
2963 libtool_flags="$libtool_flags --disable-lock"
2967 # AC_LIBTOOL_DLOPEN - check for dlopen support
2968 AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
2970 # AC_ENABLE_SHARED - implement the --enable-shared flag
2971 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
2972 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
2974 AC_DEFUN(AC_ENABLE_SHARED,
2975 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2976 AC_ARG_ENABLE(shared,
2977 changequote(<<, >>)dnl
2978 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
2979 changequote([, ])dnl
2980 [p=${PACKAGE-default}
2981 case "$enableval" in
2982 yes) enable_shared=yes ;;
2983 no) enable_shared=no ;;
2986 # Look at the argument we got. We use all the common list separators.
2987 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2988 for pkg in $enableval; do
2989 if test "X$pkg" = "X$p"; then
2996 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
2999 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3000 AC_DEFUN(AC_DISABLE_SHARED,
3001 [AC_ENABLE_SHARED(no)])
3003 # AC_ENABLE_STATIC - implement the --enable-static flag
3004 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
3005 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3007 AC_DEFUN(AC_ENABLE_STATIC,
3008 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3009 AC_ARG_ENABLE(static,
3010 changequote(<<, >>)dnl
3011 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3012 changequote([, ])dnl
3013 [p=${PACKAGE-default}
3014 case "$enableval" in
3015 yes) enable_static=yes ;;
3016 no) enable_static=no ;;
3019 # Look at the argument we got. We use all the common list separators.
3020 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3021 for pkg in $enableval; do
3022 if test "X$pkg" = "X$p"; then
3029 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3032 # AC_DISABLE_STATIC - set the default static flag to --disable-static
3033 AC_DEFUN(AC_DISABLE_STATIC,
3034 [AC_ENABLE_STATIC(no)])
3037 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3038 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3039 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3041 AC_DEFUN(AC_ENABLE_FAST_INSTALL,
3042 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3043 AC_ARG_ENABLE(fast-install,
3044 changequote(<<, >>)dnl
3045 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3046 changequote([, ])dnl
3047 [p=${PACKAGE-default}
3048 case "$enableval" in
3049 yes) enable_fast_install=yes ;;
3050 no) enable_fast_install=no ;;
3052 enable_fast_install=no
3053 # Look at the argument we got. We use all the common list separators.
3054 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3055 for pkg in $enableval; do
3056 if test "X$pkg" = "X$p"; then
3057 enable_fast_install=yes
3063 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3066 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
3067 AC_DEFUN(AC_DISABLE_FAST_INSTALL,
3068 [AC_ENABLE_FAST_INSTALL(no)])
3071 # AC_PROG_LD - find the path to the GNU or non-GNU linker
3072 AC_DEFUN(AC_PROG_LD,
3073 [AC_ARG_WITH(gnu-ld,
3074 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
3075 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3076 AC_REQUIRE([AC_PROG_CC])dnl
3077 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3078 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3080 if test "$ac_cv_prog_gcc" = yes; then
3081 # Check if gcc -print-prog-name=ld gives a path.
3082 AC_MSG_CHECKING([for ld used by GCC])
3083 ac_prog=`($CC -print-prog-name=ld) 2>&5`
3085 # Accept absolute paths.
3087 /* | [A-Za-z]:[\\/]*)
3088 re_direlt='/[^/][^/]*/\.\./'
3090 # Canonicalize the path of ld
3091 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3092 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3093 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3095 test -z "$LD" && LD="$ac_prog"
3098 # If it fails, then pretend we aren't using GCC.
3102 # If it is relative, then search for the first ld in PATH.
3106 elif test "$with_gnu_ld" = yes; then
3107 AC_MSG_CHECKING([for GNU ld])
3109 AC_MSG_CHECKING([for non-GNU ld])
3111 AC_CACHE_VAL(ac_cv_path_LD,
3112 [if test -z "$LD"; then
3113 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3114 for ac_dir in $PATH; do
3115 test -z "$ac_dir" && ac_dir=.
3116 if test -f "$ac_dir/$ac_prog"; then
3117 ac_cv_path_LD="$ac_dir/$ac_prog"
3118 # Check to see if the program is GNU ld. I'd rather use --version,
3119 # but apparently some GNU ld's only accept -v.
3120 # Break only if it was the GNU/non-GNU ld that we prefer.
3121 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3122 test "$with_gnu_ld" != no && break
3124 test "$with_gnu_ld" != yes && break
3130 ac_cv_path_LD="$LD" # Let the user override the test with a path.
3133 if test -n "$LD"; then
3138 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3143 AC_DEFUN(AC_PROG_LD_GNU,
3144 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
3145 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3146 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3147 ac_cv_prog_gnu_ld=yes
3149 ac_cv_prog_gnu_ld=no
3153 # AC_PROG_NM - find the path to a BSD-compatible name lister
3154 AC_DEFUN(AC_PROG_NM,
3155 [AC_MSG_CHECKING([for BSD-compatible nm])
3156 AC_CACHE_VAL(ac_cv_path_NM,
3157 [if test -n "$NM"; then
3158 # Let the user override the test.
3161 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3162 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3163 test -z "$ac_dir" && ac_dir=.
3164 if test -f $ac_dir/nm; then
3165 # Check to see if the nm accepts a BSD-compat flag.
3166 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3167 # nm: unknown option "B" ignored
3168 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3169 ac_cv_path_NM="$ac_dir/nm -B"
3171 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3172 ac_cv_path_NM="$ac_dir/nm -p"
3175 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3176 continue # so that we can try to find one that supports BSD flags
3181 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3184 AC_MSG_RESULT([$NM])
3188 # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
3189 # by C symbol name from nm.
3190 AC_DEFUN(AC_SYS_NM_PARSE,
3191 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3192 AC_REQUIRE([AC_PROG_NM])dnl
3193 # Check for command to grab the raw symbol name followed by C symbol from nm.
3194 AC_MSG_CHECKING([command to parse $NM output])
3195 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
3196 [# These are sane defaults that work on at least a few old systems.
3197 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
3200 # Character class describing NM global symbol codes.
3201 ac_symcode='[BCDEGRST]'
3203 # Regexp to match symbols that can be accessed directly from C.
3204 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
3206 # Transform the above into a raw symbol and a C symbol.
3207 ac_symxfrm='\1 \2\3 \3'
3209 # Transform an extracted symbol line into a proper C declaration
3210 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
3212 # Define system-specific variables.
3218 ac_symcode='[ABCDGISTW]'
3221 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
3224 ac_symcode='[BCDEGRST]'
3231 # If we're using GNU nm, then use its standard symbol codes.
3232 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
3233 ac_symcode='[ABCDGISTW]'
3237 # Try without a prefix undercore, then with it.
3238 for ac_symprfx in "" "_"; do
3240 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
3242 # Check to see that the pipe works correctly.
3244 rm -f conftest.$ac_ext
3245 cat > conftest.$ac_ext <<EOF
3250 void nm_test_func(){}
3254 int main(){nm_test_var='a';nm_test_func;return 0;}
3257 if AC_TRY_EVAL(ac_compile); then
3258 # Now try to grab the symbols.
3259 ac_nlist=conftest.nm
3261 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
3263 # Try sorting and uniquifying the output.
3264 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
3265 mv -f "$ac_nlist"T "$ac_nlist"
3270 # Make sure that we snagged all the symbols we need.
3271 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
3272 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
3273 cat <<EOF > conftest.c
3279 # Now generate the symbol file.
3280 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
3282 cat <<EOF >> conftest.c
3283 #if defined (__STDC__) && __STDC__
3284 # define lt_ptr_t void *
3286 # define lt_ptr_t char *
3290 /* The mapping between symbol names and symbols. */
3296 lt_preloaded_symbols[] =
3300 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
3301 cat <<\EOF >> conftest.c
3309 # Now try linking the two files.
3310 mv conftest.$ac_objext conftestm.$ac_objext
3311 ac_save_LIBS="$LIBS"
3312 ac_save_CFLAGS="$CFLAGS"
3313 LIBS="conftestm.$ac_objext"
3314 CFLAGS="$CFLAGS$no_builtin_flag"
3315 if AC_TRY_EVAL(ac_link) && test -s conftest; then
3318 echo "configure: failed program was:" >&AC_FD_CC
3319 cat conftest.c >&AC_FD_CC
3321 LIBS="$ac_save_LIBS"
3322 CFLAGS="$ac_save_CFLAGS"
3324 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
3327 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
3330 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
3333 echo "$progname: failed program was:" >&AC_FD_CC
3334 cat conftest.c >&AC_FD_CC
3338 # Do not use the global_symbol_pipe unless it works.
3339 if test "$ac_pipe_works" = yes; then
3340 if test x"$ac_symprfx" = x"_"; then
3341 ac_cv_sys_symbol_underscore=yes
3343 ac_cv_sys_symbol_underscore=no
3347 ac_cv_sys_global_symbol_pipe=
3353 if test -z "$ac_cv_sys_global_symbol_pipe"; then
3356 AC_MSG_RESULT($ac_result)
3359 # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
3360 AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
3361 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
3362 AC_CHECK_TOOL(AS, as, false)
3365 # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
3366 # with an underscore?
3367 AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
3368 [AC_REQUIRE([AC_PROG_NM])dnl
3369 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
3370 AC_MSG_CHECKING([for _ prefix in compiled symbols])
3371 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
3372 [ac_cv_sys_symbol_underscore=no
3373 cat > conftest.$ac_ext <<EOF
3374 void nm_test_func(){}
3375 int main(){nm_test_func;return 0;}
3377 if AC_TRY_EVAL(ac_compile); then
3378 # Now try to grab the symbols.
3379 ac_nlist=conftest.nm
3380 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
3381 # See whether the symbols have a leading underscore.
3382 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
3383 ac_cv_sys_symbol_underscore=yes
3385 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
3388 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
3392 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
3395 echo "configure: failed program was:" >&AC_FD_CC
3396 cat conftest.c >&AC_FD_CC
3400 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
3401 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
3402 AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
3405 # AC_CHECK_LIBM - check for math library
3406 AC_DEFUN(AC_CHECK_LIBM,
3407 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3409 *-*-beos* | *-*-cygwin*)
3410 # These system don't have libm
3413 AC_CHECK_LIB(mw, _mwvalidcheckl)
3414 AC_CHECK_LIB(m, cos)
3417 AC_CHECK_LIB(m, cos)
3422 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3423 # the libltdl convenience library, adds --enable-ltdl-convenience to
3424 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
3425 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
3426 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
3427 # '${top_builddir}/' (note the single quotes!) if your package is not
3428 # flat, and, if you're not using automake, define top_builddir as
3429 # appropriate in the Makefiles.
3430 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
3431 case "$enable_ltdl_convenience" in
3432 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3433 "") enable_ltdl_convenience=yes
3434 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3436 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
3439 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3440 # the libltdl installable library, and adds --enable-ltdl-install to
3441 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
3442 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
3443 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
3444 # '${top_builddir}/' (note the single quotes!) if your package is not
3445 # flat, and, if you're not using automake, define top_builddir as
3446 # appropriate in the Makefiles.
3447 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3448 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
3449 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
3450 case "$enable_ltdl_install" in
3451 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
3452 "") enable_ltdl_install=yes
3453 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
3456 if test x"$enable_ltdl_install" != x"no"; then
3457 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
3462 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
3463 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
3464 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
3465 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
3466 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
3467 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
3468 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
3469 AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
3470 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
3471 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
3473 AC_DEFUN(AC_LIBLTDL,
3475 AC_REQUIRE([AC_PROG_CC])
3478 AC_REQUIRE([AM_PROG_LIBTOOL])
3479 AC_SUBST(LIBTOOL_DEPS)
3481 AC_CACHE_CHECK([which extension is used for shared libraries],
3482 libltdl_cv_shlibext, [dnl
3485 ./libtool --config > conftest
3488 for spec in $library_names_spec; do
3493 echo "$last" | sed 's/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
3496 libltdl_cv_shlibext=`cat conftest`
3499 if test -n "$libltdl_cv_shlibext"; then
3500 AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
3501 [Define to the extension used for shared libraries, say, ".so". ])
3504 AC_CACHE_CHECK([which variable specifies run-time library path],
3505 libltdl_cv_shlibpath_var, [dnl
3508 ./libtool --config > conftest
3511 echo "$shlibpath_var" > conftest
3513 libltdl_cv_shlibpath_var=`cat conftest`
3516 if test -n "$libltdl_cv_shlibpath_var"; then
3517 AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
3518 [Define to the name of the environment variable that determines the dynamic library search path. ])
3521 AC_CACHE_CHECK([for objdir],
3522 libltdl_cv_objdir, [dnl
3525 ./libtool --config > conftest
3528 echo "$objdir" > conftest
3530 libltdl_cv_objdir=`cat conftest`
3533 test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
3534 AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
3535 [Define to the sub-directory in which libtool stores uninstalled libraries. ])
3538 AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
3539 AC_CHECK_HEADERS(string.h strings.h, break)
3540 AC_CHECK_FUNCS(strdup strchr strrchr index rindex)
3542 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
3543 libltdl_cv_preloaded_symbols, [dnl
3546 ./libtool --config > conftest
3549 if test -n "$global_symbol_pipe"; then
3555 libltdl_cv_preloaded_symbols=`cat conftest`
3558 if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
3559 AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
3560 [Define if libtool can extract symbol lists from object files. ])
3565 AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
3566 [Define if you have the libdl library or equivalent. ]) test_dlerror=yes],
3567 [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
3568 [Define if you have the libdl library. ]) dnl
3569 LIBADD_DL="-ldl" test_dlerror=yes],
3570 [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
3571 [Define if you have the GNU dld library. ]) dnl
3573 [AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
3574 [Define if you have the shl_load function. ])])]
3580 if test "$test_dlerror" = yes; then
3582 LIBS="$LIBS $LIBADD_DL"
3583 AC_CHECK_FUNCS(dlerror)
3587 AC_SYS_SYMBOL_UNDERSCORE
3588 if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then
3589 if test x"$ac_cv_func_dlopen" = xyes ||
3590 test x"$ac_cv_lib_dl_dlopen" = xyes ; then
3591 AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
3592 libltdl_cv_need_uscore, [dnl
3601 # define LTDL_GLOBAL RTLD_GLOBAL
3604 # define LTDL_GLOBAL DL_GLOBAL
3606 # define LTDL_GLOBAL 0
3610 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
3611 find out it does not work in some platform. */
3612 #ifndef LTDL_LAZY_OR_NOW
3614 # define LTDL_LAZY_OR_NOW RTLD_LAZY
3617 # define LTDL_LAZY_OR_NOW DL_LAZY
3620 # define LTDL_LAZY_OR_NOW RTLD_NOW
3623 # define LTDL_LAZY_OR_NOW DL_NOW
3625 # define LTDL_LAZY_OR_NOW 0
3632 fnord() { int i=42;}
3633 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
3634 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
3635 if(ptr1 && !ptr2) exit(0); } exit(1); }
3636 ], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
3637 libltdl_cv_need_uscore=cross
3642 if test x"$libltdl_cv_need_uscore" = xyes; then
3643 AC_DEFINE(NEED_USCORE, 1,
3644 [Define if dlsym() requires a leading underscode in symbol names. ])