Package list pipenightdreams / 079ead2
Imported Upstream version 0.10.0 Dariusz Dwornikowski 5 years ago
270 changed file(s) with 12803 addition(s) and 381 deletion(s). Raw diff Collapse all Expand all
0 0.10.0 (23/03/2002)
1 Sprite animation added.
2 Fullscreen mode now available.
3 Segmentation fault when starting level nine fixed.
4 Complete new graphic theme drawn (celebrating PND first birthday).
5 Spanish web page now available.
6
07 0.9.0 (10/12/2001)
18 Required pipes feature added.
29 Number of required pipes for each level defined.
0 SUBDIRS = src images levels
0 SUBDIRS = src images levels man
11
22 EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README pipenightdreams.lsm autogen.sh
3
4
0 default: all
1
2 dist:
3 @echo "This file is to make it easier for you to create all you need"
4 cat acinclude.m4.in libtool.m4.in >acinclude.m4
5 aclocal
6 autoheader
7 # use --include-deps, if you want to release the stuff. Don't use it for
8 # yourself
9 automake --include-deps
10 autoconf
11 touch stamp-h.in
12 LIST=`find ./po -name "*.po"`; \
13 for i in $$LIST; do \
14 file2=`echo $$i | sed -e "s#\.po#\.gmo#"`; \
15 msgfmt -o $$file2 $$i; \
16 done
17 rm -f Makefile.dist
18
19 all:
20 cat acinclude.m4.in libtool.m4.in >acinclude.m4
21 aclocal
22 autoheader
23 automake
24 autoconf
25
0 # Makefile.in generated automatically by automake 1.4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
0 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
33 # This Makefile.in is free software; the Free Software Foundation
44 # gives unlimited permission to copy and/or distribute it,
55 # with or without modifications, as long as this notice is preserved.
7676 SDL_LIBS = @SDL_LIBS@
7777 VERSION = @VERSION@
7878
79 SUBDIRS = src images levels man
79 SUBDIRS = src images levels man
8080
8181 EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README pipenightdreams.lsm autogen.sh
8282 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8484 CONFIG_HEADER = ./src/config.h
8585 CONFIG_CLEAN_FILES =
8686 DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
87 Makefile.in NEWS acinclude.m4 aclocal.m4 config.guess config.sub \
88 configure configure.in install-sh missing mkinstalldirs
87 Makefile.in NEWS TODO acinclude.m4 aclocal.m4 config.guess config.sub \
88 configure configure.in install-sh ltconfig ltmain.sh missing \
89 mkinstalldirs
8990
9091
9192 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
9293
93 TAR = tar
94 TAR = gtar
9495 GZIP_ENV = --best
9596 all: all-redirect
9697 .SUFFIXES:
145146 dot_seen=no; \
146147 rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
147148 rev="$$subdir $$rev"; \
148 test "$$subdir" = "." && dot_seen=yes; \
149 test "$$subdir" != "." || dot_seen=yes; \
149150 done; \
150151 test "$$dot_seen" = "no" && rev=". $$rev"; \
151152 target=`echo $@ | sed s/-recursive//`; \
0 ## -*- autoconf -*-
1
2 dnl This file is part of the KDE libraries/packages
3 dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
4 dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
5
6 dnl This file is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Library General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2 of the License, or (at your option) any later version.
10
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Library General Public License for more details.
15
16 dnl You should have received a copy of the GNU Library General Public License
17 dnl along with this library; see the file COPYING.LIB. If not, write to
18 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 dnl Boston, MA 02111-1307, USA.
20
21 dnl IMPORTANT NOTE:
22 dnl Please do not modify this file unless you expect your modifications to be
23 dnl carried into every other module in the repository. If you decide that you
24 dnl really want to modify it, contact coolo@kde.org mentioning that you have
25 dnl and that the modified file should be committed to every module.
26 dnl
27 dnl Single-module modifications are best placed in configure.in for kdelibs
28 dnl and kdebase or configure.in.in if present.
29
30
31 dnl ------------------------------------------------------------------------
32 dnl Find a file (or one of more files in a list of dirs)
33 dnl ------------------------------------------------------------------------
34 dnl
35 AC_DEFUN(AC_FIND_FILE,
36 [
37 $3=NO
38 for i in $2;
39 do
40 for j in $1;
41 do
42 if test -r "$i/$j"; then
43 $3=$i
44 break 2
45 fi
46 done
47 done
48 ])
49
50 dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
51 dnl if-not-found, test-parameter)
52 AC_DEFUN(KDE_FIND_PATH,
53 [
54 AC_MSG_CHECKING([for $1])
55 kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
56
57 AC_CACHE_VAL(kde_cv_path_$kde_cache,
58 [
59 kde_cv_path="NONE"
60 if test -n "$$2"; then
61 kde_cv_path="$$2";
62 else
63 dirs="$3"
64 kde_save_IFS=$IFS
65 IFS=':'
66 for dir in $PATH; do
67 dirs="$dirs $dir"
68 done
69 IFS=$kde_save_IFS
70
71 for dir in $dirs; do
72 if test -x "$dir/$1"; then
73 if test -n "$5"
74 then
75 evalstr="$dir/$1 $5 2>&1 "
76 if eval $evalstr; then
77 kde_cv_path="$dir/$1"
78 break
79 fi
80 else
81 kde_cv_path="$dir/$1"
82 break
83 fi
84 fi
85 done
86
87 fi
88
89 eval "kde_cv_path_$kde_cache=$kde_cv_path"
90
91 ])
92
93 eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
94 if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
95 AC_MSG_RESULT(not found)
96 $4
97 else
98 AC_MSG_RESULT($kde_cv_path)
99 $2=$kde_cv_path
100
101 fi
102 ])
103
104 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
105 [
106 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
107 Please check whether you installed Qt correctly.
108 You need to have a running moc binary.
109 configure tried to run $ac_cv_path_moc and the test didn't
110 succeed. If configure shouldn't have tried this one, set
111 the environment variable MOC to the right one before running
112 configure.
113 ])
114 ])
115
116 dnl ------------------------------------------------------------------------
117 dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and some
118 dnl more usual places
119 dnl ------------------------------------------------------------------------
120 dnl
121 AC_DEFUN(AC_PATH_QT_MOC,
122 [
123 KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin $QTDIR/src/moc \
124 /usr/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/lib/qt2/bin \
125 /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE])
126
127 if test -z "$MOC"; then
128 if test -n "$ac_cv_path_moc"; then
129 output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"`
130 fi
131 echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC
132 echo "configure:__oline__: moc output: $output" >&AC_FD_CC
133
134 if test -z "$output"; then
135 KDE_MOC_ERROR_MESSAGE
136 fi
137 fi
138
139 AC_SUBST(MOC)
140 ])
141
142 AC_DEFUN(KDE_1_CHECK_PATHS,
143 [
144 KDE_1_CHECK_PATH_HEADERS
145
146 KDE_TEST_RPATH=
147
148 if test -n "$USE_RPATH"; then
149
150 if test -n "$kde_libraries"; then
151 KDE_TEST_RPATH="-rpath $kde_libraries"
152 fi
153
154 if test -n "$qt_libraries"; then
155 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
156 fi
157
158 if test -n "$x_libraries"; then
159 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
160 fi
161
162 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
163 fi
164
165 AC_MSG_CHECKING([for KDE libraries installed])
166 ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
167
168 if AC_TRY_EVAL(ac_link) && test -s conftest; then
169 AC_MSG_RESULT(yes)
170 else
171 AC_MSG_ERROR([your system fails at linking a small KDE application!
172 Check, if your compiler is installed correctly and if you have used the
173 same compiler to compile Qt and kdelibs as you did use now])
174 fi
175
176 if eval `KDEDIR= ./conftest 2>&5`; then
177 kde_result=done
178 else
179 kde_result=problems
180 fi
181
182 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
183 kde_have_all_paths=yes
184 AC_LANG_CPLUSPLUS
185
186 KDE_SET_PATHS($kde_result)
187
188 ])
189
190 AC_DEFUN(KDE_SET_PATHS,
191 [
192 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
193 kde_htmldir=\"$kde_htmldir\" \
194 kde_appsdir=\"$kde_appsdir\" \
195 kde_icondir=\"$kde_icondir\" \
196 kde_sounddir=\"$kde_sounddir\" \
197 kde_datadir=\"$kde_datadir\" \
198 kde_locale=\"$kde_locale\" \
199 kde_cgidir=\"$kde_cgidir\" \
200 kde_confdir=\"$kde_confdir\" \
201 kde_mimedir=\"$kde_mimedir\" \
202 kde_toolbardir=\"$kde_toolbardir\" \
203 kde_wallpaperdir=\"$kde_wallpaperdir\" \
204 kde_bindir=\"$kde_bindir\" \
205 kde_servicesdir=\"$kde_servicesdir\" \
206 kde_servicetypesdir=\"$kde_servicetypesdir\" \
207 kde_result=$1"
208 ])
209
210 AC_DEFUN(AC_CREATE_KFSSTND,
211 [
212 AC_REQUIRE([AC_CHECK_RPATH])
213
214 AC_MSG_CHECKING([for KDE paths])
215 kde_result=""
216
217 AC_CACHE_VAL(kde_cv_all_paths,
218 [
219 if test "$1" = "default"; then
220
221 if test -z "$kde_htmldir"; then
222 kde_htmldir='\$(prefix)/share/doc/HTML'
223 fi
224 if test -z "$kde_appsdir"; then
225 kde_appsdir='\$(prefix)/share/applnk'
226 fi
227 if test -z "$kde_icondir"; then
228 kde_icondir='\$(prefix)/share/icons'
229 fi
230 if test -z "$kde_sounddir"; then
231 kde_sounddir='\$(prefix)/share/sounds'
232 fi
233 if test -z "$kde_datadir"; then
234 kde_datadir='\$(prefix)/share/apps'
235 fi
236 if test -z "$kde_locale"; then
237 kde_locale='\$(prefix)/share/locale'
238 fi
239 if test -z "$kde_cgidir"; then
240 kde_cgidir='\$(exec_prefix)/cgi-bin'
241 fi
242 if test -z "$kde_confdir"; then
243 kde_confdir='\$(prefix)/share/config'
244 fi
245 if test -z "$kde_mimedir"; then
246 kde_mimedir='\$(prefix)/share/mimelnk'
247 fi
248 if test -z "$kde_toolbardir"; then
249 kde_toolbardir='\$(prefix)/share/toolbar'
250 fi
251 if test -z "$kde_wallpaperdir"; then
252 kde_wallpaperdir='\$(prefix)/share/wallpapers'
253 fi
254 if test -z "$kde_bindir"; then
255 kde_bindir='\$(exec_prefix)/bin'
256 fi
257 if test -z "$kde_servicesdir"; then
258 kde_servicesdir='\$(prefix)/share/services'
259 fi
260 if test -z "$kde_servicetypesdir"; then
261 kde_servicetypesdir='\$(prefix)/share/servicetypes'
262 fi
263
264 KDE_SET_PATHS(defaults)
265
266 else
267
268 if test $kde_qtver = 1; then
269 AC_MSG_RESULT([compiling])
270 KDE_1_CHECK_PATHS
271 else
272 AC_MSG_ERROR([path checking not yet supported for KDE 2])
273 fi
274
275 fi
276
277 ])
278
279 eval "$kde_cv_all_paths"
280
281 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
282 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
283 test -z "$kde_datadir" || test -z "$kde_locale" ||
284 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
285 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
286 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
287 test -z "$kde_servicesdir" ||
288 test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then
289 kde_have_all_paths=no
290 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
291 Since it had compiled and linked before, it must be a strange problem on your system.
292 Look at config.log for details. If you are not able to fix this, look at
293 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
294 (If you're using an egcs version on Linux, you may update binutils!)
295 ])
296 else
297 rm -f conftest*
298 AC_MSG_RESULT($kde_result)
299 fi
300
301 bindir=$kde_bindir
302
303 ])
304
305 AC_DEFUN(AC_SUBST_KFSSTND,
306 [
307 AC_SUBST(kde_htmldir)
308 AC_SUBST(kde_appsdir)
309 AC_SUBST(kde_icondir)
310 AC_SUBST(kde_sounddir)
311 AC_SUBST(kde_datadir)
312 AC_SUBST(kde_locale)
313 AC_SUBST(kde_cgidir)
314 AC_SUBST(kde_confdir)
315 AC_SUBST(kde_mimedir)
316 AC_SUBST(kde_toolbardir)
317 AC_SUBST(kde_wallpaperdir)
318 AC_SUBST(kde_bindir)
319 dnl for KDE 2
320 AC_SUBST(kde_servicesdir)
321 AC_SUBST(kde_servicetypesdir)
322 if test "$kde_qtver" = 1; then
323 kde_minidir="$kde_icondir/mini"
324 else
325 # for KDE 1 - this breaks KDE2 apps using minidir, but
326 # that's the plan ;-/
327 kde_minidir="/dev/null"
328 fi
329 AC_SUBST(kde_minidir)
330 ])
331
332 AC_DEFUN(KDE_MISC_TESTS,
333 [
334 AC_LANG_C
335 dnl Checks for libraries.
336 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
337 AC_SUBST(LIBCOMPAT)
338 kde_have_crypt=
339 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
340 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
341 AC_MSG_WARN([you have no crypt in either libcrypt or libc.
342 You should install libcrypt from another source or configure with PAM
343 support])
344 kde_have_crypt=no
345 ]))
346 AC_SUBST(LIBCRYPT)
347 if test $kde_have_crypt = yes; then
348 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
349 fi
350 AC_CHECK_KSIZE_T
351 AC_LANG_C
352 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
353 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
354 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
355 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
356 fi
357 AC_CHECK_FUNC(inet_ntoa)
358 if test $ac_cv_func_inet_ntoa = no; then
359 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
360 fi
361 AC_CHECK_FUNC(connect)
362 if test $ac_cv_func_connect = no; then
363 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
364 $X_EXTRA_LIBS)
365 fi
366
367 AC_CHECK_FUNC(remove)
368 if test $ac_cv_func_remove = no; then
369 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
370 fi
371
372 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
373 AC_CHECK_FUNC(shmat)
374 if test $ac_cv_func_shmat = no; then
375 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
376 fi
377
378 LIBSOCKET="$X_EXTRA_LIBS"
379 AC_SUBST(LIBSOCKET)
380 AC_SUBST(X_EXTRA_LIBS)
381 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
382 AC_SUBST(LIBUCB)
383
384 case $host in dnl this *is* LynxOS specific
385 *-*-lynxos* )
386 AC_MSG_CHECKING([LynxOS header file wrappers])
387 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
388 AC_MSG_RESULT(disabled)
389 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
390 ;;
391 esac
392
393 AC_REQUIRE([KDE_CHECK_LIBDL])
394 AC_CHECK_BOOL
395 ])
396
397 dnl ------------------------------------------------------------------------
398 dnl Find the header files and libraries for X-Windows. Extended the
399 dnl macro AC_PATH_X
400 dnl ------------------------------------------------------------------------
401 dnl
402 AC_DEFUN(K_PATH_X,
403 [
404 AC_REQUIRE([AC_PROG_CPP])
405 AC_MSG_CHECKING(for X)
406 AC_LANG_SAVE
407 AC_LANG_C
408 AC_CACHE_VAL(ac_cv_have_x,
409 [# One or both of the vars are not set, and there is no cached value.
410 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
411 kde_x_includes=NO
412 else
413 kde_x_includes=$x_includes
414 fi
415 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
416 kde_x_libraries=NO
417 else
418 kde_x_libraries=$x_libraries
419 fi
420
421 # below we use the standard autoconf calls
422 ac_x_libraries=$kde_x_libraries
423 ac_x_includes=$kde_x_includes
424
425 AC_PATH_X_DIRECT
426 AC_PATH_X_XMKMF
427 if test -z "$ac_x_includes"; then
428 ac_x_includes="."
429 fi
430 if test -z "$ac_x_libraries"; then
431 ac_x_libraries="/usr/lib"
432 fi
433 #from now on we use our own again
434
435 # when the user already gave --x-includes, we ignore
436 # what the standard autoconf macros told us.
437 if test "$kde_x_includes" = NO; then
438 kde_x_includes=$ac_x_includes
439 fi
440
441 if test "$kde_x_includes" = NO; then
442 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
443 fi
444
445 if test "$ac_x_libraries" = NO; then
446 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
447 fi
448
449 # Record where we found X for the cache.
450 ac_cv_have_x="have_x=yes \
451 kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries"
452 ])dnl
453 eval "$ac_cv_have_x"
454
455 if test "$have_x" != yes; then
456 AC_MSG_RESULT($have_x)
457 no_x=yes
458 else
459 AC_MSG_RESULT([libraries $ac_x_libraries, headers $kde_x_includes])
460 fi
461
462 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
463 X_INCLUDES=""
464 x_includes="."; dnl better than nothing :-
465 else
466 x_includes=$kde_x_includes
467 X_INCLUDES="-I$x_includes"
468 fi
469
470 if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then
471 X_LDFLAGS=""
472 x_libraries="/usr/lib"; dnl better than nothing :-
473 else
474 x_libraries=$ac_x_libraries
475 X_LDFLAGS="-L$x_libraries"
476 fi
477 all_includes="$X_INCLUDES"
478 all_libraries="$X_LDFLAGS"
479
480 AC_SUBST(X_INCLUDES)
481 AC_SUBST(X_LDFLAGS)
482 AC_SUBST(x_libraries)
483 AC_SUBST(x_includes)
484
485 # Check for libraries that X11R6 Xt/Xaw programs need.
486 ac_save_LDFLAGS="$LDFLAGS"
487 test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
488 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
489 # check for ICE first), but we must link in the order -lSM -lICE or
490 # we get undefined symbols. So assume we have SM if we have ICE.
491 # These have to be linked with before -lX11, unlike the other
492 # libraries we check for below, so use a different variable.
493 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
494 AC_CHECK_LIB(ICE, IceConnectionNumber,
495 [LIBSM="$X_PRELIBS -lSM"], , $X_EXTRA_LIBS)
496 AC_SUBST(LIBSM)
497 LDFLAGS="$ac_save_LDFLAGS"
498
499 AC_SUBST(X_PRE_LIBS)
500
501 LIB_X11='-lX11 $(LIBSOCKET)'
502 AC_SUBST(LIB_X11)
503
504 AC_MSG_CHECKING(for libXext)
505 AC_CACHE_VAL(kde_cv_have_libXext,
506 [
507 kde_ldflags_safe="$LDFLAGS"
508 kde_libs_safe="$LIBS"
509
510 LDFLAGS="$X_LDFLAGS $USER_LDFLAGS"
511 LIBS="-lXext -lX11 $LIBSOCKET"
512
513 AC_TRY_LINK([
514 #include <stdio.h>
515 ],
516 [
517 printf("hello Xext\n");
518 ],
519 kde_cv_have_libXext=yes,
520 kde_cv_have_libXext=no
521 )
522
523 LDFLAGS=$kde_ldflags_safe
524 LIBS=$kde_libs_safe
525 ])
526
527 AC_MSG_RESULT($kde_cv_have_libXext)
528
529 if test "kde_cv_have_libXext" = "no"; then
530 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
531 can't find it itself, we stop here assuming that make wouldn't find
532 them either.])
533 fi
534
535 ])
536
537 AC_LANG_RESTORE
538 ])
539
540 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
541 [
542 AC_REQUIRE([KDE_USE_QT])
543 cat > conftest.$ac_ext <<EOF
544 #include "confdefs.h"
545 #include <qglobal.h>
546 #include <qapplication.h>
547 #include <qapp.h>
548 #include <qobjcoll.h>
549 EOF
550 if test "$kde_qtver" = "2"; then
551 cat >> conftest.$ac_ext <<EOF
552 #include <qstring.h>
553 #include <qstyle.h>
554 EOF
555
556 if test $kde_qtsubver -gt 0; then
557 cat >> conftest.$ac_ext <<EOF
558 #include <qiconview.h>
559 EOF
560 fi
561
562 fi
563
564 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
565 cat >> conftest.$ac_ext <<EOF
566 #error 1
567 #endif
568
569 int main() {
570 EOF
571 if test "$kde_qtver" = "2"; then
572 cat >> conftest.$ac_ext <<EOF
573 QStringList *t = new QStringList();
574 EOF
575 if test $kde_qtsubver -gt 0; then
576 cat >> conftest.$ac_ext <<EOF
577 QIconView iv(0);
578 iv.setWordWrapIconText(false);
579 QString s;
580 s.setLatin1("Elvis is alive", 14);
581 EOF
582 fi
583 fi
584 cat >> conftest.$ac_ext <<EOF
585 return 0;
586 }
587 EOF
588 ])
589
590 AC_DEFUN(KDE_USE_QT,
591 [
592
593 if test -z "$1"; then
594 kde_qtver=2
595 kde_qtsubver=1
596 else
597 kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
598 # following is the check if subversion isnĀ“t found in passed argument
599 if test "$kde_qtsubver" = "$1"; then
600 kde_qtsubver=1
601 fi
602 kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
603 if test "$kde_qtver" = "1"; then
604 kde_qtsubver=42
605 else
606 # this is the version number fallback to 2.1, unless major version is 1 or 2
607 if test "$kde_qtver" != "2"; then
608 kde_qtver=2
609 kde_qtsubver=1
610 fi
611 fi
612 fi
613
614 if test -z "$2"; then
615 if test $kde_qtver = 2; then
616 if test $kde_qtsubver -gt 0; then
617 kde_qt_minversion="snapshot >= Qt 2.1 beta2"
618 else
619 kde_qt_minversion=">= Qt 2.0.2"
620 fi
621 else
622 kde_qt_minversion=">= 1.42 and < 2.0"
623 fi
624 else
625 kde_qt_minversion=$2
626 fi
627
628 if test -z "$3"; then
629 if test $kde_qtver = 2; then
630 if test $kde_qtsubver -gt 0; then
631 kde_qt_verstring="QT_VERSION >= 210"
632 else
633 kde_qt_verstring="QT_VERSION >= 200"
634 fi
635 else
636 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
637 fi
638 else
639 kde_qt_verstring=$3
640 fi
641 ])
642
643 AC_DEFUN(KDE_CHECK_QT_DIRECT,
644 [
645 AC_REQUIRE([KDE_USE_QT])
646 AC_MSG_CHECKING([if Qt compiles without flags])
647 AC_CACHE_VAL(kde_cv_qt_direct,
648 [
649 AC_LANG_SAVE
650 AC_LANG_CPLUSPLUS
651 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
652 ac_LIBRARY_PATH="$LIBRARY_PATH"
653 ac_cxxflags_safe="$CXXFLAGS"
654 ac_ldflags_safe="$LDFLAGS"
655 ac_libs_safe="$LIBS"
656
657 CXXFLAGS="$CXXFLAGS -I$qt_includes"
658 LDFLAGS="$X_LDFLAGS"
659 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
660 LD_LIBRARY_PATH=
661 export LD_LIBRARY_PATH
662 LIBRARY_PATH=
663 export LIBRARY_PATH
664
665 KDE_PRINT_QT_PROGRAM
666
667 if AC_TRY_EVAL(ac_link) && test -s conftest; then
668 kde_cv_qt_direct="yes"
669 else
670 kde_cv_qt_direct="no"
671 echo "configure: failed program was:" >&AC_FD_CC
672 cat conftest.$ac_ext >&AC_FD_CC
673 fi
674
675 rm -f conftest*
676 CXXFLAGS="$ac_cxxflags_safe"
677 LDFLAGS="$ac_ldflags_safe"
678 LIBS="$ac_libs_safe"
679
680 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
681 export LD_LIBRARY_PATH
682 LIBRARY_PATH="$ac_LIBRARY_PATH"
683 export LIBRARY_PATH
684 AC_LANG_RESTORE
685 ])
686
687 if test "$kde_cv_qt_direct" = "yes"; then
688 AC_MSG_RESULT(yes)
689 $1
690 else
691 AC_MSG_RESULT(no)
692 $2
693 fi
694 ])
695
696 dnl ------------------------------------------------------------------------
697 dnl Try to find the Qt headers and libraries.
698 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
699 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
700 dnl ------------------------------------------------------------------------
701 dnl
702 AC_DEFUN(AC_PATH_QT_1_3,
703 [
704 AC_REQUIRE([K_PATH_X])
705 AC_REQUIRE([KDE_USE_QT])
706 LIBQT="-lqt"
707 if test $kde_qtver = 2; then
708
709 AC_REQUIRE([AC_FIND_PNG])
710 LIBQT="$LIBQT $LIBPNG"
711 fi
712 AC_MSG_CHECKING([for Qt])
713
714 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSOCKET"
715 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
716 qt_libraries=""
717 qt_includes=""
718 AC_ARG_WITH(qt-dir,
719 [ --with-qt-dir=DIR where the root of Qt is installed ],
720 [ ac_qt_includes="$withval"/include
721 ac_qt_libraries="$withval"/lib
722 ac_qt_bindir="$withval"/bin
723 ])
724
725 AC_ARG_WITH(qt-includes,
726 [ --with-qt-includes=DIR where the Qt includes are. ],
727 [
728 ac_qt_includes="$withval"
729 ])
730
731 kde_qt_libs_given=no
732
733 AC_ARG_WITH(qt-libraries,
734 [ --with-qt-libraries=DIR where the Qt library is installed.],
735 [ ac_qt_libraries="$withval"
736 kde_qt_libs_given=yes
737 ])
738
739 AC_CACHE_VAL(ac_cv_have_qt,
740 [#try to guess Qt locations
741
742 qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/lib/qt2/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
743 test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs"
744 qt_incdirs="$ac_qt_includes $qt_incdirs"
745
746 if test "$kde_qtver" = "2"; then
747 kde_qt_header=qstyle.h
748 else
749 kde_qt_header=qglobal.h
750 fi
751
752 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
753 ac_qt_includes="$qt_incdir"
754
755 qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt /usr/lib/qt2/lib $x_libraries"
756 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
757 if test ! "$ac_qt_libraries" = "NO"; then
758 qt_libdirs="$ac_qt_libraries $qt_libdirs"
759 fi
760
761 test=NONE
762 qt_libdir=NONE
763 for dir in $qt_libdirs; do
764 try="ls -1 $dir/libqt.*"
765 if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
766 done
767
768 ac_qt_libraries="$qt_libdir"
769
770 AC_LANG_SAVE
771 AC_LANG_CPLUSPLUS
772
773 ac_cxxflags_safe="$CXXFLAGS"
774 ac_ldflags_safe="$LDFLAGS"
775 ac_libs_safe="$LIBS"
776
777 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
778 LDFLAGS="-L$qt_libdir $all_libraries $USER_LDFLAGS"
779 LIBS="$LIBS $LIBQT"
780
781 KDE_PRINT_QT_PROGRAM
782
783 if AC_TRY_EVAL(ac_link) && test -s conftest; then
784 rm -f conftest*
785 else
786 echo "configure: failed program was:" >&AC_FD_CC
787 cat conftest.$ac_ext >&AC_FD_CC
788 ac_qt_libraries="NO"
789 fi
790 rm -f conftest*
791 CXXFLAGS="$ac_cxxflags_safe"
792 LDFLAGS="$ac_ldflags_safe"
793 LIBS="$ac_libs_safe"
794
795 AC_LANG_RESTORE
796 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
797 ac_cv_have_qt="have_qt=no"
798 ac_qt_notfound=""
799 if test "$ac_qt_includes" = NO; then
800 if test "$ac_qt_libraries" = NO; then
801 ac_qt_notfound="(headers and libraries)";
802 else
803 ac_qt_notfound="(headers)";
804 fi
805 else
806 ac_qt_notfound="(libraries)";
807 fi
808
809 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! ]);
810 else
811 have_qt="yes"
812 fi
813 ])
814
815 eval "$ac_cv_have_qt"
816
817 if test "$have_qt" != yes; then
818 AC_MSG_RESULT([$have_qt]);
819 else
820 ac_cv_have_qt="have_qt=yes \
821 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
822 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
823
824 qt_libraries="$ac_qt_libraries"
825 qt_includes="$ac_qt_includes"
826 fi
827
828 if test ! "$kde_qt_libs_given" = "yes"; then
829 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
830 fi
831
832 AC_SUBST(qt_libraries)
833 AC_SUBST(qt_includes)
834
835 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
836 QT_INCLUDES="";
837 else
838 QT_INCLUDES="-I$qt_includes"
839 all_includes="$QT_INCLUDES $all_includes"
840 fi
841
842 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
843 QT_LDFLAGS=""
844 else
845 QT_LDFLAGS="-L$qt_libraries"
846 all_libraries="$all_libraries $QT_LDFLAGS"
847 fi
848
849 AC_SUBST(QT_INCLUDES)
850 AC_SUBST(QT_LDFLAGS)
851 AC_PATH_QT_MOC
852
853 LIB_QT='-lqt $(LIBPNG) -lXext $(LIB_X11) $(X_PRE_LIBS)'
854 AC_SUBST(LIB_QT)
855
856 ])
857
858 AC_DEFUN(AC_PATH_QT,
859 [
860 AC_PATH_QT_1_3
861 ])
862
863 AC_DEFUN(KDE_CHECK_FINAL,
864 [
865 AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (needs lots of memory)],
866 kde_use_final=$enableval, kde_use_final=no)
867
868 if test "x$kde_use_final" = "xyes"; then
869 KDE_USE_FINAL_TRUE=""
870 KDE_USE_FINAL_FALSE="#"
871 KDE_CHECK_REPO
872 else
873 KDE_USE_FINAL_TRUE="#"
874 KDE_USE_FINAL_FALSE=""
875 fi
876 AC_SUBST(KDE_USE_FINAL_TRUE)
877 AC_SUBST(KDE_USE_FINAL_FALSE)
878
879 AC_ARG_ENABLE(closure, [ --disable-closure do not compile link tests],
880 kde_use_closure=$enableval, kde_use_closure=yes)
881
882 if test "x$kde_use_closure" = "xyes"; then
883 KDE_USE_CLOSURE_TRUE=""
884 KDE_USE_CLOSURE_FALSE="#"
885 KDE_COMPILER_REPO
886 # CXXFLAGS="$CXXFLAGS $REPO"
887 else
888 KDE_USE_CLOSURE_TRUE="#"
889 KDE_USE_CLOSURE_FALSE=""
890 fi
891 AC_SUBST(KDE_USE_CLOSURE_TRUE)
892 AC_SUBST(KDE_USE_CLOSURE_FALSE)
893 ])
894
895 dnl ------------------------------------------------------------------------
896 dnl Now, the same with KDE
897 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
898 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
899 dnl ------------------------------------------------------------------------
900 dnl
901 AC_DEFUN(AC_BASE_PATH_KDE,
902 [
903 AC_PREREQ([2.13])
904 AC_REQUIRE([KDE_MISC_TESTS])
905 AC_REQUIRE([AC_PATH_QT])dnl
906 AC_CHECK_RPATH
907 AC_MSG_CHECKING([for KDE])
908
909 if test "${prefix}" != NONE; then
910 kde_includes=${prefix}/include
911 ac_kde_includes=$prefix/include
912
913 if test "${exec_prefix}" != NONE; then
914 kde_libraries=${exec_prefix}/lib
915 ac_kde_libraries=$exec_prefix/lib
916 else
917 kde_libraries=${prefix}/lib
918 ac_kde_libraries=$prefix/lib
919 fi
920 else
921 ac_kde_includes=
922 ac_kde_libraries=
923 kde_libraries=""
924 kde_includes=""
925 fi
926
927 AC_CACHE_VAL(ac_cv_have_kde,
928 [#try to guess kde locations
929
930 if test -z "$1"; then
931
932 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde/include $x_includes $qt_includes"
933 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
934 kde_incdirs="$ac_kde_includes $kde_incdirs"
935 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
936 ac_kde_includes="$kde_incdir"
937
938 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
939 AC_MSG_ERROR([
940 in the prefix, you've chosen, are no KDE headers installed. This will fail.
941 So, check this please and use another prefix!])
942 fi
943
944 kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde/lib /usr/X11R6/kde/lib"
945 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
946 kde_libdirs="$ac_kde_libraries $kde_libdirs"
947 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
948 ac_kde_libraries="$kde_libdir"
949
950 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
951 AC_MSG_ERROR([
952 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
953 So, check this please and use another prefix!])
954 fi
955 ac_kde_libraries="$kde_libdir"
956
957 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
958 ac_cv_have_kde="have_kde=no"
959 else
960 ac_cv_have_kde="have_kde=yes \
961 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
962 fi
963
964 else dnl test -z $1
965
966 ac_cv_have_kde="have_kde=no"
967
968 fi
969 ])dnl
970
971 eval "$ac_cv_have_kde"
972
973 if test "$have_kde" != "yes"; then
974 if test "${prefix}" = NONE; then
975 ac_kde_prefix="$ac_default_prefix"
976 else
977 ac_kde_prefix="$prefix"
978 fi
979 if test "$exec_prefix" = NONE; then
980 ac_kde_exec_prefix="$ac_kde_prefix"
981 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
982 else
983 ac_kde_exec_prefix="$exec_prefix"
984 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
985 fi
986
987 kde_libraries="${ac_kde_exec_prefix}/lib"
988 kde_includes=${ac_kde_prefix}/include
989
990 else
991 ac_cv_have_kde="have_kde=yes \
992 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
993 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
994
995 kde_libraries="$ac_kde_libraries"
996 kde_includes="$ac_kde_includes"
997 fi
998 AC_SUBST(kde_libraries)
999 AC_SUBST(kde_includes)
1000
1001 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
1002 KDE_INCLUDES=""
1003 else
1004 KDE_INCLUDES="-I$kde_includes"
1005 all_includes="$KDE_INCLUDES $all_includes"
1006 fi
1007
1008 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
1009 KDE_LDFLAGS=""
1010 else
1011 KDE_LDFLAGS="-L$kde_libraries"
1012 all_libraries="$all_libraries $KDE_LDFLAGS"
1013 fi
1014
1015 AC_SUBST(KDE_LDFLAGS)
1016 AC_SUBST(KDE_INCLUDES)
1017
1018 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1019
1020 all_libraries="$all_libraries $USER_LDFLAGS"
1021 all_includes="$all_includes $USER_INCLUDES"
1022 AC_SUBST(all_includes)
1023 AC_SUBST(all_libraries)
1024
1025 AC_SUBST(AUTODIRS)
1026
1027 if test -z "$DCOPIDL"; then
1028 DCOPIDL='$(kde_bindir)/dcopidl'
1029 fi
1030 if test -z "$DCOPIDL2CPP"; then
1031 DCOPIDL2CPP='$(kde_bindir)/dcopidl2cpp'
1032 fi
1033 DCOP_DEPENDENCIES='$(DCOPIDL)'
1034 AC_SUBST(DCOPIDL)
1035 AC_SUBST(DCOPIDL2CPP)
1036 AC_SUBST(DCOP_DEPENDENCIES)
1037 ])
1038
1039 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1040 [
1041 AC_MSG_CHECKING(for extra includes)
1042 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1043 adds non standard include paths],
1044 kde_use_extra_includes="$withval",
1045 kde_use_extra_includes=NONE
1046 )
1047 kde_extra_includes=
1048 if test -n "$kde_use_extra_includes" && \
1049 test "$kde_use_extra_includes" != "NONE"; then
1050
1051 ac_save_ifs=$IFS
1052 IFS=':'
1053 for dir in $kde_use_extra_includes; do
1054 kde_extra_includes="$kde_extra_includes $dir"
1055 USER_INCLUDES="$USER_INCLUDES -I$dir"
1056 done
1057 IFS=$ac_save_ifs
1058 kde_use_extra_includes="added"
1059 else
1060 kde_use_extra_includes="no"
1061 fi
1062 AC_SUBST(USER_INCLUDES)
1063
1064 AC_MSG_RESULT($kde_use_extra_includes)
1065
1066 kde_extra_libs=
1067 AC_MSG_CHECKING(for extra libs)
1068 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1069 kde_use_extra_libs=$withval,
1070 kde_use_extra_libs=NONE
1071 )
1072 if test -n "$kde_use_extra_libs" && \
1073 test "$kde_use_extra_libs" != "NONE"; then
1074
1075 ac_save_ifs=$IFS
1076 IFS=':'
1077 for dir in $kde_use_extra_libs; do
1078 kde_extra_libs="$kde_extra_libs $dir"
1079 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir"
1080 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1081 done
1082 IFS=$ac_save_ifs
1083 kde_use_extra_libs="added"
1084 else
1085 kde_use_extra_libs="no"
1086 fi
1087
1088 AC_SUBST(USER_LDFLAGS)
1089
1090 AC_MSG_RESULT($kde_use_extra_libs)
1091
1092 ])
1093
1094 AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1095 [
1096 AC_MSG_CHECKING([for KDE headers installed])
1097 AC_LANG_CPLUSPLUS
1098 cat > conftest.$ac_ext <<EOF
1099 #include <stdio.h>
1100 #include "confdefs.h"
1101 #include <kapp.h>
1102
1103 int main() {
1104 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1105 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1106 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1107 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1108 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1109 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1110 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1111 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1112 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1113 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1114 printf("kde_wallpaperdir=\\"%s\\"\n",
1115 KApplication::kde_wallpaperdir().data());
1116 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1117 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1118 printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1119 printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1120 return 0;
1121 }
1122 EOF
1123
1124 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1125 if AC_TRY_EVAL(ac_compile); then
1126 AC_MSG_RESULT(yes)
1127 else
1128 AC_MSG_ERROR([your system is not able to compile a small KDE application!
1129 Check, if you installed the KDE header files correctly.])
1130 fi
1131 ])
1132
1133 AC_DEFUN(KDE_CHECK_KIMGIO,
1134 [
1135 AC_REQUIRE([AC_BASE_PATH_KDE])
1136 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1137 AC_REQUIRE([AC_FIND_TIFF])
1138 AC_REQUIRE([AC_FIND_JPEG])
1139 AC_REQUIRE([AC_FIND_PNG])
1140 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1141
1142 if test "$1" = "existance"; then
1143 AC_LANG_SAVE
1144 AC_LANG_CPLUSPLUS
1145 kde_save_LIBS="$LIBS"
1146 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1147 AC_CHECK_LIB(kimgio, kimgioRegister, [
1148 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1149 LIBS="$kde_save_LIBS"
1150 AC_LANG_RESTORE
1151 else
1152 LIBKIMGIO_EXISTS=yes
1153 fi
1154
1155 if test "$LIBKIMGIO_EXISTS" = "yes"; then
1156 LIB_KIMGIO='-lkimgio'
1157 else
1158 LIB_KIMGIO=''
1159 fi
1160 AC_SUBST(LIB_KIMGIO)
1161 ])
1162
1163 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1164 [
1165 AC_REQUIRE([KDE_MISC_TESTS])
1166 AC_REQUIRE([KDE_CHECK_LIBDL])
1167 AC_REQUIRE([K_PATH_X])
1168
1169 if test $kde_qtver = 2; then
1170 LIB_KDECORE='-lkdecore'
1171 AC_SUBST(LIB_KDECORE)
1172 LIB_KDEUI='-lkdeui'
1173 AC_SUBST(LIB_KDEUI)
1174 LIB_KFORMULA='-lkformula'
1175 AC_SUBST(LIB_KFORMULA)
1176 LIB_KIO='-lkio'
1177 AC_SUBST(LIB_KIO)
1178 LIB_KSYCOCA='-lksycoca'
1179 AC_SUBST(LIB_KSYCOCA)
1180 LIB_SMB='-lsmb'
1181 AC_SUBST(LIB_SMB)
1182 LIB_KFILE='-lkfile'
1183 AC_SUBST(LIB_KFILE)
1184 LIB_KAB='-lkab'
1185 AC_SUBST(LIB_KAB)
1186 LIB_MEDIATOOL='-lmediatool'
1187 AC_SUBST(LIB_MEDIATOOL)
1188 LIB_KHTML='-lkhtml'
1189 AC_SUBST(LIB_KHTML)
1190 LIB_KSPELL='-lkspell'
1191 AC_SUBST(LIB_KSPELL)
1192 LIB_KPARTS='-lkparts'
1193 AC_SUBST(LIB_KPARTS)
1194 else
1195 LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1196 AC_SUBST(LIB_KDECORE)
1197 LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1198 AC_SUBST(LIB_KDEUI)
1199 LIB_KFM='-lkfm $(LIB_KDECORE)'
1200 AC_SUBST(LIB_KFM)
1201 LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1202 AC_SUBST(LIB_KFILE)
1203 LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1204 AC_SUBST(LIB_KAB)
1205 LIB_MEDIATOOL='-lmediatool $(LIB_KDECORE)'
1206 AC_SUBST(LIB_MEDIATOOL)
1207 fi
1208 ])
1209
1210 AC_DEFUN(AC_PATH_KDE,
1211 [
1212 AC_BASE_PATH_KDE
1213 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1214 [
1215 if test "$enableval" = "no";
1216 then ac_use_path_checking="default"
1217 else ac_use_path_checking=""
1218 fi
1219 ],
1220 [
1221 if test "$kde_qtver" = 1;
1222 then ac_use_path_checking=""
1223 else ac_use_path_checking="default"
1224 fi
1225 ]
1226 )
1227
1228 AC_CREATE_KFSSTND($ac_use_path_checking)
1229
1230 AC_SUBST_KFSSTND
1231 KDE_CREATE_LIBS_ALIASES
1232 ])
1233
1234 dnl slightly changed version of AC_CHECK_FUNC(setenv)
1235 AC_DEFUN(AC_CHECK_SETENV,
1236 [AC_MSG_CHECKING([for setenv])
1237 AC_CACHE_VAL(ac_cv_func_setenv,
1238 [AC_LANG_C
1239 AC_TRY_LINK(
1240 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
1241 dnl which includes <sys/select.h> which contains a prototype for
1242 dnl select. Similarly for bzero.
1243 [#include <assert.h>
1244 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
1245 extern "C"
1246 #endif
1247 ])dnl
1248 [/* We use char because int might match the return type of a gcc2
1249 builtin and then its argument prototype would still apply. */
1250 #include <stdlib.h>
1251 ], [
1252 /* The GNU C library defines this for functions which it implements
1253 to always fail with ENOSYS. Some functions are actually named
1254 something starting with __ and the normal name is an alias. */
1255 #if defined (__stub_$1) || defined (__stub___$1)
1256 choke me
1257 #else
1258 setenv("TEST", "alle", 1);
1259 #endif
1260 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
1261
1262 if test "$ac_cv_func_setenv" = "yes"; then
1263 AC_MSG_RESULT(yes)
1264 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV, 1, [Define if you have setenv])
1265 else
1266 AC_MSG_RESULT(no)
1267 fi
1268 ])
1269
1270 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1271 [
1272 AC_LANG_CPLUSPLUS
1273 save_CXXFLAGS="$CXXFLAGS"
1274 if test "$GCC" = "yes"; then
1275 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1276 fi
1277 AC_MSG_CHECKING(for getdomainname)
1278 AC_CACHE_VAL(ac_cv_func_getdomainname,
1279 [
1280 AC_TRY_COMPILE([
1281 #include <stdlib.h>
1282 #include <unistd.h>
1283 ],
1284 [
1285 char buffer[200];
1286 getdomainname(buffer, 200);
1287 ],
1288 ac_cv_func_getdomainname=yes,
1289 ac_cv_func_getdomainname=no)
1290 ])
1291 AC_MSG_RESULT($ac_cv_func_getdomainname)
1292 if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1293 AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1294 fi
1295 CXXFLAGS="$save_CXXFLAGS"
1296 ])
1297
1298 AC_DEFUN(AC_CHECK_GETHOSTNAME,
1299 [
1300 AC_LANG_CPLUSPLUS
1301 save_CXXFLAGS="$CXXFLAGS"
1302 if test "$GCC" = "yes"; then
1303 CXXFLAGS="$CXXFLAGS -pedantic-errors"
1304 fi
1305
1306 AC_MSG_CHECKING([for gethostname])
1307 AC_CACHE_VAL(ac_cv_func_gethostname,
1308 [
1309 AC_TRY_COMPILE([
1310 #include <stdlib.h>
1311 #include <unistd.h>
1312 ],
1313 [
1314 char buffer[200];
1315 gethostname(buffer, 200);
1316 ],
1317 ac_cv_func_gethostname=yes,
1318 ac_cv_func_gethostname=no)
1319 ])
1320 AC_MSG_RESULT($ac_cv_func_gethostname)
1321 if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1322 AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have getdomainname])
1323 fi
1324 CXXFLAGS="$save_CXXFLAGS"
1325 ])
1326
1327 AC_DEFUN(AC_CHECK_USLEEP,
1328 [
1329 AC_LANG_CPLUSPLUS
1330
1331 AC_MSG_CHECKING([for usleep])
1332 AC_CACHE_VAL(ac_cv_func_usleep,
1333 [
1334 ac_libs_safe="$LIBS"
1335 LIBS="$LIBS $LIBUCB"
1336 AC_TRY_LINK([
1337 #include <stdlib.h>
1338 #include <unistd.h>
1339 ],
1340 [
1341 usleep(200);
1342 ],
1343 ac_cv_func_usleep=yes,
1344 ac_cv_func_usleep=no)
1345 ])
1346 AC_MSG_RESULT($ac_cv_func_usleep)
1347 if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1348 AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1349 fi
1350 LIBS="$ac_libs_safe"
1351 ])
1352
1353 AC_DEFUN(AC_CHECK_RANDOM,
1354 [
1355 AC_LANG_CPLUSPLUS
1356
1357 AC_MSG_CHECKING([for random])
1358 AC_CACHE_VAL(ac_cv_func_random,
1359 [
1360 ac_libs_safe="$LIBS"
1361 LIBS="$LIBS $LIBUCB"
1362 AC_TRY_LINK([
1363 #include <stdlib.h>
1364 ],
1365 [
1366 random();
1367 ],
1368 ac_cv_func_random=yes,
1369 ac_cv_func_random=no)
1370 ])
1371 AC_MSG_RESULT($ac_cv_func_random)
1372 if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1373 AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1374 fi
1375 LIBS="$ac_libs_safe"
1376 ])
1377
1378 AC_DEFUN(AC_FIND_GIF,
1379 [AC_MSG_CHECKING([for giflib])
1380 AC_CACHE_VAL(ac_cv_lib_gif,
1381 [ac_save_LIBS="$LIBS"
1382 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1383 AC_TRY_LINK(dnl
1384 [
1385 #ifdef __cplusplus
1386 extern "C" {
1387 #endif
1388 int GifLastError(void);
1389 #ifdef __cplusplus
1390 }
1391 #endif
1392 /* We use char because int might match the return type of a gcc2
1393 builtin and then its argument prototype would still apply. */
1394 ],
1395 [return GifLastError();],
1396 eval "ac_cv_lib_gif=yes",
1397 eval "ac_cv_lib_gif=no")
1398 LIBS="$ac_save_LIBS"
1399 ])dnl
1400 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1401 AC_MSG_RESULT(yes)
1402 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
1403 else
1404 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1405 fi
1406 ])
1407
1408 AC_DEFUN(KDE_FIND_JPEG_HELPER,
1409 [
1410 AC_MSG_CHECKING([for libjpeg$2])
1411 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1412 [
1413 AC_LANG_C
1414 ac_save_LIBS="$LIBS"
1415 LIBS="$all_libraries -ljpeg$2 -lm"
1416 AC_TRY_LINK(
1417 [/* Override any gcc2 internal prototype to avoid an error. */
1418 struct jpeg_decompress_struct;
1419 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1420 typedef int size_t;
1421 #ifdef __cplusplus
1422 extern "C" {
1423 #endif
1424 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1425 int version, size_t structsize);
1426 #ifdef __cplusplus
1427 }
1428 #endif
1429 /* We use char because int might match the return type of a gcc2
1430 builtin and then its argument prototype would still apply. */
1431 ],
1432 [jpeg_CreateDecompress(0L, 0, 0);],
1433 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1434 eval "ac_cv_lib_jpeg_$1=no")
1435 LIBS="$ac_save_LIBS"
1436 ])
1437
1438 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1439 LIBJPEG="$ac_cv_lib_jpeg_$1"
1440 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1441 else
1442 AC_MSG_RESULT(no)
1443 $3
1444 fi
1445
1446 ])
1447
1448 AC_DEFUN(AC_FIND_JPEG,
1449 [
1450 KDE_FIND_JPEG_HELPER(6b, 6b,
1451 KDE_FIND_JPEG_HELPER(normal, [],
1452 [
1453 dnl what to do, if the normal way fails:
1454 if test -f "$kde_libraries/libjpeg.so"; then
1455 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1456 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1457 else if test -f "$kde_libraries/libjpeg.sl"; then
1458 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1459 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1460 else if test -f "$kde_libraries/libjpeg.a"; then
1461 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1462 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1463 else
1464 AC_MSG_ERROR([
1465 You need the development package of libjpeg6b. You can get
1466 a source package of libjpeg from http://www.ijg.org/
1467 ])
1468 fi
1469 fi
1470 fi
1471
1472 LIBJPEG=$ac_cv_lib_jpeg
1473 ]))
1474
1475 AC_SUBST(LIBJPEG)
1476 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
1477
1478 ])
1479
1480 AC_DEFUN(AC_FIND_ZLIB,
1481 [
1482 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1483 AC_MSG_CHECKING([for libz])
1484 AC_CACHE_VAL(ac_cv_lib_z,
1485 [
1486 AC_LANG_C
1487 kde_save_LIBS="$LIBS"
1488 LIBS="$all_libraries -lz $LIBSOCKET"
1489 kde_save_CFLAGS="$CFLAGS"
1490 CFLAGS="$CFLAGS $all_includes"
1491 AC_TRY_LINK(dnl
1492 [
1493 #include<zlib.h>
1494 ],
1495 [return (zlibVersion() == ZLIB_VERSION); ],
1496 eval "ac_cv_lib_z='-lz'",
1497 eval "ac_cv_lib_z=no")
1498 LIBS="$kde_save_LIBS"
1499 CFLAGS="$kde_save_CFLAGS"
1500 ])dnl
1501 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1502 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
1503 LIBZ="$ac_cv_lib_z"
1504 AC_SUBST(LIBZ)
1505 AC_MSG_RESULT($ac_cv_lib_z)
1506 else
1507 AC_MSG_RESULT(no)
1508 LIBZ=""
1509 AC_SUBST(LIBZ)
1510 fi
1511 ])
1512
1513 AC_DEFUN(KDE_TRY_TIFFLIB,
1514 [
1515 AC_MSG_CHECKING([for libtiff $1])
1516
1517 AC_CACHE_VAL(kde_cv_libtiff_$1,
1518 [
1519 AC_LANG_CPLUSPLUS
1520 kde_save_LIBS="$LIBS"
1521 LIBS="$all_libraries -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
1522 kde_save_CXXFLAGS="$CXXFLAGS"
1523 CXXFLAGS="$CXXFLAGS $all_includes"
1524
1525 AC_TRY_LINK(dnl
1526 [
1527 #include<tiffio.h>
1528 ],
1529 [return (TIFFOpen( "", "r") == 0); ],
1530 [
1531 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
1532 ], [
1533 kde_cv_libtiff_$1=no
1534 ])
1535
1536 LIBS="$kde_save_LIBS"
1537 CXXFLAGS="$kde_save_CXXFLAGS"
1538
1539 ])
1540
1541 if test "$kde_cv_libtiff_$1" = "no"; then
1542 AC_MSG_RESULT(no)
1543 LIBTIFF=""
1544 $3
1545 else
1546 LIBTIFF="$kde_cv_libtiff_$1"
1547 AC_MSG_RESULT(yes)
1548 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
1549 $2
1550 fi
1551
1552 ])
1553
1554 AC_DEFUN(AC_FIND_TIFF,
1555 [
1556 AC_REQUIRE([K_PATH_X])
1557 AC_REQUIRE([AC_FIND_ZLIB])
1558 AC_REQUIRE([AC_FIND_JPEG])
1559 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1560
1561 KDE_TRY_TIFFLIB(tiff, [],
1562 KDE_TRY_TIFFLIB(tiff34))
1563
1564 AC_SUBST(LIBTIFF)
1565 ])
1566
1567
1568 AC_DEFUN(AC_FIND_PNG,
1569 [
1570 AC_REQUIRE([AC_FIND_ZLIB])
1571 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1572 AC_MSG_CHECKING([for libpng])
1573 AC_CACHE_VAL(ac_cv_lib_png,
1574 [
1575 kde_save_LIBS="$LIBS"
1576 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1577 kde_save_CFLAGS="$CFLAGS"
1578 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1579 AC_LANG_C
1580 AC_TRY_LINK(dnl
1581 [
1582 #include<png.h>
1583 ],
1584 [
1585 png_structp png_ptr = png_create_read_struct( /* image ptr */
1586 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1587 return( png_ptr != 0 );
1588 ],
1589 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1590 eval "ac_cv_lib_png=no"
1591 )
1592 LIBS="$kde_save_LIBS"
1593 CFLAGS="$kde_save_CFLAGS"
1594 ])dnl
1595 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1596 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
1597 LIBPNG="$ac_cv_lib_png"
1598 AC_SUBST(LIBPNG)
1599 AC_MSG_RESULT($ac_cv_lib_png)
1600 else
1601 AC_MSG_RESULT(no)
1602 LIBPNG=""
1603 AC_SUBST(LIBPNG)
1604 fi
1605 ])
1606
1607 AC_DEFUN(AC_CHECK_BOOL,
1608 [
1609 AC_MSG_CHECKING([for bool])
1610 AC_CACHE_VAL(ac_cv_have_bool,
1611 [
1612 AC_LANG_CPLUSPLUS
1613 AC_TRY_COMPILE([],
1614 [bool aBool = true;],
1615 [ac_cv_have_bool="yes"],
1616 [ac_cv_have_bool="no"])
1617 ]) dnl end AC_CHECK_VAL
1618 AC_MSG_RESULT($ac_cv_have_bool)
1619 if test "$ac_cv_have_bool" = "yes"; then
1620 AC_DEFINE(HAVE_BOOL, 1, [Define if the C++ compiler supports BOOL])
1621 fi
1622 ])
1623
1624 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1625 [
1626 AC_MSG_CHECKING(if you need GNU extensions)
1627 AC_CACHE_VAL(ac_cv_gnu_extensions,
1628 [
1629 cat > conftest.c << EOF
1630 #include <features.h>
1631
1632 #ifdef __GNU_LIBRARY__
1633 yes
1634 #endif
1635 EOF
1636
1637 if (eval "$ac_cpp conftest.c") 2>&5 |
1638 egrep "yes" >/dev/null 2>&1; then
1639 rm -rf conftest*
1640 ac_cv_gnu_extensions=yes
1641 else
1642 ac_cv_gnu_extensions=no
1643 fi
1644 ])
1645
1646 AC_MSG_RESULT($ac_cv_gnu_extensions)
1647 if test "$ac_cv_gnu_extensions" = "yes"; then
1648 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
1649 fi
1650 ])
1651
1652 AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
1653 [
1654 AC_REQUIRE([AC_CHECK_COMPILERS])
1655 AC_MSG_CHECKING(whether $CXX supports -$1)
1656 kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
1657 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
1658 [
1659 echo 'void f(){}' >conftest.cc
1660 if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
1661 eval "kde_cv_prog_cxx_$kde_cache=yes"
1662 else
1663 eval "kde_cv_prog_cxx_$kde_cache=no"
1664 fi
1665 rm -f conftest*
1666 ])
1667 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
1668 AC_MSG_RESULT(yes)
1669 :
1670 $2
1671 else
1672 AC_MSG_RESULT(no)
1673 :
1674 $3
1675 fi
1676 ])
1677
1678 AC_DEFUN(AC_CHECK_COMPILERS,
1679 [
1680 dnl this is somehow a fat lie, but prevents other macros from double checking
1681 AC_PROVIDE([AC_PROG_CC])
1682 AC_PROVIDE([AC_PROG_CPP])
1683 AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
1684 [
1685 if test $enableval = "no"; dnl
1686 then
1687 kde_use_debug_code="no"
1688 kde_use_debug_define=yes
1689 else
1690 kde_use_debug_code="yes"
1691 kde_use_debug_define=no
1692 fi
1693 ], [kde_use_debug_code="no"
1694 kde_use_debug_define=no
1695 ])
1696
1697 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
1698 [
1699 if test $enableval = "no"; then
1700 kde_use_strict_options="no"
1701 else
1702 kde_use_strict_options="yes"
1703 fi
1704 ], [kde_use_strict_options="no"])
1705
1706 dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
1707 AC_MSG_CHECKING(for a C-Compiler)
1708 dnl if there is one, print out. if not, don't matter
1709 AC_MSG_RESULT($CC)
1710
1711 if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
1712 if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
1713 if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
1714 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
1715
1716 AC_PROG_CC_WORKS
1717 AC_PROG_CC_GNU
1718
1719 if test $ac_cv_prog_gcc = yes; then
1720 GCC=yes
1721 else
1722 GCC=
1723 fi
1724
1725 if test -z "$CFLAGS"; then
1726 if test "$kde_use_debug_code" = "yes"; then
1727 AC_PROG_CC_G
1728 if test $ac_cv_prog_cc_g = yes; then
1729 CFLAGS="-g"
1730 fi
1731 else
1732 if test "$GCC" = "yes"; then
1733 CFLAGS="-O2"
1734 else
1735 CFLAGS=""
1736 fi
1737 if test "$kde_use_debug_define" = "yes"; then
1738 CFLAGS="$CFLAGS -DNDEBUG"
1739 fi
1740 fi
1741
1742 if test "$GCC" = "yes"; then
1743 CFLAGS="$CFLAGS"
1744
1745 if test "$kde_use_strict_options" = "yes"; then
1746 CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
1747 fi
1748 fi
1749
1750 fi
1751
1752 case "$host" in
1753 *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
1754 esac
1755
1756 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
1757 LDFLAGS="-s"
1758 fi
1759
1760
1761 dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
1762 dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
1763
1764 AC_MSG_CHECKING(how to run the C preprocessor)
1765 # On Suns, sometimes $CPP names a directory.
1766 if test -n "$CPP" && test -d "$CPP"; then
1767 CPP=
1768 fi
1769 if test -z "$CPP"; then
1770 AC_CACHE_VAL(ac_cv_prog_CPP,
1771 [ # This must be in double quotes, not single quotes, because CPP may get
1772 # substituted into the Makefile and "${CC-cc}" will confuse make.
1773 CPP="${CC-cc} -E"
1774 # On the NeXT, cc -E runs the code through the compiler's parser,
1775 # not just through cpp.
1776 dnl Use a header file that comes with gcc, so configuring glibc
1777 dnl with a fresh cross-compiler works.
1778 AC_TRY_CPP([#include <assert.h>
1779 Syntax Error], ,
1780 CPP="${CC-cc} -E -traditional-cpp"
1781 AC_TRY_CPP([#include <assert.h>
1782 Syntax Error], , CPP=/lib/cpp))
1783 ac_cv_prog_CPP="$CPP"])dnl
1784 CPP="$ac_cv_prog_CPP"
1785 else
1786 ac_cv_prog_CPP="$CPP"
1787 fi
1788 AC_MSG_RESULT($CPP)
1789 AC_SUBST(CPP)dnl
1790
1791
1792 AC_MSG_CHECKING(for a C++-Compiler)
1793 dnl if there is one, print out. if not, don't matter
1794 AC_MSG_RESULT($CXX)
1795
1796 if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
1797 if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
1798 if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
1799 if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
1800 test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
1801
1802 AC_PROG_CXX_WORKS
1803 AC_PROG_CXX_GNU
1804
1805 if test $ac_cv_prog_gxx = yes; then
1806 GXX=yes
1807 fi
1808
1809 if test -z "$CXXFLAGS"; then
1810 if test "$kde_use_debug_code" = "yes"; then
1811 AC_PROG_CXX_G
1812 if test $ac_cv_prog_cxx_g = yes; then
1813 CXXFLAGS="-g"
1814 fi
1815 else
1816 if test "$GXX" = "yes"; then
1817 CXXFLAGS="-O2"
1818 fi
1819 if test "$kde_use_debug_define" = "yes"; then
1820 CXXFLAGS="$CXXFLAGS -DNDEBUG"
1821 fi
1822 fi
1823
1824 KDE_CHECK_COMPILER_FLAG(fno-exceptions,
1825 [
1826 CXXFLAGS="$CXXFLAGS -fno-exceptions"
1827 ])
1828
1829 KDE_CHECK_COMPILER_FLAG(fno-rtti,
1830 [
1831 CXXFLAGS="$CXXFLAGS -fno-rtti"
1832 ])
1833
1834 KDE_CHECK_COMPILER_FLAG(fno-check-new,
1835 [
1836 CXXFLAGS="$CXXFLAGS -fno-check-new"
1837 ])
1838
1839 if test "$GXX" = "yes"; then
1840 CXXFLAGS="$CXXFLAGS"
1841
1842 if test "$kde_use_debug_code" = "yes"; then
1843 CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
1844
1845 KDE_CHECK_COMPILER_FLAG(Wno-long-long,
1846 [
1847 CXXFLAGS="$CXXFLAGS -Wno-long-long"
1848 ])
1849 KDE_CHECK_COMPILER_FLAG(fno-builtin,
1850 [
1851 CXXFLAGS="$CXXFLAGS -fno-builtin"
1852 ])
1853
1854 fi
1855
1856 if test "$kde_use_strict_options" = "yes"; then
1857 CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align -Woverloaded-virtual"
1858 fi
1859
1860 if test "$kde_very_strict" = "yes"; then
1861 CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
1862 fi
1863 fi
1864 fi
1865
1866 KDE_CHECK_COMPILER_FLAG(fexceptions,
1867 [
1868 USE_EXCEPTIONS="-fexceptions"
1869 ],
1870 USE_EXCEPTIONS=
1871 )
1872 AC_SUBST(USE_EXCEPTIONS)
1873
1874 KDE_CHECK_COMPILER_FLAG(frtti,
1875 [
1876 USE_RTTI="-frtti"
1877 ],
1878 USE_RTTI=
1879 )
1880 AC_SUBST(USE_RTTI)
1881
1882 case "$host" in
1883 *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
1884 esac
1885
1886 AC_PROVIDE(AC_PROG_CXXCPP)
1887
1888 AC_MSG_CHECKING(how to run the C++ preprocessor)
1889 if test -z "$CXXCPP"; then
1890 AC_CACHE_VAL(ac_cv_prog_CXXCPP,
1891 [
1892 AC_LANG_SAVE[]dnl
1893 AC_LANG_CPLUSPLUS[]dnl
1894 CXXCPP="${CXX-g++} -E"
1895 AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
1896 ac_cv_prog_CXXCPP="$CXXCPP"
1897 AC_LANG_RESTORE[]dnl
1898 ])dnl
1899 CXXCPP="$ac_cv_prog_CXXCPP"
1900 fi
1901 AC_MSG_RESULT($CXXCPP)
1902 AC_SUBST(CXXCPP)dnl
1903
1904 # the following is to allow programs, that are known to
1905 # have problems when compiled with -O2
1906 if test -n "$CXXFLAGS"; then
1907 kde_safe_IFS=$IFS
1908 IFS=" "
1909 NOOPT_CXXFLAGS=""
1910 for i in $CXXFLAGS; do
1911 if test ! "$i" = "-O2"; then
1912 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
1913 fi
1914 done
1915 IFS=$kde_safe_IFS
1916 fi
1917 AC_SUBST(NOOPT_CXXFLAGS)
1918
1919 KDE_CHECK_FINAL
1920
1921 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
1922
1923 KDE_CXXFLAGS=
1924 AC_SUBST(KDE_CXXFLAGS)
1925 ])
1926
1927 AC_DEFUN(KDE_ADD_DEPENDENCIES,
1928 [
1929 [A]M_DEPENDENCIES(CC)
1930 [A]M_DEPENDENCIES(CXX)
1931 ])
1932
1933 dnl just a wrapper to clean up configure.in
1934 AC_DEFUN(KDE_PROG_LIBTOOL,
1935 [
1936 AC_REQUIRE([AC_CHECK_COMPILERS])
1937 AC_REQUIRE([AC_ENABLE_SHARED])
1938 AC_REQUIRE([AC_ENABLE_STATIC])
1939
1940 if test -z "$LIBTOOL"; then
1941 dnl libtool is only for C, so I must force him
1942 dnl to find the correct flags for C++
1943 kde_save_cc=$CC
1944 kde_save_cflags="$CFLAGS"
1945 CC=$CXX
1946 CFLAGS="$CXXFLAGS"
1947 AC_LANG_SAVE
1948 AC_LANG_C
1949 AC_LIBTOOL_DLOPEN
1950 AM_PROG_LIBTOOL
1951 # LIBTOOL="$LIBTOOL --silent"
1952 dnl AC_SUBST(LIBTOOL)
1953 AC_LANG_RESTORE
1954 CC=$kde_save_cc
1955 CFLAGS="$kde_save_cflags"
1956 LIBTOOL_SHELL='/bin/sh ./libtool'
1957 else
1958 LIBTOOL_SHELL=$LIBTOOL
1959 fi
1960 ])
1961
1962 AC_DEFUN(KDE_DO_IT_ALL,
1963 [
1964 AC_CANONICAL_SYSTEM
1965 AC_ARG_PROGRAM
1966 AM_INIT_AUTOMAKE($1, $2)
1967 AM_DISABLE_LIBRARIES
1968 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1969 AC_CHECK_COMPILERS
1970 KDE_PROG_LIBTOOL
1971 AM_KDE_WITH_NLS
1972 AC_PATH_KDE
1973 ])
1974
1975 AC_DEFUN(AC_CHECK_RPATH,
1976 [
1977 AC_MSG_CHECKING(for rpath)
1978 AC_ARG_ENABLE(rpath,
1979 [ --disable-rpath do not use the rpath feature of ld],
1980 USE_RPATH=$enableval, USE_RPATH=yes)
1981
1982 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1983
1984 KDE_RPATH="-rpath \$(kde_libraries)"
1985
1986 if test -n "$qt_libraries"; then
1987 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1988 fi
1989 dnl $x_libraries is set to /usr/lib in case
1990 if test -n "$X_LDFLAGS"; then
1991 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1992 fi
1993 if test -n "$KDE_EXTRA_RPATH"; then
1994 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1995 fi
1996 fi
1997 AC_SUBST(KDE_EXTRA_RPATH)
1998 AC_SUBST(KDE_RPATH)
1999 AC_MSG_RESULT($USE_RPATH)
2000 ])
2001
2002 dnl Check for the type of the third argument of getsockname
2003 AC_DEFUN(AC_CHECK_KSIZE_T,
2004 [AC_MSG_CHECKING(for the third argument of getsockname)
2005 AC_CACHE_VAL(ac_cv_ksize_t,
2006 AC_LANG_SAVE
2007 AC_LANG_CPLUSPLUS
2008 [AC_TRY_COMPILE([
2009 #include <sys/types.h>
2010 #include <sys/socket.h>
2011 ],[
2012 socklen_t a=0;
2013 getsockname(0,(struct sockaddr*)0, &a);
2014 ],
2015 ac_cv_ksize_t=socklen_t,
2016 ac_cv_ksize_t=)
2017 if test -z "$ac_cv_ksize_t"; then
2018 ac_safe_cxxflags="$CXXFLAGS"
2019 if test "$GCC" = "yes"; then
2020 CXXFLAGS="-Werror $CXXFLAGS"
2021 fi
2022 AC_TRY_COMPILE([
2023 #include <sys/types.h>
2024 #include <sys/socket.h>
2025 ],[
2026 int a=0;
2027 getsockname(0,(struct sockaddr*)0, &a);
2028 ],
2029 ac_cv_ksize_t=int,
2030 ac_cv_ksize_t=size_t)
2031 CXXFLAGS="$ac_safe_cxxflags"
2032 fi
2033 AC_LANG_RESTORE
2034 ])
2035
2036 if test -z "$ac_cv_ksize_t"; then
2037 ac_cv_ksize_t=int
2038 fi
2039
2040 AC_MSG_RESULT($ac_cv_ksize_t)
2041 AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t,
2042 [Define the type of the third argument for getsockname]
2043 )
2044
2045 ])
2046
2047 dnl This is a merge of some macros out of the gettext aclocal.m4
2048 dnl since we don't need anything, I took the things we need
2049 dnl the copyright for them is:
2050 dnl >
2051 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2052 dnl This Makefile.in is free software; the Free Software Foundation
2053 dnl gives unlimited permission to copy and/or distribute it,
2054 dnl with or without modifications, as long as this notice is preserved.
2055
2056 dnl This program is distributed in the hope that it will be useful,
2057 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2058 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2059 dnl PARTICULAR PURPOSE.
2060 dnl >
2061 dnl for this file it is relicensed under LGPL
2062
2063 AC_DEFUN(AM_KDE_WITH_NLS,
2064 [AC_MSG_CHECKING([whether NLS is requested])
2065 dnl Default is enabled NLS
2066 AC_ARG_ENABLE(nls,
2067 [ --disable-nls do not use Native Language Support],
2068 USE_NLS=$enableval, USE_NLS=yes)
2069 AC_MSG_RESULT($USE_NLS)
2070 AC_SUBST(USE_NLS)
2071
2072 dnl If we use NLS figure out what method
2073 if test "$USE_NLS" = "yes"; then
2074 AC_DEFINE(ENABLE_NLS, 1, [Define if NLS is requested])
2075
2076 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
2077 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
2078 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2079
2080 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
2081 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
2082 GMSGFMT=":"
2083 fi
2084 MSGFMT=$GMSGFMT
2085 AC_SUBST(GMSGFMT)
2086 AC_SUBST(MSGFMT)
2087
2088 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
2089 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2090
2091 dnl Test whether we really found GNU xgettext.
2092 if test "$XGETTEXT" != ":"; then
2093 dnl If it is no GNU xgettext we define it as : so that the
2094 dnl Makefiles still can work.
2095 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2096 : ;
2097 else
2098 AC_MSG_RESULT(
2099 [found xgettext programs is not GNU xgettext; ignore it])
2100 XGETTEXT=":"
2101 fi
2102 fi
2103 AC_SUBST(XGETTEXT)
2104 fi
2105
2106 ])
2107
2108 # Search path for a program which passes the given test.
2109 # Ulrich Drepper <drepper@cygnus.com>, 1996.
2110
2111 # serial 1
2112 # Stephan Kulow: I appended a _KDE against name conflicts
2113
2114 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
2115 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2116 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
2117 [# Extract the first word of "$2", so it can be a program name with args.
2118 set dummy $2; ac_word=[$]2
2119 AC_MSG_CHECKING([for $ac_word])
2120 AC_CACHE_VAL(ac_cv_path_$1,
2121 [case "[$]$1" in
2122 /*)
2123 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2124 ;;
2125 *)
2126 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2127 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2128 test -z "$ac_dir" && ac_dir=.
2129 if test -f $ac_dir/$ac_word; then
2130 if [$3]; then
2131 ac_cv_path_$1="$ac_dir/$ac_word"
2132 break
2133 fi
2134 fi
2135 done
2136 IFS="$ac_save_ifs"
2137 dnl If no 4th arg is given, leave the cache variable unset,
2138 dnl so AC_PATH_PROGS will keep looking.
2139 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2140 ])dnl
2141 ;;
2142 esac])dnl
2143 $1="$ac_cv_path_$1"
2144 if test -n "[$]$1"; then
2145 AC_MSG_RESULT([$]$1)
2146 else
2147 AC_MSG_RESULT(no)
2148 fi
2149 AC_SUBST($1)dnl
2150 ])
2151
2152
2153 # Check whether LC_MESSAGES is available in <locale.h>.
2154 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2155
2156 # serial 1
2157
2158 AC_DEFUN(AM_LC_MESSAGES,
2159 [if test $ac_cv_header_locale_h = yes; then
2160 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2161 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2162 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2163 if test $am_cv_val_LC_MESSAGES = yes; then
2164 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2165 fi
2166 fi])
2167
2168 dnl From Jim Meyering.
2169 dnl FIXME: migrate into libit.
2170
2171 AC_DEFUN(AM_FUNC_OBSTACK,
2172 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
2173 [AC_TRY_LINK([#include "obstack.h"],
2174 [struct obstack *mem;obstack_free(mem,(char *) 0)],
2175 am_cv_func_obstack=yes,
2176 am_cv_func_obstack=no)])
2177 if test $am_cv_func_obstack = yes; then
2178 AC_DEFINE(HAVE_OBSTACK)
2179 else
2180 LIBOBJS="$LIBOBJS obstack.o"
2181 fi
2182 ])
2183
2184 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
2185 dnl FIXME: Migrate into libit
2186
2187 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
2188 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
2189 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
2190 am_cv_lib_error_at_line=yes,
2191 am_cv_lib_error_at_line=no)])
2192 if test $am_cv_lib_error_at_line = no; then
2193 LIBOBJS="$LIBOBJS error.o"
2194 fi
2195 AC_SUBST(LIBOBJS)dnl
2196 ])
2197
2198 # Macro to add for using GNU gettext.
2199 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2200
2201 # serial 1
2202 # Stephan Kulow: I put a KDE in it to avoid name conflicts
2203
2204 AC_DEFUN(AM_KDE_GNU_GETTEXT,
2205 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2206 AC_REQUIRE([AC_PROG_RANLIB])dnl
2207 AC_REQUIRE([AC_HEADER_STDC])dnl
2208 AC_REQUIRE([AC_C_INLINE])dnl
2209 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2210 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2211 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2212 AC_REQUIRE([AC_FUNC_MMAP])dnl
2213 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2214 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
2215 unistd.h values.h alloca.h])
2216 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2217 __argz_count __argz_stringify __argz_next])
2218
2219 AC_MSG_CHECKING(for stpcpy)
2220 AC_CACHE_VAL(kde_cv_func_stpcpy,
2221 [
2222 kde_safe_cxxflags=$CXXFLAGS
2223 CXXFLAGS="-Wmissing-prototypes -Werror"
2224 AC_LANG_SAVE
2225 AC_LANG_CPLUSPLUS
2226 AC_TRY_COMPILE([
2227 #include <string.h>
2228 ],
2229 [
2230 char buffer[200];
2231 stpcpy(buffer, buffer);
2232 ],
2233 kde_cv_func_stpcpy=yes,
2234 kde_cv_func_stpcpy=no)
2235 AC_LANG_RESTORE
2236 CXXFLAGS=$kde_safe_cxxflags
2237 ])
2238 AC_MSG_RESULT($kde_cv_func_stpcpy)
2239 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
2240 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
2241 fi
2242
2243 AM_LC_MESSAGES
2244
2245 if test "x$CATOBJEXT" != "x"; then
2246 if test "x$ALL_LINGUAS" = "x"; then
2247 LINGUAS=
2248 else
2249 AC_MSG_CHECKING(for catalogs to be installed)
2250 NEW_LINGUAS=
2251 for lang in ${LINGUAS=$ALL_LINGUAS}; do
2252 case "$ALL_LINGUAS" in
2253 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2254 esac
2255 done
2256 LINGUAS=$NEW_LINGUAS
2257 AC_MSG_RESULT($LINGUAS)
2258 fi
2259
2260 dnl Construct list of names of catalog files to be constructed.
2261 if test -n "$LINGUAS"; then
2262 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2263 fi
2264 fi
2265
2266 ])
2267
2268 AC_DEFUN(AC_HAVE_XPM,
2269 [AC_REQUIRE_CPP()dnl
2270 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2271
2272 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
2273 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
2274
2275 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
2276 xpm_test=$withval, xpm_test="yes")
2277 if test "x$xpm_test" = xno; then
2278 ac_cv_have_xpm=no
2279 else
2280 AC_MSG_CHECKING(for XPM)
2281 AC_CACHE_VAL(ac_cv_have_xpm,
2282 [
2283 AC_LANG_C
2284 ac_save_ldflags="$LDFLAGS"
2285 ac_save_cflags="$CFLAGS"
2286 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
2287 CFLAGS="$CFLAGS $X_INCLUDES"
2288 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
2289 AC_TRY_LINK([#include <X11/xpm.h>],[],
2290 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
2291 LDFLAGS="$ac_save_ldflags"
2292 CFLAGS="$ac_save_cflags"
2293 ])dnl
2294
2295 if test "$ac_cv_have_xpm" = no; then
2296 AC_MSG_RESULT(no)
2297 XPM_LDFLAGS=""
2298 XPMINC=""
2299 $2
2300 else
2301 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
2302 if test "$XPM_LDFLAGS" = ""; then
2303 XPMLIB='-lXpm $(LIB_X11)'
2304 else
2305 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
2306 fi
2307 if test "$XPM_INCLUDE" = ""; then
2308 XPMINC=""
2309 else
2310 XPMINC="-I$XPM_INCLUDE"
2311 fi
2312 AC_MSG_RESULT(yes)
2313 $1
2314 fi
2315 fi
2316 AC_SUBST(XPMINC)
2317 AC_SUBST(XPMLIB)
2318 ])
2319
2320 AC_DEFUN(AC_HAVE_DPMS,
2321 [AC_REQUIRE_CPP()dnl
2322 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2323
2324 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
2325 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
2326
2327 AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
2328 dpms_test=$withval, dpms_test="yes")
2329 if test "x$dpms_test" = xno; then
2330 ac_cv_have_dpms=no
2331 else
2332 AC_MSG_CHECKING(for DPMS)
2333 AC_CACHE_VAL(ac_cv_have_dpms,
2334 [
2335 AC_LANG_C
2336 ac_save_ldflags="$LDFLAGS"
2337 ac_save_cflags="$CFLAGS"
2338 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
2339 CFLAGS="$CFLAGS $X_INCLUDES"
2340 test ! -z "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2341 AC_TRY_LINK([#include <X11/extensions/dpms.h>],[],
2342 ac_cv_have_dpms="yes",ac_cv_have_dpms="no")
2343 LDFLAGS="$ac_save_ldflags"
2344 CFLAGS="$ac_save_cflags"
2345 ])dnl
2346
2347 if test "$ac_cv_have_dpms" = no; then
2348 AC_MSG_RESULT(no)
2349 DPMS_LDFLAGS=""
2350 DPMSINC=""
2351 $2
2352 else
2353 AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
2354 if test "$DPMS_LDFLAGS" = ""; then
2355 DPMSLIB='-lXdpms $(LIB_X11)'
2356 else
2357 DPMSLIB="-L$DPMS_LDFLAGS -lXdpms "'$(LIB_X11)'
2358 fi
2359 if test "$DPMS_INCLUDE" = ""; then
2360 DPMSINC=""
2361 else
2362 DPMSINC="-I$DPMS_INCLUDE"
2363 fi
2364 AC_MSG_RESULT(yes)
2365 $1
2366 fi
2367 fi
2368 AC_SUBST(DPMSINC)
2369 AC_SUBST(DPMSLIB)
2370 ])
2371
2372 AC_DEFUN(AC_HAVE_GL,
2373 [AC_REQUIRE_CPP()dnl
2374 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2375
2376 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
2377 test -z "$GL_INCLUDE" && GL_INCLUDE=
2378
2379 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
2380 gl_test=$withval, gl_test="yes")
2381 if test "x$gl_test" = xno; then
2382 ac_cv_have_gl=no
2383 else
2384 AC_MSG_CHECKING(for GL)
2385 AC_CACHE_VAL(ac_cv_have_gl,
2386 [
2387 AC_LANG_C
2388 ac_save_ldflags="$LDFLAGS"
2389 ac_save_cflags="$CFLAGS"
2390 LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
2391 CFLAGS="$CFLAGS $X_INCLUDES"
2392 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2393 AC_TRY_LINK([],[],
2394 ac_cv_have_gl="mesa", ac_cv_have_gl="no")
2395 if test "x$ac_cv_have_gl" = "xno"; then
2396 LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
2397 CFLAGS="$ac_save_cflags $X_INCLUDES"
2398 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2399 AC_TRY_LINK([],[],
2400 ac_cv_have_gl="yes", ac_cv_have_gl="no")
2401 fi
2402 LDFLAGS="$ac_save_ldflags"
2403 CFLAGS="$ac_save_cflags"
2404 ])dnl
2405
2406 if test "$ac_cv_have_gl" = "no"; then
2407 AC_MSG_RESULT(no)
2408 GL_LDFLAGS=""
2409 GLINC=""
2410 $2
2411 else
2412 AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
2413 if test "$GL_LDFLAGS" = ""; then
2414 if test "$ac_cv_have_gl" = "mesa"; then
2415 GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
2416 else
2417 GLLIB='-lGL -lGLU $(LIB_X11)'
2418 fi
2419 else
2420 if test "$ac_cv_have_gl" = "mesa"; then
2421 GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
2422 else
2423 GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
2424 fi
2425 fi
2426 if test "$GL_INCLUDE" = ""; then
2427 GLINC=""
2428 else
2429 GLINC="-I$GL_INCLUDE"
2430 fi
2431 AC_MSG_RESULT($ac_cv_have_gl)
2432 $1
2433 fi
2434 fi
2435 AC_SUBST(GLINC)
2436 AC_SUBST(GLLIB)
2437 ])
2438
2439 dnl PAM pam
2440
2441 dnl Should test for PAM (Pluggable Authentication Modules)
2442 AC_DEFUN(AC_PATH_PAM_DIRECT,
2443 [
2444 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
2445 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
2446
2447 for ac_dir in \
2448 \
2449 /usr/local/include \
2450 /usr/include \
2451 /usr/unsupported/include \
2452 /opt/include \
2453 /usr/pam/include \
2454 /usr/local/pam/include \
2455 /usr/lib/pam/include \
2456 \
2457 $extra_include \
2458 ; \
2459 do
2460 if test -r "$ac_dir/$pam_direct_test_include"; then
2461 no_pam= ac_pam_includes=$ac_dir
2462 break
2463 fi
2464 done
2465
2466 # First see if replacing the include by lib works.
2467 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
2468 \
2469 /lib \
2470 /usr/lib \
2471 /usr/local/lib \
2472 /usr/unsupported/lib \
2473 /lib/security \
2474 /usr/security/lib \
2475 $extra_lib \
2476 ; \
2477 do
2478 for ac_extension in a so sl; do
2479 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
2480 no_pam= ac_pam_libraries=$ac_dir
2481 break 2
2482 fi
2483 done
2484 done
2485 ])
2486
2487 AC_DEFUN(AC_PATH_PAM,
2488 [
2489 AC_REQUIRE([KDE_CHECK_LIBDL])
2490 AC_REQUIRE_CPP()dnl
2491
2492 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"
2493 AC_DEFINE_UNQUOTED(HAVE_PAM_MISC, 1, [Define if you have a PAM implementation with the pam_misc library])], [], [-lpam $LIBDL])
2494
2495 AC_MSG_CHECKING(for PAM)
2496 AC_ARG_WITH(pam,
2497 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
2498 [
2499 if test "x$withval" = "xyes"; then
2500 no_pam=
2501 default_pam=yes
2502 elif test "x$withval" = "xno"; then
2503 no_pam=yes
2504 else
2505 no_pam=
2506 pam_service="$withval"
2507 if test -z "$pam_service"; then
2508 default_pam=yes
2509 else
2510 default_pam=
2511 fi
2512 fi
2513 ], no_pam=yes
2514 )
2515
2516 if test ! "$no_pam" = yes; then
2517
2518 AC_CACHE_VAL(ac_cv_path_pam,
2519 [
2520 ac_pam_includes=NONE
2521 ac_pam_libraries=NONE
2522 if test -z "$pam_libraries"; then
2523 pam_libraries=NONE
2524 fi
2525 if test -z "$pam_includes"; then
2526 pam_includes=NONE
2527 fi
2528
2529 AC_PATH_PAM_DIRECT
2530
2531 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
2532 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
2533
2534 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
2535 ac_pam_libs="-lpam $PAM_MISC_LIB $LIBDL"
2536 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
2537 else
2538 ac_cv_path_pam="no_pam=yes"
2539 fi
2540 ])
2541
2542 eval "$ac_cv_path_pam"
2543
2544 fi
2545
2546 if test "$no_pam" = yes; then
2547 AC_MSG_RESULT(no)
2548 else
2549 AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules); Redhat-Users!])
2550 PAMLIBS="$ac_pam_libs"
2551 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
2552 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
2553 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
2554 if test "$default_pam" = yes; then
2555 AC_MSG_RESULT(["default pam service name will be used"])
2556 else
2557 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service", [Define to change the default name of the PAM service used by KDE])
2558 AC_MSG_RESULT(["pam service name will be: " $pam_service])
2559 fi
2560 dnl test whether struct pam_message is const (Linux) or not (Sun)
2561 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
2562 AC_MSG_CHECKING(for const pam_message)
2563 AC_EGREP_HEADER([struct pam_message],
2564 $pam_appl_h,
2565 [ AC_EGREP_HEADER([const struct pam_message],
2566 $pam_appl_h,
2567 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
2568 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
2569 AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
2570 )],
2571 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
2572 )
2573 fi
2574
2575 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
2576 PAMLIBPATHS="-L$pam_libraries"
2577 fi
2578 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
2579 PAMINC="-I$pam_includes"
2580 fi
2581
2582 AC_SUBST(PAMINC)
2583 AC_SUBST(PAMLIBS)
2584 AC_SUBST(PAMLIBPATHS)
2585
2586 ])
2587
2588 AC_DEFUN(KDE_CHECK_LIBDL,
2589 [
2590 AC_CHECK_LIB(dl, dlopen, [
2591 LIBDL="-ldl"
2592 ac_cv_have_dlfcn=yes
2593 ])
2594
2595 AC_CHECK_LIB(dld, shl_unload, [
2596 LIBDL="-ldld"
2597 ac_cv_have_shload=yes
2598 ])
2599
2600 AC_SUBST(LIBDL)
2601 ])
2602
2603 AC_DEFUN(KDE_CHECK_DLOPEN,
2604 [
2605 KDE_CHECK_LIBDL
2606 AC_CHECK_HEADERS(dlfcn.h dl.h)
2607 if test "$ac_cv_header_dlfcn_h" = "no"; then
2608 ac_cv_have_dlfcn=no
2609 fi
2610
2611 if test "$ac_cv_header_dl_h" = "no"; then
2612 ac_cv_have_shload=no
2613 fi
2614
2615 enable_dlopen=no
2616 AC_ARG_ENABLE(dlopen,
2617 [ --disable-dlopen link staticly [default=no]] ,
2618 [if test "$enableval" = yes; then
2619 enable_dlopen=yes
2620 fi],
2621 enable_dlopen=yes)
2622
2623 # override the user's opinion, if we know it better ;)
2624 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
2625 enable_dlopen=no
2626 fi
2627
2628 if test "$ac_cv_have_dlfcn" = "yes"; then
2629 AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
2630 fi
2631
2632 if test "$ac_cv_have_shload" = "yes"; then
2633 AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
2634 fi
2635
2636 if test "$enable_dlopen" = no ; then
2637 test -n "$1" && eval $1
2638 else
2639 test -n "$2" && eval $2
2640 fi
2641
2642 ])
2643
2644 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
2645 [
2646 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
2647 KDE_PROG_LIBTOOL
2648 AC_MSG_CHECKING([dynamic loading])
2649 eval "`egrep '^build_libtool_libs=' libtool`"
2650 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
2651 dynamic_loading=yes
2652 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
2653 else
2654 dynamic_loading=no
2655 fi
2656 AC_MSG_RESULT($dynamic_loading)
2657 if test "$dynamic_loading" = "yes"; then
2658 $1
2659 else
2660 $2
2661 fi
2662 ])
2663
2664 AC_DEFUN(KDE_ADD_INCLUDES,
2665 [
2666 if test -z "$1"; then
2667 test_include="Pix.h"
2668 else
2669 test_include="$1"
2670 fi
2671
2672 AC_MSG_CHECKING([for libg++ ($test_include)])
2673
2674 AC_CACHE_VAL(kde_cv_libgpp_includes,
2675 [
2676 kde_cv_libgpp_includes=no
2677
2678 for ac_dir in \
2679 \
2680 /usr/include/g++ \
2681 /usr/include \
2682 /usr/unsupported/include \
2683 /opt/include \
2684 $extra_include \
2685 ; \
2686 do
2687 if test -r "$ac_dir/$test_include"; then
2688 kde_cv_libgpp_includes=$ac_dir
2689 break
2690 fi
2691 done
2692 ])
2693
2694 AC_MSG_RESULT($kde_cv_libgpp_includes)
2695 if test "$kde_cv_libgpp_includes" != "no"; then
2696 all_includes="-I$kde_cv_libgpp_includes $all_includes"
2697 fi
2698 ])
2699 ])
2700
2701
2702 AC_DEFUN(KDE_CHECK_MICO,
2703 [
2704 AC_REQUIRE([KDE_CHECK_LIBDL])
2705 AC_REQUIRE([KDE_MISC_TESTS])
2706 AC_MSG_CHECKING(for MICO)
2707
2708 if test -z "$MICODIR"; then
2709 kde_micodir=/usr/local
2710 else
2711 kde_micodir="$MICODIR"
2712 fi
2713
2714 AC_ARG_WITH(micodir,
2715 [ --with-micodir=micodir where mico is installed ],
2716 kde_micodir=$withval,
2717 kde_micodir=$kde_micodir
2718 )
2719
2720 AC_CACHE_VAL(kde_cv_mico_incdir,
2721 [
2722 mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
2723 AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
2724
2725 ])
2726 kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
2727
2728 if test ! -r $kde_micodir/include/CORBA.h; then
2729 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
2730 fi
2731
2732 AC_MSG_RESULT($kde_micodir)
2733
2734 MICO_INCLUDES=-I$kde_micodir/include
2735 AC_SUBST(MICO_INCLUDES)
2736 MICO_LDFLAGS=-L$kde_micodir/lib
2737 AC_SUBST(MICO_LDFLAGS)
2738 micodir=$kde_micodir
2739 AC_SUBST(micodir)
2740
2741 AC_MSG_CHECKING([for MICO version])
2742 AC_CACHE_VAL(kde_cv_mico_version,
2743 [
2744 AC_LANG_C
2745 cat >conftest.$ac_ext <<EOF
2746 #include <stdio.h>
2747 #include <mico/version.h>
2748 int main() {
2749
2750 printf("MICO_VERSION=%s\n",MICO_VERSION);
2751 return (0);
2752 }
2753 EOF
2754 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
2755 if AC_TRY_EVAL(ac_compile); then
2756 if eval `./conftest 2>&5`; then
2757 kde_cv_mico_version=$MICO_VERSION
2758 else
2759 AC_MSG_ERROR([your system is not able to execute a small application to
2760 find MICO version! Check $kde_micodir/include/mico/version.h])
2761 fi
2762 else
2763 AC_MSG_ERROR([your system is not able to compile a small application to
2764 find MICO version! Check $kde_micodir/include/mico/version.h])
2765 fi
2766 ])
2767
2768 dnl installed MICO version
2769 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2770 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2771 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2772
2773 if test "x$1" = "x"; then
2774 req_version="2.3.0"
2775 else
2776 req_version=$1
2777 fi
2778
2779 dnl required MICO version
2780 req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2781 req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2782 req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2783
2784 if test "$mico_v_maj" -lt "$req_v_maj" || \
2785 ( test "$mico_v_maj" -eq "$req_v_maj" && \
2786 test "$mico_v_mid" -lt "$req_v_mid" ) || \
2787 ( test "$mico_v_mid" -eq "$req_v_mid" && \
2788 test "$mico_v_min" -lt "$req_v_min" )
2789
2790 then
2791 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
2792 at least is required. You should upgrade MICO.])
2793 else
2794 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
2795 fi
2796
2797 LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
2798 AC_SUBST(LIBMICO)
2799 if test -z "$IDL"; then
2800 IDL='$(kde_bindir)/cuteidl'
2801 fi
2802 AC_SUBST(IDL)
2803 IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
2804 AC_SUBST(IDL_DEPENDENCIES)
2805
2806 idldir="\$(includedir)/idl"
2807 AC_SUBST(idldir)
2808
2809 ])
2810
2811 AC_DEFUN(KDE_CHECK_MINI_STL,
2812 [
2813 AC_REQUIRE([KDE_CHECK_MICO])
2814
2815 AC_MSG_CHECKING(if we use mico's mini-STL)
2816 AC_CACHE_VAL(kde_cv_have_mini_stl,
2817 [
2818 AC_LANG_SAVE
2819 AC_LANG_CPLUSPLUS
2820 kde_save_cxxflags="$CXXFLAGS"
2821 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
2822 AC_TRY_COMPILE(
2823 [
2824 #include <mico/config.h>
2825 ],
2826 [
2827 #ifdef HAVE_MINI_STL
2828 #error "nothing"
2829 #endif
2830 ],
2831 kde_cv_have_mini_stl=no,
2832 kde_cv_have_mini_stl=yes)
2833 CXXFLAGS="$kde_save_cxxflags"
2834 AC_LANG_RESTORE
2835 ])
2836
2837 if test "x$kde_cv_have_mini_stl" = "xyes"; then
2838 AC_MSG_RESULT(yes)
2839 $1
2840 else
2841 AC_MSG_RESULT(no)
2842 $2
2843 fi
2844 ])
2845
2846 ])
2847
2848
2849 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
2850 [
2851 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
2852 AC_SUBST(LIBPTHREAD)
2853 ])
2854
2855 AC_DEFUN(KDE_TRY_LINK_PYTHON,
2856 [
2857 if test "$kde_python_link_found" = no; then
2858
2859 if test "$1" = normal; then
2860 AC_MSG_CHECKING(if a Python application links)
2861 else
2862 AC_MSG_CHECKING(if Python depends on $2)
2863 fi
2864
2865 AC_CACHE_VAL(kde_cv_try_link_python_$1,
2866 [
2867 AC_LANG_SAVE
2868 AC_LANG_C
2869 kde_save_cflags="$CFLAGS"
2870 CFLAGS="$CFLAGS $PYTHONINC"
2871 kde_save_libs="$LIBS"
2872 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
2873 kde_save_ldflags="$LDFLAGS"
2874 LDFLAGS="$LDFLAGS $PYTHONLIB"
2875
2876 AC_TRY_LINK(
2877 [
2878 #include <Python.h>
2879 ],[
2880 PySys_SetArgv(1, 0);
2881 ],
2882 [kde_cv_try_link_python_$1=yes],
2883 [kde_cv_try_link_python_$1=no]
2884 )
2885 CFLAGS="$kde_save_cflags"
2886 LIBS="$kde_save_libs"
2887 LDFLAGS="$kde_save_ldflags"
2888 ])
2889
2890 if test "$kde_cv_try_link_python_$1" = "yes"; then
2891 AC_MSG_RESULT(yes)
2892 kde_python_link_found=yes
2893 if test ! "$1" = normal; then
2894 LIBPYTHON="$LIBPYTHON $2"
2895 fi
2896 $3
2897 else
2898 AC_MSG_RESULT(no)
2899 $4
2900 fi
2901 AC_LANG_RESTORE
2902
2903 fi
2904
2905 ])
2906
2907 AC_DEFUN(KDE_CHECK_PYTHON,
2908 [
2909 AC_REQUIRE([KDE_CHECK_LIBDL])
2910 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
2911
2912 AC_MSG_CHECKING([for Python directory])
2913
2914 AC_CACHE_VAL(kde_cv_pythondir,
2915 [
2916 if test -z "$PYTHONDIR"; then
2917 kde_cv_pythondir=/usr/local
2918 else
2919 kde_cv_pythondir="$PYTHONDIR"
2920 fi
2921 ])
2922
2923 AC_ARG_WITH(pythondir,
2924 [ --with-pythondir=pythondir use python installed in pythondir ],
2925 [
2926 ac_python_dir=$withval
2927 ], ac_python_dir=$kde_cv_pythondir
2928 )
2929
2930 AC_MSG_RESULT($ac_python_dir)
2931
2932 if test -z "$1"; then
2933 version="1.5"
2934 else
2935 version="$1"
2936 fi
2937
2938 AC_MSG_CHECKING([for Python$version])
2939
2940 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
2941 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
2942 if test ! -r $python_incdir/Python.h; then
2943 AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
2944 python_incdir=$python_incdir/python$version
2945 if test ! -r $python_incdir/Python.h; then
2946 AC_MSG_ERROR(Python.h not found.)
2947 fi
2948 fi
2949
2950 PYTHONINC=-I$python_incdir
2951
2952 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
2953 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
2954 if test ! -r $python_libdir/libpython$version.a; then
2955 AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
2956 python_libdir=$python_libdir/python$version/config
2957 if test ! -r $python_libdir/libpython$version.a; then
2958 AC_MSG_ERROR(libpython$version.a not found.)
2959 fi
2960 fi
2961
2962 PYTHONLIB=-L$python_libdir
2963 if test -z "$LIBPYTHON"; then
2964 LIBPYTHON=-lpython$version
2965 fi
2966
2967 AC_MSG_RESULT(header $python_incdir library $python_libdir)
2968
2969 dnl Note: this test is very weak
2970 kde_python_link_found=no
2971 KDE_TRY_LINK_PYTHON(normal)
2972 KDE_TRY_LINK_PYTHON(m, -lm)
2973 KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
2974 KDE_TRY_LINK_PYTHON(tcl, -ltcl)
2975 KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm], [],
2976 [AC_MSG_WARN([it seems, Python depends on another library.
2977 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
2978 and contact the authors to let them know about this problem])
2979 ])
2980
2981 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
2982 AC_SUBST(PYTHONINC)
2983 AC_SUBST(PYTHONLIB)
2984 AC_SUBST(LIBPYTHON)
2985
2986 ])
2987
2988
2989 AC_DEFUN(KDE_CHECK_STL_SGI,
2990 [
2991 AC_MSG_CHECKING([if STL implementation is SGI like])
2992 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2993 [
2994 AC_TRY_COMPILE([
2995 #include <string>
2996 using namespace std;
2997 ],[
2998 string astring="Hallo Welt.";
2999 astring.erase(0, 6); // now astring is "Welt"
3000 return 0;
3001 ], kde_cv_stl_type_sgi=yes,
3002 kde_cv_stl_type_sgi=no)
3003 ])
3004
3005 AC_MSG_RESULT($kde_cv_stl_type_sgi)
3006
3007 if test "$kde_cv_stl_type_sgi" = "yes"; then
3008 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
3009 fi
3010 ])
3011
3012 AC_DEFUN(KDE_CHECK_STL_HP,
3013 [
3014 AC_MSG_CHECKING([if STL implementation is HP like])
3015 AC_CACHE_VAL(kde_cv_stl_type_hp,
3016 [
3017 AC_TRY_COMPILE([
3018 #include <string>
3019 using namespace std;
3020 ],[
3021 string astring="Hello World";
3022 astring.remove(0, 6); // now astring is "World"
3023 return 0;
3024 ], kde_cv_stl_type_hp=yes,
3025 kde_cv_stl_type_hp=no)
3026 ])
3027 AC_MSG_RESULT($kde_cv_stl_type_hp)
3028
3029 if test "$kde_cv_stl_type_hp" = "yes"; then
3030 AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by SGI])
3031 fi
3032 ])
3033
3034 AC_DEFUN(KDE_CHECK_STL,
3035 [
3036 AC_LANG_SAVE
3037 AC_LANG_CPLUSPLUS
3038 KDE_CHECK_STL_SGI
3039
3040 if test "$kde_cv_stl_type_sgi" = "no"; then
3041 KDE_CHECK_STL_HP
3042
3043 if test "$kde_cv_stl_type_hp" = "no"; then
3044 AC_MSG_ERROR("no known STL type found")
3045 fi
3046 fi
3047
3048 AC_LANG_RESTORE
3049 ])
3050
3051 AC_DEFUN(AC_FIND_QIMGIO,
3052 [AC_REQUIRE([AC_FIND_JPEG])
3053 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3054 AC_MSG_CHECKING([for qimgio])
3055 AC_CACHE_VAL(ac_cv_lib_qimgio,
3056 [
3057 AC_LANG_SAVE
3058 AC_LANG_CPLUSPLUS
3059 ac_save_LIBS="$LIBS"
3060 ac_save_CXXFLAGS="$CXXFLAGS"
3061 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
3062 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
3063 AC_TRY_RUN(dnl
3064 [
3065 #include <qimageio.h>
3066 #include <qstring.h>
3067