source: trunk/MagicSoft/AMC/activemirrorcontrol/aclocal.m4@ 9435

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