Mercurial > hg > easyhg-kdiff3
comparison kdiff3/admin/acinclude.m4.in @ 2:53b8ecbce0cb
Initial revision
author | joachim99 |
---|---|
date | Sun, 18 Aug 2002 16:23:32 +0000 |
parents | |
children | 415083d043f3 |
comparison
equal
deleted
inserted
replaced
1:391d4ae068d9 | 2:53b8ecbce0cb |
---|---|
1 ## -*- autoconf -*- | |
2 | |
3 dnl This file is part of the KDE libraries/packages | |
4 dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) | |
5 dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) | |
6 | |
7 dnl This file is free software; you can redistribute it and/or | |
8 dnl modify it under the terms of the GNU Library General Public | |
9 dnl License as published by the Free Software Foundation; either | |
10 dnl version 2 of the License, or (at your option) any later version. | |
11 | |
12 dnl This library is distributed in the hope that it will be useful, | |
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 dnl Library General Public License for more details. | |
16 | |
17 dnl You should have received a copy of the GNU Library General Public License | |
18 dnl along with this library; see the file COPYING.LIB. If not, write to | |
19 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 dnl Boston, MA 02111-1307, USA. | |
21 | |
22 dnl IMPORTANT NOTE: | |
23 dnl Please do not modify this file unless you expect your modifications to be | |
24 dnl carried into every other module in the repository. If you decide that you | |
25 dnl really want to modify it, contact coolo@kde.org mentioning that you have | |
26 dnl and that the modified file should be committed to every module. | |
27 dnl | |
28 dnl Single-module modifications are best placed in configure.in for kdelibs | |
29 dnl and kdebase or configure.in.in if present. | |
30 | |
31 dnl ------------------------------------------------------------------------ | |
32 dnl Forward compatibility macros (make autoconf 2.13 look like 2.50), | |
33 dnl thanks to Raja R Harinath. | |
34 dnl ------------------------------------------------------------------------ | |
35 dnl | |
36 ifdef([_AC_PATH_X_XMKMF],[], | |
37 [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])]) | |
38 ifdef([AC_OUTPUT_SUBDIRS],[], | |
39 [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])]) | |
40 | |
41 # KDE_PATH_X_DIRECT | |
42 dnl Internal subroutine of AC_PATH_X. | |
43 dnl Set ac_x_includes and/or ac_x_libraries. | |
44 AC_DEFUN(KDE_PATH_X_DIRECT, | |
45 [if test "$ac_x_includes" = NO; then | |
46 # Guess where to find include files, by looking for this one X11 .h file. | |
47 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h | |
48 | |
49 # First, try using that file with no special directory specified. | |
50 AC_TRY_CPP([#include <$x_direct_test_include>], | |
51 [# We can compile using X headers with no special include directory. | |
52 ac_x_includes=], | |
53 [# Look for the header file in a standard set of common directories. | |
54 # Check X11 before X11Rn because it is often a symlink to the current release. | |
55 for ac_dir in \ | |
56 /usr/X11/include \ | |
57 /usr/X11R6/include \ | |
58 /usr/X11R5/include \ | |
59 /usr/X11R4/include \ | |
60 \ | |
61 /usr/include/X11 \ | |
62 /usr/include/X11R6 \ | |
63 /usr/include/X11R5 \ | |
64 /usr/include/X11R4 \ | |
65 \ | |
66 /usr/local/X11/include \ | |
67 /usr/local/X11R6/include \ | |
68 /usr/local/X11R5/include \ | |
69 /usr/local/X11R4/include \ | |
70 \ | |
71 /usr/local/include/X11 \ | |
72 /usr/local/include/X11R6 \ | |
73 /usr/local/include/X11R5 \ | |
74 /usr/local/include/X11R4 \ | |
75 \ | |
76 /usr/X386/include \ | |
77 /usr/x386/include \ | |
78 /usr/XFree86/include/X11 \ | |
79 \ | |
80 /usr/include \ | |
81 /usr/local/include \ | |
82 /usr/unsupported/include \ | |
83 /usr/athena/include \ | |
84 /usr/local/x11r5/include \ | |
85 /usr/lpp/Xamples/include \ | |
86 \ | |
87 /usr/openwin/include \ | |
88 /usr/openwin/share/include \ | |
89 ; \ | |
90 do | |
91 if test -r "$ac_dir/$x_direct_test_include"; then | |
92 ac_x_includes=$ac_dir | |
93 break | |
94 fi | |
95 done]) | |
96 fi # $ac_x_includes = NO | |
97 | |
98 if test "$ac_x_libraries" = NO; then | |
99 # Check for the libraries. | |
100 | |
101 test -z "$x_direct_test_library" && x_direct_test_library=Xt | |
102 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc | |
103 | |
104 # See if we find them without any special options. | |
105 # Don't add to $LIBS permanently. | |
106 ac_save_LIBS="$LIBS" | |
107 LIBS="-l$x_direct_test_library $LIBS" | |
108 AC_TRY_LINK(, [${x_direct_test_function}()], | |
109 [LIBS="$ac_save_LIBS" | |
110 # We can link X programs with no special library path. | |
111 ac_x_libraries=], | |
112 [LIBS="$ac_save_LIBS" | |
113 # First see if replacing the include by lib works. | |
114 # Check X11 before X11Rn because it is often a symlink to the current release. | |
115 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ | |
116 /usr/X11/lib \ | |
117 /usr/X11R6/lib \ | |
118 /usr/X11R5/lib \ | |
119 /usr/X11R4/lib \ | |
120 \ | |
121 /usr/lib/X11 \ | |
122 /usr/lib/X11R6 \ | |
123 /usr/lib/X11R5 \ | |
124 /usr/lib/X11R4 \ | |
125 \ | |
126 /usr/local/X11/lib \ | |
127 /usr/local/X11R6/lib \ | |
128 /usr/local/X11R5/lib \ | |
129 /usr/local/X11R4/lib \ | |
130 \ | |
131 /usr/local/lib/X11 \ | |
132 /usr/local/lib/X11R6 \ | |
133 /usr/local/lib/X11R5 \ | |
134 /usr/local/lib/X11R4 \ | |
135 \ | |
136 /usr/X386/lib \ | |
137 /usr/x386/lib \ | |
138 /usr/XFree86/lib/X11 \ | |
139 \ | |
140 /usr/lib \ | |
141 /usr/local/lib \ | |
142 /usr/unsupported/lib \ | |
143 /usr/athena/lib \ | |
144 /usr/local/x11r5/lib \ | |
145 /usr/lpp/Xamples/lib \ | |
146 /lib/usr/lib/X11 \ | |
147 \ | |
148 /usr/openwin/lib \ | |
149 /usr/openwin/share/lib \ | |
150 ; \ | |
151 do | |
152 dnl Don't even attempt the hair of trying to link an X program! | |
153 for ac_extension in a so sl; do | |
154 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then | |
155 ac_x_libraries=$ac_dir | |
156 break 2 | |
157 fi | |
158 done | |
159 done]) | |
160 fi # $ac_x_libraries = NO | |
161 ]) | |
162 | |
163 | |
164 dnl ------------------------------------------------------------------------ | |
165 dnl Find a file (or one of more files in a list of dirs) | |
166 dnl ------------------------------------------------------------------------ | |
167 dnl | |
168 AC_DEFUN(AC_FIND_FILE, | |
169 [ | |
170 $3=NO | |
171 for i in $2; | |
172 do | |
173 for j in $1; | |
174 do | |
175 echo "configure: __oline__: $i/$j" >&AC_FD_CC | |
176 if test -r "$i/$j"; then | |
177 echo "taking that" >&AC_FD_CC | |
178 $3=$i | |
179 break 2 | |
180 fi | |
181 done | |
182 done | |
183 ]) | |
184 | |
185 dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, | |
186 dnl if-not-found, test-parameter) | |
187 AC_DEFUN(KDE_FIND_PATH, | |
188 [ | |
189 AC_MSG_CHECKING([for $1]) | |
190 if test -n "$$2"; then | |
191 kde_cv_path="$$2"; | |
192 else | |
193 kde_cache=`echo $1 | sed 'y%./+-%__p_%'` | |
194 | |
195 AC_CACHE_VAL(kde_cv_path_$kde_cache, | |
196 [ | |
197 kde_cv_path="NONE" | |
198 dirs="$3" | |
199 kde_save_IFS=$IFS | |
200 IFS=':' | |
201 for dir in $PATH; do | |
202 dirs="$dirs $dir" | |
203 done | |
204 IFS=$kde_save_IFS | |
205 | |
206 for dir in $dirs; do | |
207 if test -x "$dir/$1"; then | |
208 if test -n "$5" | |
209 then | |
210 evalstr="$dir/$1 $5 2>&1 " | |
211 if eval $evalstr; then | |
212 kde_cv_path="$dir/$1" | |
213 break | |
214 fi | |
215 else | |
216 kde_cv_path="$dir/$1" | |
217 break | |
218 fi | |
219 fi | |
220 done | |
221 | |
222 eval "kde_cv_path_$kde_cache=$kde_cv_path" | |
223 | |
224 ]) | |
225 | |
226 eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" | |
227 | |
228 fi | |
229 | |
230 if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then | |
231 AC_MSG_RESULT(not found) | |
232 $4 | |
233 else | |
234 AC_MSG_RESULT($kde_cv_path) | |
235 $2=$kde_cv_path | |
236 | |
237 fi | |
238 ]) | |
239 | |
240 AC_DEFUN(KDE_MOC_ERROR_MESSAGE, | |
241 [ | |
242 AC_MSG_ERROR([No Qt meta object compiler (moc) found! | |
243 Please check whether you installed Qt correctly. | |
244 You need to have a running moc binary. | |
245 configure tried to run $ac_cv_path_moc and the test didn't | |
246 succeed. If configure shouldn't have tried this one, set | |
247 the environment variable MOC to the right one before running | |
248 configure. | |
249 ]) | |
250 ]) | |
251 | |
252 AC_DEFUN(KDE_UIC_ERROR_MESSAGE, | |
253 [ | |
254 AC_MSG_WARN([No Qt ui compiler (uic) found! | |
255 Please check whether you installed Qt correctly. | |
256 You need to have a running uic binary. | |
257 configure tried to run $ac_cv_path_uic and the test didn't | |
258 succeed. If configure shouldn't have tried this one, set | |
259 the environment variable UIC to the right one before running | |
260 configure. | |
261 ]) | |
262 ]) | |
263 | |
264 dnl ------------------------------------------------------------------------ | |
265 dnl Find the meta object compiler and the ui compiler in the PATH, | |
266 dnl in $QTDIR/bin, and some more usual places | |
267 dnl ------------------------------------------------------------------------ | |
268 dnl | |
269 AC_DEFUN(AC_PATH_QT_MOC_UIC, | |
270 [ | |
271 qt_bindirs="" | |
272 for dir in $kde_qt_dirs; do | |
273 qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc" | |
274 done | |
275 qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin" | |
276 if test ! "$ac_qt_bindir" = "NO"; then | |
277 qt_bindirs="$ac_qt_bindir $qt_bindirs" | |
278 fi | |
279 | |
280 KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE]) | |
281 if test -z "$UIC_NOT_NEEDED"; then | |
282 KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""]) | |
283 if test -z "$UIC" ; then | |
284 KDE_UIC_ERROR_MESSAGE | |
285 exit 1 | |
286 fi | |
287 else | |
288 UIC="echo uic not available: " | |
289 fi | |
290 | |
291 AC_SUBST(MOC) | |
292 AC_SUBST(UIC) | |
293 | |
294 UIC_TR="i18n" | |
295 if test $kde_qtver = 3; then | |
296 UIC_TR="tr2i18n" | |
297 fi | |
298 | |
299 AC_SUBST(UIC_TR) | |
300 ]) | |
301 | |
302 AC_DEFUN(KDE_1_CHECK_PATHS, | |
303 [ | |
304 KDE_1_CHECK_PATH_HEADERS | |
305 | |
306 KDE_TEST_RPATH= | |
307 | |
308 if test -n "$USE_RPATH"; then | |
309 | |
310 if test -n "$kde_libraries"; then | |
311 KDE_TEST_RPATH="-R $kde_libraries" | |
312 fi | |
313 | |
314 if test -n "$qt_libraries"; then | |
315 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries" | |
316 fi | |
317 | |
318 if test -n "$x_libraries"; then | |
319 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries" | |
320 fi | |
321 | |
322 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH" | |
323 fi | |
324 | |
325 AC_MSG_CHECKING([for KDE libraries installed]) | |
326 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' | |
327 | |
328 if AC_TRY_EVAL(ac_link) && test -s conftest; then | |
329 AC_MSG_RESULT(yes) | |
330 else | |
331 AC_MSG_ERROR([your system fails at linking a small KDE application! | |
332 Check, if your compiler is installed correctly and if you have used the | |
333 same compiler to compile Qt and kdelibs as you did use now. | |
334 For more details about this problem, look at the end of config.log.]) | |
335 fi | |
336 | |
337 if eval `KDEDIR= ./conftest 2>&5`; then | |
338 kde_result=done | |
339 else | |
340 kde_result=problems | |
341 fi | |
342 | |
343 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log | |
344 kde_have_all_paths=yes | |
345 | |
346 KDE_SET_PATHS($kde_result) | |
347 | |
348 ]) | |
349 | |
350 AC_DEFUN(KDE_SET_PATHS, | |
351 [ | |
352 kde_cv_all_paths="kde_have_all_paths=\"yes\" \ | |
353 kde_htmldir=\"$kde_htmldir\" \ | |
354 kde_appsdir=\"$kde_appsdir\" \ | |
355 kde_icondir=\"$kde_icondir\" \ | |
356 kde_sounddir=\"$kde_sounddir\" \ | |
357 kde_datadir=\"$kde_datadir\" \ | |
358 kde_locale=\"$kde_locale\" \ | |
359 kde_cgidir=\"$kde_cgidir\" \ | |
360 kde_confdir=\"$kde_confdir\" \ | |
361 kde_mimedir=\"$kde_mimedir\" \ | |
362 kde_toolbardir=\"$kde_toolbardir\" \ | |
363 kde_wallpaperdir=\"$kde_wallpaperdir\" \ | |
364 kde_templatesdir=\"$kde_templatesdir\" \ | |
365 kde_bindir=\"$kde_bindir\" \ | |
366 kde_servicesdir=\"$kde_servicesdir\" \ | |
367 kde_servicetypesdir=\"$kde_servicetypesdir\" \ | |
368 kde_moduledir=\"$kde_moduledir\" \ | |
369 kde_styledir=\"$kde_styledir\" \ | |
370 kde_widgetdir=\"$kde_widgetdir\" \ | |
371 kde_result=$1" | |
372 ]) | |
373 | |
374 AC_DEFUN(KDE_SET_DEFAULT_PATHS, | |
375 [ | |
376 if test "$1" = "default"; then | |
377 | |
378 if test -z "$kde_htmldir"; then | |
379 kde_htmldir='\${prefix}/share/doc/HTML' | |
380 fi | |
381 if test -z "$kde_appsdir"; then | |
382 kde_appsdir='\${prefix}/share/applnk' | |
383 fi | |
384 if test -z "$kde_icondir"; then | |
385 kde_icondir='\${prefix}/share/icons' | |
386 fi | |
387 if test -z "$kde_sounddir"; then | |
388 kde_sounddir='\${prefix}/share/sounds' | |
389 fi | |
390 if test -z "$kde_datadir"; then | |
391 kde_datadir='\${prefix}/share/apps' | |
392 fi | |
393 if test -z "$kde_locale"; then | |
394 kde_locale='\${prefix}/share/locale' | |
395 fi | |
396 if test -z "$kde_cgidir"; then | |
397 kde_cgidir='\${exec_prefix}/cgi-bin' | |
398 fi | |
399 if test -z "$kde_confdir"; then | |
400 kde_confdir='\${prefix}/share/config' | |
401 fi | |
402 if test -z "$kde_mimedir"; then | |
403 kde_mimedir='\${prefix}/share/mimelnk' | |
404 fi | |
405 if test -z "$kde_toolbardir"; then | |
406 kde_toolbardir='\${prefix}/share/toolbar' | |
407 fi | |
408 if test -z "$kde_wallpaperdir"; then | |
409 kde_wallpaperdir='\${prefix}/share/wallpapers' | |
410 fi | |
411 if test -z "$kde_templatesdir"; then | |
412 kde_templatesdir='\${prefix}/share/templates' | |
413 fi | |
414 if test -z "$kde_bindir"; then | |
415 kde_bindir='\${exec_prefix}/bin' | |
416 fi | |
417 if test -z "$kde_servicesdir"; then | |
418 kde_servicesdir='\${prefix}/share/services' | |
419 fi | |
420 if test -z "$kde_servicetypesdir"; then | |
421 kde_servicetypesdir='\${prefix}/share/servicetypes' | |
422 fi | |
423 if test -z "$kde_moduledir"; then | |
424 if test "$kde_qtver" = "2"; then | |
425 kde_moduledir='\${exec_prefix}/lib/kde2' | |
426 else | |
427 kde_moduledir='\${exec_prefix}/lib/kde3' | |
428 fi | |
429 fi | |
430 if test -z "$kde_styledir"; then | |
431 kde_styledir='\${exec_prefix}/lib/kde3/plugins/styles' | |
432 fi | |
433 if test -z "$kde_widgetdir"; then | |
434 kde_widgetdir='\${exec_prefix}/lib/kde3/plugins/designer' | |
435 fi | |
436 | |
437 KDE_SET_PATHS(defaults) | |
438 | |
439 else | |
440 | |
441 if test $kde_qtver = 1; then | |
442 AC_MSG_RESULT([compiling]) | |
443 KDE_1_CHECK_PATHS | |
444 else | |
445 AC_MSG_ERROR([path checking not yet supported for KDE 2]) | |
446 fi | |
447 | |
448 fi | |
449 ]) | |
450 | |
451 AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS, | |
452 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" || | |
453 test -z "$kde_icondir" || test -z "$kde_sounddir" || | |
454 test -z "$kde_datadir" || test -z "$kde_locale" || | |
455 test -z "$kde_cgidir" || test -z "$kde_confdir" || | |
456 test -z "$kde_mimedir" || test -z "$kde_toolbardir" || | |
457 test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" || | |
458 test -z "$kde_bindir" || test -z "$kde_servicesdir" || | |
459 test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" || | |
460 test -z "$kde_styledir" || test -z "kde_widgetdir" | |
461 test "x$kde_have_all_paths" != "xyes"; then | |
462 kde_have_all_paths=no | |
463 fi | |
464 ]) | |
465 | |
466 AC_DEFUN(KDE_MISSING_PROG_ERROR, | |
467 [ | |
468 AC_MSG_ERROR([The important program $1 was not found! | |
469 Please check whether you installed KDE correctly. | |
470 ]) | |
471 ]) | |
472 | |
473 AC_DEFUN(KDE_SUBST_PROGRAMS, | |
474 [ | |
475 | |
476 kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" | |
477 if test -n "$KDEDIRS"; then | |
478 kde_save_IFS=$IFS | |
479 IFS=: | |
480 for dir in $KDEDIRS; do | |
481 kde_default_bindirs="$dir/bin $kde_default_bindirs " | |
482 done | |
483 IFS=$kde_save_IFS | |
484 fi | |
485 kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs" | |
486 KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)]) | |
487 KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)]) | |
488 KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)]) | |
489 KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)]) | |
490 KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs]) | |
491 KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs]) | |
492 | |
493 if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then | |
494 kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share" | |
495 test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs" | |
496 AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET) | |
497 if test "$KDE_XSL_STYLESHEET" = "NO"; then | |
498 KDE_XSL_STYLESHEET="" | |
499 else | |
500 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl" | |
501 fi | |
502 fi | |
503 | |
504 DCOP_DEPENDENCIES='$(DCOPIDL)' | |
505 AC_SUBST(DCOPIDL) | |
506 AC_SUBST(DCOPIDL2CPP) | |
507 AC_SUBST(DCOP_DEPENDENCIES) | |
508 AC_SUBST(MCOPIDL) | |
509 AC_SUBST(ARTSCCONFIG) | |
510 AC_SUBST(KDECONFIG) | |
511 AC_SUBST(MEINPROC) | |
512 AC_SUBST(KDE_XSL_STYLESHEET) | |
513 | |
514 if test -x "$KDECONFIG"; then # it can be "compiled" | |
515 kde_libs_prefix=`$KDECONFIG --prefix` | |
516 if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then | |
517 AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. | |
518 This means it has been moved since you installed it. | |
519 This won't work. Please recompile kdelibs for the new prefix. | |
520 ]) | |
521 fi | |
522 kde_libs_htmldir=`$KDECONFIG --install html --expandvars` | |
523 else | |
524 kde_libs_prefix='$(prefix)' | |
525 kde_libs_htmldir='$(kde_htmldir)' | |
526 fi | |
527 AC_SUBST(kde_libs_prefix) | |
528 AC_SUBST(kde_libs_htmldir) | |
529 ])dnl | |
530 | |
531 AC_DEFUN(AC_CREATE_KFSSTND, | |
532 [ | |
533 AC_REQUIRE([AC_CHECK_RPATH]) | |
534 | |
535 AC_MSG_CHECKING([for KDE paths]) | |
536 kde_result="" | |
537 kde_cached_paths=yes | |
538 AC_CACHE_VAL(kde_cv_all_paths, | |
539 [ | |
540 KDE_SET_DEFAULT_PATHS($1) | |
541 kde_cached_paths=no | |
542 ]) | |
543 eval "$kde_cv_all_paths" | |
544 KDE_CHECK_PATHS_FOR_COMPLETENESS | |
545 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then | |
546 # wrong values were cached, may be, we can set better ones | |
547 kde_result= | |
548 kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir= | |
549 kde_datadir= kde_locale= kde_cgidir= kde_confdir= | |
550 kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir= | |
551 kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir= | |
552 kde_have_all_paths= | |
553 kde_styledir= | |
554 kde_widgetdir= | |
555 KDE_SET_DEFAULT_PATHS($1) | |
556 eval "$kde_cv_all_paths" | |
557 KDE_CHECK_PATHS_FOR_COMPLETENESS | |
558 kde_result="$kde_result (cache overridden)" | |
559 fi | |
560 if test "$kde_have_all_paths" = "no"; then | |
561 AC_MSG_ERROR([configure could not run a little KDE program to test the environment. | |
562 Since it had compiled and linked before, it must be a strange problem on your system. | |
563 Look at config.log for details. If you are not able to fix this, look at | |
564 http://www.kde.org/faq/installation.html or any www.kde.org mirror. | |
565 (If you're using an egcs version on Linux, you may update binutils!) | |
566 ]) | |
567 else | |
568 rm -f conftest* | |
569 AC_MSG_RESULT($kde_result) | |
570 fi | |
571 | |
572 bindir=$kde_bindir | |
573 | |
574 KDE_SUBST_PROGRAMS | |
575 | |
576 ]) | |
577 | |
578 AC_DEFUN(AC_SUBST_KFSSTND, | |
579 [ | |
580 AC_SUBST(kde_htmldir) | |
581 AC_SUBST(kde_appsdir) | |
582 AC_SUBST(kde_icondir) | |
583 AC_SUBST(kde_sounddir) | |
584 AC_SUBST(kde_datadir) | |
585 AC_SUBST(kde_locale) | |
586 AC_SUBST(kde_confdir) | |
587 AC_SUBST(kde_mimedir) | |
588 AC_SUBST(kde_wallpaperdir) | |
589 AC_SUBST(kde_bindir) | |
590 dnl for KDE 2 | |
591 AC_SUBST(kde_templatesdir) | |
592 AC_SUBST(kde_servicesdir) | |
593 AC_SUBST(kde_servicetypesdir) | |
594 AC_SUBST(kde_moduledir) | |
595 AC_SUBST(kde_styledir) | |
596 AC_SUBST(kde_widgetdir) | |
597 if test "$kde_qtver" = 1; then | |
598 kde_minidir="$kde_icondir/mini" | |
599 else | |
600 # for KDE 1 - this breaks KDE2 apps using minidir, but | |
601 # that's the plan ;-/ | |
602 kde_minidir="/dev/null" | |
603 fi | |
604 dnl AC_SUBST(kde_minidir) | |
605 dnl AC_SUBST(kde_cgidir) | |
606 dnl AC_SUBST(kde_toolbardir) | |
607 ]) | |
608 | |
609 AC_DEFUN(KDE_MISC_TESTS, | |
610 [ | |
611 AC_LANG_C | |
612 dnl Checks for libraries. | |
613 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD | |
614 AC_SUBST(LIBUTIL) | |
615 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD | |
616 AC_SUBST(LIBCOMPAT) | |
617 kde_have_crypt= | |
618 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], | |
619 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ | |
620 AC_MSG_WARN([you have no crypt in either libcrypt or libc. | |
621 You should install libcrypt from another source or configure with PAM | |
622 support]) | |
623 kde_have_crypt=no | |
624 ])) | |
625 AC_SUBST(LIBCRYPT) | |
626 if test $kde_have_crypt = yes; then | |
627 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) | |
628 fi | |
629 AC_CHECK_SOCKLEN_T | |
630 AC_LANG_C | |
631 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) | |
632 if test $ac_cv_lib_dnet_dnet_ntoa = no; then | |
633 AC_CHECK_LIB(dnet_stub, dnet_ntoa, | |
634 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) | |
635 fi | |
636 AC_CHECK_FUNC(inet_ntoa) | |
637 if test $ac_cv_func_inet_ntoa = no; then | |
638 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") | |
639 fi | |
640 AC_CHECK_FUNC(connect) | |
641 if test $ac_cv_func_connect = no; then | |
642 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , | |
643 $X_EXTRA_LIBS) | |
644 fi | |
645 | |
646 AC_CHECK_FUNC(remove) | |
647 if test $ac_cv_func_remove = no; then | |
648 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") | |
649 fi | |
650 | |
651 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. | |
652 AC_CHECK_FUNC(shmat, , | |
653 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")) | |
654 | |
655 # Solaris 2.6 and others need -lresolv for res_init | |
656 AC_CHECK_FUNCS(res_init, , [ | |
657 kde_libs_safe="$LIBS" | |
658 LIBS="$LIBS $X_EXTRA_LIBS -lresolv" | |
659 AC_TRY_LINK( | |
660 [ | |
661 #include <resolv.h> | |
662 ], | |
663 [ | |
664 res_init(); | |
665 ], | |
666 LIBRESOLV="-lresolv" | |
667 X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV" | |
668 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) | |
669 ) | |
670 LIBS=$kde_libs_safe | |
671 ]) | |
672 | |
673 LIBSOCKET="$X_EXTRA_LIBS" | |
674 AC_SUBST(LIBSOCKET) | |
675 AC_SUBST(LIBRESOLV) | |
676 AC_SUBST(X_EXTRA_LIBS) | |
677 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 | |
678 AC_SUBST(LIBUCB) | |
679 | |
680 case $host in dnl this *is* LynxOS specific | |
681 *-*-lynxos* ) | |
682 AC_MSG_CHECKING([LynxOS header file wrappers]) | |
683 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] | |
684 AC_MSG_RESULT(disabled) | |
685 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS | |
686 ;; | |
687 esac | |
688 | |
689 KDE_CHECK_TYPES | |
690 KDE_CHECK_LIBDL | |
691 ]) | |
692 | |
693 dnl ------------------------------------------------------------------------ | |
694 dnl Find the header files and libraries for X-Windows. Extended the | |
695 dnl macro AC_PATH_X | |
696 dnl ------------------------------------------------------------------------ | |
697 dnl | |
698 AC_DEFUN(K_PATH_X, | |
699 [ | |
700 AC_REQUIRE([KDE_MISC_TESTS])dnl | |
701 | |
702 AC_ARG_ENABLE( | |
703 embedded, | |
704 [ --enable-embedded link to Qt-embedded, don't use X], | |
705 kde_use_qt_emb=$enableval, | |
706 kde_use_qt_emb=no | |
707 ) | |
708 | |
709 AC_ARG_ENABLE( | |
710 qtopia, | |
711 [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment], | |
712 kde_use_qt_emb_palm=$enableval, | |
713 kde_use_qt_emb_palm=no | |
714 ) | |
715 | |
716 if test "$kde_use_qt_emb" = "no"; then | |
717 | |
718 AC_MSG_CHECKING(for X) | |
719 AC_LANG_SAVE | |
720 AC_LANG_C | |
721 AC_CACHE_VAL(kde_cv_have_x, | |
722 [# One or both of the vars are not set, and there is no cached value. | |
723 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then | |
724 kde_x_includes=NO | |
725 else | |
726 kde_x_includes=$x_includes | |
727 fi | |
728 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then | |
729 kde_x_libraries=NO | |
730 else | |
731 kde_x_libraries=$x_libraries | |
732 fi | |
733 | |
734 # below we use the standard autoconf calls | |
735 ac_x_libraries=$kde_x_libraries | |
736 ac_x_includes=$kde_x_includes | |
737 | |
738 KDE_PATH_X_DIRECT | |
739 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries. | |
740 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct | |
741 dnl location. The correct location is /usr/lib32 or an undefined value | |
742 dnl (the linker is smart enough to pick the correct default library). | |
743 dnl Things work just fine if you use just AC_PATH_X_DIRECT. | |
744 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to | |
745 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so | |
746 dnl x_includes should be left alone. | |
747 case "$host" in | |
748 mips-sgi-irix6*) | |
749 ;; | |
750 *-*-solaris*) | |
751 ;; | |
752 *) | |
753 _AC_PATH_X_XMKMF | |
754 if test -z "$ac_x_includes"; then | |
755 ac_x_includes="." | |
756 fi | |
757 if test -z "$ac_x_libraries"; then | |
758 ac_x_libraries="/usr/lib" | |
759 fi | |
760 esac | |
761 #from now on we use our own again | |
762 | |
763 # when the user already gave --x-includes, we ignore | |
764 # what the standard autoconf macros told us. | |
765 if test "$kde_x_includes" = NO; then | |
766 kde_x_includes=$ac_x_includes | |
767 fi | |
768 | |
769 # for --x-libraries too | |
770 if test "$kde_x_libraries" = NO; then | |
771 kde_x_libraries=$ac_x_libraries | |
772 fi | |
773 | |
774 if test "$kde_x_includes" = NO; then | |
775 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) | |
776 fi | |
777 | |
778 if test "$kde_x_libraries" = NO; then | |
779 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) | |
780 fi | |
781 | |
782 # Record where we found X for the cache. | |
783 kde_cv_have_x="have_x=yes \ | |
784 kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries" | |
785 ])dnl | |
786 | |
787 eval "$kde_cv_have_x" | |
788 | |
789 if test "$have_x" != yes; then | |
790 AC_MSG_RESULT($have_x) | |
791 no_x=yes | |
792 else | |
793 AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes]) | |
794 fi | |
795 | |
796 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then | |
797 X_INCLUDES="" | |
798 x_includes="."; dnl better than nothing :- | |
799 else | |
800 x_includes=$kde_x_includes | |
801 X_INCLUDES="-I$x_includes" | |
802 fi | |
803 | |
804 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then | |
805 X_LDFLAGS="" | |
806 x_libraries="/usr/lib"; dnl better than nothing :- | |
807 else | |
808 x_libraries=$kde_x_libraries | |
809 X_LDFLAGS="-L$x_libraries" | |
810 fi | |
811 all_includes="$X_INCLUDES" | |
812 all_libraries="$X_LDFLAGS" | |
813 | |
814 AC_SUBST(X_INCLUDES) | |
815 AC_SUBST(X_LDFLAGS) | |
816 AC_SUBST(x_libraries) | |
817 AC_SUBST(x_includes) | |
818 | |
819 # Check for libraries that X11R6 Xt/Xaw programs need. | |
820 ac_save_LDFLAGS="$LDFLAGS" | |
821 LDFLAGS="$LDFLAGS $X_LDFLAGS" | |
822 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to | |
823 # check for ICE first), but we must link in the order -lSM -lICE or | |
824 # we get undefined symbols. So assume we have SM if we have ICE. | |
825 # These have to be linked with before -lX11, unlike the other | |
826 # libraries we check for below, so use a different variable. | |
827 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. | |
828 AC_CHECK_LIB(ICE, IceConnectionNumber, | |
829 [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS) | |
830 AC_SUBST(LIBSM) | |
831 LDFLAGS="$ac_save_LDFLAGS" | |
832 | |
833 AC_SUBST(X_PRE_LIBS) | |
834 | |
835 LIB_X11='-lX11 $(LIBSOCKET)' | |
836 AC_SUBST(LIB_X11) | |
837 | |
838 AC_MSG_CHECKING(for libXext) | |
839 AC_CACHE_VAL(kde_cv_have_libXext, | |
840 [ | |
841 kde_ldflags_safe="$LDFLAGS" | |
842 kde_libs_safe="$LIBS" | |
843 | |
844 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" | |
845 LIBS="-lXext -lX11 $LIBSOCKET" | |
846 | |
847 AC_TRY_LINK([ | |
848 #include <stdio.h> | |
849 #ifdef STDC_HEADERS | |
850 # include <stdlib.h> | |
851 #endif | |
852 ], | |
853 [ | |
854 printf("hello Xext\n"); | |
855 ], | |
856 kde_cv_have_libXext=yes, | |
857 kde_cv_have_libXext=no | |
858 ) | |
859 | |
860 LDFLAGS=$kde_ldflags_safe | |
861 LIBS=$kde_libs_safe | |
862 ]) | |
863 | |
864 AC_MSG_RESULT($kde_cv_have_libXext) | |
865 | |
866 if test "$kde_cv_have_libXext" = "no"; then | |
867 AC_MSG_ERROR([We need a working libXext to proceed. Since configure | |
868 can't find it itself, we stop here assuming that make wouldn't find | |
869 them either.]) | |
870 fi | |
871 | |
872 AC_MSG_CHECKING(for Xinerama) | |
873 | |
874 AC_ARG_WITH(xinerama, | |
875 [ --with-xinerama enable support for Xinerama ], | |
876 [ | |
877 no_xinerama=no | |
878 ], [ | |
879 no_xinerama=yes | |
880 ] | |
881 ) | |
882 | |
883 kde_save_LDFLAGS="$LDFLAGS" | |
884 kde_save_CFLAGS="$CFLAGS" | |
885 kde_save_LIBS="$LIBS" | |
886 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" | |
887 CFLAGS="$CFLAGS -I$x_includes" | |
888 LIBS="-lXinerama -lXext" | |
889 | |
890 if test "x$no_xinerama" = "xno"; then | |
891 | |
892 AC_CACHE_VAL(ac_cv_have_xinerama, | |
893 [ | |
894 AC_TRY_LINK([#include <X11/Xlib.h> | |
895 #include <X11/extensions/Xinerama.h>], | |
896 [XineramaIsActive(NULL);], | |
897 [ac_cv_have_xinerama="yes"], | |
898 [ac_cv_have_xinerama="no"]) | |
899 ]) | |
900 else | |
901 ac_cv_have_xinerama=no; | |
902 fi | |
903 | |
904 AC_MSG_RESULT($ac_cv_have_xinerama) | |
905 | |
906 LIBXINERAMA="" | |
907 | |
908 if test "$ac_cv_have_xinerama" = "yes"; then | |
909 AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support]) | |
910 LIBXINERAMA="-lXinerama" | |
911 fi | |
912 | |
913 AC_SUBST(LIBXINERAMA) | |
914 | |
915 LDFLAGS="$kde_save_LDFLAGS" | |
916 CFLAGS="$kde_save_CFLAGS" | |
917 LIBS="$kde_save_LIBS" | |
918 | |
919 LIB_XEXT="-lXext" | |
920 QTE_NORTTI="" | |
921 | |
922 else | |
923 dnl We're using QT Embedded | |
924 CXXFLAGS="$CXXFLAGS -fno-rtti -DQWS" | |
925 CFLAGS="$CFLAGS -DQWS" | |
926 LDFLAGS="$LDFLAGS -DQWS" | |
927 QTE_NORTTI="-fno-rtti -DQWS" | |
928 X_PRE_LIBS="" | |
929 LIB_X11="" | |
930 LIB_XEXT="" | |
931 LIBSM="" | |
932 X_INCLUDES="" | |
933 X_LDFLAGS="" | |
934 x_includes="" | |
935 x_libraries="" | |
936 AC_SUBST(X_PRE_LIBS) | |
937 AC_SUBST(LIB_X11) | |
938 AC_SUBST(LIBSM) | |
939 AC_SUBST(X_INCLUDES) | |
940 AC_SUBST(X_LDFLAGS) | |
941 AC_SUBST(x_includes) | |
942 AC_SUBST(x_libraries) | |
943 fi | |
944 AC_SUBST(QTE_NORTTI) | |
945 AC_SUBST(LIB_XEXT) | |
946 | |
947 | |
948 AC_LANG_RESTORE | |
949 | |
950 ]) | |
951 | |
952 AC_DEFUN(KDE_PRINT_QT_PROGRAM, | |
953 [ | |
954 AC_REQUIRE([KDE_USE_QT]) | |
955 cat > conftest.$ac_ext <<EOF | |
956 #include "confdefs.h" | |
957 #include <qglobal.h> | |
958 #include <qapplication.h> | |
959 EOF | |
960 if test "$kde_qtver" = "2"; then | |
961 cat >> conftest.$ac_ext <<EOF | |
962 #include <qevent.h> | |
963 #include <qstring.h> | |
964 #include <qstyle.h> | |
965 EOF | |
966 | |
967 if test $kde_qtsubver -gt 0; then | |
968 cat >> conftest.$ac_ext <<EOF | |
969 #include <qiconview.h> | |
970 EOF | |
971 fi | |
972 fi | |
973 | |
974 if test "$kde_qtver" = "3"; then | |
975 cat >> conftest.$ac_ext <<EOF | |
976 #include <qcursor.h> | |
977 #include <qstylefactory.h> | |
978 #include <private/qucomextra_p.h> | |
979 EOF | |
980 fi | |
981 | |
982 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext | |
983 cat >> conftest.$ac_ext <<EOF | |
984 #error 1 | |
985 #endif | |
986 | |
987 int main() { | |
988 EOF | |
989 if test "$kde_qtver" = "2"; then | |
990 cat >> conftest.$ac_ext <<EOF | |
991 QStringList *t = new QStringList(); | |
992 Q_UNUSED(t); | |
993 EOF | |
994 if test $kde_qtsubver -gt 0; then | |
995 cat >> conftest.$ac_ext <<EOF | |
996 QIconView iv(0); | |
997 iv.setWordWrapIconText(false); | |
998 QString s; | |
999 s.setLatin1("Elvis is alive", 14); | |
1000 EOF | |
1001 fi | |
1002 fi | |
1003 if test "$kde_qtver" = "3"; then | |
1004 cat >> conftest.$ac_ext <<EOF | |
1005 (void)QStyleFactory::create(QString::null); | |
1006 QCursor c(Qt::WhatsThisCursor); | |
1007 EOF | |
1008 fi | |
1009 cat >> conftest.$ac_ext <<EOF | |
1010 return 0; | |
1011 } | |
1012 EOF | |
1013 ]) | |
1014 | |
1015 AC_DEFUN(KDE_USE_QT, | |
1016 [ | |
1017 if test -z "$1"; then | |
1018 kde_qtver=3 | |
1019 kde_qtsubver=1 | |
1020 else | |
1021 kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'` | |
1022 # following is the check if subversion isn´t found in passed argument | |
1023 if test "$kde_qtsubver" = "$1"; then | |
1024 kde_qtsubver=1 | |
1025 fi | |
1026 kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'` | |
1027 if test "$kde_qtver" = "1"; then | |
1028 kde_qtsubver=42 | |
1029 fi | |
1030 fi | |
1031 | |
1032 if test -z "$2"; then | |
1033 if test "$kde_qtver" = "2"; then | |
1034 if test $kde_qtsubver -gt 0; then | |
1035 kde_qt_minversion=">= Qt 2.2.2" | |
1036 else | |
1037 kde_qt_minversion=">= Qt 2.0.2" | |
1038 fi | |
1039 fi | |
1040 if test "$kde_qtver" = "3"; then | |
1041 kde_qt_minversion=">= Qt 3.0.1" | |
1042 fi | |
1043 if test "$kde_qtver" = "1"; then | |
1044 kde_qt_minversion=">= 1.42 and < 2.0" | |
1045 fi | |
1046 else | |
1047 kde_qt_minversion=$2 | |
1048 fi | |
1049 | |
1050 if test -z "$3"; then | |
1051 if test $kde_qtver = 3; then | |
1052 kde_qt_verstring="QT_VERSION >= 301" | |
1053 fi | |
1054 if test $kde_qtver = 2; then | |
1055 if test $kde_qtsubver -gt 0; then | |
1056 kde_qt_verstring="QT_VERSION >= 222" | |
1057 else | |
1058 kde_qt_verstring="QT_VERSION >= 200" | |
1059 fi | |
1060 fi | |
1061 if test $kde_qtver = 1; then | |
1062 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" | |
1063 fi | |
1064 else | |
1065 kde_qt_verstring=$3 | |
1066 fi | |
1067 | |
1068 if test $kde_qtver = 3; then | |
1069 kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt" | |
1070 fi | |
1071 if test $kde_qtver = 2; then | |
1072 kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt" | |
1073 fi | |
1074 if test $kde_qtver = 1; then | |
1075 kde_qt_dirs="$QTDIR /usr/lib/qt" | |
1076 fi | |
1077 ]) | |
1078 | |
1079 AC_DEFUN(KDE_CHECK_QT_DIRECT, | |
1080 [ | |
1081 AC_REQUIRE([KDE_USE_QT]) | |
1082 AC_MSG_CHECKING([if Qt compiles without flags]) | |
1083 AC_CACHE_VAL(kde_cv_qt_direct, | |
1084 [ | |
1085 AC_LANG_SAVE | |
1086 AC_LANG_CPLUSPLUS | |
1087 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH | |
1088 ac_LIBRARY_PATH="$LIBRARY_PATH" | |
1089 ac_cxxflags_safe="$CXXFLAGS" | |
1090 ac_ldflags_safe="$LDFLAGS" | |
1091 ac_libs_safe="$LIBS" | |
1092 | |
1093 CXXFLAGS="$CXXFLAGS -I$qt_includes" | |
1094 LDFLAGS="$LDFLAGS $X_LDFLAGS" | |
1095 if test "x$kde_use_qt_emb" != "xyes"; then | |
1096 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET" | |
1097 else | |
1098 LIBS="$LIBQT $LIBSOCKET" | |
1099 fi | |
1100 LD_LIBRARY_PATH= | |
1101 export LD_LIBRARY_PATH | |
1102 LIBRARY_PATH= | |
1103 export LIBRARY_PATH | |
1104 | |
1105 KDE_PRINT_QT_PROGRAM | |
1106 | |
1107 if AC_TRY_EVAL(ac_link) && test -s conftest; then | |
1108 kde_cv_qt_direct="yes" | |
1109 else | |
1110 kde_cv_qt_direct="no" | |
1111 echo "configure: failed program was:" >&AC_FD_CC | |
1112 cat conftest.$ac_ext >&AC_FD_CC | |
1113 fi | |
1114 | |
1115 rm -f conftest* | |
1116 CXXFLAGS="$ac_cxxflags_safe" | |
1117 LDFLAGS="$ac_ldflags_safe" | |
1118 LIBS="$ac_libs_safe" | |
1119 | |
1120 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" | |
1121 export LD_LIBRARY_PATH | |
1122 LIBRARY_PATH="$ac_LIBRARY_PATH" | |
1123 export LIBRARY_PATH | |
1124 AC_LANG_RESTORE | |
1125 ]) | |
1126 | |
1127 if test "$kde_cv_qt_direct" = "yes"; then | |
1128 AC_MSG_RESULT(yes) | |
1129 $1 | |
1130 else | |
1131 AC_MSG_RESULT(no) | |
1132 $2 | |
1133 fi | |
1134 ]) | |
1135 | |
1136 dnl ------------------------------------------------------------------------ | |
1137 dnl Try to find the Qt headers and libraries. | |
1138 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) | |
1139 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) | |
1140 dnl ------------------------------------------------------------------------ | |
1141 dnl | |
1142 AC_DEFUN(AC_PATH_QT_1_3, | |
1143 [ | |
1144 AC_REQUIRE([K_PATH_X]) | |
1145 AC_REQUIRE([KDE_USE_QT]) | |
1146 | |
1147 dnl ------------------------------------------------------------------------ | |
1148 dnl Add configure flag to enable linking to MT version of Qt library. | |
1149 dnl ------------------------------------------------------------------------ | |
1150 | |
1151 AC_ARG_ENABLE( | |
1152 mt, | |
1153 [ --disable-mt link to non-threaded Qt (deprecated)], | |
1154 kde_use_qt_mt=$enableval, | |
1155 [ | |
1156 if test $kde_qtver = 3; then | |
1157 kde_use_qt_mt=yes | |
1158 else | |
1159 kde_use_qt_mt=no | |
1160 fi | |
1161 ] | |
1162 ) | |
1163 | |
1164 USING_QT_MT="" | |
1165 | |
1166 dnl ------------------------------------------------------------------------ | |
1167 dnl If we not get --disable-qt-mt then adjust some vars for the host. | |
1168 dnl ------------------------------------------------------------------------ | |
1169 | |
1170 KDE_MT_LDFLAGS= | |
1171 KDE_MT_LIBS= | |
1172 if test "x$kde_use_qt_mt" = "xyes"; then | |
1173 KDE_CHECK_THREADING | |
1174 if test "x$kde_use_threading" = "xyes"; then | |
1175 CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS" | |
1176 KDE_MT_LDFLAGS="$USE_THREADS" | |
1177 KDE_MT_LIBS="$LIBPTHREAD" | |
1178 else | |
1179 kde_use_qt_mt=no | |
1180 fi | |
1181 fi | |
1182 AC_SUBST(KDE_MT_LDFLAGS) | |
1183 AC_SUBST(KDE_MT_LIBS) | |
1184 | |
1185 kde_qt_was_given=yes | |
1186 | |
1187 dnl ------------------------------------------------------------------------ | |
1188 dnl If we haven't been told how to link to Qt, we work it out for ourselves. | |
1189 dnl ------------------------------------------------------------------------ | |
1190 if test -z "$LIBQT_GLOB"; then | |
1191 if test "x$kde_use_qt_emb" = "xyes"; then | |
1192 LIBQT_GLOB="libqte.*" | |
1193 else | |
1194 LIBQT_GLOB="libqt.*" | |
1195 fi | |
1196 fi | |
1197 | |
1198 if test -z "$LIBQT"; then | |
1199 dnl ------------------------------------------------------------ | |
1200 dnl If we got --enable-embedded then adjust the Qt library name. | |
1201 dnl ------------------------------------------------------------ | |
1202 if test "x$kde_use_qt_emb" = "xyes"; then | |
1203 qtlib="qte" | |
1204 else | |
1205 qtlib="qt" | |
1206 fi | |
1207 | |
1208 kde_int_qt="-l$qtlib" | |
1209 else | |
1210 kde_int_qt="$LIBQT" | |
1211 kde_lib_qt_set=yes | |
1212 fi | |
1213 | |
1214 if test -z "$LIBQPE"; then | |
1215 dnl ------------------------------------------------------------ | |
1216 dnl If we got --enable-palmtop then add -lqpe to the link line | |
1217 dnl ------------------------------------------------------------ | |
1218 if test "x$kde_use_qt_emb" = "xyes"; then | |
1219 if test "x$kde_use_qt_emb_palm" = "xyes"; then | |
1220 LIB_QPE="-lqpe" | |
1221 else | |
1222 LIB_QPE="" | |
1223 fi | |
1224 else | |
1225 LIB_QPE="" | |
1226 fi | |
1227 fi | |
1228 | |
1229 dnl ------------------------------------------------------------------------ | |
1230 dnl If we got --enable-qt-mt then adjust the Qt library name for the host. | |
1231 dnl ------------------------------------------------------------------------ | |
1232 | |
1233 if test "x$kde_use_qt_mt" = "xyes"; then | |
1234 if test -z "$LIBQT"; then | |
1235 LIBQT="-l$qtlib-mt" | |
1236 kde_int_qt="-l$qtlib-mt" | |
1237 else | |
1238 LIBQT="$qtlib-mt" | |
1239 kde_int_qt="$qtlib-mt" | |
1240 fi | |
1241 LIBQT_GLOB="lib$qtlib-mt.*" | |
1242 USING_QT_MT="using -mt" | |
1243 else | |
1244 LIBQT="-l$qtlib" | |
1245 fi | |
1246 | |
1247 if test $kde_qtver != 1; then | |
1248 | |
1249 AC_REQUIRE([AC_FIND_PNG]) | |
1250 AC_REQUIRE([AC_FIND_JPEG]) | |
1251 LIBQT="$LIBQT $LIBPNG $LIBJPEG" | |
1252 fi | |
1253 | |
1254 if test $kde_qtver = 3; then | |
1255 AC_REQUIRE([KDE_CHECK_LIBDL]) | |
1256 LIBQT="$LIBQT $LIBDL" | |
1257 fi | |
1258 | |
1259 AC_MSG_CHECKING([for Qt]) | |
1260 | |
1261 if test "x$kde_use_qt_emb" != "xyes"; then | |
1262 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET" | |
1263 fi | |
1264 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO | |
1265 qt_libraries="" | |
1266 qt_includes="" | |
1267 AC_ARG_WITH(qt-dir, | |
1268 [ --with-qt-dir=DIR where the root of Qt is installed ], | |
1269 [ ac_qt_includes="$withval"/include | |
1270 ac_qt_libraries="$withval"/lib | |
1271 ac_qt_bindir="$withval"/bin | |
1272 ]) | |
1273 | |
1274 AC_ARG_WITH(qt-includes, | |
1275 [ --with-qt-includes=DIR where the Qt includes are. ], | |
1276 [ | |
1277 ac_qt_includes="$withval" | |
1278 ]) | |
1279 | |
1280 kde_qt_libs_given=no | |
1281 | |
1282 AC_ARG_WITH(qt-libraries, | |
1283 [ --with-qt-libraries=DIR where the Qt library is installed.], | |
1284 [ ac_qt_libraries="$withval" | |
1285 kde_qt_libs_given=yes | |
1286 ]) | |
1287 | |
1288 AC_CACHE_VAL(ac_cv_have_qt, | |
1289 [#try to guess Qt locations | |
1290 | |
1291 qt_incdirs="" | |
1292 for dir in $kde_qt_dirs; do | |
1293 qt_incdirs="$qt_incdirs $dir/include $dir" | |
1294 done | |
1295 qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes" | |
1296 if test ! "$ac_qt_includes" = "NO"; then | |
1297 qt_incdirs="$ac_qt_includes $qt_incdirs" | |
1298 fi | |
1299 | |
1300 if test "$kde_qtver" != "1"; then | |
1301 kde_qt_header=qstyle.h | |
1302 else | |
1303 kde_qt_header=qglobal.h | |
1304 fi | |
1305 | |
1306 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) | |
1307 ac_qt_includes="$qt_incdir" | |
1308 | |
1309 qt_libdirs="" | |
1310 for dir in $kde_qt_dirs; do | |
1311 qt_libdirs="$qt_libdirs $dir/lib $dir" | |
1312 done | |
1313 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" | |
1314 if test ! "$ac_qt_libraries" = "NO"; then | |
1315 qt_libdir=$ac_qt_libraries | |
1316 else | |
1317 qt_libdirs="$ac_qt_libraries $qt_libdirs" | |
1318 # if the Qt was given, the chance is too big that libqt.* doesn't exist | |
1319 qt_libdir=NONE | |
1320 for dir in $qt_libdirs; do | |
1321 try="ls -1 $dir/${LIBQT_GLOB}" | |
1322 if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi | |
1323 done | |
1324 fi | |
1325 | |
1326 ac_qt_libraries="$qt_libdir" | |
1327 | |
1328 AC_LANG_SAVE | |
1329 AC_LANG_CPLUSPLUS | |
1330 | |
1331 ac_cxxflags_safe="$CXXFLAGS" | |
1332 ac_ldflags_safe="$LDFLAGS" | |
1333 ac_libs_safe="$LIBS" | |
1334 | |
1335 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" | |
1336 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" | |
1337 LIBS="$LIBS $LIBQT $KDE_MT_LIBS" | |
1338 | |
1339 KDE_PRINT_QT_PROGRAM | |
1340 | |
1341 if AC_TRY_EVAL(ac_link) && test -s conftest; then | |
1342 rm -f conftest* | |
1343 else | |
1344 echo "configure: failed program was:" >&AC_FD_CC | |
1345 cat conftest.$ac_ext >&AC_FD_CC | |
1346 ac_qt_libraries="NO" | |
1347 fi | |
1348 rm -f conftest* | |
1349 CXXFLAGS="$ac_cxxflags_safe" | |
1350 LDFLAGS="$ac_ldflags_safe" | |
1351 LIBS="$ac_libs_safe" | |
1352 | |
1353 AC_LANG_RESTORE | |
1354 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then | |
1355 ac_cv_have_qt="have_qt=no" | |
1356 ac_qt_notfound="" | |
1357 missing_qt_mt="" | |
1358 if test "$ac_qt_includes" = NO; then | |
1359 if test "$ac_qt_libraries" = NO; then | |
1360 ac_qt_notfound="(headers and libraries)"; | |
1361 else | |
1362 ac_qt_notfound="(headers)"; | |
1363 fi | |
1364 else | |
1365 if test "x$kde_use_qt_mt" = "xyes"; then | |
1366 missing_qt_mt=" | |
1367 Make sure that you have compiled Qt with thread support!" | |
1368 ac_qt_notfound="(library $qtlib-mt)"; | |
1369 else | |
1370 ac_qt_notfound="(library $qtlib)"; | |
1371 fi | |
1372 fi | |
1373 | |
1374 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! | |
1375 For more details about this problem, look at the end of config.log.$missing_qt_mt]) | |
1376 else | |
1377 have_qt="yes" | |
1378 fi | |
1379 ]) | |
1380 | |
1381 eval "$ac_cv_have_qt" | |
1382 | |
1383 if test "$have_qt" != yes; then | |
1384 AC_MSG_RESULT([$have_qt]); | |
1385 else | |
1386 ac_cv_have_qt="have_qt=yes \ | |
1387 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" | |
1388 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) | |
1389 | |
1390 qt_libraries="$ac_qt_libraries" | |
1391 qt_includes="$ac_qt_includes" | |
1392 fi | |
1393 | |
1394 if test ! "$kde_qt_libs_given" = "yes"; then | |
1395 KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) | |
1396 fi | |
1397 | |
1398 AC_SUBST(qt_libraries) | |
1399 AC_SUBST(qt_includes) | |
1400 | |
1401 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then | |
1402 QT_INCLUDES="" | |
1403 else | |
1404 QT_INCLUDES="-I$qt_includes" | |
1405 all_includes="$QT_INCLUDES $all_includes" | |
1406 fi | |
1407 | |
1408 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then | |
1409 QT_LDFLAGS="" | |
1410 else | |
1411 QT_LDFLAGS="-L$qt_libraries" | |
1412 all_libraries="$all_libraries $QT_LDFLAGS" | |
1413 fi | |
1414 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS" | |
1415 | |
1416 AC_SUBST(QT_INCLUDES) | |
1417 AC_SUBST(QT_LDFLAGS) | |
1418 AC_PATH_QT_MOC_UIC | |
1419 | |
1420 if test "x$kde_use_qt_emb" != "xyes"; then | |
1421 LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)' | |
1422 else | |
1423 LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG)' | |
1424 fi | |
1425 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS" | |
1426 | |
1427 AC_SUBST(LIB_QT) | |
1428 AC_SUBST(LIB_QPE) | |
1429 | |
1430 AC_SUBST(kde_qtver) | |
1431 ]) | |
1432 | |
1433 AC_DEFUN(AC_PATH_QT, | |
1434 [ | |
1435 AC_PATH_QT_1_3 | |
1436 ]) | |
1437 | |
1438 AC_DEFUN(KDE_CHECK_FINAL, | |
1439 [ | |
1440 AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)], | |
1441 kde_use_final=$enableval, kde_use_final=no) | |
1442 | |
1443 KDE_COMPILER_REPO | |
1444 if test "x$kde_use_final" = "xyes"; then | |
1445 KDE_USE_FINAL_TRUE="" | |
1446 KDE_USE_FINAL_FALSE="#" | |
1447 else | |
1448 KDE_USE_FINAL_TRUE="#" | |
1449 KDE_USE_FINAL_FALSE="" | |
1450 fi | |
1451 AC_SUBST(KDE_USE_FINAL_TRUE) | |
1452 AC_SUBST(KDE_USE_FINAL_FALSE) | |
1453 | |
1454 AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation], | |
1455 kde_use_closure=$enableval, kde_use_closure=yes) | |
1456 | |
1457 if test "x$kde_use_closure" = "xyes"; then | |
1458 KDE_USE_CLOSURE_TRUE="" | |
1459 KDE_USE_CLOSURE_FALSE="#" | |
1460 # CXXFLAGS="$CXXFLAGS $REPO" | |
1461 else | |
1462 KDE_USE_CLOSURE_TRUE="#" | |
1463 KDE_USE_CLOSURE_FALSE="" | |
1464 fi | |
1465 AC_SUBST(KDE_USE_CLOSURE_TRUE) | |
1466 AC_SUBST(KDE_USE_CLOSURE_FALSE) | |
1467 ]) | |
1468 | |
1469 dnl ------------------------------------------------------------------------ | |
1470 dnl Now, the same with KDE | |
1471 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) | |
1472 dnl and $(kde_includes) will be the kdehdrlocation (if needed) | |
1473 dnl ------------------------------------------------------------------------ | |
1474 dnl | |
1475 AC_DEFUN(AC_BASE_PATH_KDE, | |
1476 [ | |
1477 AC_PREREQ([2.13]) | |
1478 AC_REQUIRE([AC_PATH_QT])dnl | |
1479 AC_CHECK_RPATH | |
1480 AC_MSG_CHECKING([for KDE]) | |
1481 | |
1482 if test "${prefix}" != NONE; then | |
1483 kde_includes=${prefix}/include | |
1484 ac_kde_includes=$prefix/include | |
1485 | |
1486 if test "${exec_prefix}" != NONE; then | |
1487 kde_libraries=${exec_prefix}/lib | |
1488 ac_kde_libraries=$exec_prefix/lib | |
1489 else | |
1490 kde_libraries=${prefix}/lib | |
1491 ac_kde_libraries=$prefix/lib | |
1492 fi | |
1493 else | |
1494 ac_kde_includes= | |
1495 ac_kde_libraries= | |
1496 kde_libraries="" | |
1497 kde_includes="" | |
1498 fi | |
1499 | |
1500 AC_CACHE_VAL(ac_cv_have_kde, | |
1501 [#try to guess kde locations | |
1502 | |
1503 if test "$kde_qtver" = 1; then | |
1504 kde_check_header="ksock.h" | |
1505 kde_check_lib="libkdecore.la" | |
1506 else | |
1507 kde_check_header="ksharedptr.h" | |
1508 kde_check_lib="libkio.la" | |
1509 fi | |
1510 | |
1511 if test -z "$1"; then | |
1512 | |
1513 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" | |
1514 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs" | |
1515 kde_incdirs="$ac_kde_includes $kde_incdirs" | |
1516 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir) | |
1517 ac_kde_includes="$kde_incdir" | |
1518 | |
1519 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then | |
1520 AC_MSG_ERROR([ | |
1521 in the prefix, you've chosen, are no KDE headers installed. This will fail. | |
1522 So, check this please and use another prefix!]) | |
1523 fi | |
1524 | |
1525 kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib" | |
1526 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs" | |
1527 kde_libdirs="$ac_kde_libraries $kde_libdirs" | |
1528 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir) | |
1529 ac_kde_libraries="$kde_libdir" | |
1530 | |
1531 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then | |
1532 AC_MSG_ERROR([ | |
1533 in the prefix, you've chosen, are no KDE libraries installed. This will fail. | |
1534 So, check this please and use another prefix!]) | |
1535 fi | |
1536 ac_kde_libraries="$kde_libdir" | |
1537 | |
1538 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then | |
1539 ac_cv_have_kde="have_kde=no" | |
1540 else | |
1541 ac_cv_have_kde="have_kde=yes \ | |
1542 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" | |
1543 fi | |
1544 | |
1545 else dnl test -z $1 | |
1546 | |
1547 ac_cv_have_kde="have_kde=no" | |
1548 | |
1549 fi | |
1550 ])dnl | |
1551 | |
1552 eval "$ac_cv_have_kde" | |
1553 | |
1554 if test "$have_kde" != "yes"; then | |
1555 if test "${prefix}" = NONE; then | |
1556 ac_kde_prefix="$ac_default_prefix" | |
1557 else | |
1558 ac_kde_prefix="$prefix" | |
1559 fi | |
1560 if test "$exec_prefix" = NONE; then | |
1561 ac_kde_exec_prefix="$ac_kde_prefix" | |
1562 AC_MSG_RESULT([will be installed in $ac_kde_prefix]) | |
1563 else | |
1564 ac_kde_exec_prefix="$exec_prefix" | |
1565 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix]) | |
1566 fi | |
1567 | |
1568 kde_libraries="${ac_kde_exec_prefix}/lib" | |
1569 kde_includes=${ac_kde_prefix}/include | |
1570 | |
1571 else | |
1572 ac_cv_have_kde="have_kde=yes \ | |
1573 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" | |
1574 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes]) | |
1575 | |
1576 kde_libraries="$ac_kde_libraries" | |
1577 kde_includes="$ac_kde_includes" | |
1578 fi | |
1579 AC_SUBST(kde_libraries) | |
1580 AC_SUBST(kde_includes) | |
1581 | |
1582 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then | |
1583 KDE_INCLUDES="" | |
1584 else | |
1585 KDE_INCLUDES="-I$kde_includes" | |
1586 all_includes="$KDE_INCLUDES $all_includes" | |
1587 fi | |
1588 | |
1589 KDE_LDFLAGS="-L$kde_libraries" | |
1590 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then | |
1591 all_libraries="$all_libraries $KDE_LDFLAGS" | |
1592 fi | |
1593 | |
1594 AC_SUBST(KDE_LDFLAGS) | |
1595 AC_SUBST(KDE_INCLUDES) | |
1596 | |
1597 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
1598 | |
1599 all_libraries="$all_libraries $USER_LDFLAGS" | |
1600 all_includes="$all_includes $USER_INCLUDES" | |
1601 AC_SUBST(all_includes) | |
1602 AC_SUBST(all_libraries) | |
1603 | |
1604 AC_SUBST(AUTODIRS) | |
1605 ]) | |
1606 | |
1607 AC_DEFUN(KDE_CHECK_EXTRA_LIBS, | |
1608 [ | |
1609 AC_MSG_CHECKING(for extra includes) | |
1610 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR | |
1611 adds non standard include paths], | |
1612 kde_use_extra_includes="$withval", | |
1613 kde_use_extra_includes=NONE | |
1614 ) | |
1615 kde_extra_includes= | |
1616 if test -n "$kde_use_extra_includes" && \ | |
1617 test "$kde_use_extra_includes" != "NONE"; then | |
1618 | |
1619 ac_save_ifs=$IFS | |
1620 IFS=':' | |
1621 for dir in $kde_use_extra_includes; do | |
1622 kde_extra_includes="$kde_extra_includes $dir" | |
1623 USER_INCLUDES="$USER_INCLUDES -I$dir" | |
1624 done | |
1625 IFS=$ac_save_ifs | |
1626 kde_use_extra_includes="added" | |
1627 else | |
1628 kde_use_extra_includes="no" | |
1629 fi | |
1630 AC_SUBST(USER_INCLUDES) | |
1631 | |
1632 AC_MSG_RESULT($kde_use_extra_includes) | |
1633 | |
1634 kde_extra_libs= | |
1635 AC_MSG_CHECKING(for extra libs) | |
1636 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths], | |
1637 kde_use_extra_libs=$withval, | |
1638 kde_use_extra_libs=NONE | |
1639 ) | |
1640 if test -n "$kde_use_extra_libs" && \ | |
1641 test "$kde_use_extra_libs" != "NONE"; then | |
1642 | |
1643 ac_save_ifs=$IFS | |
1644 IFS=':' | |
1645 for dir in $kde_use_extra_libs; do | |
1646 kde_extra_libs="$kde_extra_libs $dir" | |
1647 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir" | |
1648 USER_LDFLAGS="$USER_LDFLAGS -L$dir" | |
1649 done | |
1650 IFS=$ac_save_ifs | |
1651 kde_use_extra_libs="added" | |
1652 else | |
1653 kde_use_extra_libs="no" | |
1654 fi | |
1655 | |
1656 AC_SUBST(USER_LDFLAGS) | |
1657 | |
1658 AC_MSG_RESULT($kde_use_extra_libs) | |
1659 | |
1660 ]) | |
1661 | |
1662 AC_DEFUN(KDE_1_CHECK_PATH_HEADERS, | |
1663 [ | |
1664 AC_MSG_CHECKING([for KDE headers installed]) | |
1665 AC_LANG_SAVE | |
1666 AC_LANG_CPLUSPLUS | |
1667 cat > conftest.$ac_ext <<EOF | |
1668 #ifdef STDC_HEADERS | |
1669 # include <stdlib.h> | |
1670 #endif | |
1671 #include <stdio.h> | |
1672 #include "confdefs.h" | |
1673 #include <kapp.h> | |
1674 | |
1675 int main() { | |
1676 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data()); | |
1677 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data()); | |
1678 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data()); | |
1679 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data()); | |
1680 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data()); | |
1681 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data()); | |
1682 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data()); | |
1683 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data()); | |
1684 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data()); | |
1685 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data()); | |
1686 printf("kde_wallpaperdir=\\"%s\\"\n", | |
1687 KApplication::kde_wallpaperdir().data()); | |
1688 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data()); | |
1689 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data()); | |
1690 printf("kde_servicesdir=\\"/tmp/dummy\\"\n"); | |
1691 printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n"); | |
1692 printf("kde_moduledir=\\"/tmp/dummy\\"\n"); | |
1693 printf("kde_styledir=\\"/tmp/dummy\\"\n"); | |
1694 printf("kde_widgetdir=\\"/tmp/dummy\\"\n"); | |
1695 return 0; | |
1696 } | |
1697 EOF | |
1698 | |
1699 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext' | |
1700 if AC_TRY_EVAL(ac_compile); then | |
1701 AC_MSG_RESULT(yes) | |
1702 else | |
1703 AC_MSG_ERROR([your system is not able to compile a small KDE application! | |
1704 Check, if you installed the KDE header files correctly. | |
1705 For more details about this problem, look at the end of config.log.]) | |
1706 fi | |
1707 | |
1708 AC_LANG_RESTORE | |
1709 ]) | |
1710 | |
1711 AC_DEFUN(KDE_CHECK_KDEQTADDON, | |
1712 [ | |
1713 AC_MSG_CHECKING(for kde-qt-addon) | |
1714 AC_CACHE_VAL(kde_cv_have_kdeqtaddon, | |
1715 [ | |
1716 kde_ldflags_safe="$LDFLAGS" | |
1717 kde_libs_safe="$LIBS" | |
1718 kde_cxxflags_safe="$CXXFLAGS" | |
1719 | |
1720 LIBS="-lkde-qt-addon $LIBQT $LIBS" | |
1721 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes" | |
1722 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" | |
1723 | |
1724 AC_TRY_LINK([ | |
1725 #include <qdom.h> | |
1726 ], | |
1727 [ | |
1728 QDomDocument doc; | |
1729 ], | |
1730 kde_cv_have_kdeqtaddon=yes, | |
1731 kde_cv_have_kdeqtaddon=no | |
1732 ) | |
1733 | |
1734 LDFLAGS=$kde_ldflags_safe | |
1735 LIBS=$kde_libs_safe | |
1736 kde_cxxflags_safe="$CXXFLAGS" | |
1737 ]) | |
1738 | |
1739 AC_MSG_RESULT($kde_cv_have_kdeqtaddon) | |
1740 | |
1741 if test "$kde_cv_have_kdeqtaddon" = "no"; then | |
1742 AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first. | |
1743 It is a separate package (and CVS module) named kde-qt-addon.]) | |
1744 fi | |
1745 ]) | |
1746 | |
1747 AC_DEFUN(KDE_CHECK_KIMGIO, | |
1748 [ | |
1749 AC_REQUIRE([AC_BASE_PATH_KDE]) | |
1750 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
1751 AC_REQUIRE([AC_FIND_TIFF]) | |
1752 AC_REQUIRE([AC_FIND_JPEG]) | |
1753 AC_REQUIRE([AC_FIND_PNG]) | |
1754 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES]) | |
1755 | |
1756 if test "$1" = "existance"; then | |
1757 AC_LANG_SAVE | |
1758 AC_LANG_CPLUSPLUS | |
1759 kde_save_LIBS="$LIBS" | |
1760 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm" | |
1761 AC_CHECK_LIB(kimgio, kimgioRegister, [ | |
1762 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no) | |
1763 LIBS="$kde_save_LIBS" | |
1764 AC_LANG_RESTORE | |
1765 else | |
1766 LIBKIMGIO_EXISTS=yes | |
1767 fi | |
1768 | |
1769 if test "$LIBKIMGIO_EXISTS" = "yes"; then | |
1770 LIB_KIMGIO='-lkimgio' | |
1771 else | |
1772 LIB_KIMGIO='' | |
1773 fi | |
1774 AC_SUBST(LIB_KIMGIO) | |
1775 ]) | |
1776 | |
1777 AC_DEFUN(KDE_CREATE_LIBS_ALIASES, | |
1778 [ | |
1779 AC_REQUIRE([KDE_MISC_TESTS]) | |
1780 AC_REQUIRE([KDE_CHECK_LIBDL]) | |
1781 AC_REQUIRE([K_PATH_X]) | |
1782 | |
1783 if test $kde_qtver = 3; then | |
1784 LIB_KDECORE='-lkdecore' | |
1785 AC_SUBST(LIB_KDECORE) | |
1786 LIB_KDEUI='-lkdeui' | |
1787 AC_SUBST(LIB_KDEUI) | |
1788 LIB_KIO='-lkio' | |
1789 AC_SUBST(LIB_KIO) | |
1790 LIB_SMB='-lsmb' | |
1791 AC_SUBST(LIB_SMB) | |
1792 LIB_KAB='-lkab' | |
1793 AC_SUBST(LIB_KAB) | |
1794 LIB_KHTML='-lkhtml' | |
1795 AC_SUBST(LIB_KHTML) | |
1796 LIB_KSPELL='-lkspell' | |
1797 AC_SUBST(LIB_KSPELL) | |
1798 LIB_KPARTS='-lkparts' | |
1799 AC_SUBST(LIB_KPARTS) | |
1800 LIB_KDEPRINT='-lkdeprint' | |
1801 AC_SUBST(LIB_KDEPRINT) | |
1802 # these are for backward compatibility | |
1803 LIB_KSYCOCA='-lkio' | |
1804 AC_SUBST(LIB_KSYCOCA) | |
1805 LIB_KFILE='-lkio' | |
1806 AC_SUBST(LIB_KFILE) | |
1807 elif test $kde_qtver = 2; then | |
1808 LIB_KDECORE='-lkdecore' | |
1809 AC_SUBST(LIB_KDECORE) | |
1810 LIB_KDEUI='-lkdeui' | |
1811 AC_SUBST(LIB_KDEUI) | |
1812 LIB_KIO='-lkio' | |
1813 AC_SUBST(LIB_KIO) | |
1814 LIB_KSYCOCA='-lksycoca' | |
1815 AC_SUBST(LIB_KSYCOCA) | |
1816 LIB_SMB='-lsmb' | |
1817 AC_SUBST(LIB_SMB) | |
1818 LIB_KFILE='-lkfile' | |
1819 AC_SUBST(LIB_KFILE) | |
1820 LIB_KAB='-lkab' | |
1821 AC_SUBST(LIB_KAB) | |
1822 LIB_KHTML='-lkhtml' | |
1823 AC_SUBST(LIB_KHTML) | |
1824 LIB_KSPELL='-lkspell' | |
1825 AC_SUBST(LIB_KSPELL) | |
1826 LIB_KPARTS='-lkparts' | |
1827 AC_SUBST(LIB_KPARTS) | |
1828 LIB_KDEPRINT='-lkdeprint' | |
1829 AC_SUBST(LIB_KDEPRINT) | |
1830 else | |
1831 LIB_KDECORE='-lkdecore -lXext $(LIB_QT)' | |
1832 AC_SUBST(LIB_KDECORE) | |
1833 LIB_KDEUI='-lkdeui $(LIB_KDECORE)' | |
1834 AC_SUBST(LIB_KDEUI) | |
1835 LIB_KFM='-lkfm $(LIB_KDECORE)' | |
1836 AC_SUBST(LIB_KFM) | |
1837 LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)' | |
1838 AC_SUBST(LIB_KFILE) | |
1839 LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)' | |
1840 AC_SUBST(LIB_KAB) | |
1841 fi | |
1842 ]) | |
1843 | |
1844 AC_DEFUN(AC_PATH_KDE, | |
1845 [ | |
1846 AC_BASE_PATH_KDE | |
1847 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install], | |
1848 [ | |
1849 if test "$enableval" = "no"; | |
1850 then ac_use_path_checking="default" | |
1851 else ac_use_path_checking="" | |
1852 fi | |
1853 ], | |
1854 [ | |
1855 if test "$kde_qtver" = 1; | |
1856 then ac_use_path_checking="" | |
1857 else ac_use_path_checking="default" | |
1858 fi | |
1859 ] | |
1860 ) | |
1861 | |
1862 AC_CREATE_KFSSTND($ac_use_path_checking) | |
1863 | |
1864 AC_SUBST_KFSSTND | |
1865 KDE_CREATE_LIBS_ALIASES | |
1866 ]) | |
1867 | |
1868 dnl obsolete | |
1869 AC_DEFUN(AC_CHECK_SETENV, | |
1870 [ | |
1871 AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl | |
1872 AC_CHECK_FUNCS([setenv unsetenv]) | |
1873 ]) | |
1874 | |
1875 AC_DEFUN(AC_CHECK_GETDOMAINNAME, | |
1876 [ | |
1877 AC_MSG_CHECKING(for getdomainname) | |
1878 AC_CACHE_VAL(ac_cv_func_getdomainname, | |
1879 [ | |
1880 AC_LANG_SAVE | |
1881 AC_LANG_CPLUSPLUS | |
1882 save_CXXFLAGS="$CXXFLAGS" | |
1883 kde_safe_LIBS="$LIBS" | |
1884 LIBS="$LIBS $X_EXTRA_LIBS" | |
1885 if test "$GCC" = "yes"; then | |
1886 CXXFLAGS="$CXXFLAGS -pedantic-errors" | |
1887 fi | |
1888 AC_TRY_COMPILE([ | |
1889 #include <stdlib.h> | |
1890 #include <unistd.h> | |
1891 ], | |
1892 [ | |
1893 char buffer[200]; | |
1894 getdomainname(buffer, 200); | |
1895 ], | |
1896 ac_cv_func_getdomainname=yes, | |
1897 ac_cv_func_getdomainname=no) | |
1898 CXXFLAGS="$save_CXXFLAGS" | |
1899 LIBS=$kde_safe_LIBS | |
1900 AC_LANG_RESTORE | |
1901 ]) | |
1902 AC_MSG_RESULT($ac_cv_func_getdomainname) | |
1903 | |
1904 AC_MSG_CHECKING([if getdomainname needs custom prototype]) | |
1905 AC_CACHE_VAL(ac_cv_proto_getdomainname, | |
1906 [ | |
1907 AC_LANG_SAVE | |
1908 AC_LANG_CPLUSPLUS | |
1909 if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then | |
1910 ac_cv_proto_getdomainname=no | |
1911 else | |
1912 kde_safe_libs=$LIBS | |
1913 LIBS="$LIBS $X_EXTRA_LIBS" | |
1914 AC_TRY_LINK([ | |
1915 #include <stdlib.h> | |
1916 #include <unistd.h> | |
1917 | |
1918 extern "C" int getdomainname (char *, int); | |
1919 ], | |
1920 [ | |
1921 char buffer[200]; | |
1922 getdomainname(buffer, 200); | |
1923 ], | |
1924 ac_cv_func_getdomainname=yes | |
1925 ac_cv_proto_getdomainname=yes, | |
1926 AC_MSG_RESULT([fatal error]) | |
1927 AC_MSG_ERROR([getdomainname unavailable])) | |
1928 fi | |
1929 LIBS=$kde_safe_libs | |
1930 AC_LANG_RESTORE | |
1931 ]) | |
1932 AC_MSG_RESULT($ac_cv_proto_getdomainname) | |
1933 | |
1934 if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then | |
1935 AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname]) | |
1936 fi | |
1937 if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then | |
1938 AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1, | |
1939 [Define if you have getdomainname prototype]) | |
1940 fi | |
1941 | |
1942 ]) | |
1943 | |
1944 AC_DEFUN(AC_CHECK_GETHOSTNAME, | |
1945 [ | |
1946 | |
1947 AC_MSG_CHECKING([for gethostname]) | |
1948 AC_CACHE_VAL(ac_cv_func_gethostname, | |
1949 [ | |
1950 AC_LANG_SAVE | |
1951 AC_LANG_CPLUSPLUS | |
1952 save_CXXFLAGS="$CXXFLAGS" | |
1953 if test "$GCC" = "yes"; then | |
1954 CXXFLAGS="$CXXFLAGS -pedantic-errors" | |
1955 fi | |
1956 AC_TRY_LINK([ | |
1957 #include <stdlib.h> | |
1958 #include <unistd.h> | |
1959 ], | |
1960 [ | |
1961 char buffer[200]; | |
1962 gethostname(buffer, 200); | |
1963 ], | |
1964 ac_cv_func_gethostname=yes, | |
1965 ac_cv_func_gethostname=no) | |
1966 CXXFLAGS="$save_CXXFLAGS" | |
1967 AC_LANG_RESTORE | |
1968 ]) | |
1969 AC_MSG_RESULT($ac_cv_func_gethostname) | |
1970 | |
1971 AC_MSG_CHECKING([if gethostname needs custom prototype]) | |
1972 AC_CACHE_VAL(ac_cv_proto_gethostname, | |
1973 [ | |
1974 AC_LANG_SAVE | |
1975 AC_LANG_CPLUSPLUS | |
1976 if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then | |
1977 ac_cv_proto_gethostname=no | |
1978 else | |
1979 AC_TRY_LINK([ | |
1980 #include <stdlib.h> | |
1981 #include <unistd.h> | |
1982 | |
1983 extern "C" int gethostname (char *, int); | |
1984 ], | |
1985 [ | |
1986 char buffer[200]; | |
1987 gethostname(buffer, 200); | |
1988 ], | |
1989 ac_cv_func_gethostname=yes | |
1990 ac_cv_proto_gethostname=yes, | |
1991 AC_MSG_RESULT([fatal error]) | |
1992 AC_MSG_ERROR(gethostname unavailable)) | |
1993 fi | |
1994 AC_LANG_RESTORE | |
1995 ]) | |
1996 AC_MSG_RESULT($ac_cv_proto_gethostname) | |
1997 | |
1998 if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then | |
1999 AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1, | |
2000 [Define if you have gethostname prototype]) | |
2001 fi | |
2002 if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then | |
2003 AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname]) | |
2004 fi | |
2005 ]) | |
2006 | |
2007 AC_DEFUN(AC_CHECK_USLEEP, | |
2008 [ | |
2009 AC_MSG_CHECKING([for usleep]) | |
2010 AC_CACHE_VAL(ac_cv_func_usleep, | |
2011 [ | |
2012 AC_LANG_SAVE | |
2013 AC_LANG_CPLUSPLUS | |
2014 ac_libs_safe="$LIBS" | |
2015 LIBS="$LIBS $LIBUCB" | |
2016 AC_TRY_LINK([ | |
2017 #include <stdlib.h> | |
2018 #include <unistd.h> | |
2019 ], | |
2020 [ | |
2021 usleep(200); | |
2022 ], | |
2023 ac_cv_func_usleep=yes, | |
2024 ac_cv_func_usleep=no) | |
2025 LIBS="$ac_libs_safe" | |
2026 AC_LANG_RESTORE | |
2027 ]) | |
2028 AC_MSG_RESULT($ac_cv_func_usleep) | |
2029 if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then | |
2030 AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function]) | |
2031 fi | |
2032 ]) | |
2033 | |
2034 AC_DEFUN(AC_CHECK_RANDOM, | |
2035 [ | |
2036 AC_MSG_CHECKING([for random]) | |
2037 AC_CACHE_VAL(ac_cv_func_random, | |
2038 [ | |
2039 AC_LANG_SAVE | |
2040 AC_LANG_CPLUSPLUS | |
2041 ac_libs_safe="$LIBS" | |
2042 LIBS="$LIBS $LIBUCB" | |
2043 AC_TRY_LINK([ | |
2044 #include <stdlib.h> | |
2045 ], | |
2046 [ | |
2047 random(); | |
2048 ], | |
2049 ac_cv_func_random=yes, | |
2050 ac_cv_func_random=no) | |
2051 LIBS="$ac_libs_safe" | |
2052 AC_LANG_RESTORE | |
2053 ]) | |
2054 AC_MSG_RESULT($ac_cv_func_random) | |
2055 if eval "test \"`echo $ac_cv_func_random`\" = yes"; then | |
2056 AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random]) | |
2057 fi | |
2058 ]) | |
2059 | |
2060 AC_DEFUN(AC_FIND_GIF, | |
2061 [AC_MSG_CHECKING([for giflib]) | |
2062 AC_CACHE_VAL(ac_cv_lib_gif, | |
2063 [ac_save_LIBS="$LIBS" | |
2064 if test "x$kde_use_qt_emb" != "xyes"; then | |
2065 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" | |
2066 else | |
2067 LIBS="$all_libraries -lgif" | |
2068 fi | |
2069 AC_TRY_LINK(dnl | |
2070 [ | |
2071 #ifdef __cplusplus | |
2072 extern "C" { | |
2073 #endif | |
2074 int GifLastError(void); | |
2075 #ifdef __cplusplus | |
2076 } | |
2077 #endif | |
2078 /* We use char because int might match the return type of a gcc2 | |
2079 builtin and then its argument prototype would still apply. */ | |
2080 ], | |
2081 [return GifLastError();], | |
2082 eval "ac_cv_lib_gif=yes", | |
2083 eval "ac_cv_lib_gif=no") | |
2084 LIBS="$ac_save_LIBS" | |
2085 ])dnl | |
2086 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then | |
2087 AC_MSG_RESULT(yes) | |
2088 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif]) | |
2089 else | |
2090 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package) | |
2091 fi | |
2092 ]) | |
2093 | |
2094 AC_DEFUN(KDE_FIND_JPEG_HELPER, | |
2095 [ | |
2096 AC_MSG_CHECKING([for libjpeg$2]) | |
2097 AC_CACHE_VAL(ac_cv_lib_jpeg_$1, | |
2098 [ | |
2099 AC_LANG_C | |
2100 ac_save_LIBS="$LIBS" | |
2101 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm" | |
2102 ac_save_CFLAGS="$CFLAGS" | |
2103 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" | |
2104 AC_TRY_LINK( | |
2105 [/* Override any gcc2 internal prototype to avoid an error. */ | |
2106 struct jpeg_decompress_struct; | |
2107 typedef struct jpeg_decompress_struct * j_decompress_ptr; | |
2108 typedef int size_t; | |
2109 #ifdef __cplusplus | |
2110 extern "C" { | |
2111 #endif | |
2112 void jpeg_CreateDecompress(j_decompress_ptr cinfo, | |
2113 int version, size_t structsize); | |
2114 #ifdef __cplusplus | |
2115 } | |
2116 #endif | |
2117 /* We use char because int might match the return type of a gcc2 | |
2118 builtin and then its argument prototype would still apply. */ | |
2119 ], | |
2120 [jpeg_CreateDecompress(0L, 0, 0);], | |
2121 eval "ac_cv_lib_jpeg_$1=-ljpeg$2", | |
2122 eval "ac_cv_lib_jpeg_$1=no") | |
2123 LIBS="$ac_save_LIBS" | |
2124 CFLAGS="$ac_save_CFLAGS" | |
2125 ]) | |
2126 | |
2127 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then | |
2128 LIBJPEG="$ac_cv_lib_jpeg_$1" | |
2129 AC_MSG_RESULT($ac_cv_lib_jpeg_$1) | |
2130 else | |
2131 AC_MSG_RESULT(no) | |
2132 $3 | |
2133 fi | |
2134 | |
2135 ]) | |
2136 | |
2137 AC_DEFUN(AC_FIND_JPEG, | |
2138 [ | |
2139 dnl first look for libraries | |
2140 KDE_FIND_JPEG_HELPER(6b, 6b, | |
2141 KDE_FIND_JPEG_HELPER(normal, [], | |
2142 [ | |
2143 LIBJPEG= | |
2144 ] | |
2145 ) | |
2146 ) | |
2147 | |
2148 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h | |
2149 dnl requires system dependent includes loaded before it) | |
2150 jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes" | |
2151 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir) | |
2152 test "x$jpeg_incdir" = xNO && jpeg_incdir= | |
2153 | |
2154 dnl if headers _and_ libraries are missing, this is no error, and we | |
2155 dnl continue with a warning (the user will get no jpeg support in khtml) | |
2156 dnl if only one is missing, it means a configuration error, but we still | |
2157 dnl only warn | |
2158 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then | |
2159 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg]) | |
2160 else | |
2161 if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then | |
2162 AC_MSG_WARN([ | |
2163 There is an installation error in jpeg support. You seem to have only one | |
2164 of either the headers _or_ the libraries installed. You may need to either | |
2165 provide correct --with-extra-... options, or the development package of | |
2166 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/ | |
2167 Disabling JPEG support. | |
2168 ]) | |
2169 else | |
2170 AC_MSG_WARN([libjpeg not found. disable JPEG support.]) | |
2171 fi | |
2172 jpeg_incdir= | |
2173 LIBJPEG= | |
2174 fi | |
2175 | |
2176 AC_SUBST(LIBJPEG) | |
2177 ]) | |
2178 | |
2179 AC_DEFUN(AC_FIND_ZLIB, | |
2180 [ | |
2181 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
2182 AC_MSG_CHECKING([for libz]) | |
2183 AC_CACHE_VAL(ac_cv_lib_z, | |
2184 [ | |
2185 AC_LANG_C | |
2186 kde_save_LIBS="$LIBS" | |
2187 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET" | |
2188 kde_save_CFLAGS="$CFLAGS" | |
2189 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" | |
2190 AC_TRY_LINK(dnl | |
2191 [ | |
2192 #include<zlib.h> | |
2193 ], | |
2194 [return (zlibVersion() == ZLIB_VERSION); ], | |
2195 eval "ac_cv_lib_z='-lz'", | |
2196 eval "ac_cv_lib_z=no") | |
2197 LIBS="$kde_save_LIBS" | |
2198 CFLAGS="$kde_save_CFLAGS" | |
2199 ])dnl | |
2200 if test ! "$ac_cv_lib_z" = no; then | |
2201 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) | |
2202 LIBZ="$ac_cv_lib_z" | |
2203 AC_SUBST(LIBZ) | |
2204 AC_MSG_RESULT($ac_cv_lib_z) | |
2205 else | |
2206 AC_MSG_ERROR(not found. Check your installation and look into config.log) | |
2207 LIBZ="" | |
2208 AC_SUBST(LIBZ) | |
2209 fi | |
2210 ]) | |
2211 | |
2212 AC_DEFUN(KDE_TRY_TIFFLIB, | |
2213 [ | |
2214 AC_MSG_CHECKING([for libtiff $1]) | |
2215 | |
2216 AC_CACHE_VAL(kde_cv_libtiff_$1, | |
2217 [ | |
2218 AC_LANG_SAVE | |
2219 AC_LANG_CPLUSPLUS | |
2220 kde_save_LIBS="$LIBS" | |
2221 if test "x$kde_use_qt_emb" != "xyes"; then | |
2222 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm" | |
2223 else | |
2224 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm" | |
2225 fi | |
2226 kde_save_CXXFLAGS="$CXXFLAGS" | |
2227 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" | |
2228 | |
2229 AC_TRY_LINK(dnl | |
2230 [ | |
2231 #include<tiffio.h> | |
2232 ], | |
2233 [return (TIFFOpen( "", "r") == 0); ], | |
2234 [ | |
2235 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ" | |
2236 ], [ | |
2237 kde_cv_libtiff_$1=no | |
2238 ]) | |
2239 | |
2240 LIBS="$kde_save_LIBS" | |
2241 CXXFLAGS="$kde_save_CXXFLAGS" | |
2242 AC_LANG_RESTORE | |
2243 ]) | |
2244 | |
2245 if test "$kde_cv_libtiff_$1" = "no"; then | |
2246 AC_MSG_RESULT(no) | |
2247 LIBTIFF="" | |
2248 $3 | |
2249 else | |
2250 LIBTIFF="$kde_cv_libtiff_$1" | |
2251 AC_MSG_RESULT(yes) | |
2252 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff]) | |
2253 $2 | |
2254 fi | |
2255 | |
2256 ]) | |
2257 | |
2258 AC_DEFUN(AC_FIND_TIFF, | |
2259 [ | |
2260 AC_REQUIRE([K_PATH_X]) | |
2261 AC_REQUIRE([AC_FIND_ZLIB]) | |
2262 AC_REQUIRE([AC_FIND_JPEG]) | |
2263 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
2264 | |
2265 KDE_TRY_TIFFLIB(tiff, [], | |
2266 KDE_TRY_TIFFLIB(tiff34)) | |
2267 | |
2268 AC_SUBST(LIBTIFF) | |
2269 ]) | |
2270 | |
2271 | |
2272 AC_DEFUN(AC_FIND_PNG, | |
2273 [ | |
2274 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
2275 AC_REQUIRE([AC_FIND_ZLIB]) | |
2276 AC_MSG_CHECKING([for libpng]) | |
2277 AC_CACHE_VAL(ac_cv_lib_png, | |
2278 [ | |
2279 kde_save_LIBS="$LIBS" | |
2280 if test "x$kde_use_qt_emb" != "xyes"; then | |
2281 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET" | |
2282 else | |
2283 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm" | |
2284 fi | |
2285 kde_save_CFLAGS="$CFLAGS" | |
2286 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" | |
2287 AC_LANG_C | |
2288 AC_TRY_LINK(dnl | |
2289 [ | |
2290 #include<png.h> | |
2291 ], | |
2292 [ | |
2293 png_structp png_ptr = png_create_read_struct( /* image ptr */ | |
2294 PNG_LIBPNG_VER_STRING, 0, 0, 0 ); | |
2295 return( png_ptr != 0 ); | |
2296 ], | |
2297 eval "ac_cv_lib_png='-lpng $LIBZ -lm'", | |
2298 eval "ac_cv_lib_png=no" | |
2299 ) | |
2300 LIBS="$kde_save_LIBS" | |
2301 CFLAGS="$kde_save_CFLAGS" | |
2302 ])dnl | |
2303 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then | |
2304 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng]) | |
2305 LIBPNG="$ac_cv_lib_png" | |
2306 AC_SUBST(LIBPNG) | |
2307 AC_MSG_RESULT($ac_cv_lib_png) | |
2308 else | |
2309 AC_MSG_RESULT(no) | |
2310 LIBPNG="" | |
2311 AC_SUBST(LIBPNG) | |
2312 fi | |
2313 ]) | |
2314 | |
2315 AC_DEFUN(AC_CHECK_BOOL, | |
2316 [ | |
2317 AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool]) | |
2318 ]) | |
2319 | |
2320 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS, | |
2321 [ | |
2322 AC_MSG_CHECKING(if you need GNU extensions) | |
2323 AC_CACHE_VAL(ac_cv_gnu_extensions, | |
2324 [ | |
2325 cat > conftest.c << EOF | |
2326 #include <features.h> | |
2327 | |
2328 #ifdef __GNU_LIBRARY__ | |
2329 yes | |
2330 #endif | |
2331 EOF | |
2332 | |
2333 if (eval "$ac_cpp conftest.c") 2>&5 | | |
2334 egrep "yes" >/dev/null 2>&1; then | |
2335 rm -rf conftest* | |
2336 ac_cv_gnu_extensions=yes | |
2337 else | |
2338 ac_cv_gnu_extensions=no | |
2339 fi | |
2340 ]) | |
2341 | |
2342 AC_MSG_RESULT($ac_cv_gnu_extensions) | |
2343 if test "$ac_cv_gnu_extensions" = "yes"; then | |
2344 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions]) | |
2345 fi | |
2346 ]) | |
2347 | |
2348 AC_DEFUN(KDE_CHECK_COMPILER_FLAG, | |
2349 [ | |
2350 AC_MSG_CHECKING(whether $CXX supports -$1) | |
2351 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` | |
2352 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, | |
2353 [ | |
2354 AC_LANG_SAVE | |
2355 AC_LANG_CPLUSPLUS | |
2356 save_CXXFLAGS="$CXXFLAGS" | |
2357 CXXFLAGS="$CXXFLAGS -$1" | |
2358 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) | |
2359 CXXFLAGS="$save_CXXFLAGS" | |
2360 AC_LANG_RESTORE | |
2361 ]) | |
2362 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then | |
2363 AC_MSG_RESULT(yes) | |
2364 : | |
2365 $2 | |
2366 else | |
2367 AC_MSG_RESULT(no) | |
2368 : | |
2369 $3 | |
2370 fi | |
2371 ]) | |
2372 | |
2373 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables | |
2374 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) | |
2375 dnl it's all white-space separated | |
2376 AC_DEFUN(AC_REMOVE_FORBIDDEN, | |
2377 [ __val=$$1 | |
2378 __forbid=" $2 " | |
2379 if test -n "$__val"; then | |
2380 __new="" | |
2381 ac_save_IFS=$IFS | |
2382 IFS=" " | |
2383 for i in $__val; do | |
2384 case "$__forbid" in | |
2385 *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; | |
2386 *) # Careful to not add spaces, where there were none, because otherwise | |
2387 # libtool gets confused, if we change e.g. CXX | |
2388 if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; | |
2389 esac | |
2390 done | |
2391 IFS=$ac_save_IFS | |
2392 $1=$__new | |
2393 fi | |
2394 ]) | |
2395 | |
2396 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given | |
2397 AC_DEFUN(AC_VALIDIFY_CXXFLAGS, | |
2398 [dnl | |
2399 if test "x$kde_use_qt_emb" != "xyes"; then | |
2400 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) | |
2401 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) | |
2402 else | |
2403 AC_REMOVE_FORBIDDEN(CXX, [-rpath]) | |
2404 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) | |
2405 fi | |
2406 ]) | |
2407 | |
2408 AC_DEFUN(AC_CHECK_COMPILERS, | |
2409 [ | |
2410 AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]], | |
2411 [ | |
2412 case $enableval in | |
2413 yes) | |
2414 kde_use_debug_code="yes" | |
2415 kde_use_debug_define=no | |
2416 ;; | |
2417 full) | |
2418 kde_use_debug_code="full" | |
2419 kde_use_debug_define=no | |
2420 ;; | |
2421 *) | |
2422 kde_use_debug_code="no" | |
2423 kde_use_debug_define=yes | |
2424 ;; | |
2425 esac | |
2426 ], | |
2427 [kde_use_debug_code="no" | |
2428 kde_use_debug_define=no | |
2429 ]) | |
2430 | |
2431 dnl Just for configure --help | |
2432 AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[]) | |
2433 | |
2434 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], | |
2435 [ | |
2436 if test $enableval = "no"; then | |
2437 kde_use_strict_options="no" | |
2438 else | |
2439 kde_use_strict_options="yes" | |
2440 fi | |
2441 ], [kde_use_strict_options="no"]) | |
2442 | |
2443 AC_ARG_ENABLE(warnings,[ --enable-warnings compiles with -Wall and similiar], | |
2444 [ | |
2445 if test $enableval = "no"; then | |
2446 kde_use_warnings="no" | |
2447 else | |
2448 kde_use_warnings="yes" | |
2449 fi | |
2450 ], [kde_use_warnings="no"]) | |
2451 | |
2452 dnl enable warnings for debug build | |
2453 if test "$kde_use_debug_code" != "no"; then | |
2454 kde_use_warnings=yes | |
2455 fi | |
2456 | |
2457 AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]], | |
2458 [kde_use_profiling=$enableval], | |
2459 [kde_use_profiling="no"] | |
2460 ) | |
2461 | |
2462 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS | |
2463 CFLAGS=" $CFLAGS" | |
2464 | |
2465 AC_PROG_CC | |
2466 | |
2467 AC_PROG_CPP | |
2468 | |
2469 if test "$GCC" = "yes"; then | |
2470 if test "$kde_use_debug_code" != "no"; then | |
2471 if test $kde_use_debug_code = "full"; then | |
2472 CFLAGS="-g3 $CFLAGS" | |
2473 else | |
2474 CFLAGS="-g -O2 $CFLAGS" | |
2475 fi | |
2476 else | |
2477 CFLAGS="-O2 $CFLAGS" | |
2478 fi | |
2479 fi | |
2480 | |
2481 if test "$kde_use_debug_define" = "yes"; then | |
2482 CFLAGS="-DNDEBUG $CFLAGS" | |
2483 fi | |
2484 | |
2485 | |
2486 case "$host" in | |
2487 *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";; | |
2488 *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";; | |
2489 esac | |
2490 | |
2491 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then | |
2492 LDFLAGS="" | |
2493 fi | |
2494 | |
2495 CXXFLAGS=" $CXXFLAGS" | |
2496 | |
2497 AC_PROG_CXX | |
2498 | |
2499 if test "$GXX" = "yes" || test "$CXX" = "KCC"; then | |
2500 if test "$kde_use_debug_code" != "no"; then | |
2501 if test "$CXX" = "KCC"; then | |
2502 CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS" | |
2503 else | |
2504 if test "$kde_use_debug_code" = "full"; then | |
2505 CXXFLAGS="-g3 $CXXFLAGS" | |
2506 else | |
2507 CXXFLAGS="-g -O2 $CXXFLAGS" | |
2508 fi | |
2509 fi | |
2510 KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"]) | |
2511 | |
2512 dnl convenience compiler flags | |
2513 KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""]) | |
2514 AC_SUBST(WOVERLOADED_VIRTUAL) | |
2515 else | |
2516 if test "$CXX" = "KCC"; then | |
2517 CXXFLAGS="+K3 $CXXFLAGS" | |
2518 else | |
2519 CXXFLAGS="-O2 $CXXFLAGS" | |
2520 fi | |
2521 fi | |
2522 fi | |
2523 | |
2524 if test "$kde_use_debug_define" = "yes"; then | |
2525 CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS" | |
2526 fi | |
2527 | |
2528 if test "$kde_use_profiling" = "yes"; then | |
2529 KDE_CHECK_COMPILER_FLAG(pg, | |
2530 [ | |
2531 CFLAGS="-pg $CFLAGS" | |
2532 CXXFLAGS="-pg $CXXFLAGS" | |
2533 ]) | |
2534 fi | |
2535 | |
2536 if test "$kde_use_warnings" = "yes"; then | |
2537 if test "$GCC" = "yes"; then | |
2538 case $host in | |
2539 *-*-linux-gnu) | |
2540 CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" | |
2541 CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS" | |
2542 ;; | |
2543 esac | |
2544 CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS" | |
2545 KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"]) | |
2546 KDE_CHECK_COMPILER_FLAG(Wbad-function-cast,[CXXFLAGS="-Wbad-function-cast $CXXFLAGS"]) | |
2547 KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"]) | |
2548 KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"]) | |
2549 fi | |
2550 fi | |
2551 | |
2552 if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then | |
2553 CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS" | |
2554 fi | |
2555 | |
2556 if test "$GXX" = "yes"; then | |
2557 KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"]) | |
2558 KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"]) | |
2559 KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= ) | |
2560 fi | |
2561 if test "$CXX" = "KCC"; then | |
2562 dnl unfortunately we currently cannot disable exception support in KCC | |
2563 dnl because doing so is binary incompatible and Qt by default links with exceptions :-( | |
2564 dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"]) | |
2565 dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= ) | |
2566 | |
2567 AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]], | |
2568 [ | |
2569 kde_use_pch=$enableval | |
2570 ],[kde_use_pch=no]) | |
2571 | |
2572 if test "$kde_use_pch" = "yes"; then | |
2573 dnl TODO: support --pch-dir! | |
2574 KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"]) | |
2575 dnl the below works (but the dir must exist), but it's | |
2576 dnl useless for a whole package. | |
2577 dnl The are precompiled headers for each source file, so when compiling | |
2578 dnl from scratch, it doesn't make a difference, and they take up | |
2579 dnl around ~5Mb _per_ sourcefile. | |
2580 dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp, | |
2581 dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"]) | |
2582 fi | |
2583 dnl this flag controls inlining. by default KCC inlines in optimisation mode | |
2584 dnl all implementations that are defined inside the class {} declaration. | |
2585 dnl because of templates-compatibility with broken gcc compilers, this | |
2586 dnl can cause excessive inlining. This flag limits it to a sane level | |
2587 KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"]) | |
2588 KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"]) | |
2589 KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"]) | |
2590 KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"]) | |
2591 dnl Some source files are shared between multiple executables | |
2592 dnl (or libraries) and some of those need template instantiations. | |
2593 dnl In that case KCC needs to compile those sources with | |
2594 dnl --one_instantiation_per_object. To make it easy for us we compile | |
2595 dnl _all_ objects with that flag (--one_per is a shorthand). | |
2596 KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"]) | |
2597 fi | |
2598 AC_SUBST(USE_EXCEPTIONS) | |
2599 dnl obsolete macro - provided to keep things going | |
2600 USE_RTTI= | |
2601 AC_SUBST(USE_RTTI) | |
2602 | |
2603 case "$host" in | |
2604 *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;; | |
2605 *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";; | |
2606 *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";; | |
2607 *-*-solaris*) | |
2608 if test "$GXX" = yes; then | |
2609 libstdcpp=`$CXX -print-file-name=libstdc++.so` | |
2610 if test ! -f $libstdcpp; then | |
2611 AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so]) | |
2612 fi | |
2613 fi | |
2614 ;; | |
2615 esac | |
2616 | |
2617 AC_VALIDIFY_CXXFLAGS | |
2618 | |
2619 AC_PROG_CXXCPP | |
2620 | |
2621 # the following is to allow programs, that are known to | |
2622 # have problems when compiled with -O2 | |
2623 if test -n "$CXXFLAGS"; then | |
2624 kde_safe_IFS=$IFS | |
2625 IFS=" " | |
2626 NOOPT_CXXFLAGS="" | |
2627 for i in $CXXFLAGS; do | |
2628 case $i in | |
2629 -O*) | |
2630 ;; | |
2631 *) | |
2632 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i" | |
2633 ;; | |
2634 esac | |
2635 done | |
2636 IFS=$kde_safe_IFS | |
2637 fi | |
2638 | |
2639 if test -n "$CFLAGS"; then | |
2640 kde_safe_IFS=$IFS | |
2641 IFS=" " | |
2642 NOOPT_CFLAGS="" | |
2643 for i in $CFLAGS; do | |
2644 case $i in | |
2645 -O*) | |
2646 ;; | |
2647 *) | |
2648 NOOPT_CFLAGS="$NOOPT_CFLAGS $i" | |
2649 ;; | |
2650 esac | |
2651 done | |
2652 IFS=$kde_safe_IFS | |
2653 fi | |
2654 | |
2655 if test "x$kde_use_qt_emb" = "xyes"; then | |
2656 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS -fno-rtti -DQWS" | |
2657 fi | |
2658 | |
2659 AC_SUBST(NOOPT_CXXFLAGS) | |
2660 AC_SUBST(NOOPT_CFLAGS) | |
2661 | |
2662 KDE_CHECK_FINAL | |
2663 | |
2664 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) | |
2665 | |
2666 KDE_CXXFLAGS= | |
2667 AC_SUBST(KDE_CXXFLAGS) | |
2668 ]) | |
2669 | |
2670 AC_DEFUN(KDE_ADD_DEPENDENCIES, | |
2671 [ | |
2672 [A]M_DEPENDENCIES(CC) | |
2673 [A]M_DEPENDENCIES(CXX) | |
2674 ]) | |
2675 | |
2676 dnl just a wrapper to clean up configure.in | |
2677 AC_DEFUN(KDE_PROG_LIBTOOL, | |
2678 [ | |
2679 AC_REQUIRE([AC_CHECK_COMPILERS]) | |
2680 AC_REQUIRE([AC_ENABLE_SHARED]) | |
2681 AC_REQUIRE([AC_ENABLE_STATIC]) | |
2682 | |
2683 AC_REQUIRE([AC_LIBTOOL_DLOPEN]) | |
2684 | |
2685 AC_LANG_SAVE | |
2686 AC_LANG_C | |
2687 AC_OBJEXT | |
2688 AC_EXEEXT | |
2689 AC_LANG_RESTORE | |
2690 | |
2691 AM_PROG_LIBTOOL | |
2692 AC_LIBTOOL_CXX | |
2693 | |
2694 LIBTOOL_SHELL="/bin/sh ./libtool" | |
2695 # LIBTOOL="$LIBTOOL --silent" | |
2696 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" | |
2697 AC_SUBST(KDE_PLUGIN) | |
2698 ]) | |
2699 | |
2700 AC_DEFUN(KDE_CHECK_TYPES, | |
2701 [ AC_CHECK_SIZEOF(int, 4)dnl | |
2702 AC_CHECK_SIZEOF(long, 4)dnl | |
2703 AC_CHECK_SIZEOF(char *, 4)dnl | |
2704 AC_CHECK_SIZEOF(char, 1)dnl | |
2705 ])dnl | |
2706 | |
2707 AC_DEFUN(KDE_DO_IT_ALL, | |
2708 [ | |
2709 AC_CANONICAL_SYSTEM | |
2710 AC_ARG_PROGRAM | |
2711 AM_INIT_AUTOMAKE($1, $2) | |
2712 AM_DISABLE_LIBRARIES | |
2713 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) | |
2714 AC_CHECK_COMPILERS | |
2715 KDE_PROG_LIBTOOL | |
2716 AM_KDE_WITH_NLS | |
2717 AC_PATH_KDE | |
2718 ]) | |
2719 | |
2720 AC_DEFUN(AC_CHECK_RPATH, | |
2721 [ | |
2722 AC_MSG_CHECKING(for rpath) | |
2723 AC_ARG_ENABLE(rpath, | |
2724 [ --disable-rpath do not use the rpath feature of ld], | |
2725 USE_RPATH=$enableval, USE_RPATH=yes) | |
2726 | |
2727 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then | |
2728 | |
2729 KDE_RPATH="-R \$(kde_libraries)" | |
2730 | |
2731 if test -n "$qt_libraries"; then | |
2732 KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)" | |
2733 fi | |
2734 dnl $x_libraries is set to /usr/lib in case | |
2735 if test -n "$X_LDFLAGS"; then | |
2736 KDE_RPATH="$KDE_RPATH -R \$(x_libraries)" | |
2737 fi | |
2738 if test -n "$KDE_EXTRA_RPATH"; then | |
2739 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" | |
2740 fi | |
2741 fi | |
2742 AC_SUBST(KDE_EXTRA_RPATH) | |
2743 AC_SUBST(KDE_RPATH) | |
2744 AC_MSG_RESULT($USE_RPATH) | |
2745 ]) | |
2746 | |
2747 dnl Check for the type of the third argument of getsockname | |
2748 AC_DEFUN(AC_CHECK_SOCKLEN_T, [ | |
2749 AC_MSG_CHECKING(for socklen_t) | |
2750 AC_CACHE_VAL(ac_cv_socklen_t, [ | |
2751 AC_LANG_SAVE | |
2752 AC_LANG_CPLUSPLUS | |
2753 AC_TRY_COMPILE([ | |
2754 #include <sys/types.h> | |
2755 #include <sys/socket.h> | |
2756 ],[ | |
2757 socklen_t a=0; | |
2758 getsockname(0,(struct sockaddr*)0, &a); | |
2759 ], | |
2760 ac_cv_socklen_t=socklen_t, | |
2761 AC_TRY_COMPILE([ | |
2762 #include <sys/types.h> | |
2763 #include <sys/socket.h> | |
2764 ],[ | |
2765 int a=0; | |
2766 getsockname(0,(struct sockaddr*)0, &a); | |
2767 ], | |
2768 ac_cv_socklen_t=int, | |
2769 ac_cv_socklen_t=size_t | |
2770 ) | |
2771 ) | |
2772 AC_LANG_RESTORE | |
2773 ]) | |
2774 | |
2775 AC_MSG_RESULT($ac_cv_socklen_t) | |
2776 if test "$ac_cv_socklen_t" != "socklen_t"; then | |
2777 AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t, | |
2778 [Define the real type of socklen_t]) | |
2779 fi | |
2780 AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define]) | |
2781 | |
2782 ]) | |
2783 | |
2784 dnl This is a merge of some macros out of the gettext aclocal.m4 | |
2785 dnl since we don't need anything, I took the things we need | |
2786 dnl the copyright for them is: | |
2787 dnl > | |
2788 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. | |
2789 dnl This Makefile.in is free software; the Free Software Foundation | |
2790 dnl gives unlimited permission to copy and/or distribute it, | |
2791 dnl with or without modifications, as long as this notice is preserved. | |
2792 | |
2793 dnl This program is distributed in the hope that it will be useful, | |
2794 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
2795 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
2796 dnl PARTICULAR PURPOSE. | |
2797 dnl > | |
2798 dnl for this file it is relicensed under LGPL | |
2799 | |
2800 AC_DEFUN(AM_KDE_WITH_NLS, | |
2801 [ | |
2802 dnl If we use NLS figure out what method | |
2803 | |
2804 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt, | |
2805 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt) | |
2806 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
2807 | |
2808 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then | |
2809 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it]) | |
2810 GMSGFMT=":" | |
2811 fi | |
2812 MSGFMT=$GMSGFMT | |
2813 AC_SUBST(GMSGFMT) | |
2814 AC_SUBST(MSGFMT) | |
2815 | |
2816 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext, | |
2817 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
2818 | |
2819 dnl Test whether we really found GNU xgettext. | |
2820 if test "$XGETTEXT" != ":"; then | |
2821 dnl If it is no GNU xgettext we define it as : so that the | |
2822 dnl Makefiles still can work. | |
2823 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
2824 : ; | |
2825 else | |
2826 AC_MSG_RESULT( | |
2827 [found xgettext programs is not GNU xgettext; ignore it]) | |
2828 XGETTEXT=":" | |
2829 fi | |
2830 fi | |
2831 AC_SUBST(XGETTEXT) | |
2832 | |
2833 ]) | |
2834 | |
2835 # Search path for a program which passes the given test. | |
2836 # Ulrich Drepper <drepper@cygnus.com>, 1996. | |
2837 | |
2838 # serial 1 | |
2839 # Stephan Kulow: I appended a _KDE against name conflicts | |
2840 | |
2841 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR, | |
2842 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
2843 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE, | |
2844 [# Extract the first word of "$2", so it can be a program name with args. | |
2845 set dummy $2; ac_word=[$]2 | |
2846 AC_MSG_CHECKING([for $ac_word]) | |
2847 AC_CACHE_VAL(ac_cv_path_$1, | |
2848 [case "[$]$1" in | |
2849 /*) | |
2850 ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
2851 ;; | |
2852 *) | |
2853 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
2854 for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
2855 test -z "$ac_dir" && ac_dir=. | |
2856 if test -f $ac_dir/$ac_word; then | |
2857 if [$3]; then | |
2858 ac_cv_path_$1="$ac_dir/$ac_word" | |
2859 break | |
2860 fi | |
2861 fi | |
2862 done | |
2863 IFS="$ac_save_ifs" | |
2864 dnl If no 4th arg is given, leave the cache variable unset, | |
2865 dnl so AC_PATH_PROGS will keep looking. | |
2866 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
2867 ])dnl | |
2868 ;; | |
2869 esac])dnl | |
2870 $1="$ac_cv_path_$1" | |
2871 if test -n "[$]$1"; then | |
2872 AC_MSG_RESULT([$]$1) | |
2873 else | |
2874 AC_MSG_RESULT(no) | |
2875 fi | |
2876 AC_SUBST($1)dnl | |
2877 ]) | |
2878 | |
2879 | |
2880 # Check whether LC_MESSAGES is available in <locale.h>. | |
2881 # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
2882 | |
2883 # serial 1 | |
2884 | |
2885 AC_DEFUN(AM_LC_MESSAGES, | |
2886 [if test $ac_cv_header_locale_h = yes; then | |
2887 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
2888 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
2889 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
2890 if test $am_cv_val_LC_MESSAGES = yes; then | |
2891 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES]) | |
2892 fi | |
2893 fi]) | |
2894 | |
2895 dnl From Jim Meyering. | |
2896 dnl FIXME: migrate into libit. | |
2897 | |
2898 AC_DEFUN([AM_FUNC_OBSTACK], | |
2899 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack, | |
2900 [AC_TRY_LINK([#include "obstack.h"], | |
2901 [struct obstack *mem;obstack_free(mem,(char *) 0)], | |
2902 am_cv_func_obstack=yes, | |
2903 am_cv_func_obstack=no)]) | |
2904 if test $am_cv_func_obstack = yes; then | |
2905 AC_DEFINE(HAVE_OBSTACK) | |
2906 else | |
2907 LIBOBJS="$LIBOBJS obstack.o" | |
2908 fi | |
2909 ]) | |
2910 | |
2911 dnl From Jim Meyering. Use this if you use the GNU error.[ch]. | |
2912 dnl FIXME: Migrate into libit | |
2913 | |
2914 AC_DEFUN([AM_FUNC_ERROR_AT_LINE], | |
2915 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, | |
2916 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], | |
2917 am_cv_lib_error_at_line=yes, | |
2918 am_cv_lib_error_at_line=no)]) | |
2919 if test $am_cv_lib_error_at_line = no; then | |
2920 LIBOBJS="$LIBOBJS error.o" | |
2921 fi | |
2922 AC_SUBST(LIBOBJS)dnl | |
2923 ]) | |
2924 | |
2925 # Macro to add for using GNU gettext. | |
2926 # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
2927 | |
2928 # serial 1 | |
2929 # Stephan Kulow: I put a KDE in it to avoid name conflicts | |
2930 | |
2931 AC_DEFUN(AM_KDE_GNU_GETTEXT, | |
2932 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
2933 AC_REQUIRE([AC_PROG_RANLIB])dnl | |
2934 AC_REQUIRE([AC_HEADER_STDC])dnl | |
2935 AC_REQUIRE([AC_TYPE_OFF_T])dnl | |
2936 AC_REQUIRE([AC_TYPE_SIZE_T])dnl | |
2937 AC_REQUIRE([AC_FUNC_ALLOCA])dnl | |
2938 AC_REQUIRE([AC_FUNC_MMAP])dnl | |
2939 AC_REQUIRE([AM_KDE_WITH_NLS])dnl | |
2940 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h]) | |
2941 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ | |
2942 __argz_count __argz_stringify __argz_next]) | |
2943 | |
2944 AC_MSG_CHECKING(for stpcpy) | |
2945 AC_CACHE_VAL(kde_cv_func_stpcpy, | |
2946 [ | |
2947 kde_safe_cxxflags=$CXXFLAGS | |
2948 CXXFLAGS="-Wmissing-prototypes -Werror" | |
2949 AC_LANG_SAVE | |
2950 AC_LANG_CPLUSPLUS | |
2951 AC_TRY_COMPILE([ | |
2952 #include <string.h> | |
2953 ], | |
2954 [ | |
2955 char buffer[200]; | |
2956 stpcpy(buffer, buffer); | |
2957 ], | |
2958 kde_cv_func_stpcpy=yes, | |
2959 kde_cv_func_stpcpy=no) | |
2960 AC_LANG_RESTORE | |
2961 CXXFLAGS=$kde_safe_cxxflags | |
2962 ]) | |
2963 AC_MSG_RESULT($kde_cv_func_stpcpy) | |
2964 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then | |
2965 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy]) | |
2966 fi | |
2967 | |
2968 AM_LC_MESSAGES | |
2969 | |
2970 if test "x$CATOBJEXT" != "x"; then | |
2971 if test "x$ALL_LINGUAS" = "x"; then | |
2972 LINGUAS= | |
2973 else | |
2974 AC_MSG_CHECKING(for catalogs to be installed) | |
2975 NEW_LINGUAS= | |
2976 for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
2977 case "$ALL_LINGUAS" in | |
2978 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
2979 esac | |
2980 done | |
2981 LINGUAS=$NEW_LINGUAS | |
2982 AC_MSG_RESULT($LINGUAS) | |
2983 fi | |
2984 | |
2985 dnl Construct list of names of catalog files to be constructed. | |
2986 if test -n "$LINGUAS"; then | |
2987 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
2988 fi | |
2989 fi | |
2990 | |
2991 ]) | |
2992 | |
2993 AC_DEFUN(AC_HAVE_XPM, | |
2994 [AC_REQUIRE_CPP()dnl | |
2995 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
2996 | |
2997 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= | |
2998 test -z "$XPM_INCLUDE" && XPM_INCLUDE= | |
2999 | |
3000 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests], | |
3001 xpm_test=$withval, xpm_test="yes") | |
3002 if test "x$xpm_test" = xno; then | |
3003 ac_cv_have_xpm=no | |
3004 else | |
3005 AC_MSG_CHECKING(for XPM) | |
3006 AC_CACHE_VAL(ac_cv_have_xpm, | |
3007 [ | |
3008 AC_LANG_C | |
3009 ac_save_ldflags="$LDFLAGS" | |
3010 ac_save_cflags="$CFLAGS" | |
3011 if test "x$kde_use_qt_emb" != "xyes"; then | |
3012 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET" | |
3013 else | |
3014 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET" | |
3015 fi | |
3016 CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES" | |
3017 test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" | |
3018 AC_TRY_LINK([#include <X11/xpm.h>],[], | |
3019 ac_cv_have_xpm="yes",ac_cv_have_xpm="no") | |
3020 LDFLAGS="$ac_save_ldflags" | |
3021 CFLAGS="$ac_save_cflags" | |
3022 ])dnl | |
3023 | |
3024 if test "$ac_cv_have_xpm" = no; then | |
3025 AC_MSG_RESULT(no) | |
3026 XPM_LDFLAGS="" | |
3027 XPMINC="" | |
3028 $2 | |
3029 else | |
3030 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support]) | |
3031 if test "$XPM_LDFLAGS" = ""; then | |
3032 XPMLIB='-lXpm $(LIB_X11)' | |
3033 else | |
3034 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)' | |
3035 fi | |
3036 if test "$XPM_INCLUDE" = ""; then | |
3037 XPMINC="" | |
3038 else | |
3039 XPMINC="-I$XPM_INCLUDE" | |
3040 fi | |
3041 AC_MSG_RESULT(yes) | |
3042 $1 | |
3043 fi | |
3044 fi | |
3045 AC_SUBST(XPMINC) | |
3046 AC_SUBST(XPMLIB) | |
3047 ]) | |
3048 | |
3049 AC_DEFUN(AC_HAVE_DPMS, | |
3050 [AC_REQUIRE_CPP()dnl | |
3051 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
3052 | |
3053 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS= | |
3054 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE= | |
3055 DPMS_LIB= | |
3056 | |
3057 AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving], | |
3058 dpms_test=$withval, dpms_test="yes") | |
3059 if test "x$dpms_test" = xno; then | |
3060 ac_cv_have_dpms=no | |
3061 else | |
3062 AC_MSG_CHECKING(for DPMS) | |
3063 dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms. | |
3064 dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms". | |
3065 AC_CACHE_VAL(ac_cv_have_dpms, | |
3066 [ | |
3067 if test "x$kde_use_qt_emb" = "xyes"; then | |
3068 AC_MSG_RESULT(no) | |
3069 ac_cv_have_dpms="no" | |
3070 else | |
3071 AC_LANG_C | |
3072 ac_save_ldflags="$LDFLAGS" | |
3073 ac_save_cflags="$CFLAGS" | |
3074 ac_save_libs="$LIBS" | |
3075 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET" | |
3076 CFLAGS="$CFLAGS $X_INCLUDES" | |
3077 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" | |
3078 AC_TRY_LINK([ | |
3079 #include <X11/Xproto.h> | |
3080 #include <X11/X.h> | |
3081 #include <X11/Xlib.h> | |
3082 #include <X11/extensions/dpms.h> | |
3083 int foo_test_dpms() | |
3084 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], | |
3085 ac_cv_have_dpms="yes", [ | |
3086 LDFLAGS="$ac_save_ldflags" | |
3087 CFLAGS="$ac_save_cflags" | |
3088 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET" | |
3089 LIBS="$LIBS -lXdpms" | |
3090 CFLAGS="$CFLAGS $X_INCLUDES" | |
3091 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" | |
3092 AC_TRY_LINK([ | |
3093 #include <X11/Xproto.h> | |
3094 #include <X11/X.h> | |
3095 #include <X11/Xlib.h> | |
3096 #include <X11/extensions/dpms.h> | |
3097 int foo_test_dpms() | |
3098 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], | |
3099 [ | |
3100 ac_cv_have_dpms="-lXdpms" | |
3101 ],ac_cv_have_dpms="no") | |
3102 ]) | |
3103 LDFLAGS="$ac_save_ldflags" | |
3104 CFLAGS="$ac_save_cflags" | |
3105 LIBS="$ac_save_libs" | |
3106 fi | |
3107 ])dnl | |
3108 | |
3109 if test "$ac_cv_have_dpms" = no; then | |
3110 AC_MSG_RESULT(no) | |
3111 DPMS_LDFLAGS="" | |
3112 DPMSINC="" | |
3113 $2 | |
3114 else | |
3115 AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support]) | |
3116 if test "$ac_cv_have_dpms" = "-lXdpms"; then | |
3117 DPMS_LIB="-lXdpms" | |
3118 fi | |
3119 if test "$DPMS_LDFLAGS" = ""; then | |
3120 DPMSLIB="$DPMS_LIB "'$(LIB_X11)' | |
3121 else | |
3122 DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)' | |
3123 fi | |
3124 if test "$DPMS_INCLUDE" = ""; then | |
3125 DPMSINC="" | |
3126 else | |
3127 DPMSINC="-I$DPMS_INCLUDE" | |
3128 fi | |
3129 AC_MSG_RESULT(yes) | |
3130 $1 | |
3131 fi | |
3132 fi | |
3133 AC_SUBST(DPMSINC) | |
3134 AC_SUBST(DPMSLIB) | |
3135 ]) | |
3136 | |
3137 AC_DEFUN(AC_HAVE_GL, | |
3138 [AC_REQUIRE_CPP()dnl | |
3139 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
3140 | |
3141 test -z "$GL_LDFLAGS" && GL_LDFLAGS= | |
3142 test -z "$GL_INCLUDE" && GL_INCLUDE= | |
3143 | |
3144 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes], | |
3145 gl_test=$withval, gl_test="yes") | |
3146 if test "x$kde_use_qt_emb" = "xyes"; then | |
3147 # GL and Qt Embedded is a no-go for now. | |
3148 ac_cv_have_gl=no | |
3149 elif test "x$gl_test" = xno; then | |
3150 ac_cv_have_gl=no | |
3151 else | |
3152 AC_MSG_CHECKING(for GL) | |
3153 AC_CACHE_VAL(ac_cv_have_gl, | |
3154 [ | |
3155 AC_LANG_C | |
3156 ac_save_ldflags="$LDFLAGS" | |
3157 ac_save_cflags="$CFLAGS" | |
3158 LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU" | |
3159 test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" | |
3160 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" | |
3161 CFLAGS="$CFLAGS $X_INCLUDES" | |
3162 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" | |
3163 AC_TRY_LINK([#include <GL/gl.h> | |
3164 #include <GL/glu.h> | |
3165 ], [], | |
3166 ac_cv_have_gl="mesa", ac_cv_have_gl="no") | |
3167 if test "x$ac_cv_have_gl" = "xno"; then | |
3168 LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU" | |
3169 test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" | |
3170 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" | |
3171 CFLAGS="$ac_save_cflags $X_INCLUDES" | |
3172 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" | |
3173 AC_TRY_LINK([#include <GL/gl.h> | |
3174 #include <GL/glu.h> | |
3175 ], [], | |
3176 ac_cv_have_gl="yes", ac_cv_have_gl="no") | |
3177 fi | |
3178 LDFLAGS="$ac_save_ldflags" | |
3179 CFLAGS="$ac_save_cflags" | |
3180 ])dnl | |
3181 | |
3182 if test "$ac_cv_have_gl" = "no"; then | |
3183 AC_MSG_RESULT(no) | |
3184 GL_LDFLAGS="" | |
3185 GLINC="" | |
3186 $2 | |
3187 else | |
3188 AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)]) | |
3189 if test "$GL_LDFLAGS" = ""; then | |
3190 if test "$ac_cv_have_gl" = "mesa"; then | |
3191 GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)' | |
3192 else | |
3193 GLLIB='-lGL -lGLU $(LIB_X11)' | |
3194 fi | |
3195 else | |
3196 if test "$ac_cv_have_gl" = "mesa"; then | |
3197 GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)' | |
3198 else | |
3199 GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)' | |
3200 fi | |
3201 fi | |
3202 if test "$GL_INCLUDE" = ""; then | |
3203 GLINC="" | |
3204 else | |
3205 GLINC="-I$GL_INCLUDE" | |
3206 fi | |
3207 AC_MSG_RESULT($ac_cv_have_gl) | |
3208 $1 | |
3209 fi | |
3210 fi | |
3211 AC_SUBST(GLINC) | |
3212 AC_SUBST(GLLIB) | |
3213 ]) | |
3214 | |
3215 | |
3216 dnl shadow password and PAM magic - maintained by ossi@kde.org | |
3217 | |
3218 AC_DEFUN(KDE_PAM, [ | |
3219 AC_REQUIRE([KDE_CHECK_LIBDL]) | |
3220 | |
3221 AC_ARG_WITH(pam, | |
3222 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]], | |
3223 [ if test "x$withval" = "xyes"; then | |
3224 use_pam=yes | |
3225 pam_service=kde | |
3226 elif test "x$withval" = "xno"; then | |
3227 use_pam=no | |
3228 else | |
3229 use_pam=yes | |
3230 pam_service=$withval | |
3231 fi | |
3232 ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service" | |
3233 ], [ | |
3234 AC_CACHE_VAL(ac_cv_path_pam, | |
3235 [ use_pam=no | |
3236 AC_CHECK_LIB(pam, pam_start, | |
3237 [ AC_CHECK_HEADER(security/pam_appl.h, | |
3238 [ use_pam=yes | |
3239 pam_service=kde ]) | |
3240 ], , $LIBDL) | |
3241 ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service" | |
3242 ]) | |
3243 ]) | |
3244 eval "$ac_cv_path_pam" | |
3245 | |
3246 AC_MSG_CHECKING(for PAM) | |
3247 if test "x$use_pam" = xno; then | |
3248 AC_MSG_RESULT(no) | |
3249 PAMLIBS="" | |
3250 else | |
3251 AC_MSG_RESULT(yes) | |
3252 AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) | |
3253 PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" | |
3254 | |
3255 dnl test whether struct pam_message is const (Linux) or not (Sun) | |
3256 AC_MSG_CHECKING(for const pam_message) | |
3257 AC_EGREP_HEADER([struct pam_message], security/pam_appl.h, | |
3258 [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h, | |
3259 [AC_MSG_RESULT([const: Linux-type PAM])], | |
3260 [AC_MSG_RESULT([nonconst: Sun-type PAM]) | |
3261 AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] | |
3262 )], | |
3263 [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) | |
3264 fi | |
3265 | |
3266 AC_SUBST(PAMLIBS) | |
3267 ]) | |
3268 | |
3269 dnl DEF_PAM_SERVICE(arg name, full name, define name) | |
3270 AC_DEFUN(DEF_PAM_SERVICE, [ | |
3271 AC_ARG_WITH($1-pam, | |
3272 [ --with-$1-pam=[val] override PAM service from --with-pam for $2], | |
3273 [ if test "x$use_pam" = xyes; then | |
3274 $3_PAM_SERVICE="$withval" | |
3275 else | |
3276 AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected. | |
3277 You may want to enforce it by using --with-pam.]) | |
3278 fi | |
3279 ], | |
3280 [ if test "x$use_pam" = xyes; then | |
3281 $3_PAM_SERVICE="$pam_service" | |
3282 fi | |
3283 ]) | |
3284 if test -n "$$3_PAM_SERVICE"; then | |
3285 AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE]) | |
3286 AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2]) | |
3287 fi | |
3288 AC_SUBST($3_PAM_SERVICE) | |
3289 ]) | |
3290 | |
3291 AC_DEFUN(KDE_SHADOWPASSWD, [ | |
3292 AC_REQUIRE([KDE_PAM]) | |
3293 | |
3294 AC_CHECK_LIB(shadow, getspent, | |
3295 [ LIBSHADOW="-lshadow" | |
3296 ac_use_shadow=yes | |
3297 ], | |
3298 [ dnl for UnixWare | |
3299 AC_CHECK_LIB(gen, getspent, | |
3300 [ LIBGEN="-lgen" | |
3301 ac_use_shadow=yes | |
3302 ], | |
3303 [ AC_CHECK_FUNC(getspent, | |
3304 [ ac_use_shadow=yes ], | |
3305 [ ac_use_shadow=no ]) | |
3306 ]) | |
3307 ]) | |
3308 AC_SUBST(LIBSHADOW) | |
3309 AC_SUBST(LIBGEN) | |
3310 | |
3311 AC_MSG_CHECKING([for shadow passwords]) | |
3312 | |
3313 AC_ARG_WITH(shadow, | |
3314 [ --with-shadow If you want shadow password support ], | |
3315 [ if test "x$withval" != "xno"; then | |
3316 use_shadow=yes | |
3317 else | |
3318 use_shadow=no | |
3319 fi | |
3320 ], [ | |
3321 use_shadow="$ac_use_shadow" | |
3322 ]) | |
3323 | |
3324 if test "x$use_shadow" = xyes; then | |
3325 AC_MSG_RESULT(yes) | |
3326 AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords]) | |
3327 else | |
3328 AC_MSG_RESULT(no) | |
3329 LIBSHADOW= | |
3330 LIBGEN= | |
3331 fi | |
3332 | |
3333 dnl finally make the relevant binaries setuid root, if we have shadow passwds. | |
3334 dnl this still applies, if we could use it indirectly through pam. | |
3335 if test "x$use_shadow" = xyes || | |
3336 ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then | |
3337 case $host in | |
3338 *-*-freebsd* | *-*-netbsd* | *-*-openbsd*) | |
3339 SETUIDFLAGS="-m 4755 -o root";; | |
3340 *) | |
3341 SETUIDFLAGS="-m 4755";; | |
3342 esac | |
3343 fi | |
3344 AC_SUBST(SETUIDFLAGS) | |
3345 | |
3346 ]) | |
3347 | |
3348 AC_DEFUN(KDE_PASSWDLIBS, [ | |
3349 AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT | |
3350 AC_REQUIRE([KDE_PAM]) | |
3351 AC_REQUIRE([KDE_SHADOWPASSWD]) | |
3352 | |
3353 if test "x$use_pam" = "xyes"; then | |
3354 PASSWDLIBS="$PAMLIBS" | |
3355 else | |
3356 PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN" | |
3357 fi | |
3358 | |
3359 dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but | |
3360 dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires | |
3361 dnl root to read, so kcheckpass needs to be root (even when using pam, since pam | |
3362 dnl may need to read /etc/master.passwd). | |
3363 case $host in | |
3364 *-*-freebsd*) | |
3365 SETUIDFLAGS="-m 4755 -o root" | |
3366 ;; | |
3367 *) | |
3368 ;; | |
3369 esac | |
3370 | |
3371 AC_SUBST(PASSWDLIBS) | |
3372 ]) | |
3373 | |
3374 AC_DEFUN(KDE_CHECK_LIBDL, | |
3375 [ | |
3376 AC_CHECK_LIB(dl, dlopen, [ | |
3377 LIBDL="-ldl" | |
3378 ac_cv_have_dlfcn=yes | |
3379 ]) | |
3380 | |
3381 AC_CHECK_LIB(dld, shl_unload, [ | |
3382 LIBDL="-ldld" | |
3383 ac_cv_have_shload=yes | |
3384 ]) | |
3385 | |
3386 AC_SUBST(LIBDL) | |
3387 ]) | |
3388 | |
3389 AC_DEFUN(KDE_CHECK_DLOPEN, | |
3390 [ | |
3391 KDE_CHECK_LIBDL | |
3392 AC_CHECK_HEADERS(dlfcn.h dl.h) | |
3393 if test "$ac_cv_header_dlfcn_h" = "no"; then | |
3394 ac_cv_have_dlfcn=no | |
3395 fi | |
3396 | |
3397 if test "$ac_cv_header_dl_h" = "no"; then | |
3398 ac_cv_have_shload=no | |
3399 fi | |
3400 | |
3401 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE | |
3402 dnl (MM) | |
3403 AC_ARG_ENABLE(dlopen, | |
3404 [ --disable-dlopen link statically [default=no]] , | |
3405 enable_dlopen=$enableval, | |
3406 enable_dlopen=yes) | |
3407 | |
3408 # override the user's opinion, if we know it better ;) | |
3409 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then | |
3410 enable_dlopen=no | |
3411 fi | |
3412 | |
3413 if test "$ac_cv_have_dlfcn" = "yes"; then | |
3414 AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn]) | |
3415 fi | |
3416 | |
3417 if test "$ac_cv_have_shload" = "yes"; then | |
3418 AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload]) | |
3419 fi | |
3420 | |
3421 if test "$enable_dlopen" = no ; then | |
3422 test -n "$1" && eval $1 | |
3423 else | |
3424 test -n "$2" && eval $2 | |
3425 fi | |
3426 | |
3427 ]) | |
3428 | |
3429 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING, | |
3430 [ | |
3431 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no) | |
3432 KDE_PROG_LIBTOOL | |
3433 AC_MSG_CHECKING([dynamic loading]) | |
3434 eval "`egrep '^build_libtool_libs=' libtool`" | |
3435 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then | |
3436 dynamic_loading=yes | |
3437 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) | |
3438 else | |
3439 dynamic_loading=no | |
3440 fi | |
3441 AC_MSG_RESULT($dynamic_loading) | |
3442 if test "$dynamic_loading" = "yes"; then | |
3443 $1 | |
3444 else | |
3445 $2 | |
3446 fi | |
3447 ]) | |
3448 | |
3449 AC_DEFUN(KDE_ADD_INCLUDES, | |
3450 [ | |
3451 if test -z "$1"; then | |
3452 test_include="Pix.h" | |
3453 else | |
3454 test_include="$1" | |
3455 fi | |
3456 | |
3457 AC_MSG_CHECKING([for libg++ ($test_include)]) | |
3458 | |
3459 AC_CACHE_VAL(kde_cv_libgpp_includes, | |
3460 [ | |
3461 kde_cv_libgpp_includes=no | |
3462 | |
3463 for ac_dir in \ | |
3464 \ | |
3465 /usr/include/g++ \ | |
3466 /usr/include \ | |
3467 /usr/unsupported/include \ | |
3468 /opt/include \ | |
3469 $extra_include \ | |
3470 ; \ | |
3471 do | |
3472 if test -r "$ac_dir/$test_include"; then | |
3473 kde_cv_libgpp_includes=$ac_dir | |
3474 break | |
3475 fi | |
3476 done | |
3477 ]) | |
3478 | |
3479 AC_MSG_RESULT($kde_cv_libgpp_includes) | |
3480 if test "$kde_cv_libgpp_includes" != "no"; then | |
3481 all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES" | |
3482 fi | |
3483 ]) | |
3484 ]) | |
3485 | |
3486 | |
3487 AC_DEFUN(KDE_CHECK_MICO, | |
3488 [ | |
3489 AC_REQUIRE([KDE_CHECK_LIBDL]) | |
3490 AC_REQUIRE([KDE_MISC_TESTS]) | |
3491 AC_MSG_CHECKING(for MICO) | |
3492 | |
3493 if test -z "$MICODIR"; then | |
3494 kde_micodir=/usr/local | |
3495 else | |
3496 kde_micodir="$MICODIR" | |
3497 fi | |
3498 | |
3499 AC_ARG_WITH(micodir, | |
3500 [ --with-micodir=micodir where mico is installed ], | |
3501 kde_micodir=$withval, | |
3502 kde_micodir=$kde_micodir | |
3503 ) | |
3504 | |
3505 AC_CACHE_VAL(kde_cv_mico_incdir, | |
3506 [ | |
3507 mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes" | |
3508 AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir) | |
3509 | |
3510 ]) | |
3511 kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'` | |
3512 | |
3513 if test ! -r $kde_micodir/include/CORBA.h; then | |
3514 AC_MSG_ERROR([No CORBA.h found, specify another micodir]) | |
3515 fi | |
3516 | |
3517 AC_MSG_RESULT($kde_micodir) | |
3518 | |
3519 MICO_INCLUDES=-I$kde_micodir/include | |
3520 AC_SUBST(MICO_INCLUDES) | |
3521 MICO_LDFLAGS=-L$kde_micodir/lib | |
3522 AC_SUBST(MICO_LDFLAGS) | |
3523 micodir=$kde_micodir | |
3524 AC_SUBST(micodir) | |
3525 | |
3526 AC_MSG_CHECKING([for MICO version]) | |
3527 AC_CACHE_VAL(kde_cv_mico_version, | |
3528 [ | |
3529 AC_LANG_C | |
3530 cat >conftest.$ac_ext <<EOF | |
3531 #include <stdio.h> | |
3532 #include <mico/version.h> | |
3533 int main() { | |
3534 | |
3535 printf("MICO_VERSION=%s\n",MICO_VERSION); | |
3536 return (0); | |
3537 } | |
3538 EOF | |
3539 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest' | |
3540 if AC_TRY_EVAL(ac_compile); then | |
3541 if eval `./conftest 2>&5`; then | |
3542 kde_cv_mico_version=$MICO_VERSION | |
3543 else | |
3544 AC_MSG_ERROR([your system is not able to execute a small application to | |
3545 find MICO version! Check $kde_micodir/include/mico/version.h]) | |
3546 fi | |
3547 else | |
3548 AC_MSG_ERROR([your system is not able to compile a small application to | |
3549 find MICO version! Check $kde_micodir/include/mico/version.h]) | |
3550 fi | |
3551 ]) | |
3552 | |
3553 dnl installed MICO version | |
3554 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` | |
3555 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` | |
3556 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` | |
3557 | |
3558 if test "x$1" = "x"; then | |
3559 req_version="2.3.0" | |
3560 else | |
3561 req_version=$1 | |
3562 fi | |
3563 | |
3564 dnl required MICO version | |
3565 req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` | |
3566 req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` | |
3567 req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` | |
3568 | |
3569 if test "$mico_v_maj" -lt "$req_v_maj" || \ | |
3570 ( test "$mico_v_maj" -eq "$req_v_maj" && \ | |
3571 test "$mico_v_mid" -lt "$req_v_mid" ) || \ | |
3572 ( test "$mico_v_mid" -eq "$req_v_mid" && \ | |
3573 test "$mico_v_min" -lt "$req_v_min" ) | |
3574 | |
3575 then | |
3576 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \ | |
3577 at least is required. You should upgrade MICO.]) | |
3578 else | |
3579 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)]) | |
3580 fi | |
3581 | |
3582 LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL" | |
3583 AC_SUBST(LIBMICO) | |
3584 if test -z "$IDL"; then | |
3585 IDL='$(kde_bindir)/cuteidl' | |
3586 fi | |
3587 AC_SUBST(IDL) | |
3588 IDL_DEPENDENCIES='$(kde_includes)/CUTE.h' | |
3589 AC_SUBST(IDL_DEPENDENCIES) | |
3590 | |
3591 idldir="\$(includedir)/idl" | |
3592 AC_SUBST(idldir) | |
3593 | |
3594 ]) | |
3595 | |
3596 AC_DEFUN(KDE_CHECK_MINI_STL, | |
3597 [ | |
3598 AC_REQUIRE([KDE_CHECK_MICO]) | |
3599 | |
3600 AC_MSG_CHECKING(if we use mico's mini-STL) | |
3601 AC_CACHE_VAL(kde_cv_have_mini_stl, | |
3602 [ | |
3603 AC_LANG_SAVE | |
3604 AC_LANG_CPLUSPLUS | |
3605 kde_save_cxxflags="$CXXFLAGS" | |
3606 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES" | |
3607 AC_TRY_COMPILE( | |
3608 [ | |
3609 #include <mico/config.h> | |
3610 ], | |
3611 [ | |
3612 #ifdef HAVE_MINI_STL | |
3613 #error "nothing" | |
3614 #endif | |
3615 ], | |
3616 kde_cv_have_mini_stl=no, | |
3617 kde_cv_have_mini_stl=yes) | |
3618 CXXFLAGS="$kde_save_cxxflags" | |
3619 AC_LANG_RESTORE | |
3620 ]) | |
3621 | |
3622 if test "x$kde_cv_have_mini_stl" = "xyes"; then | |
3623 AC_MSG_RESULT(yes) | |
3624 $1 | |
3625 else | |
3626 AC_MSG_RESULT(no) | |
3627 $2 | |
3628 fi | |
3629 ]) | |
3630 | |
3631 ]) | |
3632 | |
3633 | |
3634 AC_DEFUN(KDE_CHECK_LIBPTHREAD, | |
3635 [ | |
3636 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) | |
3637 AC_SUBST(LIBPTHREAD) | |
3638 ]) | |
3639 | |
3640 AC_DEFUN(KDE_CHECK_PTHREAD_OPTION, | |
3641 [ | |
3642 AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.], | |
3643 kde_use_kernthreads=$enableval, kde_use_kernthreads=no) | |
3644 | |
3645 if test "$kde_use_kernthreads" = "yes"; then | |
3646 ac_save_CXXFLAGS="$CXXFLAGS" | |
3647 ac_save_CFLAGS="$CXXFLAGS" | |
3648 CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS" | |
3649 CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS" | |
3650 AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h) | |
3651 CXXFLAGS="$ac_save_CXXFLAGS" | |
3652 CFLAGS="$ac_save_CFLAGS" | |
3653 if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then | |
3654 kde_use_kernthreads=no | |
3655 else | |
3656 dnl Add proper -I and -l statements | |
3657 AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD | |
3658 if test "x$LIBPTHREAD" = "x"; then | |
3659 kde_use_kernthreads=no | |
3660 else | |
3661 USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" | |
3662 fi | |
3663 fi | |
3664 else | |
3665 USE_THREADS="" | |
3666 if test -z "$LIBPTHREAD"; then | |
3667 KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) | |
3668 fi | |
3669 fi | |
3670 | |
3671 case $host_os in | |
3672 solaris*) | |
3673 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) | |
3674 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" | |
3675 ;; | |
3676 freebsd*) | |
3677 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" | |
3678 ;; | |
3679 aix*) | |
3680 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" | |
3681 LIBPTHREAD="$LIBPTHREAD -lc_r" | |
3682 ;; | |
3683 linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" | |
3684 if test "$CXX" = "KCC"; then | |
3685 CXXFLAGS="$CXXFLAGS --thread_safe" | |
3686 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe" | |
3687 fi | |
3688 ;; | |
3689 *) | |
3690 ;; | |
3691 esac | |
3692 AC_SUBST(USE_THREADS) | |
3693 AC_SUBST(LIBPTHREAD) | |
3694 ]) | |
3695 | |
3696 AC_DEFUN(KDE_CHECK_THREADING, | |
3697 [ | |
3698 AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) | |
3699 AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION]) | |
3700 dnl default is yes if libpthread is found and no if no libpthread is available | |
3701 if test -z "$LIBPTHREAD"; then | |
3702 if test -z "$USE_THREADS"; then | |
3703 kde_check_threading_default=no | |
3704 else | |
3705 kde_check_threading_default=yes | |
3706 fi | |
3707 else | |
3708 kde_check_threading_default=yes | |
3709 fi | |
3710 AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], | |
3711 kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default) | |
3712 if test "x$kde_use_threading" = "xyes"; then | |
3713 AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) | |
3714 fi | |
3715 ]) | |
3716 | |
3717 AC_DEFUN(KDE_TRY_LINK_PYTHON, | |
3718 [ | |
3719 if test "$kde_python_link_found" = no; then | |
3720 | |
3721 if test "$1" = normal; then | |
3722 AC_MSG_CHECKING(if a Python application links) | |
3723 else | |
3724 AC_MSG_CHECKING(if Python depends on $2) | |
3725 fi | |
3726 | |
3727 AC_CACHE_VAL(kde_cv_try_link_python_$1, | |
3728 [ | |
3729 AC_LANG_SAVE | |
3730 AC_LANG_C | |
3731 kde_save_cflags="$CFLAGS" | |
3732 CFLAGS="$CFLAGS $PYTHONINC" | |
3733 kde_save_libs="$LIBS" | |
3734 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET" | |
3735 kde_save_ldflags="$LDFLAGS" | |
3736 LDFLAGS="$LDFLAGS $PYTHONLIB" | |
3737 | |
3738 AC_TRY_LINK( | |
3739 [ | |
3740 #include <Python.h> | |
3741 ],[ | |
3742 PySys_SetArgv(1, 0); | |
3743 ], | |
3744 [kde_cv_try_link_python_$1=yes], | |
3745 [kde_cv_try_link_python_$1=no] | |
3746 ) | |
3747 CFLAGS="$kde_save_cflags" | |
3748 LIBS="$kde_save_libs" | |
3749 LDFLAGS="$kde_save_ldflags" | |
3750 ]) | |
3751 | |
3752 if test "$kde_cv_try_link_python_$1" = "yes"; then | |
3753 AC_MSG_RESULT(yes) | |
3754 kde_python_link_found=yes | |
3755 if test ! "$1" = normal; then | |
3756 LIBPYTHON="$LIBPYTHON $2" | |
3757 fi | |
3758 $3 | |
3759 else | |
3760 AC_MSG_RESULT(no) | |
3761 $4 | |
3762 fi | |
3763 AC_LANG_RESTORE | |
3764 | |
3765 fi | |
3766 | |
3767 ]) | |
3768 | |
3769 AC_DEFUN(KDE_CHECK_PYTHON_DIR, | |
3770 [ | |
3771 AC_MSG_CHECKING([for Python directory]) | |
3772 | |
3773 AC_CACHE_VAL(kde_cv_pythondir, | |
3774 [ | |
3775 if test -z "$PYTHONDIR"; then | |
3776 kde_cv_pythondir=/usr/local | |
3777 else | |
3778 kde_cv_pythondir="$PYTHONDIR" | |
3779 fi | |
3780 ]) | |
3781 | |
3782 AC_ARG_WITH(pythondir, | |
3783 [ --with-pythondir=pythondir use python installed in pythondir ], | |
3784 [ | |
3785 ac_python_dir=$withval | |
3786 ], ac_python_dir=$kde_cv_pythondir | |
3787 ) | |
3788 | |
3789 AC_MSG_RESULT($ac_python_dir) | |
3790 ]) | |
3791 | |
3792 AC_DEFUN(KDE_CHECK_PYTHON_INTERN, | |
3793 [ | |
3794 AC_REQUIRE([KDE_CHECK_LIBDL]) | |
3795 AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) | |
3796 AC_REQUIRE([KDE_CHECK_PYTHON_DIR]) | |
3797 | |
3798 if test -z "$1"; then | |
3799 version="1.5" | |
3800 else | |
3801 version="$1" | |
3802 fi | |
3803 | |
3804 AC_MSG_CHECKING([for Python$version]) | |
3805 | |
3806 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes" | |
3807 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir) | |
3808 if test ! -r $python_incdir/Python.h; then | |
3809 AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir) | |
3810 python_incdir=$python_incdir/python$version | |
3811 if test ! -r $python_incdir/Python.h; then | |
3812 python_incdir=no | |
3813 fi | |
3814 fi | |
3815 | |
3816 PYTHONINC=-I$python_incdir | |
3817 | |
3818 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs" | |
3819 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) | |
3820 if test ! -r $python_libdir/libpython$version.a; then | |
3821 AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) | |
3822 python_libdir=$python_libdir/python$version/config | |
3823 if test ! -r $python_libdir/libpython$version.a; then | |
3824 python_libdir=no | |
3825 fi | |
3826 fi | |
3827 | |
3828 PYTHONLIB=-L$python_libdir | |
3829 kde_orig_LIBPYTHON=$LIBPYTHON | |
3830 if test -z "$LIBPYTHON"; then | |
3831 LIBPYTHON=-lpython$version | |
3832 fi | |
3833 | |
3834 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs" | |
3835 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir) | |
3836 python_moddir=$python_moddir/python$version | |
3837 if test ! -r $python_moddir/copy.py; then | |
3838 python_moddir=no | |
3839 fi | |
3840 | |
3841 PYTHONMODDIR=$python_moddir | |
3842 | |
3843 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir) | |
3844 | |
3845 if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then | |
3846 LIBPYTHON=$kde_orig_LIBPYTHON | |
3847 test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB="" | |
3848 test "x$PYTHONINC" = "x-Ino" && PYTHONINC="" | |
3849 $2 | |
3850 else | |
3851 dnl Note: this test is very weak | |
3852 kde_python_link_found=no | |
3853 KDE_TRY_LINK_PYTHON(normal) | |
3854 KDE_TRY_LINK_PYTHON(m, -lm) | |
3855 KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD) | |
3856 KDE_TRY_LINK_PYTHON(tcl, -ltcl) | |
3857 KDE_TRY_LINK_PYTHON(db2, -ldb2) | |
3858 KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm]) | |
3859 KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil]) | |
3860 KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil]) | |
3861 KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3]) | |
3862 KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil]) | |
3863 KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm]) | |
3864 KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [], | |
3865 [AC_MSG_WARN([it seems, Python depends on another library. | |
3866 Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this | |
3867 and contact the authors to let them know about this problem]) | |
3868 ]) | |
3869 | |
3870 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET" | |
3871 AC_SUBST(PYTHONINC) | |
3872 AC_SUBST(PYTHONLIB) | |
3873 AC_SUBST(LIBPYTHON) | |
3874 AC_SUBST(PYTHONMODDIR) | |
3875 AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python]) | |
3876 fi | |
3877 | |
3878 ]) | |
3879 | |
3880 | |
3881 AC_DEFUN(KDE_CHECK_PYTHON, | |
3882 [ | |
3883 KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0", | |
3884 [ KDE_CHECK_PYTHON_INTERN($1, $2) ]) | |
3885 ]) | |
3886 ]) | |
3887 | |
3888 AC_DEFUN(KDE_CHECK_STL_SGI, | |
3889 [ | |
3890 AC_MSG_CHECKING([if STL implementation is SGI like]) | |
3891 AC_CACHE_VAL(kde_cv_stl_type_sgi, | |
3892 [ | |
3893 AC_TRY_COMPILE([ | |
3894 #include <string> | |
3895 using namespace std; | |
3896 ],[ | |
3897 string astring="Hallo Welt."; | |
3898 astring.erase(0, 6); // now astring is "Welt" | |
3899 return 0; | |
3900 ], kde_cv_stl_type_sgi=yes, | |
3901 kde_cv_stl_type_sgi=no) | |
3902 ]) | |
3903 | |
3904 AC_MSG_RESULT($kde_cv_stl_type_sgi) | |
3905 | |
3906 if test "$kde_cv_stl_type_sgi" = "yes"; then | |
3907 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) | |
3908 fi | |
3909 ]) | |
3910 | |
3911 AC_DEFUN(KDE_CHECK_STL_HP, | |
3912 [ | |
3913 AC_MSG_CHECKING([if STL implementation is HP like]) | |
3914 AC_CACHE_VAL(kde_cv_stl_type_hp, | |
3915 [ | |
3916 AC_TRY_COMPILE([ | |
3917 #include <string> | |
3918 using namespace std; | |
3919 ],[ | |
3920 string astring="Hello World"; | |
3921 astring.remove(0, 6); // now astring is "World" | |
3922 return 0; | |
3923 ], kde_cv_stl_type_hp=yes, | |
3924 kde_cv_stl_type_hp=no) | |
3925 ]) | |
3926 AC_MSG_RESULT($kde_cv_stl_type_hp) | |
3927 | |
3928 if test "$kde_cv_stl_type_hp" = "yes"; then | |
3929 AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP]) | |
3930 fi | |
3931 ]) | |
3932 | |
3933 AC_DEFUN(KDE_CHECK_STL, | |
3934 [ | |
3935 AC_LANG_SAVE | |
3936 AC_LANG_CPLUSPLUS | |
3937 ac_save_CXXFLAGS="$CXXFLAGS" | |
3938 CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" | |
3939 KDE_CHECK_STL_SGI | |
3940 | |
3941 if test "$kde_cv_stl_type_sgi" = "no"; then | |
3942 KDE_CHECK_STL_HP | |
3943 | |
3944 if test "$kde_cv_stl_type_hp" = "no"; then | |
3945 AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?") | |
3946 fi | |
3947 fi | |
3948 | |
3949 CXXFLAGS="$ac_save_CXXFLAGS" | |
3950 AC_LANG_RESTORE | |
3951 ]) | |
3952 | |
3953 AC_DEFUN(AC_FIND_QIMGIO, | |
3954 [AC_REQUIRE([AC_FIND_JPEG]) | |
3955 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) | |
3956 AC_MSG_CHECKING([for qimgio]) | |
3957 AC_CACHE_VAL(ac_cv_lib_qimgio, | |
3958 [ | |
3959 AC_LANG_SAVE | |
3960 AC_LANG_CPLUSPLUS | |
3961 ac_save_LIBS="$LIBS" | |
3962 ac_save_CXXFLAGS="$CXXFLAGS" | |
3963 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT" | |
3964 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" | |
3965 AC_TRY_RUN(dnl | |
3966 [ | |
3967 #include <qimageio.h> | |
3968 #include <qstring.h> | |
3969 int main() { | |
3970 QString t = "hallo"; | |
3971 t.fill('t'); | |
3972 qInitImageIO(); | |
3973 } | |
3974 ], | |
3975 ac_cv_lib_qimgio=yes, | |
3976 ac_cv_lib_qimgio=no, | |
3977 ac_cv_lib_qimgio=no) | |
3978 LIBS="$ac_save_LIBS" | |
3979 CXXFLAGS="$ac_save_CXXFLAGS" | |
3980 AC_LANG_RESTORE | |
3981 ])dnl | |
3982 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then | |
3983 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG" | |
3984 AC_MSG_RESULT(yes) | |
3985 AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available]) | |
3986 AC_SUBST(LIBQIMGIO) | |
3987 else | |
3988 AC_MSG_RESULT(not found) | |
3989 fi | |
3990 ]) | |
3991 | |
3992 AC_DEFUN(KDE_CHECK_ANSI, | |
3993 [ | |
3994 ]) | |
3995 | |
3996 AC_DEFUN(KDE_CHECK_INSURE, | |
3997 [ | |
3998 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]], | |
3999 [ | |
4000 if test $enableval = "no"; dnl | |
4001 then ac_use_insure="no" | |
4002 else ac_use_insure="yes" | |
4003 fi | |
4004 ], [ac_use_insure="no"]) | |
4005 | |
4006 AC_MSG_CHECKING(if we will use Insure++ to debug) | |
4007 AC_MSG_RESULT($ac_use_insure) | |
4008 if test "$ac_use_insure" = "yes"; dnl | |
4009 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "???? | |
4010 fi | |
4011 ]) | |
4012 | |
4013 AC_DEFUN(AM_DISABLE_LIBRARIES, | |
4014 [ | |
4015 AC_PROVIDE([AM_ENABLE_STATIC]) | |
4016 AC_PROVIDE([AM_ENABLE_SHARED]) | |
4017 enable_static=no | |
4018 enable_shared=yes | |
4019 ]) | |
4020 | |
4021 | |
4022 AC_DEFUN(AC_CHECK_UTMP_FILE, | |
4023 [ | |
4024 AC_MSG_CHECKING([for utmp file]) | |
4025 | |
4026 AC_CACHE_VAL(kde_cv_utmp_file, | |
4027 [ | |
4028 kde_cv_utmp_file=no | |
4029 | |
4030 for ac_file in \ | |
4031 \ | |
4032 /var/run/utmp \ | |
4033 /var/adm/utmp \ | |
4034 /etc/utmp \ | |
4035 ; \ | |
4036 do | |
4037 if test -r "$ac_file"; then | |
4038 kde_cv_utmp_file=$ac_file | |
4039 break | |
4040 fi | |
4041 done | |
4042 ]) | |
4043 | |
4044 if test "$kde_cv_utmp_file" != "no"; then | |
4045 AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries]) | |
4046 $1 | |
4047 AC_MSG_RESULT($kde_cv_utmp_file) | |
4048 else | |
4049 $2 | |
4050 AC_MSG_RESULT([non found]) | |
4051 fi | |
4052 ]) | |
4053 | |
4054 | |
4055 AC_DEFUN(KDE_CREATE_SUBDIRSLIST, | |
4056 [ | |
4057 | |
4058 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" | |
4059 | |
4060 if test ! -s $srcdir/subdirs; then | |
4061 dnl Note: Makefile.common creates subdirs, so this is just a fallback | |
4062 TOPSUBDIRS="" | |
4063 files=`cd $srcdir && ls -1` | |
4064 dirs=`for i in $files; do if test -d $i; then echo $i; fi; done` | |
4065 for i in $dirs; do | |
4066 echo $i >> $srcdir/subdirs | |
4067 done | |
4068 fi | |
4069 | |
4070 if test -s $srcdir/inst-apps; then | |
4071 ac_topsubdirs="`cat $srcdir/inst-apps`" | |
4072 else | |
4073 ac_topsubdirs="`cat $srcdir/subdirs`" | |
4074 fi | |
4075 | |
4076 for i in $ac_topsubdirs; do | |
4077 AC_MSG_CHECKING([if $i should be compiled]) | |
4078 if test -d $srcdir/$i; then | |
4079 install_it="yes" | |
4080 for j in $DO_NOT_COMPILE; do | |
4081 if test $i = $j; then | |
4082 install_it="no" | |
4083 fi | |
4084 done | |
4085 else | |
4086 install_it="no" | |
4087 fi | |
4088 AC_MSG_RESULT($install_it) | |
4089 if test $install_it = "yes"; then | |
4090 TOPSUBDIRS="$TOPSUBDIRS $i" | |
4091 fi | |
4092 done | |
4093 | |
4094 AC_SUBST(TOPSUBDIRS) | |
4095 ]) | |
4096 | |
4097 AC_DEFUN(KDE_CHECK_NAMESPACES, | |
4098 [ | |
4099 AC_MSG_CHECKING(whether C++ compiler supports namespaces) | |
4100 AC_LANG_SAVE | |
4101 AC_LANG_CPLUSPLUS | |
4102 AC_TRY_COMPILE([ | |
4103 ], | |
4104 [ | |
4105 namespace Foo { | |
4106 extern int i; | |
4107 namespace Bar { | |
4108 extern int i; | |
4109 } | |
4110 } | |
4111 | |
4112 int Foo::i = 0; | |
4113 int Foo::Bar::i = 1; | |
4114 ],[ | |
4115 AC_MSG_RESULT(yes) | |
4116 AC_DEFINE(HAVE_NAMESPACES) | |
4117 ], [ | |
4118 AC_MSG_RESULT(no) | |
4119 ]) | |
4120 AC_LANG_RESTORE | |
4121 ]) | |
4122 | |
4123 AC_DEFUN(KDE_CHECK_NEWLIBS, | |
4124 [ | |
4125 | |
4126 ]) | |
4127 | |
4128 dnl ------------------------------------------------------------------------ | |
4129 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org | |
4130 dnl ------------------------------------------------------------------------ | |
4131 dnl | |
4132 AC_DEFUN(AC_CHECK_S_ISSOCK, | |
4133 [ | |
4134 AC_MSG_CHECKING(for S_ISSOCK) | |
4135 AC_CACHE_VAL(ac_cv_have_s_issock, | |
4136 [ | |
4137 AC_LANG_SAVE | |
4138 AC_LANG_C | |
4139 AC_TRY_LINK( | |
4140 [ | |
4141 #include <sys/stat.h> | |
4142 ], | |
4143 [ | |
4144 struct stat buff; | |
4145 int b = S_ISSOCK( buff.st_mode ); | |
4146 ], | |
4147 ac_cv_have_s_issock=yes, | |
4148 ac_cv_have_s_issock=no) | |
4149 AC_LANG_RESTORE | |
4150 ]) | |
4151 AC_MSG_RESULT($ac_cv_have_s_issock) | |
4152 if test "$ac_cv_have_s_issock" = "yes"; then | |
4153 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.]) | |
4154 fi | |
4155 ]) | |
4156 | |
4157 dnl ------------------------------------------------------------------------ | |
4158 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org | |
4159 dnl ------------------------------------------------------------------------ | |
4160 dnl | |
4161 AC_DEFUN(AC_CHECK_KDEMAXPATHLEN, | |
4162 [ | |
4163 AC_MSG_CHECKING(for MAXPATHLEN) | |
4164 AC_CACHE_VAL(ac_cv_maxpathlen, | |
4165 [ | |
4166 AC_LANG_C | |
4167 cat > conftest.$ac_ext <<EOF | |
4168 #ifdef STDC_HEADERS | |
4169 # include <stdlib.h> | |
4170 #endif | |
4171 #include <stdio.h> | |
4172 #include <sys/param.h> | |
4173 #ifndef MAXPATHLEN | |
4174 #define MAXPATHLEN 1024 | |
4175 #endif | |
4176 | |
4177 KDE_HELLO MAXPATHLEN | |
4178 | |
4179 EOF | |
4180 | |
4181 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out" | |
4182 | |
4183 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then | |
4184 ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out` | |
4185 else | |
4186 ac_cv_maxpathlen=1024 | |
4187 fi | |
4188 | |
4189 rm conftest.* | |
4190 | |
4191 ]) | |
4192 AC_MSG_RESULT($ac_cv_maxpathlen) | |
4193 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] ) | |
4194 ]) | |
4195 | |
4196 dnl ------------------------------------------------------------------------- | |
4197 dnl See if the compiler supports a template repository bero@redhat.de | |
4198 dnl ------------------------------------------------------------------------- | |
4199 AC_DEFUN(KDE_COMPILER_REPO, | |
4200 [ | |
4201 REPO="" | |
4202 NOREPO="" | |
4203 | |
4204 KDE_CHECK_COMPILER_FLAG(frepo, | |
4205 [ | |
4206 REPO="-frepo" | |
4207 NOREPO="-fno-repo" | |
4208 ]) | |
4209 | |
4210 if test -z "$REPO"; then | |
4211 KDE_CHECK_COMPILER_FLAG(instances=explicit, | |
4212 [ | |
4213 REPO="-instances=explicit" | |
4214 NOREPO="-instances=extern" | |
4215 ]) | |
4216 fi | |
4217 | |
4218 if test -n "$REPO"; then | |
4219 AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1, | |
4220 [C++ compiler supports template repository]) | |
4221 $1 | |
4222 fi | |
4223 | |
4224 AC_SUBST(REPO) | |
4225 AC_SUBST(NOREPO) | |
4226 ]) | |
4227 | |
4228 AC_DEFUN(KDE_CHECK_HEADER, | |
4229 [ | |
4230 AC_LANG_SAVE | |
4231 kde_safe_cppflags=$CPPFLAGS | |
4232 CPPFLAGS="$CPPFLAGS $all_includes" | |
4233 AC_LANG_CPLUSPLUS | |
4234 AC_CHECK_HEADER($1, $2, $3) | |
4235 CPPFLAGS=$kde_safe_cppflags | |
4236 AC_LANG_RESTORE | |
4237 ]) | |
4238 | |
4239 AC_DEFUN(KDE_FAST_CONFIGURE, | |
4240 [ | |
4241 dnl makes configure fast (needs perl) | |
4242 AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)], | |
4243 with_fast_perl=$enableval, with_fast_perl=yes) | |
4244 ]) | |
4245 | |
4246 AC_DEFUN(KDE_CONF_FILES, | |
4247 [ | |
4248 val= | |
4249 if test -f $srcdir/configure.files ; then | |
4250 val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files` | |
4251 fi | |
4252 CONF_FILES= | |
4253 if test -n "$val" ; then | |
4254 for i in $val ; do | |
4255 CONF_FILES="$CONF_FILES $i" | |
4256 done | |
4257 fi | |
4258 AC_SUBST(CONF_FILES) | |
4259 ])dnl | |
4260 | |
4261 AC_DEFUN(KDE_SET_PREFIX, | |
4262 [ | |
4263 unset CDPATH | |
4264 dnl make $KDEDIR the default for the installation | |
4265 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) | |
4266 | |
4267 if test "x$prefix" = "xNONE"; then | |
4268 prefix=$ac_default_prefix | |
4269 ac_configure_args="$ac_configure_args --prefix $prefix" | |
4270 fi | |
4271 KDE_FAST_CONFIGURE | |
4272 KDE_CONF_FILES | |
4273 ]) | |
4274 | |
4275 pushdef([AC_PROG_INSTALL], | |
4276 [ | |
4277 dnl our own version, testing for a -p flag | |
4278 popdef([AC_PROG_INSTALL]) | |
4279 dnl as AC_PROG_INSTALL works as it works we first have | |
4280 dnl to save if the user didn't specify INSTALL, as the | |
4281 dnl autoconf one overwrites INSTALL and we have no chance to find | |
4282 dnl out afterwards | |
4283 test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL | |
4284 test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM | |
4285 test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT | |
4286 AC_PROG_INSTALL | |
4287 | |
4288 if test -z "$kde_save_INSTALL_given" ; then | |
4289 # OK, user hasn't given any INSTALL, autoconf found one for us | |
4290 # now we test, if it supports the -p flag | |
4291 AC_MSG_CHECKING(for -p flag to install) | |
4292 rm -f confinst.$$.* > /dev/null 2>&1 | |
4293 echo "Testtest" > confinst.$$.orig | |
4294 ac_res=no | |
4295 if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then | |
4296 if test -f confinst.$$.new ; then | |
4297 # OK, -p seems to do no harm to install | |
4298 INSTALL="${INSTALL} -p" | |
4299 ac_res=yes | |
4300 fi | |
4301 fi | |
4302 rm -f confinst.$$.* | |
4303 AC_MSG_RESULT($ac_res) | |
4304 fi | |
4305 dnl the following tries to resolve some signs and wonders coming up | |
4306 dnl with different autoconf/automake versions | |
4307 dnl e.g.: | |
4308 dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s | |
4309 dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS) | |
4310 dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s | |
4311 dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has | |
4312 dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the | |
4313 dnl install-@DIR@PROGRAMS targets to explicitly use that flag | |
4314 dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as | |
4315 dnl INSTALL_SCRIPT, which breaks with automake <= 1.4 | |
4316 dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure | |
4317 dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from | |
4318 dnl automake (due to broken Makefile.am or whatever) to install programs, | |
4319 dnl and so does not see the -s flag in automake > 1.4 | |
4320 dnl to clean up that mess we: | |
4321 dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG | |
4322 dnl which cleans KDE's program with automake > 1.4; | |
4323 dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems | |
4324 dnl with automake<=1.4 | |
4325 dnl note that dues to this sometimes two '-s' flags are used (if KDE | |
4326 dnl properly uses install-@DIR@PROGRAMS, but I don't care | |
4327 dnl | |
4328 dnl And to all this comes, that I even can't write in comments variable | |
4329 dnl names used by automake, because it is so stupid to think I wanted to | |
4330 dnl _use_ them, therefor I have written A_M_... instead of AM_ | |
4331 dnl hmm, I wanted to say something ... ahh yes: Arghhh. | |
4332 | |
4333 if test -z "$kde_save_INSTALL_PROGRAM_given" ; then | |
4334 INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)' | |
4335 fi | |
4336 if test -z "$kde_save_INSTALL_SCRIPT_given" ; then | |
4337 INSTALL_SCRIPT='${INSTALL}' | |
4338 fi | |
4339 ])dnl | |
4340 | |
4341 AC_DEFUN(KDE_LANG_CPLUSPLUS, | |
4342 [AC_LANG_CPLUSPLUS | |
4343 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' | |
4344 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS]) | |
4345 ]) | |
4346 | |
4347 pushdef([AC_LANG_CPLUSPLUS], | |
4348 [popdef([AC_LANG_CPLUSPLUS]) | |
4349 KDE_LANG_CPLUSPLUS | |
4350 ]) | |
4351 | |
4352 AC_DEFUN(KDE_CHECK_LONG_LONG, | |
4353 [ | |
4354 AC_MSG_CHECKING(for long long) | |
4355 AC_CACHE_VAL(kde_cv_c_long_long, | |
4356 [ | |
4357 AC_LANG_SAVE | |
4358 AC_LANG_CPLUSPLUS | |
4359 AC_TRY_LINK([], [ | |
4360 long long foo = 0; | |
4361 foo = foo+1; | |
4362 ], | |
4363 kde_cv_c_long_long=yes, kde_cv_c_long_long=no) | |
4364 AC_LANG_RESTORE | |
4365 ]) | |
4366 AC_MSG_RESULT($kde_cv_c_long_long) | |
4367 if test "$kde_cv_c_long_long" = yes; then | |
4368 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype]) | |
4369 fi | |
4370 ]) | |
4371 | |
4372 AC_DEFUN(KDE_CHECK_LIB, | |
4373 [ | |
4374 kde_save_LIBS="$LIBS" | |
4375 LIBS="$LIBS $all_libraries" | |
4376 case $host_os in | |
4377 aix*) LIBS="-brtl $LIBS" | |
4378 test "$GCC" = yes && LIBS="-Wl,$LIBS" | |
4379 ;; | |
4380 esac | |
4381 AC_CHECK_LIB($1, $2, $3, $4, $5) | |
4382 LIBS="$kde_save_LIBS" | |
4383 ]) | |
4384 | |
4385 | |
4386 | |
4387 | |
4388 AC_DEFUN(KDE_CHECK_INITGROUPS, | |
4389 [ | |
4390 AC_REQUIRE([AC_CANONICAL_HOST]) | |
4391 AC_CHECK_FUNCS(initgroups) | |
4392 if test "x$ac_cv_func_initgroups" = "xyes"; then | |
4393 case $host_os in | |
4394 aix*) AC_LANG_SAVE | |
4395 AC_LANG_CPLUSPLUS | |
4396 AC_MSG_CHECKING([for initgroups prototype]) | |
4397 AC_CACHE_VAL(kde_cv_check_initgroups_proto, | |
4398 [ AC_TRY_COMPILE( | |
4399 [ #include <grp.h> | |
4400 ], | |
4401 [ char buffer[10]; | |
4402 gid_t id; | |
4403 int x = initgroups(buffer,id); | |
4404 ], | |
4405 kde_cv_check_initgroups_proto=yes, | |
4406 kde_cv_check_initgroups_proto=no) | |
4407 ]) | |
4408 AC_MSG_RESULT($kde_cv_check_initgroups_proto) | |
4409 AC_LANG_RESTORE | |
4410 ;; | |
4411 *) | |
4412 kde_cv_check_initgroups_proto=yes | |
4413 ;; | |
4414 esac | |
4415 else | |
4416 kde_cv_check_initgroups_proto=no | |
4417 fi | |
4418 if test "x$kde_cv_check_initgroups_proto" = "xyes"; then | |
4419 kde_check_initgroups_proto=1 | |
4420 else | |
4421 kde_check_initgroups_proto=0 | |
4422 fi | |
4423 AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto, | |
4424 [initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)]) | |
4425 ]) | |
4426 | |
4427 | |
4428 AC_DEFUN(KDE_CHECK_JAVA_DIR, | |
4429 [ | |
4430 AC_MSG_CHECKING([for Java directory]) | |
4431 | |
4432 AC_ARG_WITH(java, | |
4433 [ --with-java=javadir use java installed in javadir, --without-java disables ], | |
4434 [ ac_java_dir=$withval | |
4435 ], ac_java_dir="" | |
4436 ) | |
4437 | |
4438 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH | |
4439 if test "x$ac_java_dir" = xno; then | |
4440 kde_cv_java_bindir=no | |
4441 kde_cv_java_includedir=no | |
4442 kde_java_libjvmdir=no | |
4443 kde_java_libhpidir=no | |
4444 else | |
4445 if test "x$ac_java_dir" = x; then | |
4446 dnl No option set -> look in $PATH | |
4447 AC_CACHE_VAL(kde_cv_java_bindir, | |
4448 [ | |
4449 dnl First look for javac in $PATH. If not found we'll look at the option. | |
4450 KDE_FIND_PATH(javac, JAVAC, [], []) | |
4451 if test -n "$JAVAC"; then | |
4452 kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'` | |
4453 dnl this substitution might not work - well, we test for jni.h below | |
4454 kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'` | |
4455 else | |
4456 kde_cv_java_bindir=no | |
4457 fi | |
4458 ]) | |
4459 else | |
4460 dnl config option set | |
4461 kde_cv_java_bindir=$ac_java_dir/bin | |
4462 kde_cv_java_includedir=$ac_java_dir/include | |
4463 fi | |
4464 fi | |
4465 | |
4466 dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no" | |
4467 if test ! "x$kde_cv_java_bindir" = xno; then | |
4468 | |
4469 dnl Look for libjvm.so | |
4470 kde_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` | |
4471 dnl Look for libhpi.so and avoid green threads | |
4472 kde_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'` | |
4473 | |
4474 dnl Now check everything's fine under there | |
4475 | |
4476 if test ! -x "$kde_cv_java_bindir/javac"; then | |
4477 AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.]) | |
4478 fi | |
4479 if test ! -x "$kde_cv_java_bindir/javah"; then | |
4480 AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.]) | |
4481 fi | |
4482 if test ! -x "$kde_cv_java_bindir/jar"; then | |
4483 AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.]) | |
4484 fi | |
4485 if test ! -r "$kde_cv_java_includedir/jni.h"; then | |
4486 AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.]) | |
4487 fi | |
4488 if test ! -r "$kde_java_libjvmdir/libjvm.so"; then | |
4489 AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) | |
4490 fi | |
4491 if test ! -r "$kde_java_libhpidir/libhpi.so"; then | |
4492 AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) | |
4493 fi | |
4494 | |
4495 jni_includes="-I$kde_cv_java_includedir" | |
4496 dnl Strange thing, jni.h requires jni_md.h which is under genunix here.. | |
4497 dnl and under linux here.. | |
4498 test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux" | |
4499 test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix" | |
4500 | |
4501 dnl Check for JNI version | |
4502 AC_LANG_SAVE | |
4503 AC_LANG_CPLUSPLUS | |
4504 ac_cxxflags_safe="$CXXFLAGS" | |
4505 CXXFLAGS="$CXXFLAGS $all_includes $jni_includes" | |
4506 | |
4507 AC_TRY_COMPILE([ | |
4508 #include <jni.h> | |
4509 ], | |
4510 [ | |
4511 #ifndef JNI_VERSION_1_2 | |
4512 Syntax Error | |
4513 #endif | |
4514 ],[ kde_jni_works=yes ], | |
4515 [ kde_jni_works=no ]) | |
4516 | |
4517 if test $kde_jni_works = no; then | |
4518 AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h. | |
4519 You need to have Java Development Kit (JDK) version 1.2. | |
4520 | |
4521 Use --with-java to specify another location. | |
4522 Use --without-java to configure without java support. | |
4523 Or download a newer JDK and try again. | |
4524 See e.g. http://java.sun.com/products/jdk/1.2 ]) | |
4525 fi | |
4526 | |
4527 CXXFLAGS="$ac_cxxflags_safe" | |
4528 AC_LANG_RESTORE | |
4529 | |
4530 dnl All tests ok, inform and subst the variables | |
4531 AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir]) | |
4532 | |
4533 JAVAC=$kde_cv_java_bindir/javac | |
4534 AC_SUBST(JAVAC) | |
4535 JAVAH=$kde_cv_java_bindir/javah | |
4536 AC_SUBST(JAVAH) | |
4537 JAR=$kde_cv_java_bindir/jar | |
4538 AC_SUBST(JAR) | |
4539 AC_SUBST(jni_includes) | |
4540 JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi" | |
4541 AC_SUBST(JVMLIBS) | |
4542 fi | |
4543 ]) | |
4544 | |
4545 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH. | |
4546 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in | |
4547 dnl big packages, m4_foreach is dog-slow. So use our own version of | |
4548 dnl it. (matz@kde.org) | |
4549 m4_define([mm_foreach], | |
4550 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])]) | |
4551 m4_define([mm_car], [[$1]]) | |
4552 m4_define([mm_car2], [[$@]]) | |
4553 m4_define([_mm_foreach], | |
4554 [m4_if(m4_quote($2), [], [], | |
4555 [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1], | |
4556 mm_car2(m4_shift($2)), | |
4557 [$3])])]) | |
4558 m4_define([AC_FOREACH], | |
4559 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) | |
4560 | |
4561 AC_DEFUN(KDE_NEED_FLEX, | |
4562 [ | |
4563 AC_REQUIRE([AM_PROG_LEX]) | |
4564 if test -z "$LEXLIB"; then | |
4565 AC_MSG_ERROR([You need to have flex installed.]) | |
4566 fi | |
4567 AC_SUBST(LEXLIB) | |
4568 ]) | |
4569 | |
4570 AC_DEFUN(AC_PATH_QTOPIA, | |
4571 [ | |
4572 dnl TODO: use AC_CACHE_VAL | |
4573 | |
4574 if test -z "$1"; then | |
4575 qtopia_minver_maj=1 | |
4576 qtopia_minver_min=5 | |
4577 qtopia_minver_pat=0 | |
4578 else | |
4579 qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"` | |
4580 qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"` | |
4581 qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"` | |
4582 fi | |
4583 | |
4584 qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat" | |
4585 qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat" | |
4586 | |
4587 AC_REQUIRE([AC_PATH_QT]) | |
4588 | |
4589 AC_MSG_CHECKING([for Qtopia]) | |
4590 | |
4591 LIB_QTOPIA="-lqpe" | |
4592 AC_SUBST(LIB_QTOPIA) | |
4593 | |
4594 kde_qtopia_dirs="$QPEDIR /opt/Qtopia" | |
4595 | |
4596 ac_qtopia_incdir=NO | |
4597 | |
4598 AC_ARG_WITH(qtopia-dir, | |
4599 [ --with-qtopia-dir=DIR where the root of Qtopia is installed ], | |
4600 [ ac_qtopia_incdir="$withval"/include] ) | |
4601 | |
4602 qtopia_incdirs="" | |
4603 for dir in $kde_qtopia_dirs; do | |
4604 qtopia_incdirs="$qtopia_incdirs $dir/include" | |
4605 done | |
4606 | |
4607 if test ! "$ac_qtopia_incdir" = "NO"; then | |
4608 qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs" | |
4609 fi | |
4610 | |
4611 qtopia_incdir="" | |
4612 AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir) | |
4613 ac_qtopia_incdir="$qtopia_incdir" | |
4614 | |
4615 if test -z "$qtopia_incdir"; then | |
4616 AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.]) | |
4617 fi | |
4618 | |
4619 qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`; | |
4620 qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`; | |
4621 qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`; | |
4622 | |
4623 qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat" | |
4624 qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat" | |
4625 if test "$qtopia_ver" -lt "$qtopia_minver"; then | |
4626 AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr | |
4627 is required.]) | |
4628 fi | |
4629 | |
4630 AC_LANG_SAVE | |
4631 AC_LANG_CPLUSPLUS | |
4632 | |
4633 ac_cxxflags_safe="$CXXFLAGS" | |
4634 ac_ldflags_safe="$LDFLAGS" | |
4635 ac_libs_safe="$LIBS" | |
4636 | |
4637 CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes" | |
4638 LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" | |
4639 LIBS="$LIBS $LIB_QTOPIA $LIBQT" | |
4640 | |
4641 cat > conftest.$ac_ext <<EOF | |
4642 #include "confdefs.h" | |
4643 #include <qpe/qpeapplication.h> | |
4644 #include <qpe/version.h> | |
4645 | |
4646 int main( int argc, char **argv ) | |
4647 { | |
4648 QPEApplication app( argc, argv ); | |
4649 return 0; | |
4650 } | |
4651 EOF | |
4652 | |
4653 if AC_TRY_EVAL(ac_link) && test -s conftest; then | |
4654 rm -f conftest* | |
4655 else | |
4656 rm -f conftest* | |
4657 AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at | |
4658 the end of config.log]) | |
4659 fi | |
4660 | |
4661 CXXFLAGS="$ac_cxxflags_safe" | |
4662 LDFLAGS="$ac_ldflags_safe" | |
4663 LIBS="$ac_libs_safe" | |
4664 | |
4665 AC_LANG_RESTORE | |
4666 | |
4667 QTOPIA_INCLUDES="-I$qtopia_incdir" | |
4668 AC_SUBST(QTOPIA_INCLUDES) | |
4669 | |
4670 AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir]) | |
4671 ]) | |
4672 |