1 dnl Some useful functions for LyXs configure.in -*- sh -*-
2 dnl Author: Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
3 dnl Lars Gullik Bjønnes (larsbj@lyx.org)
6 dnl Usage LYX_GET_VERSION Sets "lyx_version" to the version of LyX being
7 dnl built, displays it and sets variable "lyx_devel" to yes or no depending
8 dnl whether the version is a development release or not.
9 AC_DEFUN(LYX_GET_VERSION,[
11 VERSION=`grep '#define *LYX_VERSION' $1 |
12 sed -e 's/^.*"\(.*\)"$/\1/' 2>/dev/null`
13 echo "configuring LyX version $VERSION"
14 if echo "$VERSION" | grep 'cvs' >/dev/null ; then
16 echo "WARNING: This is a development version. Expect bugs."
20 if echo "$VERSION" | grep 'pre' > /dev/null ; then
22 echo "WARNING: This is a prerelease. Be careful and backup your documents."
27 PACKAGE=lyx${program_suffix}
28 AC_SUBST(lyx_devel_version)
29 if test $lyx_devel_version = yes ; then
30 AC_DEFINE(DEVEL_VERSION, 1, Define if you are building a development version of LyX)
33 dnl Usage: LYX_ERROR(message) Displays the warning "message" and sets the
34 dnl flag lyx_error to yes.
36 lyx_error_txt="$lyx_error_txt
42 dnl Usage: LYX_WARNING(message) Displays the warning "message" and sets the
43 dnl flag lyx_warning to yes.
44 AC_DEFUN(LYX_WARNING,[
45 lyx_warning_txt="$lyx_warning_txt
51 dnl Usage: LYX_LIB_ERROR(file,library) Displays an error message indication
52 dnl that 'file' cannot be found because 'lib' may be uncorrectly installed.
53 AC_DEFUN(LYX_LIB_ERROR,[
54 LYX_ERROR([Cannot find $1. Please check that the $2 library
55 is correctly installed on your system.])])
58 dnl Usage: LYX_CHECK_ERRORS Displays a warning message if a LYX_ERROR
59 dnl has occured previously.
60 AC_DEFUN(LYX_CHECK_ERRORS,[
61 if test x$lyx_error = xyes; then
63 **** The following problems have been detected by configure.
64 **** Please check the messages below before running 'make'.
65 **** (see the section 'Problems' in the INSTALL file)
68 deleting cache $cache_file
73 if test x$lyx_warning = xyes; then
75 === The following minor problems have been detected by configure.
76 === Please check the messages below before running 'make'.
77 === (see the section 'Problems' in the INSTALL file)
82 Configuration of LyX was successful.
83 Type 'make' to compile the program,
84 and then 'make install' to install it.
89 dnl LYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
91 define(LYX_SEARCH_PROG,[dnl
92 for ac_prog in $2 ; do
93 # Extract the first word of "$ac_prog", so it can be a program name with args.
94 set dummy $ac_prog ; ac_word=$[2]
95 if test -z "[$]$1"; then
96 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
97 for ac_dir in $PATH; do
98 test -z "$ac_dir" && ac_dir=.
99 if test -f [$ac_dir/$ac_word]; then
107 if test -n "[$]$1"; then
113 test -n "[$]$1" && break
118 AC_DEFUN(LYX_PROG_CXX_WORKS,
121 AC_TRY_COMPILER([class foo { int bar; }; int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
123 if test $ac_cv_prog_cxx_works = no; then
126 cross_compiling=$ac_cv_prog_cxx_cross
130 AC_DEFUN(LYX_PROG_CXX,
131 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
132 AC_MSG_CHECKING([for a working C++ compiler])
133 LYX_SEARCH_PROG(CXX, $CCC g++ gcc c++ CC cxx xlC cc++, LYX_PROG_CXX_WORKS)
135 if test -z "$CXX" ; then
136 AC_ERROR([Unable to find a working C++ compiler])
142 AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler])
143 AC_MSG_RESULT($cross_compiling)
147 dnl We might want to get or shut warnings.
148 AC_ARG_WITH(warnings,
149 [ --with-warnings tell the compiler to display more warnings],,
150 [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes && test $ac_cv_prog_gxx = yes ; then
155 if test x$with_warnings = xyes ; then
156 lyx_flags="$lyx_flags warnings"
157 AC_DEFINE(WITH_WARNINGS, 1,
158 [Define this if you want to see the warning directives put here and
159 there by the developpers to get attention])
162 # optimize less for development versions
163 if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
169 # set the debug flags correctly.
170 if test $ac_cv_prog_gxx = yes; then
172 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
173 dnl plays around with CXXFLAGS (such as to build both debugging and
174 dnl normal versions of a library), tasteless as that idea is.
175 ac_test_CXXFLAGS="${CXXFLAGS+set}"
176 ac_save_CXXFLAGS="$CXXFLAGS"
178 dnl Check the version of g++
179 gxx_version=`${CXX} --version`
182 if test "$ac_test_CXXFLAGS" = set; then
183 CXXFLAGS="$ac_save_CXXFLAGS"
184 elif test $ac_cv_prog_cxx_g = yes; then
186 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti -fno-exceptions";;
187 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
188 2.96*) CXXFLAGS="-g $lyx_opt -fhonor-std";;
189 *2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
190 *) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
195 if test x$with_warnings = xyes ; then
197 2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";;
198 2.96*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";;
199 *) CXXFLAGS="$CXXFLAGS -ansi -W -Wall -Wno-return-type";;
201 if test $lyx_devel_version = yes ; then
206 *) CXXFLAGS="$CXXFLAGS -pedantic";;
212 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
217 dnl Usage: LYX_CXX_RTTI : checks whether the C++ compiler
219 AC_DEFUN(LYX_CXX_RTTI,[
220 ### Check whether the compiler supports runtime type information
221 AC_CACHE_CHECK(whether the C++ compiler supports RTTI,lyx_cv_rtti,
225 virtual int tag() { return 0; }
227 class derived1 : public rtti {
229 int tag() { return 1; }
231 class derived2 : public rtti {
233 int tag() { return 2; }
236 derived1 * foo1 = new derived1();
237 derived2 * foo2 = new derived2();
239 derived1 * bar1 = dynamic_cast<derived1 *>(bar);
243 bar1 = dynamic_cast<derived1 *>(bar);
248 ],lyx_cv_rtti=yes,lyx_cv_rtti=no,lyx_cv_rtti=no)
250 if test x$lyx_cv_rtti = xyes ; then
251 AC_DEFINE(HAVE_RTTI, 1,
252 [Define to 1 if your compiler supports runtime type information])
256 dnl Usage: LYX_CXX_EXPLICIT : checks whether the C++ compiler
257 dnl understands the "explicit" directive.
258 AC_DEFUN(LYX_CXX_EXPLICIT,[
259 ### Check whether the compiler understands the keyword `explicit'
260 AC_CACHE_CHECK(whether the C++ compiler understands explicit,lyx_cv_explicit,
265 };],,lyx_cv_explicit=yes,lyx_cv_explicit=no)
267 if test $lyx_cv_explicit = no ; then
268 AC_DEFINE(explicit,[ ],
269 [Define to nothing if your compiler does not understand the
270 'explicit' directive])
274 dnl Usage: LYX_CXX_STL_STACK : checks whether the C++ compiler
275 dnl has a working stl stack template
276 AC_DEFUN(LYX_CXX_STL_STACK,[
277 AC_CACHE_CHECK(for broken STL stack template,lyx_cv_broken_stack,
284 ],lyx_cv_broken_stack=no,lyx_cv_broken_stack=yes)
286 if test $lyx_cv_broken_stack = yes ; then
287 AC_DEFINE(BROKEN_STL_STACK, 1,
288 [Define if you have the STL from libg++ 2.7.x, where stack<> is not defined
293 dnl Usage: LYX_STD_COUNT : checks wherer the C++ library have a conforming
294 dnl count template, if not the old HP version is assumed.
295 AC_DEFUN(LYX_STD_COUNT,[
296 AC_CACHE_CHECK(for conforming std::count,lyx_cv_std_count,
302 int countChar(string const & a, char const c)
304 return count(a.begin(), a.end(), c);
308 int i = countChar(a, 'l');
309 ],lyx_cv_std_count=yes,lyx_cv_std_count=no)
311 if test $lyx_cv_std_count = yes ; then
312 AC_DEFINE(HAVE_STD_COUNT, 1,
313 [Define if you have a conforming std::count template, otherwise HP version of count template is assumed.])
317 dnl Usage: LYX_CXX_STL_MODERN_STREAMS : checks whether the C++ compiler
318 dnl supports modern STL streams
319 AC_DEFUN(LYX_CXX_STL_MODERN_STREAMS,[
320 AC_CACHE_CHECK(for modern STL streams,lyx_cv_modern_streams,
324 std::streambuf * test = std::cerr.rdbuf();
326 ],lyx_cv_modern_streams=yes,lyx_cv_modern_streams=no)
328 if test $lyx_cv_modern_streams = yes ; then
329 AC_DEFINE(MODERN_STL_STREAMS, 1,
330 [Define if you have modern standard-compliant STL streams])
334 dnl Usage: LYX_CXX_STL_STRING : checks whether the C++ compiler
335 dnl has a working stl string container, the check is really stupid
336 dnl and could need some improvement.
337 AC_DEFUN(LYX_CXX_STL_STRING,[
338 AC_REQUIRE([LYX_PROG_CXX])
339 AC_MSG_CHECKING(whether the included std::string should be used)
340 AC_ARG_WITH(included-string,
341 [ --with-included-string use LyX string class instead of STL string],
342 [with_included_string=$withval],
347 string a("hello there");
351 int t = a.compare(a.length() - 1, 1, s);
354 with_included_string=no
356 with_included_string=yes
360 if test x$with_included_string = xyes ; then
361 AC_DEFINE(USE_INCLUDED_STRING, 1,
362 [Define to use the lyxstring class bundled with LyX.])
363 lyx_flags="$lyx_flags included-string"
365 AM_CONDITIONAL(USE_LYXSTRING, test x$with_included_string = xyes)
366 AC_MSG_RESULT([$with_included_string])
370 dnl Usage: LYX_REGEX : checks if the header regex.h is available
371 dnl if it is not available the automake variable USE_REGEX will be
372 dnl defined and the regex.h and regex.c that we provide will be used.
374 AC_CHECK_HEADERS(regex.h, lyx_regex=no, lyx_regex=yes)
375 AM_CONDITIONAL(USE_REGEX, test x$lyx_regex = xyes)
380 AC_DEFUN(LYX_CXX_MUTABLE, [
381 AC_REQUIRE([LYX_PROG_CXX])
382 AC_MSG_CHECKING(if C++ compiler supports mutable)
388 void foo() const { c=0; }
393 AC_DEFINE(HAVE_MUTABLE, 1,
394 [Defined if you compiler supports 'mutable'.])
398 AC_MSG_RESULT([$ac_mutable])
403 AC_DEFUN(LYX_CXX_PARTIAL, [
404 AC_REQUIRE([LYX_PROG_CXX])
405 AC_MSG_CHECKING(if C++ compiler supports partial specialization)
408 template<class T, class K>
412 template<class T> class k<void,T> { };
417 ac_partial_specialization=yes
418 AC_DEFINE(HAVE_PARTIAL_SPECIALIZATION, 1,
419 [Defined if your compiler supports partial specialization.])
421 ac_partial_specialization=no
423 AC_MSG_RESULT([$ac_partial_specialization])
427 dnl Usage: LYX_CXX_NAMESPACES : checks whether the C++ compiler
428 dnl has a correct namespace handling and define CXX_WORKING_NAMESPACES
429 dnl if true. This macro does not do a thourough test, but it should be
430 dnl good enough to suit our needs.
431 AC_DEFUN(LYX_CXX_NAMESPACES,[
432 AC_CACHE_CHECK(for correct namespaces support,lyx_cv_cxx_namespace,
440 ],lyx_cv_cxx_namespace=yes,lyx_cv_cxx_namespace=no)
442 if test $lyx_cv_cxx_namespace = yes ; then
443 AC_DEFINE(CXX_WORKING_NAMESPACES, 1,
444 [Define if your C++ compiler has correct support for namespaces])
448 dnl Usage: LYX_CXX_CHEADERS : checks whether the C++ compiler
449 dnl provides wrappers for C headers and use our alternate version otherwise.
450 AC_DEFUN(LYX_CXX_CHEADERS,[
451 AC_CACHE_CHECK(for C headers wrappers,lyx_cv_cxx_cheaders,
461 #include <ctime>],[lyx_cv_cxx_cheaders=yes],[lyx_cv_cxx_cheaders=no])])
462 if test $lyx_cv_cxx_cheaders = no ; then
463 LYX_ADD_INC_DIR(lyx_cppflags,\$(top_srcdir)/src/cheaders)
467 dnl Usage LYX_PATH_XPM: Checks for xpm library and header
468 AC_DEFUN(LYX_PATH_XPM,[
469 ### Check for Xpm library
470 AC_CHECK_LIB(Xpm, XpmCreateBufferFromImage,LYX_LIBS="-lXpm $LYX_LIBS",
471 [LYX_LIB_ERROR(libXpm,Xpm)], $LYX_LIBS)
473 ### Check for Xpm headers
474 lyx_cv_xpm_h_location="<xpm.h>"
475 AC_CHECK_HEADER(X11/xpm.h,[
476 ac_cv_header_xpm_h=yes
477 lyx_cv_xpm_h_location="<X11/xpm.h>"],[
478 AC_CHECK_HEADER(xpm.h,[],[
479 LYX_LIB_ERROR(xpm.h,Xpm)])])
480 AC_DEFINE_UNQUOTED(XPM_H_LOCATION,$lyx_cv_xpm_h_location)
482 ### Test for the header version
483 if test $ac_cv_header_xpm_h = yes; then
484 AC_CACHE_CHECK([xpm header version],lyx_cv_xpmversion,
485 [ cat > conftest.$ac_ext <<EOF
486 #line __oline__ "configure"
487 #include "confdefs.h"
489 #include XPM_H_LOCATION
490 "%%%"lyx_cv_xpmv=XpmVersion;lyx_cv_xpmr=XpmRevision"%%%"
492 eval `(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
493 grep '^"%%%"' 2>/dev/null | \
494 sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'`
495 case "$lyx_cv_xpmr" in
497 [0-9]) lyxxpmr_alpha=`echo $lyx_cv_xpmr |tr 123456789 abcdefghi`
498 lyxxpmv_alpha=" (aka 3.$lyx_cv_xpmv$lyxxpmr_alpha)";;
502 lyx_cv_xpmversion="$lyx_cv_xpmv.$lyx_cv_xpmr$lyxxpmv_alpha"
504 case "$lyx_cv_xpmr" in
506 [789]|[0-9][0-9]*) ;;
508 *) LYX_WARNING([Version $lyx_cv_xpmversion of the Xpm library is a bit old.
509 If you experience strange crashes with LyX, try to upgrade
510 to at least version 4.7 (aka 3.4g).
511 If you have installed a newer version of the library, check whether you
512 have an old xpm.h header file in your include path.]);;
517 dnl Usage LYX_PATH_XFORMS: Checks for xforms library and flags
518 AC_DEFUN(LYX_PATH_XFORMS,[
519 ### Check for xforms library
520 AC_CHECK_LIB(forms, fl_initialize, LYX_LIBS="-lforms $LYX_LIBS",
521 [AC_CHECK_LIB(xforms, fl_initialize, LYX_LIBS="-lxforms $LYX_LIBS",
522 [LYX_LIB_ERROR(libforms or libxforms,xforms)], $LYX_LIBS)], $LYX_LIBS)
524 ### Check for xforms headers
525 lyx_cv_forms_h_location="<forms.h>"
526 AC_CHECK_HEADER(X11/forms.h,[
527 ac_cv_header_forms_h=yes
528 lyx_cv_forms_h_location="<X11/forms.h>"],[
529 AC_CHECK_HEADER(forms.h,[],[
530 LYX_LIB_ERROR(forms.h,forms)])])
531 AC_DEFINE_UNQUOTED(FORMS_H_LOCATION,$lyx_cv_forms_h_location)
532 if test $ac_cv_header_forms_h = yes; then
533 AC_CACHE_CHECK([xforms header version],lyx_cv_xfversion,
534 [ cat > conftest.$ac_ext <<EOF
535 #line __oline__ "configure"
536 #include "confdefs.h"
538 #include FORMS_H_LOCATION
539 #if ! defined(FL_INCLUDE_VERSION)
542 "%%%"FL_VERSION.FL_REVISION"%%%"
545 lyx_cv_xfversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
546 grep '^"%%%"' 2>/dev/null | \
547 sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'`
549 case "$lyx_cv_xfversion" in
550 "(unknown)"|0.8[1-7])
552 Version $lyx_cv_xfversion of xforms is not compatible with LyX.
553 This version of LyX works best with versions 0.88 (recommended) and later.) ;;
555 0.89) LYX_WARNING(dnl
556 LyX should work ok with version $lyx_cv_xfversion of xforms[,] but
557 it is an unproven version and might still have some bugs. If you
558 have problems[,] please use version 0.88 instead.) ;;
560 Version $lyx_cv_xfversion of xforms might not be compatible with LyX[,]
561 since it is newer than 0.88. You might have slight problems with it.);;
566 dnl Usage: LYX_HPUX Checks for HP-UX and update CXXFLAGS accordingly
568 [#It seems that HPUX requires using -fpcc-struct-return with gcc.
569 AC_CACHE_CHECK(for HP-UX,ac_cv_hpux,[
570 os=`uname -s | tr '[A-Z]' '[a-z]'`
572 test "$os" = hp-ux && ac_cv_hpux=yes])
573 if test "$ac_cv_hpux" = yes; then
574 test "x$GXX" = xyes && CXXFLAGS="$CXXFLAGS -fpcc-struct-return"
578 dnl Usage: LYX_SUNOS4 Checks for SunOS 4.x and sets the flag lyx_broken_headers
581 [#The headers are not correct under SunOS4
582 AC_CACHE_CHECK(for SunOS 4.x,ac_cv_sunos4,[
584 os=`uname -a | sed -e 's/^\([^ ]*\) [^ ]* \([0-9]\)\..*/\1\2/'`
585 changequote([, ]) dnl
587 test "$os" = SunOS4 && ac_cv_sunos4=yes])
588 if test "$ac_cv_sunos4" = yes; then
589 test "x$GXX" = xyes && lyx_broken_headers=yes
593 dnl Usage: LYX_SCO Checks for SCO and sets the flag lyx_broken_headers
596 [AC_CACHE_CHECK(for SCO 3.2v4,ac_cv_sco,[
598 if test `uname -s` != "SCO_SV"; then
599 lyx_machine_rel=`uname -m`:`uname -r`
600 if test $lyx_machine_rel = i386:3.2 || test $lyx_machine_rel = i486:3.2;
602 if test -f /usr/options/cb.name; then
604 elif /bin/uname -X 2>/dev/null >/dev/null ; then
609 if test "$ac_cv_sco" = yes; then
610 test "x$GXX" = xyes && lyx_broken_headers=yes
613 dnl Usage: LYX_FUNC_PUTENV_ARGTYPE
614 dnl Checks whether putenv() takes 'char const *' or 'char *' as
615 dnl argument. This is needed because Solaris 7 (wrongly?) uses 'char *',
616 dnl while everybody else uses the former...
617 AC_DEFUN(LYX_FUNC_PUTENV_ARGTYPE,
618 [AC_MSG_CHECKING([type of argument for putenv()])
619 AC_CACHE_VAL(lyx_cv_func_putenv_arg,dnl
621 [#include <cstdlib>],
622 [char const * foo = "bar";
624 [lyx_cv_func_putenv_arg='char const *'],[lyx_cv_func_putenv_arg='char *'])])
625 AC_MSG_RESULT($lyx_cv_func_putenv_arg)
626 AC_DEFINE_UNQUOTED(PUTENV_TYPE_ARG,$lyx_cv_func_putenv_arg,dnl
627 [Define to the type of the argument of putenv(). Needed on Solaris 7.])])
630 dnl Usage: LYX_WITH_DIR(dir-name,desc,dir-var-name,default-value,
631 dnl [default-yes-value])
632 dnl Adds a --with-'dir-name' option (described by 'desc') and puts the
633 dnl resulting directory name in 'dir-var-name'.
634 AC_DEFUN(LYX_WITH_DIR,[
635 AC_ARG_WITH($1,[ --with-$1 specify $2])
636 AC_MSG_CHECKING([for $2])
637 if test -z "$with_$3"; then
638 AC_CACHE_VAL(lyx_cv_$3, lyx_cv_$3=$4)
640 test "x$with_$3" = xyes && with_$3=$5
643 AC_MSG_RESULT($lyx_cv_$3)])
646 dnl Usage: LYX_LOOP_DIR(value,action)
647 dnl Executes action for values of variable `dir' in `values'. `values' can
648 dnl use ":" as a separator.
649 AC_DEFUN(LYX_LOOP_DIR,[
650 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
651 for dir in `eval "echo $1"`; do
652 if test ! "$dir" = NONE; then
653 test ! -d "$dir" && AC_ERROR([\"$dir\" is not a directory])
661 dnl Usage: LYX_ADD_LIB_DIR(var-name,dir) Adds a -L directive to variable
663 AC_DEFUN(LYX_ADD_LIB_DIR,[
665 if test "`(uname) 2>/dev/null`" = SunOS &&
666 uname -r | grep '^5' >/dev/null; then
667 if test $ac_cv_prog_gxx = yes ; then
668 $1="${$1} -Wl[,]-R$2"
675 dnl Usage: LYX_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable
677 AC_DEFUN(LYX_ADD_INC_DIR,[$1="${$1} -I$2 "])
679 ### Check which libsigc++ we're using and make sure any external one works
680 ### Check for libsigc++ library
681 AC_DEFUN(LYX_WITH_SIGC,
682 [AC_MSG_CHECKING(whether the included libsigc++ should be used)
683 AC_ARG_WITH([included-libsigc],
684 [ --without-included-libsigc
685 Use the libsigc++ installed on the system],
686 [lyx_use_included_libsigc=$withval],
687 [lyx_use_included_libsigc=yes])
688 AC_MSG_RESULT([$lyx_use_included_libsigc])
689 if test x$lyx_use_included_libsigc = xno; then
690 ### Check for libsigc++
691 ## can't use AC_SUBST right here!
696 [Cannot find libsigc++ library or headers at least as recent as 0.8.7.
697 Check your installation. Have you installed the development package?])
700 ### Use the included libsigc++
701 ### sigc-config hasn't been created yet so we can't just do the same as above
702 ### unless of course someone gets keen and merges the sigc++ configure.in
703 ### with this one. We don't really gain much by doing that though except
704 ### a considerably smaller dist and more difficult maintenance.
705 ### It'd also mean we'd have the equivalent of config/gettext.m4
706 lyx_flags="$lyx_flags included-libsigc"
707 SIGC_LIBS="\`\${top_builddir}/sigc++/sigc-config --libs-names | sed -e 's/-lsigc//'\`"
708 # Libsigc++ always installs into a subdirectory called sigc++. Therefore we
709 # have to always use #include <sigc++/signal_system.h> in our code.
710 # Remember if you decide to do anything to the sigc++ code to do your mods on
711 # the makeLyXsigc.sh script in development/tools using a current cvs checkout
712 # of libsigc++. A tarball distribution doesn't have everything in it that we
714 # We need both these -I entries to build when builddir != srcdir
715 if test "x$src_dir" = "x." ; then
716 SIGC_CFLAGS="-I\${top_srcdir}"
718 SIGC_CFLAGS="-I\${top_builddir} -I\${top_srcdir}"
720 INCLUDED_SIGC="\${top_builddir}/sigc++/libsigc.la"
721 ## can't substitute these here like this otherwise all remaining tests fail
722 ## instead we SUBST directly into the Makefiles
723 ##LIBS="$LIBS \$SIGC_LIBS"
724 ##CPPFLAGS="$CPPFLAGS \$SIGC_CFLAGS"
726 AC_SUBST(SIGC_CFLAGS)
728 AC_SUBST(INCLUDED_SIGC)
731 ### Check for a headers existence and location iff it exists
732 ## This is supposed to be a generalised version of LYX_STL_STRING_FWD
733 ## It almost works. I've tried a few variations but they give errors
734 ## of one sort or other: bad substitution or file not found etc. The
735 ## actual header _is_ found though and the cache variable is set however
736 ## the reported setting (on screen) is equal to $ac_safe for some unknown
738 AC_DEFUN(LYX_PATH_HEADER,
739 [ AC_CHECK_HEADER($1,[
740 ac_tr_safe=PATH_`echo $ac_safe | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
741 AC_CACHE_CHECK([path to $1],lyx_cv_path_$ac_safe,
742 [ cat > conftest.$ac_ext <<EOF
743 #line __oline__ "configure"
744 #include "confdefs.h"
748 lyx_cv_path_$ac_safe=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
749 grep $1 2>/dev/null | \
750 sed -e 's/.*\(".*$1"\).*/\1/' -e "1q"`
752 AC_DEFINE_UNQUOTED(${ac_tr_safe},${lyx_cv_path_$ac_safe})])
754 ### end of LYX_PATH_HEADER
756 ### Check for stl_string_fwd.h existence and location if it exists
757 AC_DEFUN(LYX_STL_STRING_FWD,
758 [ AC_CHECK_HEADER(stl_string_fwd.h,[
759 AC_CACHE_CHECK([path to stl_string_fwd.h],lyx_cv_path_stl_string_fwd_h,
760 [ cat > conftest.$ac_ext <<EOF
761 #line __oline__ "configure"
762 #include "confdefs.h"
764 #include <stl_string_fwd.h>
766 lyx_cv_path_stl_string_fwd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
767 grep 'stl_string_fwd.h' 2>/dev/null | \
768 sed -e 's/.*\(".*stl_string_fwd.h"\).*/\1/' -e "1q"`
770 AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h,
771 [define this to the location of stl_string_fwd.h to be used with #include,
772 NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
773 supplied version of the header.
774 e.g. <../include/stl_string_fwd.h> or better yet use an absolute path])])
778 dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
779 dnl if the cache file is inconsistent with the current host,
780 dnl target and build system types, execute CMD or print a default
782 AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
783 AC_REQUIRE([AC_CANONICAL_SYSTEM])
784 AC_MSG_CHECKING([config.cache system type])
785 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
786 test x"$ac_cv_host_system_type" != x"$host"; } ||
787 { test x"${ac_cv_build_system_type+set}" = x"set" &&
788 test x"$ac_cv_build_system_type" != x"$build"; } ||
789 { test x"${ac_cv_target_system_type+set}" = x"set" &&
790 test x"$ac_cv_target_system_type" != x"$target"; }; then
791 AC_MSG_RESULT([different])
793 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
795 AC_MSG_RESULT([same])
797 ac_cv_host_system_type="$host"
798 ac_cv_build_system_type="$build"
799 ac_cv_target_system_type="$target"
802 dnl We use this until autoconf fixes its version.
803 AC_DEFUN(LYX_FUNC_SELECT_ARGTYPES,
804 [AC_MSG_CHECKING([types of arguments for select()])
805 AC_CACHE_VAL(ac_cv_func_select_arg234,dnl
806 [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl
807 [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl
808 [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
809 for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
811 [#ifdef HAVE_SYS_TYPES_H
812 #include <sys/types.h>
814 #ifdef HAVE_SYS_TIME_H
815 #include <sys/time.h>
817 #ifdef HAVE_SYS_SELECT_H
818 #include <sys/select.h>
820 #ifdef HAVE_SYS_SOCKET_H
821 #include <sys/socket.h>
823 extern int select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl
824 [ac_not_found=no ; break 3],ac_not_found=yes)
831 if test "$ac_not_found" = yes; then
832 ac_cv_func_select_arg1=int
833 ac_cv_func_select_arg234='int *'
834 ac_cv_func_select_arg5='struct timeval *'
836 AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
837 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1)
838 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234))
839 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5))
842 ### Check which frontend we want to use. The default is XForms
844 AC_DEFUN(LYX_USE_FRONTEND,
845 [AC_MSG_CHECKING(what frontend should be used as main GUI)
846 AC_ARG_WITH(frontend,
847 [ --with-frontend[=value] Use THIS frontend as main GUI:
848 Possible values: xforms,kde],
849 [lyx_use_frontend="$withval"], [lyx_use_frontend="xforms"])
850 AC_MSG_RESULT($lyx_use_frontend)
851 lyx_flags="$lyx_flags frontend-$lyx_use_frontend"
853 AC_SUBST(FRONTEND_GUILIB)
854 AC_SUBST(FRONTEND_LDFLAGS)
855 AC_SUBST(FRONTEND_INCLUDES)
856 AC_SUBST(FRONTEND_LIBS)
858 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
859 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
860 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
862 ## This program is free software; you can redistribute it and/or modify
863 ## it under the terms of the GNU General Public License as published by
864 ## the Free Software Foundation; either version 2 of the License, or
865 ## (at your option) any later version.
867 ## This program is distributed in the hope that it will be useful, but
868 ## WITHOUT ANY WARRANTY; without even the implied warranty of
869 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
870 ## General Public License for more details.
872 ## You should have received a copy of the GNU General Public License
873 ## along with this program; if not, write to the Free Software
874 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
876 ## As a special exception to the GNU General Public License, if you
877 ## distribute this file as part of a program that contains a
878 ## configuration script generated by Autoconf, you may include it under
879 ## the same distribution terms that you use for the rest of that program.
881 # serial 40 AC_PROG_LIBTOOL
882 AC_DEFUN(AC_PROG_LIBTOOL,
883 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
885 # Save cache, so that ltconfig can load it
888 # Actually configure libtool. ac_aux_dir is where install-sh is found.
889 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
890 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
891 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
892 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
893 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
894 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
895 || AC_MSG_ERROR([libtool configure failed])
897 # Reload cache, that may have been modified by ltconfig
900 # This can be used to rebuild libtool when needed
901 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
903 # Always use our own libtool.
904 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
907 # Redirect the config.log output again, so that the ltconfig log is not
908 # clobbered by the next message.
912 AC_DEFUN(AC_LIBTOOL_SETUP,
914 AC_REQUIRE([AC_ENABLE_SHARED])dnl
915 AC_REQUIRE([AC_ENABLE_STATIC])dnl
916 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
917 AC_REQUIRE([AC_CANONICAL_HOST])dnl
918 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
919 AC_REQUIRE([AC_PROG_RANLIB])dnl
920 AC_REQUIRE([AC_PROG_CC])dnl
921 AC_REQUIRE([AC_PROG_LD])dnl
922 AC_REQUIRE([AC_PROG_NM])dnl
923 AC_REQUIRE([AC_PROG_LN_S])dnl
927 NONE) lt_target="$host" ;;
928 *) lt_target="$target" ;;
931 # Check for any special flags to pass to ltconfig.
932 libtool_flags="--cache-file=$cache_file"
933 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
934 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
935 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
936 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
937 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
938 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
939 [libtool_flags="$libtool_flags --enable-dlopen"])
940 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
941 [libtool_flags="$libtool_flags --enable-win32-dll"])
942 AC_ARG_ENABLE(libtool-lock,
943 [ --disable-libtool-lock avoid locking (might break parallel builds)])
944 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
945 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
947 # Some flags need to be propagated to the compiler or linker for good
951 # Find out which ABI we are using.
952 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
953 if AC_TRY_EVAL(ac_compile); then
954 case "`/usr/bin/file conftest.o`" in
970 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
971 SAVE_CFLAGS="$CFLAGS"
972 CFLAGS="$CFLAGS -belf"
973 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
974 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
975 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
976 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
977 CFLAGS="$SAVE_CFLAGS"
981 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
982 [*-*-cygwin* | *-*-mingw*)
983 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
984 AC_CHECK_TOOL(AS, as, false)
985 AC_CHECK_TOOL(OBJDUMP, objdump, false)
991 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
992 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
994 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
995 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
997 # AC_ENABLE_SHARED - implement the --enable-shared flag
998 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
999 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1001 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1002 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1003 AC_ARG_ENABLE(shared,
1004 changequote(<<, >>)dnl
1005 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1006 changequote([, ])dnl
1007 [p=${PACKAGE-default}
1008 case "$enableval" in
1009 yes) enable_shared=yes ;;
1010 no) enable_shared=no ;;
1013 # Look at the argument we got. We use all the common list separators.
1014 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1015 for pkg in $enableval; do
1016 if test "X$pkg" = "X$p"; then
1023 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1026 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1027 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1028 AC_ENABLE_SHARED(no)])
1030 # AC_ENABLE_STATIC - implement the --enable-static flag
1031 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1032 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1034 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1035 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1036 AC_ARG_ENABLE(static,
1037 changequote(<<, >>)dnl
1038 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1039 changequote([, ])dnl
1040 [p=${PACKAGE-default}
1041 case "$enableval" in
1042 yes) enable_static=yes ;;
1043 no) enable_static=no ;;
1046 # Look at the argument we got. We use all the common list separators.
1047 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1048 for pkg in $enableval; do
1049 if test "X$pkg" = "X$p"; then
1056 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1059 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1060 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1061 AC_ENABLE_STATIC(no)])
1064 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1065 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1066 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1068 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1069 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1070 AC_ARG_ENABLE(fast-install,
1071 changequote(<<, >>)dnl
1072 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1073 changequote([, ])dnl
1074 [p=${PACKAGE-default}
1075 case "$enableval" in
1076 yes) enable_fast_install=yes ;;
1077 no) enable_fast_install=no ;;
1079 enable_fast_install=no
1080 # Look at the argument we got. We use all the common list separators.
1081 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1082 for pkg in $enableval; do
1083 if test "X$pkg" = "X$p"; then
1084 enable_fast_install=yes
1090 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1093 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1094 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1095 AC_ENABLE_FAST_INSTALL(no)])
1097 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1098 AC_DEFUN(AC_PROG_LD,
1099 [AC_ARG_WITH(gnu-ld,
1100 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1101 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1102 AC_REQUIRE([AC_PROG_CC])dnl
1103 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1104 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1106 if test "$ac_cv_prog_gcc" = yes; then
1107 # Check if gcc -print-prog-name=ld gives a path.
1108 AC_MSG_CHECKING([for ld used by GCC])
1109 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1111 # Accept absolute paths.
1113 [\\/]* | [A-Za-z]:[\\/]*)
1114 re_direlt='/[^/][^/]*/\.\./'
1116 # Canonicalize the path of ld
1117 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1118 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1119 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1121 test -z "$LD" && LD="$ac_prog"
1124 # If it fails, then pretend we aren't using GCC.
1128 # If it is relative, then search for the first ld in PATH.
1132 elif test "$with_gnu_ld" = yes; then
1133 AC_MSG_CHECKING([for GNU ld])
1135 AC_MSG_CHECKING([for non-GNU ld])
1137 AC_CACHE_VAL(ac_cv_path_LD,
1138 [if test -z "$LD"; then
1139 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1140 for ac_dir in $PATH; do
1141 test -z "$ac_dir" && ac_dir=.
1142 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1143 ac_cv_path_LD="$ac_dir/$ac_prog"
1144 # Check to see if the program is GNU ld. I'd rather use --version,
1145 # but apparently some GNU ld's only accept -v.
1146 # Break only if it was the GNU/non-GNU ld that we prefer.
1147 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1148 test "$with_gnu_ld" != no && break
1150 test "$with_gnu_ld" != yes && break
1156 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1159 if test -n "$LD"; then
1164 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1168 AC_DEFUN(AC_PROG_LD_GNU,
1169 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1170 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1171 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1172 ac_cv_prog_gnu_ld=yes
1174 ac_cv_prog_gnu_ld=no
1178 # AC_PROG_NM - find the path to a BSD-compatible name lister
1179 AC_DEFUN(AC_PROG_NM,
1180 [AC_MSG_CHECKING([for BSD-compatible nm])
1181 AC_CACHE_VAL(ac_cv_path_NM,
1182 [if test -n "$NM"; then
1183 # Let the user override the test.
1186 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1187 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1188 test -z "$ac_dir" && ac_dir=.
1189 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1190 # Check to see if the nm accepts a BSD-compat flag.
1191 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1192 # nm: unknown option "B" ignored
1193 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1194 ac_cv_path_NM="$ac_dir/nm -B"
1196 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1197 ac_cv_path_NM="$ac_dir/nm -p"
1200 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1201 continue # so that we can try to find one that supports BSD flags
1206 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1209 AC_MSG_RESULT([$NM])
1212 # AC_CHECK_LIBM - check for math library
1213 AC_DEFUN(AC_CHECK_LIBM,
1214 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1216 case "$lt_target" in
1217 *-*-beos* | *-*-cygwin*)
1218 # These system don't have libm
1221 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1222 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1225 AC_CHECK_LIB(m, main, LIBM="-lm")
1230 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1231 # the libltdl convenience library, adds --enable-ltdl-convenience to
1232 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1233 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1234 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1235 # '${top_builddir}/' (note the single quotes!) if your package is not
1236 # flat, and, if you're not using automake, define top_builddir as
1237 # appropriate in the Makefiles.
1238 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1239 case "$enable_ltdl_convenience" in
1240 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1241 "") enable_ltdl_convenience=yes
1242 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1244 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1245 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1248 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1249 # the libltdl installable library, and adds --enable-ltdl-install to
1250 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1251 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1252 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1253 # '${top_builddir}/' (note the single quotes!) if your package is not
1254 # flat, and, if you're not using automake, define top_builddir as
1255 # appropriate in the Makefiles.
1256 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1257 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1258 AC_CHECK_LIB(ltdl, main,
1259 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1260 [if test x"$enable_ltdl_install" = xno; then
1261 AC_MSG_WARN([libltdl not installed, but installation disabled])
1263 enable_ltdl_install=yes
1266 if test x"$enable_ltdl_install" = x"yes"; then
1267 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1268 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1269 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1271 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1278 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1279 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1280 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1281 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1282 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1283 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1284 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1286 dnl This is just to silence aclocal about the macro not being used
1287 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1288 # Macro to add for using GNU gettext.
1289 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1291 # This file can be copied and used freely without restrictions. It can
1292 # be used in projects which are not available under the GNU Public License
1293 # but which still want to provide support for the GNU gettext functionality.
1294 # Please note that the actual code is *not* freely available.
1298 AC_DEFUN(AM_WITH_NLS,
1299 [AC_MSG_CHECKING([whether NLS is requested])
1300 dnl Default is enabled NLS
1302 [ --disable-nls do not use Native Language Support],
1303 USE_NLS=$enableval, USE_NLS=yes)
1304 AC_MSG_RESULT($USE_NLS)
1307 USE_INCLUDED_LIBINTL=no
1309 dnl If we use NLS figure out what method
1310 if test "$USE_NLS" = "yes"; then
1311 AC_DEFINE(ENABLE_NLS)
1312 AC_MSG_CHECKING([whether included gettext is requested])
1313 AC_ARG_WITH(included-gettext,
1314 [ --with-included-gettext use the GNU gettext library included here],
1315 nls_cv_force_use_gnu_gettext=$withval,
1316 nls_cv_force_use_gnu_gettext=no)
1317 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1319 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1320 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1321 dnl User does not insist on using GNU NLS library. Figure out what
1322 dnl to use. If gettext or catgets are available (in this order) we
1323 dnl use this. Else we have to fall back to GNU NLS library.
1324 dnl catgets is only used if permitted by option --with-catgets.
1326 nls_cv_header_libgt=
1329 AC_CHECK_HEADER(libintl.h,
1330 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
1331 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
1332 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
1334 if test "$gt_cv_func_gettext_libc" != "yes"; then
1335 AC_CHECK_LIB(intl, bindtextdomain,
1336 [AC_CACHE_CHECK([for gettext in libintl],
1337 gt_cv_func_gettext_libintl,
1338 [AC_CHECK_LIB(intl, gettext,
1339 dnl ============== A fix is here! ======================
1340 dnl -lintl was not added to the LIBS variable in this case
1341 [gt_cv_func_gettext_libintl=yes
1344 gt_cv_func_gettext_libintl=no)],
1345 gt_cv_func_gettext_libintl=no)])
1348 if test "$gt_cv_func_gettext_libc" = "yes" \
1349 || test "$gt_cv_func_gettext_libintl" = "yes"; then
1350 AC_DEFINE(HAVE_GETTEXT)
1351 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1352 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1353 if test "$MSGFMT" != "no"; then
1354 AC_CHECK_FUNCS(dcgettext)
1355 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1356 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1357 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1358 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1359 return _nl_msg_cat_cntr],
1369 if test "$CATOBJEXT" = "NONE"; then
1370 AC_MSG_CHECKING([whether catgets can be used])
1371 AC_ARG_WITH(catgets,
1372 [ --with-catgets use catgets functions if available],
1373 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
1374 AC_MSG_RESULT($nls_cv_use_catgets)
1376 if test "$nls_cv_use_catgets" = "yes"; then
1377 dnl No gettext in C library. Try catgets next.
1378 AC_CHECK_LIB(i, main)
1379 AC_CHECK_FUNC(catgets,
1380 [AC_DEFINE(HAVE_CATGETS)
1381 INTLOBJS="\$(CATOBJS)"
1382 AC_PATH_PROG(GENCAT, gencat, no)dnl
1383 if test "$GENCAT" != "no"; then
1384 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
1385 if test "$GMSGFMT" = "no"; then
1386 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
1387 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
1389 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1390 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1391 USE_INCLUDED_LIBINTL=yes
1395 INTLDEPS='$(top_builddir)/intl/libintl.a'
1397 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1398 nls_cv_header_intl=intl/libintl.h
1399 nls_cv_header_libgt=intl/libgettext.h
1404 if test "$CATOBJEXT" = "NONE"; then
1405 dnl Neither gettext nor catgets in included in the C library.
1406 dnl Fall back on GNU gettext library.
1407 nls_cv_use_gnu_gettext=yes
1411 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1412 dnl Mark actions used to generate GNU NLS library.
1413 INTLOBJS="\$(GETTOBJS)"
1414 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1415 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
1416 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1417 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1418 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1420 USE_INCLUDED_LIBINTL=yes
1424 INTLDEPS='$(top_builddir)/intl/libintl.a'
1426 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1427 nls_cv_header_intl=intl/libintl.h
1428 nls_cv_header_libgt=intl/libgettext.h
1431 dnl Test whether we really found GNU xgettext.
1432 if test "$XGETTEXT" != ":"; then
1433 dnl If it is no GNU xgettext we define it as : so that the
1434 dnl Makefiles still can work.
1435 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1439 [found xgettext program is not GNU xgettext; ignore it])
1444 # We need to process the po/ directory.
1448 nls_cv_header_intl=intl/libintl.h
1449 nls_cv_header_libgt=intl/libgettext.h
1451 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
1453 [case "$CONFIG_FILES" in *po/Makefile.in*)
1454 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1458 # If this is used in GNU gettext we have to set USE_NLS to `yes'
1459 # because some of the sources are only built for this goal.
1460 if test "$PACKAGE" = gettext; then
1462 USE_INCLUDED_LIBINTL=yes
1465 dnl These rules are solely for the distribution goal. While doing this
1466 dnl we only have to keep exactly one list of the available catalogs
1467 dnl in configure.in.
1468 for lang in $ALL_LINGUAS; do
1469 GMOFILES="$GMOFILES $lang.gmo"
1470 POFILES="$POFILES $lang.po"
1473 dnl Make all variables we use known to autoconf.
1474 AC_SUBST(USE_INCLUDED_LIBINTL)
1477 AC_SUBST(DATADIRNAME)
1479 AC_SUBST(INSTOBJEXT)
1487 AC_DEFUN(AM_GNU_GETTEXT,
1488 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1489 AC_REQUIRE([AC_PROG_CC])dnl
1490 AC_REQUIRE([AC_PROG_RANLIB])dnl
1491 AC_REQUIRE([AC_ISC_POSIX])dnl
1492 AC_REQUIRE([AC_HEADER_STDC])dnl
1493 AC_REQUIRE([AC_C_CONST])dnl
1494 AC_REQUIRE([AC_C_INLINE])dnl
1495 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1496 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1497 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1498 AC_REQUIRE([AC_FUNC_MMAP])dnl
1500 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1501 unistd.h sys/param.h])
1502 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1503 strdup __argz_count __argz_stringify __argz_next])
1505 if test "${ac_cv_func_stpcpy+set}" != "set"; then
1506 AC_CHECK_FUNCS(stpcpy)
1508 if test "${ac_cv_func_stpcpy}" = "yes"; then
1509 AC_DEFINE(HAVE_STPCPY)
1515 if test "x$CATOBJEXT" != "x"; then
1516 if test "x$ALL_LINGUAS" = "x"; then
1519 AC_MSG_CHECKING(for catalogs to be installed)
1521 dnl ============== Fix is here! ======================
1522 dnl Some sh do not like substitution in bounds of for loops
1523 dnl for lang in ${LINGUAS=$ALL_LINGUAS}; do
1524 tmplinguas=${LINGUAS=$ALL_LINGUAS}
1525 for lang in ${tmplinguas}; do
1527 case "$ALL_LINGUAS" in
1528 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1531 LINGUAS=$NEW_LINGUAS
1532 AC_MSG_RESULT($LINGUAS)
1535 dnl Construct list of names of catalog files to be constructed.
1536 if test -n "$LINGUAS"; then
1537 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1541 dnl The reference to <locale.h> in the installed <libintl.h> file
1542 dnl must be resolved because we cannot expect the users of this
1543 dnl to define HAVE_LOCALE_H.
1544 if test $ac_cv_header_locale_h = yes; then
1545 INCLUDE_LOCALE_H="#include <locale.h>"
1548 /* The system does not provide the header <locale.h>. Take care yourself. */"
1550 AC_SUBST(INCLUDE_LOCALE_H)
1552 dnl Determine which catalog format we have (if any is needed)
1553 dnl For now we know about two different formats:
1554 dnl Linux libc-5 and the normal X/Open format
1555 test -d intl || mkdir intl
1556 if test "$CATOBJEXT" = ".cat"; then
1557 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1559 dnl Transform the SED scripts while copying because some dumb SEDs
1560 dnl cannot handle comments.
1561 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
1563 dnl po2tbl.sed is always needed.
1564 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1565 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
1567 dnl In the intl/Makefile.in we have a special dependency which makes
1568 dnl only sense for gettext. We comment this out for non-gettext
1570 if test "$PACKAGE" = "gettext"; then
1580 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1581 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1582 dnl Try to locate is.
1584 if test -n "$ac_aux_dir"; then
1585 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1587 if test -z "$MKINSTALLDIRS"; then
1588 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1590 AC_SUBST(MKINSTALLDIRS)
1592 dnl *** For now the libtool support in intl/Makefile is not for real.
1596 dnl Generate list of files to be processed by xgettext which will
1597 dnl be included in po/Makefile.
1598 test -d po || mkdir po
1599 if test "x$srcdir" != "x."; then
1600 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1601 posrcprefix="$srcdir/"
1603 posrcprefix="../$srcdir/"
1609 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1610 < $srcdir/po/POTFILES.in > po/POTFILES
1612 # Check whether LC_MESSAGES is available in <locale.h>.
1613 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1615 # This file can be copied and used freely without restrictions. It can
1616 # be used in projects which are not available under the GNU Public License
1617 # but which still want to provide support for the GNU gettext functionality.
1618 # Please note that the actual code is *not* freely available.
1622 AC_DEFUN(AM_LC_MESSAGES,
1623 [if test $ac_cv_header_locale_h = yes; then
1624 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1625 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1626 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1627 if test $am_cv_val_LC_MESSAGES = yes; then
1628 AC_DEFINE(HAVE_LC_MESSAGES)
1631 # Search path for a program which passes the given test.
1632 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1634 # This file can be copied and used freely without restrictions. It can
1635 # be used in projects which are not available under the GNU Public License
1636 # but which still want to provide support for the GNU gettext functionality.
1637 # Please note that the actual code is *not* freely available.
1641 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1642 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1643 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1644 [# Extract the first word of "$2", so it can be a program name with args.
1645 set dummy $2; ac_word=[$]2
1646 AC_MSG_CHECKING([for $ac_word])
1647 AC_CACHE_VAL(ac_cv_path_$1,
1650 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1653 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1654 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1655 test -z "$ac_dir" && ac_dir=.
1656 if test -f $ac_dir/$ac_word; then
1658 ac_cv_path_$1="$ac_dir/$ac_word"
1664 dnl If no 4th arg is given, leave the cache variable unset,
1665 dnl so AC_PATH_PROGS will keep looking.
1666 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1671 if test -n "[$]$1"; then
1672 AC_MSG_RESULT([$]$1)
1678 # Configure paths for Libsigc++
1679 # Based on Gtk-- script by Erik Andersen and Tero Pulkkinen
1681 dnl Test for Libsigc++, and define SIGC_CFLAGS and SIGC_LIBS
1682 dnl to be used as follows:
1683 dnl AM_PATH_SIGC(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1685 AC_DEFUN(AM_PATH_SIGC,
1687 dnl Get the cflags and libraries from the sigc-config script
1693 AC_ARG_WITH(sigc-prefix,
1694 [ --with-sigc-prefix=PREFIX
1695 Prefix where libsigc++ is installed (optional)]
1696 , sigc_config_prefix="$withval", sigc_config_prefix="")
1698 AC_ARG_WITH(sigc-exec-prefix,
1699 [ --with-sigc-exec-prefix=PREFIX
1700 Exec prefix where libsigc++ is installed (optional)]
1701 , sigc_config_exec_prefix="$withval", sigc_config_exec_prefix="")
1703 AC_ARG_ENABLE(sigctest,
1704 [ --disable-sigctest Do not try to compile and run a test libsigc++
1706 , enable_sigctest=yes)
1711 if test x$sigc_config_exec_prefix != x ; then
1712 sigc_config_args="$sigc_config_args --exec-prefix=$sigc_config_exec_prefix"
1713 if test x${SIGC_CONFIG+set} != xset ; then
1714 SIGC_CONFIG=$sigc_config_exec_prefix/bin/sigc-config
1717 if test x$sigc_config_prefix != x ; then
1718 sigc_config_args="$sigc_config_args --prefix=$sigc_config_prefix"
1719 if test x${SIGC_CONFIG+set} != xset ; then
1720 SIGC_CONFIG=$sigc_config_prefix/bin/sigc-config
1725 dnl See if sigc-config is alive
1727 AC_PATH_PROG(SIGC_CONFIG, sigc-config, no)
1733 AC_MSG_CHECKING(for libsigc++ - version >= $sigc_version_min)
1735 if test "$SIGC_CONFIG" = "no" ; then
1738 sigc_version=`$SIGC_CONFIG --version`
1740 SIGC_CFLAGS=`$SIGC_CONFIG $sigc_config_args --cflags`
1741 SIGC_LIBS=`$SIGC_CONFIG $sigc_config_args --libs`
1742 SIGC_MACROS=`$SIGC_CONFIG $sigc_config_args --libs`
1744 sigc_major_version=`echo $sigc_version | \
1745 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1746 sigc_minor_version=`echo $sigc_version | \
1747 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1748 sigc_micro_version=`echo $sigc_version | \
1749 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1751 sigc_major_min=`echo $sigc_version_min | \
1752 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1753 sigc_minor_min=`echo $sigc_version_min | \
1754 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1755 sigc_micro_min=`echo $sigc_version_min | \
1756 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1758 sigc_version_proper=`expr \
1759 $sigc_major_version \> $sigc_major_min \| \
1760 $sigc_major_version \= $sigc_major_min \& \
1761 $sigc_minor_version \> $sigc_minor_min \| \
1762 $sigc_major_version \= $sigc_major_min \& \
1763 $sigc_minor_version \= $sigc_minor_min \& \
1764 $sigc_micro_version \>= $sigc_micro_min `
1766 if test "$sigc_version_proper" = "1" ; then
1767 AC_MSG_RESULT([$sigc_major_version.$sigc_minor_version.$sigc_micro_version])
1773 if test "X$no_sigc" = "Xyes" ; then
1783 if test "x$enable_sigctest" = "xyes" ; then
1784 AC_MSG_CHECKING(if libsigc++ sane)
1785 ac_save_CXXFLAGS="$CXXFLAGS"
1786 ac_save_LIBS="$LIBS"
1787 CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS"
1788 LIBS="$LIBS $SIGC_LIBS"
1793 #include <sigc++/signal_system.h>
1795 #ifdef SIGC_CXX_NAMESPACES
1796 using namespace SigC;
1804 int main(int argc,char **argv)
1806 if (sigc_major_version!=$sigc_major_version ||
1807 sigc_minor_version!=$sigc_minor_version ||
1808 sigc_micro_version!=$sigc_micro_version)
1809 { printf("(%d.%d.%d) ",
1810 sigc_major_version,sigc_minor_version,sigc_micro_version);
1813 Signal1<int,int> sig1;
1814 sig1.connect(slot(foo1));
1825 ,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1827 CXXFLAGS="$ac_save_CXXFLAGS"
1828 LIBS="$ac_save_LIBS"
1834 if test "x$no_sigc" = x ; then
1835 ifelse([$2], , :, [$2])
1840 ifelse([$3], , :, [$3])
1845 AC_SUBST(SIGC_CFLAGS)
1847 AC_SUBST(SIGC_MACROS)
1850 # Configure paths and libs when using KDE GUI
1851 ## -*- shell-script -*-
1853 ## This file is part of the KDE libraries/packages
1854 ## Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
1855 ## (C) 1997 Stephan Kulow (coolo@kde.org)
1857 ## This file is free software; you can redistribute it and/or
1858 ## modify it under the terms of the GNU Library General Public
1859 ## License as published by the Free Software Foundation; either
1860 ## version 2 of the License, or (at your option) any later version.
1862 ## This library is distributed in the hope that it will be useful,
1863 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
1864 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1865 ## Library General Public License for more details.
1867 ## You should have received a copy of the GNU Library General Public License
1868 ## along with this library; see the file COPYING.LIB. If not, write to
1869 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1870 ## Boston, MA 02111-1307, USA.
1873 ## Please do not modify this file unless you expect your modifications to be
1874 ## carried into every other module in the repository. If you decide that you
1875 ## really want to modify it, contact coolo@kde.org mentioning that you have
1876 ## and that the modified file should be committed to every module.
1878 ## Single-module modifications are best placed in configure.in for kdelibs
1879 ## and kdebase or configure.in.1 if present.
1882 ## ------------------------------------------------------------------------
1883 ## Find a file (or one of more files in a list of dirs)
1884 ## ------------------------------------------------------------------------
1886 AC_DEFUN(AC_FIND_FILE,
1893 if test -r "$i/$j"; then
1901 AC_DEFUN(KDE_FIND_PATH,
1903 AC_MSG_CHECKING([for $1])
1904 AC_CACHE_VAL(kde_cv_path_$1,
1906 kde_cv_path_$1="NONE"
1907 if test -n "$$2"; then
1908 kde_cv_path_$1="$$2";
1913 for dir in $PATH; do
1918 for dir in $dirs; do
1919 if test -x "$dir/$1"; then
1922 evalstr="$dir/$1 $5 2>&1 "
1923 if eval $evalstr; then
1924 kde_cv_path_$1="$dir/$1"
1928 kde_cv_path_$1="$dir/$1"
1938 if test -z "$kde_cv_path_$1" || test "$kde_cv_path_$1" = "NONE"; then
1939 AC_MSG_RESULT(not found)
1942 AC_MSG_RESULT($kde_cv_path_$1)
1946 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
1948 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
1949 Please check whether you installed Qt correctly.
1950 You need to have a running moc binary.
1951 configure tried to run $ac_cv_path_moc and the test didn't
1952 succeed. If configure shouldn't have tried this one, set
1953 the environment variable MOC to the right one before running
1958 dnl ------------------------------------------------------------------------
1959 dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and some
1960 dnl more usual places
1961 dnl ------------------------------------------------------------------------
1963 AC_DEFUN(AC_PATH_QT_MOC,
1965 KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin \
1966 /usr/bin /usr/X11R6/bin /usr/lib/qt/bin \
1967 /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE])
1969 if test -z "$MOC"; then
1970 if test -n "$ac_cv_path_moc"; then
1971 output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"`
1973 echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC
1974 echo "configure:__oline__: moc output: $output" >&AC_FD_CC
1976 if test -z "$output"; then
1977 KDE_MOC_ERROR_MESSAGE
1984 AC_DEFUN(KDE_REPLACE_ROOT,
1985 $1=`echo "$$1" | sed -e "s#^/#\$\{install_root\}/#"`
1988 AC_DEFUN(AC_CREATE_KFSSTND,
1990 AC_REQUIRE([AC_CHECK_RPATH])
1992 if test "$1" = "default"; then
1994 AC_MSG_CHECKING(for KDE paths)
1996 if test -z "$kde_htmldir"; then
1997 kde_htmldir="\$(prefix)/share/doc/HTML"
1999 if test -z "$kde_appsdir"; then
2000 kde_appsdir="\$(prefix)/share/applnk"
2002 if test -z "$kde_icondir"; then
2003 kde_icondir="\$(prefix)/share/icons"
2005 if test -z "$kde_sounddir"; then
2006 kde_sounddir="\$(prefix)/share/sounds"
2008 if test -z "$kde_datadir"; then
2009 kde_datadir="\$(prefix)/share/apps"
2011 if test -z "$kde_locale"; then
2012 kde_locale="\$(prefix)/share/locale"
2014 if test -z "$kde_cgidir"; then
2015 kde_cgidir="\$(exec_prefix)/cgi-bin"
2017 if test -z "$kde_confdir"; then
2018 kde_confdir="\$(prefix)/share/config"
2020 if test -z "$kde_mimedir"; then
2021 kde_mimedir="\$(prefix)/share/mimelnk"
2023 if test -z "$kde_toolbardir"; then
2024 kde_toolbardir="\$(prefix)/share/toolbar"
2026 if test -z "$kde_wallpaperdir"; then
2027 kde_wallpaperdir="\$(prefix)/share/wallpapers"
2029 if test -z "$kde_bindir"; then
2030 kde_bindir="\$(exec_prefix)/bin"
2032 if test -z "$kde_partsdir"; then
2033 kde_partsdir="\$(exec_prefix)/parts"
2035 AC_MSG_RESULT(defaults)
2039 AC_CACHE_VAL(kde_cv_all_paths,
2041 AC_MSG_CHECKING([for kde headers installed])
2043 cat > conftest.$ac_ext <<EOF
2045 #include "confdefs.h"
2049 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
2050 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
2051 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
2052 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
2053 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
2054 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
2055 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
2056 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
2057 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
2058 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
2059 printf("kde_wallpaperdir=\\"%s\\"\n", KApplication::kde_wallpaperdir().data());
2060 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
2061 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
2066 if test -n "$kde_libraries"; then
2067 KDE_TEST_RPATH="-rpath $kde_libraries"
2070 if test -n "$qt_libraries"; then
2071 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
2074 if test -n "$x_libraries"; then
2075 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
2078 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
2080 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
2081 if AC_TRY_EVAL(ac_compile); then
2084 AC_MSG_ERROR([your system is not able to compile a small KDE application!
2085 Check, if you installed the KDE header files correctly.])
2088 AC_MSG_CHECKING([for kde libraries installed])
2089 ac_link='/bin/sh ./libtool --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore -lqt -lXext -lX11 $LIBSOCKET $KDE_TEST_RPATH 1>&5'
2091 if AC_TRY_EVAL(ac_link) && test -s conftest; then
2094 AC_MSG_ERROR([your system fails at linking a small KDE application!
2095 Check, if your compiler is installed correctly and if you have used the
2096 same compiler to compile Qt and kdelibs as you did use now])
2099 AC_MSG_CHECKING([for KDE paths])
2100 if eval `./conftest 2>&5`; then
2103 AC_MSG_RESULT(problems)
2106 ./conftest 2> /dev/null >&5 # make an echo for config.log
2107 kde_have_all_paths=yes
2110 if test "$kde_have_all_paths" = "yes"; then
2111 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
2112 kde_htmldir=\"$kde_htmldir\" \
2113 kde_appsdir=\"$kde_appsdir\" \
2114 kde_icondir=\"$kde_icondir\" \
2115 kde_sounddir=\"$kde_sounddir\" \
2116 kde_datadir=\"$kde_datadir\" \
2117 kde_locale=\"$kde_locale\" \
2118 kde_cgidir=\"$kde_cgidir\" \
2119 kde_confdir=\"$kde_confdir\" \
2120 kde_mimedir=\"$kde_mimedir\" \
2121 kde_toolbardir=\"$kde_toolbardir\" \
2122 kde_wallpaperdir=\"$kde_wallpaperdir\" \
2123 kde_bindir=\"$kde_bindir\" \
2124 kde_partsdir=\"$kde_partsdir\""
2130 eval "$kde_cv_all_paths"
2132 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
2133 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
2134 test -z "$kde_datadir" || test -z "$kde_locale" ||
2135 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
2136 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
2137 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
2138 test -z "$kde_partsdir" || test "$kde_have_all_paths" != "yes"; then
2139 kde_have_all_paths=no
2140 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
2141 Since it had compiled and linked before, it must be a strange problem on your system.
2142 Look at config.log for details. If you are not able to fix this, please contact Stephan Kulow <coolo@kde.org>.])
2145 if test -n "$install_root"; then
2146 KDE_REPLACE_ROOT(kde_htmldir)
2147 KDE_REPLACE_ROOT(kde_appsdir)
2148 KDE_REPLACE_ROOT(kde_icondir)
2149 KDE_REPLACE_ROOT(kde_sounddir)
2150 KDE_REPLACE_ROOT(kde_datadir)
2151 KDE_REPLACE_ROOT(kde_locale)
2152 KDE_REPLACE_ROOT(kde_cgidir)
2153 KDE_REPLACE_ROOT(kde_confdir)
2154 KDE_REPLACE_ROOT(kde_mimedir)
2155 KDE_REPLACE_ROOT(kde_toolbardir)
2156 KDE_REPLACE_ROOT(kde_wallpaperdir)
2157 KDE_REPLACE_ROOT(kde_bindir)
2158 KDE_REPLACE_ROOT(kde_partsdir)
2159 AC_SUBST(install_root)
2168 AC_DEFUN(AC_SUBST_KFSSTND,
2170 AC_SUBST(kde_htmldir)
2171 AC_SUBST(kde_appsdir)
2172 AC_SUBST(kde_icondir)
2173 AC_SUBST(kde_sounddir)
2174 kde_minidir="$kde_icondir/mini"
2175 AC_SUBST(kde_minidir)
2176 AC_SUBST(kde_datadir)
2177 AC_SUBST(kde_locale)
2178 AC_SUBST(kde_cgidir)
2179 AC_SUBST(kde_confdir)
2180 AC_SUBST(kde_mimedir)
2181 AC_SUBST(kde_toolbardir)
2182 AC_SUBST(kde_wallpaperdir)
2183 AC_SUBST(kde_bindir)
2184 AC_SUBST(kde_partsdir)
2187 AC_DEFUN(KDE_MISC_TESTS,
2190 dnl Checks for libraries.
2191 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
2193 AC_CHECK_LIB(crypt, main, [LIBCRYPT="-lcrypt"]) dnl for BSD
2195 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
2196 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2197 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
2198 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
2200 AC_CHECK_FUNC(gethostbyname)
2201 if test $ac_cv_func_gethostbyname = no; then
2202 AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
2204 AC_CHECK_FUNC(connect)
2205 if test $ac_cv_func_connect = no; then
2206 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
2210 AC_CHECK_FUNC(remove)
2211 if test $ac_cv_func_remove = no; then
2212 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
2215 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2216 AC_CHECK_FUNC(shmat)
2217 if test $ac_cv_func_shmat = no; then
2218 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
2221 LIBSOCKET=$X_EXTRA_LIBS
2223 AC_SUBST(X_EXTRA_LIBS)
2224 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
2227 case $host in dnl this *is* LynxOS specific
2229 AC_MSG_CHECKING([LynxOS header file wrappers])
2230 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
2231 AC_MSG_RESULT(disabled)
2232 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
2238 ## ------------------------------------------------------------------------
2239 ## Find the header files and libraries for X-Windows. Extended the
2241 ## ------------------------------------------------------------------------
2245 AC_MSG_CHECKING(for X)
2246 AC_CACHE_VAL(ac_cv_have_x,
2247 [# One or both of the vars are not set, and there is no cached value.
2248 ac_x_includes=NO ac_x_libraries=NO
2251 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2252 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
2254 # Record where we found X for the cache.
2255 ac_cv_have_x="have_x=yes \
2256 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2258 eval "$ac_cv_have_x"
2260 if test "$have_x" != yes; then
2261 AC_MSG_RESULT($have_x)
2264 # If each of the values was on the command line, it overrides each guess.
2265 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2266 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2267 # Update the cache value to reflect the command line values.
2268 ac_cv_have_x="have_x=yes \
2269 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2270 AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
2273 if test -z "$x_includes" || test "x$x_includes" = xNONE; then
2275 x_includes="."; dnl better than nothing :-
2277 X_INCLUDES="-I$x_includes"
2280 if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then
2282 x_libraries="/usr/lib"; dnl better than nothing :-
2284 X_LDFLAGS="-L$x_libraries"
2286 all_includes="$all_includes $X_INCLUDES"
2287 all_libraries="$all_libraries $X_LDFLAGS"
2289 AC_SUBST(X_INCLUDES)
2291 AC_SUBST(x_libraries)
2292 AC_SUBST(x_includes)
2295 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
2298 cat > conftest.$ac_ext <<EOF
2299 #include "confdefs.h"
2301 #include <qapplication.h>
2310 AC_DEFUN(KDE_CHECK_QT_DIRECT,
2312 AC_MSG_CHECKING([if Qt compiles without flags])
2313 AC_CACHE_VAL(kde_cv_qt_direct,
2315 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
2316 ac_LIBRARY_PATH="$LIBRARY_PATH"
2317 ac_cxxflags_safe="$CXXFLAGS"
2318 ac_ldflags_safe="$LDFLAGS"
2319 ac_libs_safe="$LIBS"
2321 CXXFLAGS="$CXXFLAGS -I$qt_includes"
2322 LDFLAGS="$X_LDFLAGS"
2323 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
2325 export LD_LIBRARY_PATH
2329 KDE_PRINT_QT_PROGRAM
2331 if AC_TRY_EVAL(ac_link) && test -s conftest; then
2332 kde_cv_qt_direct="yes"
2334 kde_cv_qt_direct="no"
2335 echo "configure: failed program was:" >&AC_FD_CC
2336 cat conftest.$ac_ext >&AC_FD_CC
2339 CXXFLAGS="$ac_cxxflags_safe"
2340 LDFLAGS="$ac_ldflags_safe"
2341 LIBS="$ac_libs_safe"
2343 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
2344 export LD_LIBRARY_PATH
2345 LIBRARY_PATH="$ac_LIBRARY_PATH"
2349 if test "$kde_cv_qt_direct" = "yes"; then
2358 ## ------------------------------------------------------------------------
2359 ## Try to find the Qt headers and libraries.
2360 ## $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
2361 ## and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
2362 ## ------------------------------------------------------------------------
2364 AC_DEFUN(AC_PATH_QT_1_3,
2366 AC_REQUIRE([K_PATH_X])
2368 AC_MSG_CHECKING([for Qt])
2369 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
2373 [ --with-qt-dir where the root of qt is installed ],
2374 [ ac_qt_includes="$withval"/include
2375 ac_qt_libraries="$withval"/lib
2376 ac_qt_bindir="$withval"/bin
2379 AC_ARG_WITH(qt-includes,
2380 [ --with-qt-includes where the Qt includes are. ],
2382 ac_qt_includes="$withval"
2385 kde_qt_libs_given=no
2387 AC_ARG_WITH(qt-libraries,
2388 [ --with-qt-libraries where the Qt library is installed.],
2389 [ ac_qt_libraries="$withval"
2390 kde_qt_libs_given=yes
2393 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
2395 AC_CACHE_VAL(ac_cv_have_qt,
2396 [#try to guess Qt locations
2398 qt_incdirs="$ac_qt_includes /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes $QTINC"
2399 test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs"
2400 AC_FIND_FILE(qmovie.h, $qt_incdirs, qt_incdir)
2401 ac_qt_includes="$qt_incdir"
2403 if test ! "$ac_qt_libraries" = "NO"; then
2404 qt_libdirs="$ac_qt_libraries"
2407 qt_libdirs="$qt_libdirs /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt $x_libraries $QTLIB"
2408 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
2412 for dir in $qt_libdirs; do
2413 try="ls -1 $dir/libqt*"
2414 if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
2417 dnl AC_FIND_FILE(libqt.so libqt.so.1.40 libqt.so.1.41 libqt.so.1 libqt.a libqt.sl, $qt_libdirs, qt_libdir)
2418 ac_qt_libraries="$qt_libdir"
2420 ac_cxxflags_safe="$CXXFLAGS"
2421 ac_ldflags_safe="$LDFLAGS"
2422 ac_libs_safe="$LIBS"
2424 CXXFLAGS="$CXXFLAGS -I$qt_incdir"
2425 LDFLAGS="-L$qt_libdir $X_LDFLAGS"
2426 LIBS="$LIBS -lqt -lXext -lX11 $LIBSOCKET"
2428 KDE_PRINT_QT_PROGRAM
2430 if AC_TRY_EVAL(ac_link) && test -s conftest; then
2433 echo "configure: failed program was:" >&AC_FD_CC
2434 cat conftest.$ac_ext >&AC_FD_CC
2435 ac_qt_libraries="NO"
2438 CXXFLAGS="$ac_cxxflags_safe"
2439 LDFLAGS="$ac_ldflags_safe"
2440 LIBS="$ac_libs_safe"
2442 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
2443 ac_cv_have_qt="have_qt=no"
2445 if test "$ac_qt_includes" = NO; then
2446 if test "$ac_qt_libraries" = NO; then
2447 ac_qt_notfound="(headers and libraries)";
2449 ac_qt_notfound="(headers)";
2452 ac_qt_notfound="(libraries)";
2455 AC_MSG_ERROR([Qt-1.4 $ac_qt_notfound not found. Please check your installation! ]);
2464 eval "$ac_cv_have_qt"
2466 if test "$have_qt" != yes; then
2467 AC_MSG_RESULT([$have_qt]);
2469 ac_cv_have_qt="have_qt=yes \
2470 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
2471 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
2473 qt_libraries="$ac_qt_libraries"
2474 qt_includes="$ac_qt_includes"
2477 if test ! "$kde_qt_libs_given" = "yes"; then
2478 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
2481 AC_SUBST(qt_libraries)
2482 AC_SUBST(qt_includes)
2484 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
2487 QT_INCLUDES="-I$qt_includes"
2488 all_includes="$QT_INCLUDES $all_includes"
2491 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
2494 QT_LDFLAGS="-L$qt_libraries"
2495 all_libraries="$QT_LDFLAGS $all_libraries"
2498 AC_SUBST(QT_INCLUDES)
2499 AC_SUBST(QT_LDFLAGS)
2503 AC_DEFUN(AC_PATH_QT,
2508 ## ------------------------------------------------------------------------
2509 ## Now, the same with KDE
2510 ## $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
2511 ## and $(kde_includes) will be the kdehdrlocation (if needed)
2512 ## ------------------------------------------------------------------------
2514 AC_DEFUN(AC_BASE_PATH_KDE,
2516 AC_REQUIRE([KDE_MISC_TESTS])
2517 AC_REQUIRE([AC_PATH_QT])dnl
2518 AC_MSG_CHECKING([for KDE])
2520 if test "${prefix}" != NONE; then
2521 kde_includes=${prefix}/include
2522 ac_kde_includes=$prefix/include
2524 if test "${exec_prefix}" != NONE; then
2525 kde_libraries=${exec_prefix}/lib
2526 ac_kde_libraries=$exec_prefix/lib
2528 kde_libraries=${prefix}/lib
2529 ac_kde_libraries=$prefix/lib
2538 AC_CACHE_VAL(ac_cv_have_kde,
2539 [#try to guess kde locations
2541 if test -z "$1"; then
2543 kde_incdirs="$ac_kde_includes /usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde/include $x_includes $qt_includes"
2544 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
2545 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
2546 ac_kde_includes="$kde_incdir"
2548 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
2550 in the prefix, you've chosen, are no kde headers installed. This will fail.
2551 So, check this please and use another prefix!])
2554 kde_libdirs="$ac_kde_libraries /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"
2555 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
2556 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
2557 ac_kde_libraries="$kde_libdir"
2559 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
2561 in the prefix, you've chosen $ac_kde_libraries, are no kde libraries installed. This will fail.
2562 So, check this please and use another prefix!])
2564 ac_kde_libraries="$kde_libdir"
2566 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
2567 ac_cv_have_kde="have_kde=no"
2569 ac_cv_have_kde="have_kde=yes \
2570 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
2575 ac_cv_have_kde="have_kde=no"
2580 eval "$ac_cv_have_kde"
2582 if test "$have_kde" != "yes"; then
2583 if test "${prefix}" = NONE; then
2584 ac_kde_prefix="$ac_default_prefix"
2586 ac_kde_prefix="$prefix"
2588 if test "$exec_prefix" = NONE; then
2589 ac_kde_exec_prefix="$ac_kde_prefix"
2590 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
2592 ac_kde_exec_prefix="$exec_prefix"
2593 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
2596 kde_libraries="${ac_kde_exec_prefix}/lib"
2597 kde_includes=${ac_kde_prefix}/include
2600 ac_cv_have_kde="have_kde=yes \
2601 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
2602 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
2604 kde_libraries="$ac_kde_libraries"
2605 kde_includes="$ac_kde_includes"
2607 AC_SUBST(kde_libraries)
2608 AC_SUBST(kde_includes)
2610 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
2613 KDE_INCLUDES="-I$kde_includes"
2614 all_includes="$KDE_INCLUDES $all_includes"
2617 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
2620 KDE_LDFLAGS="-L$kde_libraries"
2621 all_libraries="$KDE_LDFLAGS $all_libraries"
2624 AC_SUBST(KDE_LDFLAGS)
2625 AC_SUBST(KDE_INCLUDES)
2627 KDE_CHECK_EXTRA_LIBS
2629 AC_SUBST(all_includes)
2630 AC_SUBST(all_libraries)
2634 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
2636 AC_MSG_CHECKING(for extra includes)
2637 AC_ARG_WITH(extra-includes, [ --with-extra-includes adds non standard include paths],
2638 kde_use_extra_includes="$withval",
2639 kde_use_extra_includes=NONE
2641 if test -n "$kde_use_extra_includes" && \
2642 test "$kde_use_extra_includes" != "NONE"; then
2646 for dir in $kde_use_extra_includes; do
2647 all_includes="$all_includes -I$dir"
2648 USER_INCLUDES="$USER_INCLUDES -I$dir"
2651 kde_use_extra_includes="added"
2653 kde_use_extra_includes="no"
2656 AC_MSG_RESULT($kde_use_extra_includes)
2658 AC_MSG_CHECKING(for extra libs)
2659 AC_ARG_WITH(extra-libs, [ --with-extra-libs adds non standard library paths],
2660 kde_use_extra_libs=$withval,
2661 kde_use_extra_libs=NONE
2663 if test -n "$kde_use_extra_libs" && \
2664 test "$kde_use_extra_libs" != "NONE"; then
2668 for dir in $kde_use_extra_libs; do
2669 all_libraries="$all_libraries -L$dir"
2670 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir"
2671 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
2674 kde_use_extra_libs="added"
2676 kde_use_extra_libs="no"
2679 AC_MSG_RESULT($kde_use_extra_libs)
2683 AC_DEFUN(KDE_CHECK_KIMGIO,
2685 AC_REQUIRE([AC_FIND_TIFF])
2686 AC_REQUIRE([AC_FIND_JPEG])
2687 AC_REQUIRE([AC_FIND_PNG])
2689 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) -lm'
2690 AC_SUBST(LIB_KIMGIO)
2691 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
2692 AC_SUBST(LIB_KHTMLW)
2693 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
2697 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
2699 AC_REQUIRE([KDE_MISC_TESTS])
2701 KDE_LIBS='-lqt -lkdecore -lkdeui -lkfm -lkfile'
2703 # LIB_X11='-lX11 $(LIBSOCKET)'
2705 # LIB_QT='-lqt $(LIB_X11)'
2707 # LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
2708 # AC_SUBST(LIB_KDECORE)
2709 # LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
2710 # AC_SUBST(LIB_KDEUI)
2711 # LIB_KFM='-lkfm $(LIB_KDECORE)'
2713 # LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
2714 # AC_SUBST(LIB_KFILE)
2717 AC_DEFUN(AC_PATH_KDE,
2720 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
2722 if test "$enableval" = "no";
2723 then ac_use_path_checking="default"
2724 else ac_use_path_checking=""
2726 ], [ac_use_path_checking=""]
2729 AC_ARG_WITH(install-root, [ --with-install-root the root, where to install to [default=/]],
2731 if test "$withval" = "no";
2732 then kde_install_root="";
2733 else kde_install_root=$withval;
2735 ], [kde_install_root=""]
2738 if test -n "$kde_install_root"; then
2739 install_root="$kde_install_root"
2744 AC_CREATE_KFSSTND($ac_use_path_checking)
2747 KDE_CREATE_LIBS_ALIASES
2750 dnl slightly changed version of AC_CHECK_FUNC(setenv)
2751 AC_DEFUN(AC_CHECK_SETENV,
2752 [AC_MSG_CHECKING([for setenv])
2753 AC_CACHE_VAL(ac_cv_func_setenv,
2756 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
2757 dnl which includes <sys/select.h> which contains a prototype for
2758 dnl select. Similarly for bzero.
2759 [#include <assert.h>
2760 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
2764 [/* We use char because int might match the return type of a gcc2
2765 builtin and then its argument prototype would still apply. */
2768 /* The GNU C library defines this for functions which it implements
2769 to always fail with ENOSYS. Some functions are actually named
2770 something starting with __ and the normal name is an alias. */
2771 #if defined (__stub_$1) || defined (__stub___$1)
2774 setenv("TEST", "alle", 1);
2776 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
2778 if test "$ac_cv_func_setenv" = "yes"; then
2780 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
2786 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
2789 save_CXXFLAGS="$CXXFLAGS"
2790 if test "$GCC" = "yes"; then
2791 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2793 AC_MSG_CHECKING(for getdomainname)
2794 AC_CACHE_VAL(ac_cv_func_getdomainname,
2802 getdomainname(buffer, 200);
2804 ac_cv_func_getdomainname=yes,
2805 ac_cv_func_getdomainname=no)
2807 AC_MSG_RESULT($ac_cv_func_getdomainname)
2808 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
2809 AC_DEFINE(HAVE_GETDOMAINNAME)
2811 CXXFLAGS="$save_CXXFLAGS"
2814 AC_DEFUN(AC_CHECK_GETHOSTNAME,
2817 save_CXXFLAGS="$CXXFLAGS"
2818 if test "$GCC" = "yes"; then
2819 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2822 AC_MSG_CHECKING([for gethostname])
2823 AC_CACHE_VAL(ac_cv_func_gethostname,
2831 gethostname(buffer, 200);
2833 ac_cv_func_gethostname=yes,
2834 ac_cv_func_gethostname=no)
2836 AC_MSG_RESULT($ac_cv_func_gethostname)
2837 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
2838 AC_DEFINE(HAVE_GETHOSTNAME)
2840 CXXFLAGS="$save_CXXFLAGS"
2843 AC_DEFUN(AC_CHECK_USLEEP,
2847 AC_MSG_CHECKING([for usleep])
2848 AC_CACHE_VAL(ac_cv_func_usleep,
2850 ac_libs_safe="$LIBS"
2851 LIBS="$LIBS $LIBUCB"
2859 ac_cv_func_usleep=yes,
2860 ac_cv_func_usleep=no)
2862 AC_MSG_RESULT($ac_cv_func_usleep)
2863 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
2864 AC_DEFINE(HAVE_USLEEP)
2866 LIBS="$ac_libs_safe"
2869 AC_DEFUN(AC_FIND_GIF,
2870 [AC_MSG_CHECKING([for giflib])
2871 AC_CACHE_VAL(ac_cv_lib_gif,
2872 [ac_save_LIBS="$LIBS"
2873 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2879 int GifLastError(void);
2883 /* We use char because int might match the return type of a gcc2
2884 builtin and then its argument prototype would still apply. */
2886 [return GifLastError();],
2887 eval "ac_cv_lib_gif=yes",
2888 eval "ac_cv_lib_gif=no")
2889 LIBS="$ac_save_LIBS"
2891 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2893 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
2895 AC_MSG_ERROR(You need giflib23. Please install the kdesupport package)
2899 AC_DEFUN(AC_FIND_JPEG,
2900 [AC_MSG_CHECKING([for jpeglib])
2901 AC_CACHE_VAL(ac_cv_lib_jpeg,
2902 [ac_save_LIBS="$LIBS"
2903 LIBS="$all_libraries -ljpeg -lm"
2905 [/* Override any gcc2 internal prototype to avoid an error. */
2906 struct jpeg_decompress_struct;
2907 typedef struct jpeg_decompress_struct * j_decompress_ptr;
2912 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2913 int version, size_t structsize);
2917 /* We use char because int might match the return type of a gcc2
2918 builtin and then its argument prototype would still apply. */
2920 [jpeg_CreateDecompress(0L, 0, 0);],
2921 eval "ac_cv_lib_jpeg=-ljpeg",
2922 eval "ac_cv_lib_jpeg=no")
2923 LIBS="$ac_save_LIBS"
2925 dnl what to do, if the normal way fails:
2926 if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then
2927 if test -f "$kde_libraries/libjpeg.so"; then
2928 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
2929 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
2930 else if test -f "$kde_libraries/libjpeg.sl"; then
2931 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
2932 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
2933 else if test -f "$kde_libraries/libjpeg.a"; then
2934 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
2935 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
2938 You need jpeglib6a. Please install the kdesupport package.
2939 If you have already installed kdesupport, you may have an
2940 old libjpeg somewhere.
2941 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
2948 if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then
2949 LIBJPEG="$ac_cv_lib_jpeg"
2951 AC_MSG_RESULT($ac_cv_lib_jpeg)
2952 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
2956 AC_DEFUN(AC_FIND_ZLIB,
2958 AC_MSG_CHECKING([for libz])
2959 AC_CACHE_VAL(ac_cv_lib_z,
2960 [ac_save_LIBS="$LIBS"
2961 LIBS="$all_libraries -lz $LIBSOCKET"
2966 [return (zlibVersion() == ZLIB_VERSION); ],
2967 eval "ac_cv_lib_z='-lz'",
2968 eval "ac_cv_lib_z=no")
2969 LIBS="$ac_save_LIBS"
2971 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
2972 dnl AC_DEFINE_UNQUOTED(HAVE_LIBZ)
2975 AC_MSG_RESULT($ac_cv_lib_z)
2983 AC_DEFUN(AC_FIND_TIFF,
2985 AC_REQUIRE([AC_FIND_ZLIB])
2986 AC_REQUIRE([AC_FIND_JPEG])
2987 AC_MSG_CHECKING([for libtiff])
2988 AC_CACHE_VAL(ac_cv_lib_tiff,
2989 [ac_save_LIBS="$LIBS"
2990 LIBS="$all_libraries -ltiff $LIBJPEG $LIBZ -lX11 $LIBSOCKET"
2995 [return (TIFFOpen( "", "r") == 0); ],
2996 eval "ac_cv_lib_tiff='-ltiff $LIBJPEG $LIBZ'",
2997 eval "ac_cv_lib_tiff=no")
2998 LIBS="$ac_save_LIBS"
3000 if eval "test ! \"`echo $ac_cv_lib_tiff`\" = no"; then
3001 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
3002 LIBTIFF="$ac_cv_lib_tiff"
3004 AC_MSG_RESULT($ac_cv_lib_tiff)
3013 AC_DEFUN(AC_FIND_PNG,
3015 AC_REQUIRE([AC_FIND_ZLIB])
3016 AC_MSG_CHECKING([for libpng])
3017 AC_CACHE_VAL(ac_cv_lib_png,
3018 [ac_save_LIBS="$LIBS"
3019 LIBS="$all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
3026 png_structp png_ptr = png_create_read_struct( // image ptr
3027 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
3028 return( png_ptr != 0 );
3030 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
3031 eval "ac_cv_lib_png=no")
3032 LIBS="$ac_save_LIBS"
3034 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
3035 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
3036 LIBPNG="$ac_cv_lib_png"
3038 AC_MSG_RESULT($ac_cv_lib_png)
3046 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
3048 AC_MSG_CHECKING(if you need GNU extensions)
3049 AC_CACHE_VAL(ac_cv_gnu_extensions,
3051 cat > conftest.c << EOF
3052 #include <features.h>
3054 #ifdef __GNU_LIBRARY__
3059 if (eval "$ac_cpp conftest.c") 2>&5 |
3060 egrep "yes" >/dev/null 2>&1; then
3062 ac_cv_gnu_extensions=yes
3064 ac_cv_gnu_extensions=no
3068 AC_MSG_RESULT($ac_cv_gnu_extensions)
3069 if test "$ac_cv_gnu_extensions" = "yes"; then
3070 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
3074 AC_DEFUN(AC_CHECK_COMPILERS,
3076 dnl this is somehow a fat lie, but prevents other macros from double checking
3077 AC_PROVIDE([AC_PROG_CC])
3078 AC_PROVIDE([AC_PROG_CPP])
3079 AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
3081 if test $enableval = "no"; dnl
3082 then ac_use_debug_code="no"
3083 else ac_use_debug_code="yes"
3085 ], [ac_use_debug_code="no"])
3087 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
3089 if test $enableval = "no"; then
3090 ac_use_strict_options="no"
3092 ac_use_strict_options="yes"
3094 ], [ac_use_strict_options="no"])
3096 dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
3097 AC_MSG_CHECKING(for a C-Compiler)
3098 dnl if there is one, print out. if not, don't matter
3101 if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
3102 if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
3103 if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
3104 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
3109 if test $ac_cv_prog_gcc = yes; then
3115 if test -z "$CFLAGS"; then
3116 if test "$ac_use_debug_code" = "yes"; then
3118 if test $ac_cv_prog_cc_g = yes; then
3122 if test "$GCC" = "yes"; then
3129 if test "$GCC" = "yes"; then
3130 CFLAGS="$CFLAGS -Wall"
3132 if test "$ac_use_strict_options" = "yes"; then
3133 CFLAGS="$CFLAGS -W -ansi -pedantic"
3140 *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
3143 if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then
3148 dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
3149 dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
3151 AC_MSG_CHECKING(how to run the C preprocessor)
3152 # On Suns, sometimes $CPP names a directory.
3153 if test -n "$CPP" && test -d "$CPP"; then
3156 if test -z "$CPP"; then
3157 AC_CACHE_VAL(ac_cv_prog_CPP,
3158 [ # This must be in double quotes, not single quotes, because CPP may get
3159 # substituted into the Makefile and "${CC-cc}" will confuse make.
3161 # On the NeXT, cc -E runs the code through the compiler's parser,
3162 # not just through cpp.
3163 dnl Use a header file that comes with gcc, so configuring glibc
3164 dnl with a fresh cross-compiler works.
3165 AC_TRY_CPP([#include <assert.h>
3167 CPP="${CC-cc} -E -traditional-cpp"
3168 AC_TRY_CPP([#include <assert.h>
3169 Syntax Error], , CPP=/lib/cpp))
3170 ac_cv_prog_CPP="$CPP"])dnl
3171 CPP="$ac_cv_prog_CPP"
3173 ac_cv_prog_CPP="$CPP"
3179 AC_MSG_CHECKING(for a C++-Compiler)
3180 dnl if there is one, print out. if not, don't matter
3183 if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
3184 if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
3185 if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
3186 if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
3187 test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
3192 if test $ac_cv_prog_gxx = yes; then
3195 AC_MSG_CHECKING(whether we are using SPARC CC)
3197 cat > conftest.C << EOF
3203 ac_try="$CXX -E conftest.C"
3204 if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then
3209 AC_MSG_RESULT($ac_cv_prog_CC)
3212 if test -z "$CXXFLAGS"; then
3213 if test "$ac_use_debug_code" = "yes"; then
3215 if test $ac_cv_prog_cxx_g = yes; then
3218 if test "$ac_cv_prog_CC" = "yes"; then
3219 CXXFLAGS="$CXXFLAGS -pto"
3222 if test "$GXX" = "yes"; then
3225 if test "$ac_cv_prog_CC" = "yes"; then
3233 if test "$GXX" = "yes"; then
3234 CXXFLAGS="$CXXFLAGS -Wall"
3236 if test "$ac_use_strict_options" = "yes"; then
3237 CXXFLAGS="$CXXFLAGS -W -ansi -Wtraditional -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wbad-function-cast -Wsynth"
3240 if test "$kde_very_strict" = "yes"; then
3241 CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wshadow -Wredundant-decls -Wconversion"
3247 *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
3252 dnl just a wrapper to clean up configure.in
3253 AC_DEFUN(KDE_PROG_LIBTOOL,
3255 AC_REQUIRE([AM_ENABLE_SHARED])
3256 AC_REQUIRE([AM_ENABLE_STATIC])
3257 dnl libtool is only for C, so I must force him
3258 dnl to find the correct flags for C++
3260 ac_save_cflags="$CFLAGS"
3263 AM_PROG_LIBTOOL dnl for libraries
3265 CFLAGS="$ac_save_cflags"
3268 AC_DEFUN(KDE_DO_IT_ALL,
3270 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3276 AC_DEFUN(AC_CHECK_RPATH,
3278 AC_MSG_CHECKING(for rpath)
3279 AC_ARG_ENABLE(rpath,
3280 [ --disable-rpath do not use the rpath feature of ld],
3281 USE_RPATH=$enableval, USE_RPATH=yes)
3282 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3284 KDE_RPATH="-rpath \$(kde_libraries)"
3286 if test -n "$qt_libraries"; then
3287 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
3289 dnl $x_libraries is set to /usr/lib in case
3290 if test -n "$X_LDFLAGS"; then
3291 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
3293 if test -n "$KDE_EXTRA_RPATH"; then
3294 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3297 AC_SUBST(KDE_EXTRA_RPATH)
3299 AC_MSG_RESULT($USE_RPATH)
3302 dnl This is a merge of some macros out of the gettext aclocal.m4
3303 dnl since we don't need anything, I took the things we need
3304 AC_DEFUN(AM_KDE_WITH_NLS,
3305 [AC_MSG_CHECKING([whether NLS is requested])
3307 dnl Default is enabled NLS
3309 [ --disable-nls do not use Native Language Support],
3310 USE_NLS=$enableval, USE_NLS=yes)
3311 AC_MSG_RESULT($USE_NLS)
3314 dnl If we use NLS figure out what method
3315 if test "$USE_NLS" = "yes"; then
3316 AC_DEFINE(ENABLE_NLS)
3318 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3319 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3320 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3322 if test -z "`$MSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3323 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3328 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3329 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3331 dnl Test whether we really found GNU xgettext.
3332 if test "$XGETTEXT" != ":"; then
3333 dnl If it is no GNU xgettext we define it as : so that the
3334 dnl Makefiles still can work.
3335 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3339 [found xgettext programs is not GNU xgettext; ignore it])
3348 # Search path for a program which passes the given test.
3349 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3352 # Stephan Kulow: I appended a _KDE against name conflicts
3354 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3355 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3356 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
3357 [# Extract the first word of "$2", so it can be a program name with args.
3358 set dummy $2; ac_word=[$]2
3359 AC_MSG_CHECKING([for $ac_word])
3360 AC_CACHE_VAL(ac_cv_path_$1,
3363 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3366 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3367 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3368 test -z "$ac_dir" && ac_dir=.
3369 if test -f $ac_dir/$ac_word; then
3371 ac_cv_path_$1="$ac_dir/$ac_word"
3377 dnl If no 4th arg is given, leave the cache variable unset,
3378 dnl so AC_PATH_PROGS will keep looking.
3379 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3384 if test -n "[$]$1"; then
3385 AC_MSG_RESULT([$]$1)
3393 dnl From Jim Meyering.
3394 dnl FIXME: migrate into libit.
3396 AC_DEFUN(AM_FUNC_OBSTACK,
3397 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3398 [AC_TRY_LINK([#include "obstack.h"],
3399 [struct obstack *mem;obstack_free(mem,(char *) 0)],
3400 am_cv_func_obstack=yes,
3401 am_cv_func_obstack=no)])
3402 if test $am_cv_func_obstack = yes; then
3403 AC_DEFINE(HAVE_OBSTACK)
3405 LIBOBJS="$LIBOBJS obstack.o"
3409 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3410 dnl FIXME: Migrate into libit
3412 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
3413 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3414 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3415 am_cv_lib_error_at_line=yes,
3416 am_cv_lib_error_at_line=no)])
3417 if test $am_cv_lib_error_at_line = no; then
3418 LIBOBJS="$LIBOBJS error.o"
3420 AC_SUBST(LIBOBJS)dnl
3423 # Macro to add for using GNU gettext.
3424 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3427 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3429 AC_DEFUN(AM_KDE_GNU_GETTEXT,
3430 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3431 AC_REQUIRE([AC_PROG_RANLIB])dnl
3432 AC_REQUIRE([AC_HEADER_STDC])dnl
3433 AC_REQUIRE([AC_C_INLINE])dnl
3434 AC_REQUIRE([AC_TYPE_OFF_T])dnl
3435 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3436 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3437 AC_REQUIRE([AC_FUNC_MMAP])dnl
3438 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3439 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
3440 unistd.h values.h alloca.h])
3441 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
3442 __argz_count __argz_stringify __argz_next stpcpy])
3446 if test "x$CATOBJEXT" != "x"; then
3447 if test "x$ALL_LINGUAS" = "x"; then
3450 AC_MSG_CHECKING(for catalogs to be installed)
3452 for lang in ${LINGUAS=$ALL_LINGUAS}; do
3453 case "$ALL_LINGUAS" in
3454 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3457 LINGUAS=$NEW_LINGUAS
3458 AC_MSG_RESULT($LINGUAS)
3461 dnl Construct list of names of catalog files to be constructed.
3462 if test -n "$LINGUAS"; then
3463 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3469 AC_DEFUN(AC_HAVE_XPM,
3470 [AC_REQUIRE_CPP()dnl
3472 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3473 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3475 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
3476 xpm_test=$withval, xpm_test="yes")
3477 if test "x$xpm_test" = xno; then
3480 AC_MSG_CHECKING(for XPM)
3481 AC_CACHE_VAL(ac_cv_have_xpm,
3484 ac_save_ldflags="$LDFLAGS"
3485 ac_save_cflags="$CFLAGS"
3486 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
3487 CFLAGS="$CFLAGS $X_INCLUDES"
3488 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3489 AC_TRY_LINK([#include <X11/xpm.h>],[],
3490 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3491 LDFLAGS="$ac_save_ldflags"
3492 CFLAGS="$ac_save_cflags"
3495 if test "$ac_cv_have_xpm" = no; then
3502 if test "$XPM_LDFLAGS" = ""; then
3505 XPMLIB="-L$XPM_LDFLAGS -lXpm"
3507 if test "$XPM_INCLUDE" = ""; then
3510 XPMINC="-I$XPM_INCLUDE"
3520 AC_DEFUN(AC_HAVE_GL,
3521 [AC_REQUIRE_CPP()dnl
3523 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3524 test -z "$GL_INCLUDE" && GL_INCLUDE=
3526 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
3527 gl_test=$withval, gl_test="yes")
3528 if test "x$gl_test" = xno; then
3531 AC_MSG_CHECKING(for GL)
3532 AC_CACHE_VAL(ac_cv_have_gl,
3535 ac_save_ldflags="$LDFLAGS"
3536 ac_save_cflags="$CFLAGS"
3537 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
3538 CFLAGS="$CFLAGS $X_INCLUDES"
3539 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3541 ac_cv_have_gl="yes",ac_cv_have_gl="no")
3542 LDFLAGS="$ac_save_ldflags"
3543 CFLAGS="$ac_save_cflags"
3546 if test "$ac_cv_have_gl" = no; then
3553 if test "$GL_LDFLAGS" = ""; then
3554 GLLIB="-lMesaGL -lMesaGLU"
3556 GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU"
3558 if test "$GL_INCLUDE" = ""; then
3561 GLINC="-I$GL_INCLUDE"
3573 dnl Should test for PAM (Pluggable Authentication Modules)
3574 AC_DEFUN(AC_PATH_PAM_DIRECT,
3576 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
3577 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
3581 /usr/local/include \
3583 /usr/unsupported/include \
3586 /usr/local/pam/include \
3587 /usr/lib/pam/include \
3592 if test -r "$ac_dir/$pam_direct_test_include"; then
3593 no_pam= ac_pam_includes=$ac_dir
3598 # First see if replacing the include by lib works.
3599 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
3604 /usr/unsupported/lib \
3610 for ac_extension in a so sl; do
3611 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
3612 no_pam= ac_pam_libraries=$ac_dir
3619 AC_DEFUN(AC_PATH_PAM,
3620 [AC_REQUIRE_CPP()dnl
3622 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"], [], [-lpam -ldl])
3624 AC_MSG_CHECKING(for PAM)
3626 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
3628 if test "x$withval" = "xyes"; then
3631 elif test "x$withval" = "xno"; then
3635 pam_service="$withval"
3636 if test -z "$pam_service"; then
3645 if test ! "$no_pam" = yes; then
3647 AC_CACHE_VAL(ac_cv_path_pam,
3649 ac_pam_includes=NONE
3650 ac_pam_libraries=NONE
3651 if test -z "$pam_libraries"; then
3654 if test -z "$pam_includes"; then
3660 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
3661 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
3663 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
3664 ac_pam_libs="-lpam $PAM_MISC_LIB -ldl"
3665 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
3667 ac_cv_path_pam="no_pam=yes"
3671 eval "$ac_cv_path_pam"
3675 if test "$no_pam" = yes; then
3679 PAMLIBS="$ac_pam_libs"
3680 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
3681 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
3682 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
3683 if test "$default_pam" = yes; then
3684 AC_MSG_RESULT(["default pam service name will be used"])
3686 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service")
3687 AC_MSG_RESULT(["pam service name will be: " $pam_service])
3689 dnl test whether struct pam_message is const (Linux) or not (Sun)
3690 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
3691 AC_MSG_CHECKING(for const pam_message)
3692 AC_EGREP_HEADER([struct pam_message],
3694 [ AC_EGREP_HEADER([const struct pam_message],
3696 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
3697 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
3698 AC_DEFINE(PAM_MESSAGE_NONCONST)]
3700 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
3704 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
3705 PAMLIBPATHS="-L$pam_libraries"
3707 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
3708 PAMINC="-I$pam_includes"
3713 AC_SUBST(PAMLIBPATHS)
3717 AC_DEFUN(KDE_CHECK_LIBDL,
3719 AC_CHECK_LIB(dl, dlopen, [
3721 ac_cv_have_dlfcn=yes
3724 AC_CHECK_LIB(dld, shl_unload, [
3726 ac_cv_have_shload=yes
3732 AC_DEFUN(KDE_CHECK_DLOPEN,
3735 AC_CHECK_HEADERS(dlfcn.h dl.h)
3736 if test "$ac_cv_header_dlfcn_h" = "no"; then
3740 if test "$ac_cv_header_dl_h" = "no"; then
3741 ac_cv_have_shload=no
3745 AC_ARG_ENABLE(dlopen,
3746 [ --disable-dlopen link staticly [default=no]] ,
3747 [if test "$enableval" = yes; then
3752 # override the user's opinion, if we know it better ;)
3753 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3757 if test "$ac_cv_have_dlfcn" = "yes"; then
3758 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
3761 if test "$ac_cv_have_shload" = "yes"; then
3762 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
3765 if test "$enable_dlopen" = no ; then
3766 test -n "$1" && eval $1
3768 test -n "$2" && eval $2
3773 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3775 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
3777 AC_MSG_CHECKING([dynamic loading])
3778 eval "`egrep '^build_libtool_libs=' libtool`"
3779 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3781 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3785 AC_MSG_RESULT($dynamic_loading)
3786 if test "$dynamic_loading" = "yes"; then
3793 AC_DEFUN(KDE_ADD_INCLUDES,
3795 if test -z "$1"; then
3796 test_include="Pix.h"
3801 AC_MSG_CHECKING([for libg++ ($test_include)])
3803 AC_CACHE_VAL(kde_cv_libgpp_includes,
3805 kde_cv_libgpp_includes=no
3811 /usr/unsupported/include \
3816 if test -r "$ac_dir/$test_include"; then
3817 kde_cv_libgpp_includes=$ac_dir
3823 AC_MSG_RESULT($kde_cv_libgpp_includes)
3824 if test "$kde_cv_libgpp_includes" != "no"; then
3825 all_includes="-I$kde_cv_libgpp_includes $all_includes"
3831 AC_DEFUN(KDE_CHECK_MICO,
3833 AC_REQUIRE([KDE_CHECK_LIBDL])
3834 AC_MSG_CHECKING(for MICO)
3835 AC_ARG_WITH(micodir,
3836 [ --with-micodir=micodir where mico is installed ],
3837 kde_micodir=$withval,
3838 kde_micodir=/usr/local
3840 AC_MSG_RESULT($kde_micodir)
3841 if test ! -r $kde_micodir/include/CORBA.h; then
3842 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3845 MICO_INCLUDES=-I$kde_micodir/include
3846 AC_SUBST(MICO_INCLUDES)
3847 MICO_LDFLAGS=-L$kde_micodir/lib
3848 AC_SUBST(MICO_LDFLAGS)
3850 AC_MSG_CHECKING([for MICO version])
3851 AC_CACHE_VAL(kde_cv_mico_version,
3854 cat >conftest.$ac_ext <<EOF
3856 #include <mico/version.h>
3859 printf("MICO_VERSION=%s\n",MICO_VERSION);
3863 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3864 if AC_TRY_EVAL(ac_compile); then
3865 if eval `./conftest 2>&5`; then
3866 kde_cv_mico_version=$MICO_VERSION
3868 AC_MSG_ERROR([your system is not able to execute a small application to
3869 find MICO version! Check $kde_micodir/include/mico/version.h])
3872 AC_MSG_ERROR([your system is not able to compile a small application to
3873 find MICO version! Check $kde_micodir/include/mico/version.h])
3877 dnl installed MICO version
3878 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3879 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3880 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3882 dnl required MICO version
3883 req_v_maj=`echo $1 | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3884 req_v_mid=`echo $1 | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3885 req_v_min=`echo $1 | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3887 if test "$mico_v_maj" -lt "$req_v_maj" || \
3888 ( test "$mico_v_maj" -eq "$req_v_maj" && \
3889 test "$mico_v_mid" -lt "$req_v_mid" ) || \
3890 ( test "$mico_v_mid" -eq "$req_v_mid" && \
3891 test "$mico_v_min" -lt "$req_v_min" )
3894 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $1 \
3895 at least is required. You should upgrade MICO.])
3897 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $1, ok)])
3900 LIBMICO="-lmico$kde_cv_mico_version $LIBDL"
3902 IDL=$kde_micodir/bin/idl
3907 AC_DEFUN(KDE_CHECK_MINI_STL,
3909 AC_REQUIRE([KDE_CHECK_MICO])
3911 AC_MSG_CHECKING(if we use mico's mini-STL)
3912 AC_CACHE_VAL(kde_cv_have_mini_stl,
3915 kde_save_cxxflags="$CXXFLAGS"
3916 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3919 #include <mico/config.h>
3922 #ifdef HAVE_MINI_STL
3926 kde_cv_have_mini_stl=no,
3927 kde_cv_have_mini_stl=yes)
3928 CXXFLAGS="$kde_save_cxxflags"
3932 AC_MSG_RESULT($kde_cv_have_mini_stl)
3933 if test "$kde_cv_have_mini_stl" = "yes"; then
3934 AC_DEFINE_UNQUOTED(HAVE_MINI_STL)
3941 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3943 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
3944 AC_SUBST(LIBPTHREAD)
3947 AC_DEFUN(KDE_TRY_LINK_PYTHON,
3949 AC_CACHE_VAL(kde_cv_try_link_python_$1,
3951 kde_save_cxxflags="$CXXFLAGS"
3952 CXXFLAGS="$CXXFLAGS $PYTHONINC"
3953 kde_save_libs="$LIBS"
3954 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
3955 kde_save_ldflags="$LDFLAGS"
3956 LDFLAGS="$LDFLAGS $PYTHONLIB"
3962 PySys_SetArgv(1, 0);
3964 [kde_cv_try_link_python_$1=yes],
3965 [kde_cv_try_link_python_$1=no]
3967 CXXFLAGS="$kde_save_cxxflags"
3968 LIBS="$kde_save_libs"
3969 LDFLAGS="$kde_save_ldflags"
3972 if test "$kde_cv_try_link_python_$1" = "yes"; then
3980 AC_DEFUN(KDE_CHECK_PYTHON,
3982 AC_REQUIRE([KDE_CHECK_LIBDL])
3983 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3984 if test -z "$1"; then
3990 AC_MSG_CHECKING([for Python$version])
3992 AC_ARG_WITH(pythondir,
3993 [ --with-pythondir=pythondir use python installed in pythondir ],
3995 ac_python_dir=$withval
3996 ], ac_python_dir=/usr/local
3999 python_incdirs="$ac_python_dir/include/python$version /usr/include/python$version /usr/local/include/python$version /usr/local/include"
4000 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4001 if test ! -r $python_incdir/Python.h; then
4002 AC_MSG_ERROR(Python.h not found.)
4005 PYTHONINC=-I$python_incdir
4007 python_libdirs="$ac_python_dir/lib/python$version/config /usr/lib/python$version/config /usr/local/python$version/config"
4008 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4009 if test ! -r $python_libdir/libpython$version.a; then
4010 AC_MSG_ERROR(libpython$version.a not found.)
4013 PYTHONLIB=-L$python_libdir
4014 LIBPYTHON=-lpython$version
4016 AC_MSG_RESULT(header $python_incdir library $python_libdir)
4018 dnl Note: this test is very weak
4019 AC_MSG_CHECKING(if an Python application links)
4020 KDE_TRY_LINK_PYTHON(normal, "", AC_MSG_RESULT(yes),
4023 AC_MSG_CHECKING(if Python depends on -lpthread)
4024 KDE_TRY_LINK_PYTHON(pthread, "$LIBPTHREAD",
4027 LIBPYTHON="$LIBPYTHON $LIBPTHREAD $LIBDL"
4031 AC_MSG_CHECKING(if Python depeds on -ltcl)
4032 KDE_TRY_LINK_PYTHON(tcl, "-ltcl",
4035 LIBPYTHON="$LIBPYTHON -ltcl"
4039 AC_MSG_WARN([it seems, Python depends on another library.
4040 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
4041 and contact the authors to let them know about this problem])
4053 AC_DEFUN(KDE_CHECK_STL_SGI,
4055 AC_MSG_CHECKING([if STL implementation is SGI like])
4056 AC_CACHE_VAL(kde_cv_stl_type_sgi,
4061 string astring="Hallo Welt.";
4062 astring.erase(0, 6); // now astring is "Welt"
4064 ], kde_cv_stl_type_sgi=yes,
4065 kde_cv_stl_type_sgi=no)
4068 AC_MSG_RESULT($kde_cv_stl_type_sgi)
4070 if test "$kde_cv_stl_type_sgi" = "yes"; then
4071 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
4075 AC_DEFUN(KDE_CHECK_STL_HP,
4077 AC_MSG_CHECKING([if STL implementation is HP like])
4078 AC_CACHE_VAL(kde_cv_stl_type_hp,
4083 string astring="Hello World";
4084 astring.remove(0, 6); // now astring is "World"
4086 ], kde_cv_stl_type_hp=yes,
4087 kde_cv_stl_type_hp=no)
4089 AC_MSG_RESULT($kde_cv_stl_type_hp)
4091 if test "$kde_cv_stl_type_hp" = "yes"; then
4092 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
4096 AC_DEFUN(KDE_CHECK_STL,
4100 if test "$kde_cv_stl_type_sgi" = "no"; then
4103 if test "$kde_cv_stl_type_hp" = "no"; then
4104 AC_MSG_ERROR("no known STL type found")
4110 AC_DEFUN(AC_FIND_QIMGIO,
4111 [AC_REQUIRE([AC_FIND_JPEG])
4112 AC_MSG_CHECKING([for qimgio])
4113 AC_CACHE_VAL(ac_cv_lib_qimgio,
4114 [ac_save_LIBS="$LIBS"
4115 LIBS="$all_libraries -lqimgio -lpng -lz -lqt $LIBJPEG -lX11 $LIBSOCKET"
4118 void qInitImageIO ();
4121 eval "ac_cv_lib_qimgio=yes",
4122 eval "ac_cv_lib_qimgio=no")
4123 LIBS="$ac_save_LIBS"
4125 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4126 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4128 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
4131 AC_MSG_RESULT(not found)
4135 AC_DEFUN(KDE_CHECK_ANSI,
4137 AC_MSG_CHECKING([for strdup])
4139 AC_CACHE_VAL(kde_cv_stl_type_sgi,
4142 save_CXXFLAGS="$CXXFLAGS"
4143 if test "$GCC" = "yes"; then
4144 CXXFLAGS="$CXXFLAGS -pedantic-errors"
4150 char buffer[] = "Hallo";
4152 ], kde_cv_has_strdup=yes,
4153 kde_cv_has_strdup=no)
4154 CXXFLAGS="$save_CXXFLAGS"
4156 AC_MSG_RESULT($kde_cv_has_strdup)
4158 if test "$kde_cv_has_strdup" = "yes"; then
4159 AC_DEFINE_UNQUOTED(HAVE_STRDUP)
4164 AC_DEFUN(KDE_CHECK_INSURE,
4166 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
4168 if test $enableval = "no"; dnl
4169 then ac_use_insure="no"
4170 else ac_use_insure="yes"
4172 ], [ac_use_insure="no"])
4174 AC_MSG_CHECKING(if we will use Insure++ to debug)
4175 AC_MSG_RESULT($ac_use_insure)
4176 if test "$ac_use_insure" = "yes"; dnl
4177 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
4181 dnl this is for kdm:
4183 AC_DEFUN(AC_CHECK_KDM,
4185 AC_CHECK_FUNCS(getsecretkey)
4186 dnl checks for X server
4188 AC_PATH_PROG(X_SERVER, X)
4189 if test ! -z "$X_SERVER"; then
4190 X_SERVER=`echo $X_SERVER | sed -e 's+/X$++'`
4191 AC_DEFINE_UNQUOTED(XBINDIR,$X_SERVER)
4196 dnl This one tries to find XDMDIR for config files
4198 [ --with-xdmdir If the xdm config dir can't be found automaticly],
4199 [ ac_xdmdir=$withval],
4202 AC_MSG_CHECKING([for xdm configuration dir])
4203 if test "$ac_xdmdir" = "no"; then
4205 if mkdir conftestdir; then
4207 cat > Imakefile <<'EOF'
4209 @echo 'ac_xdmdir="$(XDMDIR)";'
4211 if (xmkmf) > /dev/null 2> /dev/null && test -f Makefile; then
4212 eval `${MAKE-make} acfindxdm 2>/dev/null 2>/dev/null | grep -v make`
4216 dnl Check if Imake was right
4217 if test -f $ac_xdmdir/xdm-config; then
4218 AC_MSG_RESULT($ac_xdmdir)
4220 dnl Here we must do something else
4221 dnl Maybe look for xdm-config in standard places, and
4222 dnl if that fails use a fresh copy in $KDEDIR/config/kdm/
4223 AC_FIND_FILE(xdm-config,/etc/X11/xdm /var/X11/xdm /usr/openwin/xdm /usr/X11R6/lib/X11/xdm,ac_xdmdir)
4224 if test -f $ac_xdmdir/xdm-config; then
4225 AC_MSG_RESULT($ac_xdmdir)
4227 if test "${prefix}" = NONE; then
4228 ac_xdmdir=$ac_default_prefix/config/kdm
4230 ac_xdmdir=$prefix/config/kdm
4232 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
4233 xdmconfigsubdir=xdmconfig
4234 AC_SUBST(xdmconfigsubdir)
4239 if test -f $ac_xdmdir/xdm-config; then
4240 AC_MSG_RESULT($ac_xdmdir)
4243 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
4244 xdmconfigsubdir=xdmconfig
4245 AC_SUBST(xdmconfigsubdir)
4248 AC_DEFINE_UNQUOTED(XDMDIR,"$ac_xdmdir")
4252 if test "x$no_pam" = "xyes"; then
4256 shadow_support="no" # if pam is installed, use it. We can't savely
4257 # test, if it works *sigh*
4261 [ --with-shadow If you want shadow password support ],
4262 [ if test "$withval" = "yes"; then
4263 shadow_support="yes"
4267 if test "$pam_support" = "yes" && test "$shadow_support=yes"; then
4268 AC_MSG_WARN("You can not define both pam AND shadow")
4271 [ if test -z "$shadow_support"; then shadow_support="no"; fi ] )
4273 if test "$pam_support" = "yes"; then
4274 AC_CHECK_LIB(pam, main, [PASSWDLIB="-lpam -ldl"
4275 AC_DEFINE_UNQUOTED(HAVE_PAM_LIB)],
4279 if test -z "$PASSWDLIB" && test "$shadow_support" = "yes"; then
4280 AC_CHECK_LIB(shadow, main,
4281 [ PASSWDLIB="-lshadow"
4282 AC_DEFINE_UNQUOTED(HAVE_SHADOW_LIB)
4286 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
4288 AC_CHECK_LIB(s, main, [LIB_LIBS="-ls"]) dnl for AIX
4290 AC_CHECK_LIB(Xdmcp, main, [LIBXDMCP="-lXdmcp"], , $X_LDFLAGS -lX11) dnl for Unixware
4293 if test -n "$LIBXDMCP"; then
4295 ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
4296 AC_CHECK_HEADERS(X11/Xdmcp.h)