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

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