3
dnl This file is part of the KDE libraries/packages
4
dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5
dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
7
dnl This file is free software; you can redistribute it and/or
8
dnl modify it under the terms of the GNU Library General Public
9
dnl License as published by the Free Software Foundation; either
10
dnl version 2 of the License, or (at your option) any later version.
12
dnl This library is distributed in the hope that it will be useful,
13
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
dnl Library General Public License for more details.
17
dnl You should have received a copy of the GNU Library General Public License
18
dnl along with this library; see the file COPYING.LIB. If not, write to
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
dnl Boston, MA 02111-1307, USA.
23
dnl Please do not modify this file unless you expect your modifications to be
24
dnl carried into every other module in the repository. If you decide that you
25
dnl really want to modify it, contact coolo@kde.org mentioning that you have
26
dnl and that the modified file should be committed to every module.
28
dnl Single-module modifications are best placed in configure.in for kdelibs
29
dnl and kdebase or configure.in.in if present.
31
dnl ------------------------------------------------------------------------
32
dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
33
dnl thanks to Raja R Harinath.
34
dnl ------------------------------------------------------------------------
36
ifdef([_AC_PATH_X_DIRECT],[],
37
[AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
38
ifdef([_AC_PATH_X_XMKMF],[],
39
[AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
41
dnl ------------------------------------------------------------------------
42
dnl Find a file (or one of more files in a list of dirs)
43
dnl ------------------------------------------------------------------------
45
AC_DEFUN(AC_FIND_FILE,
52
echo "configure: __oline__: $i/$j" >&AC_FD_CC
53
if test -r "$i/$j"; then
54
echo "taking that" >&AC_FD_CC
62
dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
63
dnl if-not-found, test-parameter)
64
AC_DEFUN(KDE_FIND_PATH,
66
AC_MSG_CHECKING([for $1])
67
if test -n "$$2"; then
70
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
72
AC_CACHE_VAL(kde_cv_path_$kde_cache,
84
if test -x "$dir/$1"; then
87
evalstr="$dir/$1 $5 2>&1 "
88
if eval $evalstr; then
99
eval "kde_cv_path_$kde_cache=$kde_cv_path"
103
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
107
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
108
AC_MSG_RESULT(not found)
111
AC_MSG_RESULT($kde_cv_path)
117
AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
119
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
120
Please check whether you installed Qt correctly.
121
You need to have a running moc binary.
122
configure tried to run $ac_cv_path_moc and the test didn't
123
succeed. If configure shouldn't have tried this one, set
124
the environment variable MOC to the right one before running
129
AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
131
AC_MSG_WARN([No Qt ui compiler (uic) found!
132
Please check whether you installed Qt correctly.
133
You need to have a running uic binary.
134
configure tried to run $ac_cv_path_uic and the test didn't
135
succeed. If configure shouldn't have tried this one, set
136
the environment variable UIC to the right one before running
141
dnl ------------------------------------------------------------------------
142
dnl Find the meta object compiler and the ui compiler in the PATH,
143
dnl in $QTDIR/bin, and some more usual places
144
dnl ------------------------------------------------------------------------
146
AC_DEFUN(AC_PATH_QT_MOC_UIC,
149
for dir in $kde_qt_dirs; do
150
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
152
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
153
if test ! "$ac_qt_bindir" = "NO"; then
154
qt_bindirs="$ac_qt_bindir $qt_bindirs"
157
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
158
if test -z "$UIC_NOT_NEEDED"; then
159
KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
160
if test -z "$UIC" ; then
161
KDE_UIC_ERROR_MESSAGE
165
UIC="echo uic not available: "
172
if test $kde_qtver = 3; then
179
AC_DEFUN(KDE_1_CHECK_PATHS,
181
KDE_1_CHECK_PATH_HEADERS
185
if test -n "$USE_RPATH"; then
187
if test -n "$kde_libraries"; then
188
KDE_TEST_RPATH="-R $kde_libraries"
191
if test -n "$qt_libraries"; then
192
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
195
if test -n "$x_libraries"; then
196
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
199
KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
202
AC_MSG_CHECKING([for KDE libraries installed])
203
ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
205
if AC_TRY_EVAL(ac_link) && test -s conftest; then
208
AC_MSG_ERROR([your system fails at linking a small KDE application!
209
Check, if your compiler is installed correctly and if you have used the
210
same compiler to compile Qt and kdelibs as you did use now.
211
For more details about this problem, look at the end of config.log.])
214
if eval `KDEDIR= ./conftest 2>&5`; then
220
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
221
kde_have_all_paths=yes
223
KDE_SET_PATHS($kde_result)
227
AC_DEFUN(KDE_SET_PATHS,
229
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
230
kde_htmldir=\"$kde_htmldir\" \
231
kde_appsdir=\"$kde_appsdir\" \
232
kde_icondir=\"$kde_icondir\" \
233
kde_sounddir=\"$kde_sounddir\" \
234
kde_datadir=\"$kde_datadir\" \
235
kde_locale=\"$kde_locale\" \
236
kde_cgidir=\"$kde_cgidir\" \
237
kde_confdir=\"$kde_confdir\" \
238
kde_mimedir=\"$kde_mimedir\" \
239
kde_toolbardir=\"$kde_toolbardir\" \
240
kde_wallpaperdir=\"$kde_wallpaperdir\" \
241
kde_templatesdir=\"$kde_templatesdir\" \
242
kde_bindir=\"$kde_bindir\" \
243
kde_servicesdir=\"$kde_servicesdir\" \
244
kde_servicetypesdir=\"$kde_servicetypesdir\" \
245
kde_moduledir=\"$kde_moduledir\" \
246
kde_styledir=\"$kde_styledir\" \
247
kde_widgetdir=\"$kde_widgetdir\" \
251
AC_DEFUN(KDE_SET_DEFAULT_PATHS,
253
if test "$1" = "default"; then
255
if test -z "$kde_htmldir"; then
256
kde_htmldir='\${prefix}/share/doc/HTML'
258
if test -z "$kde_appsdir"; then
259
kde_appsdir='\${prefix}/share/applnk'
261
if test -z "$kde_icondir"; then
262
kde_icondir='\${prefix}/share/icons'
264
if test -z "$kde_sounddir"; then
265
kde_sounddir='\${prefix}/share/sounds'
267
if test -z "$kde_datadir"; then
268
kde_datadir='\${prefix}/share/apps'
270
if test -z "$kde_locale"; then
271
kde_locale='\${prefix}/share/locale'
273
if test -z "$kde_cgidir"; then
274
kde_cgidir='\${exec_prefix}/cgi-bin'
276
if test -z "$kde_confdir"; then
277
kde_confdir='\${prefix}/share/config'
279
if test -z "$kde_mimedir"; then
280
kde_mimedir='\${prefix}/share/mimelnk'
282
if test -z "$kde_toolbardir"; then
283
kde_toolbardir='\${prefix}/share/toolbar'
285
if test -z "$kde_wallpaperdir"; then
286
kde_wallpaperdir='\${prefix}/share/wallpapers'
288
if test -z "$kde_templatesdir"; then
289
kde_templatesdir='\${prefix}/share/templates'
291
if test -z "$kde_bindir"; then
292
kde_bindir='\${exec_prefix}/bin'
294
if test -z "$kde_servicesdir"; then
295
kde_servicesdir='\${prefix}/share/services'
297
if test -z "$kde_servicetypesdir"; then
298
kde_servicetypesdir='\${prefix}/share/servicetypes'
300
if test -z "$kde_moduledir"; then
301
if test $kde_qtver = 2; then
302
kde_moduledir='\${exec_prefix}/lib/kde2'
304
kde_moduledir='\${exec_prefix}/lib/kde3'
307
if test -z "$kde_styledir"; then
308
kde_styledir='\${exec_prefix}/lib/kde3/plugins/styles'
310
if test -z "$kde_widgetdir"; then
311
kde_widgetdir='\${exec_prefix}/lib/kde3/plugins/designer'
314
KDE_SET_PATHS(defaults)
318
if test $kde_qtver = 1; then
319
AC_MSG_RESULT([compiling])
322
AC_MSG_ERROR([path checking not yet supported for KDE 2])
328
AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
329
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
330
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
331
test -z "$kde_datadir" || test -z "$kde_locale" ||
332
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
333
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
334
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
335
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
336
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
337
test -z "$kde_styledir" || test -z "kde_widgetdir"
338
test "$kde_have_all_paths" != "yes"; then
339
kde_have_all_paths=no
343
AC_DEFUN(KDE_MISSING_PROG_ERROR,
345
AC_MSG_ERROR([The important program $1 was not found!
346
Please check whether you installed KDE correctly.
350
AC_DEFUN(KDE_SUBST_PROGRAMS,
353
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"
354
if test -n "$KDEDIRS"; then
357
for dir in $KDEDIRS; do
358
kde_default_bindirs="$dir/bin $kde_default_bindirs "
362
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
363
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
364
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
365
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
366
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
367
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
368
KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
370
if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
371
kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
372
test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
373
AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
374
if test "$KDE_XSL_STYLESHEET" = "NO"; then
375
KDE_XSL_STYLESHEET=""
377
KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
381
DCOP_DEPENDENCIES='$(DCOPIDL)'
383
AC_SUBST(DCOPIDL2CPP)
384
AC_SUBST(DCOP_DEPENDENCIES)
386
AC_SUBST(ARTSCCONFIG)
389
AC_SUBST(KDE_XSL_STYLESHEET)
391
if test -x "$KDECONFIG"; then # it can be "compiled"
392
kde_libs_prefix=`$KDECONFIG --prefix`
393
if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
394
AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
395
This means it has been moved since you installed it.
396
This won't work. Please recompile kdelibs for the new prefix.
399
kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
401
kde_libs_prefix='$(prefix)'
402
kde_libs_htmldir='$(kde_htmldir)'
404
AC_SUBST(kde_libs_prefix)
405
AC_SUBST(kde_libs_htmldir)
408
AC_DEFUN(AC_CREATE_KFSSTND,
410
AC_REQUIRE([AC_CHECK_RPATH])
412
AC_MSG_CHECKING([for KDE paths])
415
AC_CACHE_VAL(kde_cv_all_paths,
417
KDE_SET_DEFAULT_PATHS($1)
420
eval "$kde_cv_all_paths"
421
KDE_CHECK_PATHS_FOR_COMPLETENESS
422
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
423
# wrong values were cached, may be, we can set better ones
425
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
426
kde_datadir= kde_locale= kde_cgidir= kde_confdir=
427
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
428
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
432
KDE_SET_DEFAULT_PATHS($1)
433
eval "$kde_cv_all_paths"
434
KDE_CHECK_PATHS_FOR_COMPLETENESS
435
kde_result="$kde_result (cache overridden)"
437
if test "$kde_have_all_paths" = "no"; then
438
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
439
Since it had compiled and linked before, it must be a strange problem on your system.
440
Look at config.log for details. If you are not able to fix this, look at
441
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
442
(If you're using an egcs version on Linux, you may update binutils!)
446
AC_MSG_RESULT($kde_result)
455
AC_DEFUN(AC_SUBST_KFSSTND,
457
AC_SUBST(kde_htmldir)
458
AC_SUBST(kde_appsdir)
459
AC_SUBST(kde_icondir)
460
AC_SUBST(kde_sounddir)
461
AC_SUBST(kde_datadir)
463
AC_SUBST(kde_confdir)
464
AC_SUBST(kde_mimedir)
465
AC_SUBST(kde_wallpaperdir)
468
AC_SUBST(kde_templatesdir)
469
AC_SUBST(kde_servicesdir)
470
AC_SUBST(kde_servicetypesdir)
471
AC_SUBST(kde_moduledir)
472
AC_SUBST(kde_styledir)
473
AC_SUBST(kde_widgetdir)
474
if test "$kde_qtver" = 1; then
475
kde_minidir="$kde_icondir/mini"
477
# for KDE 1 - this breaks KDE2 apps using minidir, but
478
# that's the plan ;-/
479
kde_minidir="/dev/null"
481
dnl AC_SUBST(kde_minidir)
482
dnl AC_SUBST(kde_cgidir)
483
dnl AC_SUBST(kde_toolbardir)
486
AC_DEFUN(KDE_MISC_TESTS,
489
dnl Checks for libraries.
490
AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
492
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
495
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
496
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
497
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
498
You should install libcrypt from another source or configure with PAM
503
if test $kde_have_crypt = yes; then
504
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
508
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
509
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
510
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
511
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
513
AC_CHECK_FUNC(inet_ntoa)
514
if test $ac_cv_func_inet_ntoa = no; then
515
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
517
AC_CHECK_FUNC(connect)
518
if test $ac_cv_func_connect = no; then
519
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
523
AC_CHECK_FUNC(remove)
524
if test $ac_cv_func_remove = no; then
525
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
528
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
529
AC_CHECK_FUNC(shmat, ,
530
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
532
# Solaris 2.6 and others need -lresolv for res_init
533
AC_CHECK_FUNCS(res_init, , [
534
kde_libs_safe="$LIBS"
535
LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
544
X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
545
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
550
LIBSOCKET="$X_EXTRA_LIBS"
553
AC_SUBST(X_EXTRA_LIBS)
554
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
557
case $host in dnl this *is* LynxOS specific
559
AC_MSG_CHECKING([LynxOS header file wrappers])
560
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
561
AC_MSG_RESULT(disabled)
562
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
570
dnl ------------------------------------------------------------------------
571
dnl Find the header files and libraries for X-Windows. Extended the
573
dnl ------------------------------------------------------------------------
577
AC_REQUIRE([AC_PROG_CPP])dnl
578
AC_REQUIRE([KDE_MISC_TESTS])dnl
582
[ --enable-embedded link to Qt-embedded, don't use X],
583
kde_use_qt_emb=$enableval,
587
if test "$kde_use_qt_emb" = "no"; then
589
AC_MSG_CHECKING(for X)
592
AC_CACHE_VAL(kde_cv_have_x,
593
[# One or both of the vars are not set, and there is no cached value.
594
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
597
kde_x_includes=$x_includes
599
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
602
kde_x_libraries=$x_libraries
605
# below we use the standard autoconf calls
606
ac_x_libraries=$kde_x_libraries
607
ac_x_includes=$kde_x_includes
610
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
611
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
612
dnl location. The correct location is /usr/lib32 or an undefined value
613
dnl (the linker is smart enough to pick the correct default library).
614
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
615
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
616
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
617
dnl x_includes should be left alone.
625
if test -z "$ac_x_includes"; then
628
if test -z "$ac_x_libraries"; then
629
ac_x_libraries="/usr/lib"
632
#from now on we use our own again
634
# when the user already gave --x-includes, we ignore
635
# what the standard autoconf macros told us.
636
if test "$kde_x_includes" = NO; then
637
kde_x_includes=$ac_x_includes
640
# for --x-libraries too
641
if test "$kde_x_libraries" = NO; then
642
kde_x_libraries=$ac_x_libraries
645
if test "$kde_x_includes" = NO; then
646
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
649
if test "$kde_x_libraries" = NO; then
650
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
653
# Record where we found X for the cache.
654
kde_cv_have_x="have_x=yes \
655
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
658
eval "$kde_cv_have_x"
660
if test "$have_x" != yes; then
661
AC_MSG_RESULT($have_x)
664
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
667
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
669
x_includes="."; dnl better than nothing :-
671
x_includes=$kde_x_includes
672
X_INCLUDES="-I$x_includes"
675
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
677
x_libraries="/usr/lib"; dnl better than nothing :-
679
x_libraries=$kde_x_libraries
680
X_LDFLAGS="-L$x_libraries"
682
all_includes="$X_INCLUDES"
683
all_libraries="$X_LDFLAGS"
687
AC_SUBST(x_libraries)
690
# Check for libraries that X11R6 Xt/Xaw programs need.
691
ac_save_LDFLAGS="$LDFLAGS"
692
LDFLAGS="$LDFLAGS $X_LDFLAGS"
693
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
694
# check for ICE first), but we must link in the order -lSM -lICE or
695
# we get undefined symbols. So assume we have SM if we have ICE.
696
# These have to be linked with before -lX11, unlike the other
697
# libraries we check for below, so use a different variable.
698
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
699
AC_CHECK_LIB(ICE, IceConnectionNumber,
700
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
702
LDFLAGS="$ac_save_LDFLAGS"
706
LIB_X11='-lX11 $(LIBSOCKET)'
709
AC_MSG_CHECKING(for libXext)
710
AC_CACHE_VAL(kde_cv_have_libXext,
712
kde_ldflags_safe="$LDFLAGS"
713
kde_libs_safe="$LIBS"
715
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
716
LIBS="-lXext -lX11 $LIBSOCKET"
725
printf("hello Xext\n");
727
kde_cv_have_libXext=yes,
728
kde_cv_have_libXext=no
731
LDFLAGS=$kde_ldflags_safe
735
AC_MSG_RESULT($kde_cv_have_libXext)
737
if test "$kde_cv_have_libXext" = "no"; then
738
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
739
can't find it itself, we stop here assuming that make wouldn't find
743
AC_MSG_CHECKING(for Xinerama)
745
AC_ARG_WITH(xinerama,
746
[ --with-xinerama enable support for Xinerama ],
754
kde_save_LDFLAGS="$LDFLAGS"
755
kde_save_CFLAGS="$CFLAGS"
756
kde_save_LIBS="$LIBS"
757
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
758
CFLAGS="$CFLAGS -I$x_includes"
759
LIBS="-lXinerama -lXext"
761
if test "x$no_xinerama" = "xno"; then
763
AC_CACHE_VAL(ac_cv_have_xinerama,
765
AC_TRY_LINK([#include <X11/Xlib.h>
766
#include <X11/extensions/Xinerama.h>],
767
[XineramaIsActive(NULL);],
768
[ac_cv_have_xinerama="yes"],
769
[ac_cv_have_xinerama="no"])
772
ac_cv_have_xinerama=no;
775
AC_MSG_RESULT($ac_cv_have_xinerama)
779
if test "$ac_cv_have_xinerama" = "yes"; then
780
AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
781
LIBXINERAMA="-lXinerama"
784
AC_SUBST(LIBXINERAMA)
786
LDFLAGS="$kde_save_LDFLAGS"
787
CFLAGS="$kde_save_CFLAGS"
788
LIBS="$kde_save_LIBS"
794
dnl We're using QT Embedded
795
CXXFLAGS="$CXXFLAGS -DQWS"
796
CFLAGS="$CFLAGS -DQWS"
797
LDFLAGS="$LDFLAGS -DQWS"
813
AC_SUBST(x_libraries)
823
AC_DEFUN(KDE_PRINT_QT_PROGRAM,
825
AC_REQUIRE([KDE_USE_QT])
826
cat > conftest.$ac_ext <<EOF
827
#include "confdefs.h"
829
#include <qapplication.h>
831
if test "$kde_qtver" = "2"; then
832
cat >> conftest.$ac_ext <<EOF
838
if test $kde_qtsubver -gt 0; then
839
cat >> conftest.$ac_ext <<EOF
840
#include <qiconview.h>
845
if test "$kde_qtver" = "3"; then
846
cat >> conftest.$ac_ext <<EOF
847
#include <qstylefactory.h>
848
#include <private/qucomextra_p.h>
852
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
853
cat >> conftest.$ac_ext <<EOF
859
if test "$kde_qtver" = "2"; then
860
cat >> conftest.$ac_ext <<EOF
861
QStringList *t = new QStringList();
863
if test $kde_qtsubver -gt 0; then
864
cat >> conftest.$ac_ext <<EOF
866
iv.setWordWrapIconText(false);
868
s.setLatin1("Elvis is alive", 14);
869
int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
873
if test "$kde_qtver" = "3"; then
874
cat >> conftest.$ac_ext <<EOF
875
(void)QStyleFactory::create(QString::null);
878
cat >> conftest.$ac_ext <<EOF
887
if test -z "$1"; then
891
kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
892
# following is the check if subversion isn�t found in passed argument
893
if test "$kde_qtsubver" = "$1"; then
896
kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
897
if test "$kde_qtver" = "1"; then
902
if test -z "$2"; then
903
if test "$kde_qtver" = "2"; then
904
if test $kde_qtsubver -gt 0; then
905
kde_qt_minversion=">= Qt 2.2.2"
907
kde_qt_minversion=">= Qt 2.0.2"
910
if test "$kde_qtver" = "3"; then
911
kde_qt_minversion=">= Qt 3.0.0-beta6"
913
if test "$kde_qtver" = "1"; then
914
kde_qt_minversion=">= 1.42 and < 2.0"
920
if test -z "$3"; then
921
if test $kde_qtver = 3; then
922
kde_qt_verstring="QT_VERSION >= 300"
924
if test $kde_qtver = 2; then
925
if test $kde_qtsubver -gt 0; then
926
kde_qt_verstring="QT_VERSION >= 222"
928
kde_qt_verstring="QT_VERSION >= 200"
931
if test $kde_qtver = 1; then
932
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
938
if test $kde_qtver = 3; then
939
kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
941
if test $kde_qtver = 2; then
942
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
944
if test $kde_qtver = 1; then
945
kde_qt_dirs="$QTDIR /usr/lib/qt"
949
AC_DEFUN(KDE_CHECK_QT_DIRECT,
951
AC_REQUIRE([KDE_USE_QT])
952
AC_MSG_CHECKING([if Qt compiles without flags])
953
AC_CACHE_VAL(kde_cv_qt_direct,
957
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
958
ac_LIBRARY_PATH="$LIBRARY_PATH"
959
ac_cxxflags_safe="$CXXFLAGS"
960
ac_ldflags_safe="$LDFLAGS"
963
CXXFLAGS="$CXXFLAGS -I$qt_includes"
964
LDFLAGS="$LDFLAGS $X_LDFLAGS"
965
if test "x$kde_use_qt_emb" != "xyes"; then
966
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
968
LIBS="$LIBQT $LIBSOCKET"
971
export LD_LIBRARY_PATH
977
if AC_TRY_EVAL(ac_link) && test -s conftest; then
978
kde_cv_qt_direct="yes"
980
kde_cv_qt_direct="no"
981
echo "configure: failed program was:" >&AC_FD_CC
982
cat conftest.$ac_ext >&AC_FD_CC
986
CXXFLAGS="$ac_cxxflags_safe"
987
LDFLAGS="$ac_ldflags_safe"
990
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
991
export LD_LIBRARY_PATH
992
LIBRARY_PATH="$ac_LIBRARY_PATH"
997
if test "$kde_cv_qt_direct" = "yes"; then
1006
dnl ------------------------------------------------------------------------
1007
dnl Try to find the Qt headers and libraries.
1008
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1009
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1010
dnl ------------------------------------------------------------------------
1012
AC_DEFUN(AC_PATH_QT_1_3,
1014
AC_REQUIRE([K_PATH_X])
1015
AC_REQUIRE([KDE_USE_QT])
1017
dnl ------------------------------------------------------------------------
1018
dnl Add configure flag to enable linking to MT version of Qt library.
1019
dnl ------------------------------------------------------------------------
1023
[ --disable-mt link to non-threaded Qt (deprecated)],
1024
kde_use_qt_mt=$enableval,
1026
if test $kde_qtver = 3; then
1036
dnl ------------------------------------------------------------------------
1037
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1038
dnl ------------------------------------------------------------------------
1041
if test "x$kde_use_qt_mt" = "xyes"; then
1043
if test "x$kde_use_threading" = "xyes"; then
1044
CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1045
KDE_MT_LDFLAGS="$USE_THREADS $LIBPTHREAD"
1050
AC_SUBST(KDE_MT_LDFLAGS)
1052
kde_qt_was_given=yes
1054
dnl ------------------------------------------------------------------------
1055
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1056
dnl ------------------------------------------------------------------------
1057
if test -z "$LIBQT_GLOB"; then
1058
if test "x$kde_use_qt_emb" = "xyes"; then
1059
LIBQT_GLOB="libqte.*"
1061
LIBQT_GLOB="libqt.*"
1065
if test -z "$LIBQT"; then
1066
dnl ------------------------------------------------------------
1067
dnl If we got --enable-embedded then adjust the Qt library name.
1068
dnl ------------------------------------------------------------
1069
if test "x$kde_use_qt_emb" = "xyes"; then
1076
kde_int_qt="-l$qtlib"
1079
dnl ------------------------------------------------------------------------
1080
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1081
dnl ------------------------------------------------------------------------
1083
if test "x$kde_use_qt_mt" = "xyes"; then
1085
kde_int_qt="-l$qtlib-mt"
1086
LIBQT_GLOB="lib$qtlib-mt.*"
1087
USING_QT_MT="using -mt"
1090
if test $kde_qtver != 1; then
1092
AC_REQUIRE([AC_FIND_PNG])
1093
AC_REQUIRE([AC_FIND_JPEG])
1094
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1097
AC_MSG_CHECKING([for Qt])
1099
if test "x$kde_use_qt_emb" != "xyes"; then
1100
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1102
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1106
[ --with-qt-dir=DIR where the root of Qt is installed ],
1107
[ ac_qt_includes="$withval"/include
1108
ac_qt_libraries="$withval"/lib
1109
ac_qt_bindir="$withval"/bin
1112
AC_ARG_WITH(qt-includes,
1113
[ --with-qt-includes=DIR where the Qt includes are. ],
1115
ac_qt_includes="$withval"
1118
kde_qt_libs_given=no
1120
AC_ARG_WITH(qt-libraries,
1121
[ --with-qt-libraries=DIR where the Qt library is installed.],
1122
[ ac_qt_libraries="$withval"
1123
kde_qt_libs_given=yes
1126
AC_CACHE_VAL(ac_cv_have_qt,
1127
[#try to guess Qt locations
1130
for dir in $kde_qt_dirs; do
1131
qt_incdirs="$qt_incdirs $dir/include $dir"
1133
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes"
1134
if test ! "$ac_qt_includes" = "NO"; then
1135
qt_incdirs="$ac_qt_includes $qt_incdirs"
1138
if test "$kde_qtver" != "1"; then
1139
kde_qt_header=qstyle.h
1141
kde_qt_header=qglobal.h
1144
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1145
ac_qt_includes="$qt_incdir"
1148
for dir in $kde_qt_dirs; do
1149
qt_libdirs="$qt_libdirs $dir/lib $dir"
1151
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1152
if test ! "$ac_qt_libraries" = "NO"; then
1153
qt_libdir=$ac_qt_libraries
1155
qt_libdirs="$ac_qt_libraries $qt_libdirs"
1156
# if the Qt was given, the chance is too big that libqt.* doesn't exist
1158
for dir in $qt_libdirs; do
1159
try="ls -1 $dir/${LIBQT_GLOB}"
1160
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1164
ac_qt_libraries="$qt_libdir"
1169
ac_cxxflags_safe="$CXXFLAGS"
1170
ac_ldflags_safe="$LDFLAGS"
1171
ac_libs_safe="$LIBS"
1173
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1174
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1177
KDE_PRINT_QT_PROGRAM
1179
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1182
echo "configure: failed program was:" >&AC_FD_CC
1183
cat conftest.$ac_ext >&AC_FD_CC
1184
ac_qt_libraries="NO"
1187
CXXFLAGS="$ac_cxxflags_safe"
1188
LDFLAGS="$ac_ldflags_safe"
1189
LIBS="$ac_libs_safe"
1192
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1193
ac_cv_have_qt="have_qt=no"
1195
if test "$ac_qt_includes" = NO; then
1196
if test "$ac_qt_libraries" = NO; then
1197
ac_qt_notfound="(headers and libraries)";
1199
ac_qt_notfound="(headers)";
1202
ac_qt_notfound="(libraries)";
1205
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1206
For more details about this problem, look at the end of config.log.])
1212
eval "$ac_cv_have_qt"
1214
if test "$have_qt" != yes; then
1215
AC_MSG_RESULT([$have_qt]);
1217
ac_cv_have_qt="have_qt=yes \
1218
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1219
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1221
qt_libraries="$ac_qt_libraries"
1222
qt_includes="$ac_qt_includes"
1225
if test ! "$kde_qt_libs_given" = "yes"; then
1226
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1229
AC_SUBST(qt_libraries)
1230
AC_SUBST(qt_includes)
1232
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1235
QT_INCLUDES="-I$qt_includes"
1236
all_includes="$QT_INCLUDES $all_includes"
1239
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1242
QT_LDFLAGS="-L$qt_libraries"
1243
all_libraries="$all_libraries $QT_LDFLAGS"
1245
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1247
AC_SUBST(QT_INCLUDES)
1248
AC_SUBST(QT_LDFLAGS)
1251
if test "x$kde_use_qt_emb" != "xyes"; then
1252
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
1254
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG)'
1261
AC_DEFUN(AC_PATH_QT,
1266
AC_DEFUN(KDE_CHECK_FINAL,
1268
AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1269
kde_use_final=$enableval, kde_use_final=no)
1272
if test "x$kde_use_final" = "xyes"; then
1273
KDE_USE_FINAL_TRUE=""
1274
KDE_USE_FINAL_FALSE="#"
1276
KDE_USE_FINAL_TRUE="#"
1277
KDE_USE_FINAL_FALSE=""
1279
AC_SUBST(KDE_USE_FINAL_TRUE)
1280
AC_SUBST(KDE_USE_FINAL_FALSE)
1282
AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
1283
kde_use_closure=$enableval, kde_use_closure=yes)
1285
if test "x$kde_use_closure" = "xyes"; then
1286
KDE_USE_CLOSURE_TRUE=""
1287
KDE_USE_CLOSURE_FALSE="#"
1288
# CXXFLAGS="$CXXFLAGS $REPO"
1290
KDE_USE_CLOSURE_TRUE="#"
1291
KDE_USE_CLOSURE_FALSE=""
1293
AC_SUBST(KDE_USE_CLOSURE_TRUE)
1294
AC_SUBST(KDE_USE_CLOSURE_FALSE)
1297
dnl ------------------------------------------------------------------------
1298
dnl Now, the same with KDE
1299
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1300
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1301
dnl ------------------------------------------------------------------------
1303
AC_DEFUN(AC_BASE_PATH_KDE,
1306
AC_REQUIRE([AC_PATH_QT])dnl
1308
AC_MSG_CHECKING([for KDE])
1310
if test "${prefix}" != NONE; then
1311
kde_includes=${prefix}/include
1312
ac_kde_includes=$prefix/include
1314
if test "${exec_prefix}" != NONE; then
1315
kde_libraries=${exec_prefix}/lib
1316
ac_kde_libraries=$exec_prefix/lib
1318
kde_libraries=${prefix}/lib
1319
ac_kde_libraries=$prefix/lib
1328
AC_CACHE_VAL(ac_cv_have_kde,
1329
[#try to guess kde locations
1331
if test "$kde_qtver" = 1; then
1332
kde_check_header="ksock.h"
1333
kde_check_lib="libkdecore.la"
1335
kde_check_header="ksharedptr.h"
1336
kde_check_lib="libkio.la"
1339
if test -z "$1"; then
1341
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
1342
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1343
kde_incdirs="$ac_kde_includes $kde_incdirs"
1344
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1345
ac_kde_includes="$kde_incdir"
1347
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1349
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1350
So, check this please and use another prefix!])
1353
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
1354
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
1355
kde_libdirs="$ac_kde_libraries $kde_libdirs"
1356
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1357
ac_kde_libraries="$kde_libdir"
1359
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1361
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1362
So, check this please and use another prefix!])
1364
ac_kde_libraries="$kde_libdir"
1366
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
1367
ac_cv_have_kde="have_kde=no"
1369
ac_cv_have_kde="have_kde=yes \
1370
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1375
ac_cv_have_kde="have_kde=no"
1380
eval "$ac_cv_have_kde"
1382
if test "$have_kde" != "yes"; then
1383
if test "${prefix}" = NONE; then
1384
ac_kde_prefix="$ac_default_prefix"
1386
ac_kde_prefix="$prefix"
1388
if test "$exec_prefix" = NONE; then
1389
ac_kde_exec_prefix="$ac_kde_prefix"
1390
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1392
ac_kde_exec_prefix="$exec_prefix"
1393
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1396
kde_libraries="${ac_kde_exec_prefix}/lib"
1397
kde_includes=${ac_kde_prefix}/include
1400
ac_cv_have_kde="have_kde=yes \
1401
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1402
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1404
kde_libraries="$ac_kde_libraries"
1405
kde_includes="$ac_kde_includes"
1407
AC_SUBST(kde_libraries)
1408
AC_SUBST(kde_includes)
1410
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1413
KDE_INCLUDES="-I$kde_includes"
1414
all_includes="$KDE_INCLUDES $all_includes"
1417
KDE_LDFLAGS="-L$kde_libraries"
1418
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1419
all_libraries="$all_libraries $KDE_LDFLAGS"
1422
AC_SUBST(KDE_LDFLAGS)
1423
AC_SUBST(KDE_INCLUDES)
1425
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1427
all_libraries="$all_libraries $USER_LDFLAGS"
1428
all_includes="$all_includes $USER_INCLUDES"
1429
AC_SUBST(all_includes)
1430
AC_SUBST(all_libraries)
1435
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1437
AC_MSG_CHECKING(for extra includes)
1438
AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1439
adds non standard include paths],
1440
kde_use_extra_includes="$withval",
1441
kde_use_extra_includes=NONE
1444
if test -n "$kde_use_extra_includes" && \
1445
test "$kde_use_extra_includes" != "NONE"; then
1449
for dir in $kde_use_extra_includes; do
1450
kde_extra_includes="$kde_extra_includes $dir"
1451
USER_INCLUDES="$USER_INCLUDES -I$dir"
1454
kde_use_extra_includes="added"
1456
kde_use_extra_includes="no"
1458
AC_SUBST(USER_INCLUDES)
1460
AC_MSG_RESULT($kde_use_extra_includes)
1463
AC_MSG_CHECKING(for extra libs)
1464
AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1465
kde_use_extra_libs=$withval,
1466
kde_use_extra_libs=NONE
1468
if test -n "$kde_use_extra_libs" && \
1469
test "$kde_use_extra_libs" != "NONE"; then
1473
for dir in $kde_use_extra_libs; do
1474
kde_extra_libs="$kde_extra_libs $dir"
1475
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1476
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1479
kde_use_extra_libs="added"
1481
kde_use_extra_libs="no"
1484
AC_SUBST(USER_LDFLAGS)
1486
AC_MSG_RESULT($kde_use_extra_libs)
1490
AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1492
AC_MSG_CHECKING([for KDE headers installed])
1495
cat > conftest.$ac_ext <<EOF
1497
# include <stdlib.h>
1500
#include "confdefs.h"
1504
printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1505
printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1506
printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1507
printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1508
printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1509
printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1510
printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1511
printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1512
printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1513
printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1514
printf("kde_wallpaperdir=\\"%s\\"\n",
1515
KApplication::kde_wallpaperdir().data());
1516
printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1517
printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1518
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1519
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1520
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1521
printf("kde_styledir=\\"/tmp/dummy\\"\n");
1522
printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1527
ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1528
if AC_TRY_EVAL(ac_compile); then
1531
AC_MSG_ERROR([your system is not able to compile a small KDE application!
1532
Check, if you installed the KDE header files correctly.
1533
For more details about this problem, look at the end of config.log.])
1539
AC_DEFUN(KDE_CHECK_KDEQTADDON,
1541
AC_MSG_CHECKING(for kde-qt-addon)
1542
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1544
kde_ldflags_safe="$LDFLAGS"
1545
kde_libs_safe="$LIBS"
1546
kde_cxxflags_safe="$CXXFLAGS"
1548
LIBS="-lkde-qt-addon $LIBQT $LIBS"
1549
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1550
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1558
kde_cv_have_kdeqtaddon=yes,
1559
kde_cv_have_kdeqtaddon=no
1562
LDFLAGS=$kde_ldflags_safe
1564
kde_cxxflags_safe="$CXXFLAGS"
1567
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1569
if test "$kde_cv_have_kdeqtaddon" = "no"; then
1570
AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1571
It is a separate package (and CVS module) named kde-qt-addon.])
1575
AC_DEFUN(KDE_CHECK_KIMGIO,
1577
AC_REQUIRE([AC_BASE_PATH_KDE])
1578
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1579
AC_REQUIRE([AC_FIND_TIFF])
1580
AC_REQUIRE([AC_FIND_JPEG])
1581
AC_REQUIRE([AC_FIND_PNG])
1582
AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1584
if test "$1" = "existance"; then
1587
kde_save_LIBS="$LIBS"
1588
LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1589
AC_CHECK_LIB(kimgio, kimgioRegister, [
1590
LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1591
LIBS="$kde_save_LIBS"
1594
LIBKIMGIO_EXISTS=yes
1597
if test "$LIBKIMGIO_EXISTS" = "yes"; then
1598
LIB_KIMGIO='-lkimgio'
1602
AC_SUBST(LIB_KIMGIO)
1605
AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1607
AC_REQUIRE([KDE_MISC_TESTS])
1608
AC_REQUIRE([KDE_CHECK_LIBDL])
1609
AC_REQUIRE([K_PATH_X])
1611
if test $kde_qtver != 1; then
1612
LIB_KDECORE='-lkdecore'
1613
AC_SUBST(LIB_KDECORE)
1618
LIB_KSYCOCA='-lksycoca'
1619
AC_SUBST(LIB_KSYCOCA)
1628
LIB_KSPELL='-lkspell'
1629
AC_SUBST(LIB_KSPELL)
1630
LIB_KPARTS='-lkparts'
1631
AC_SUBST(LIB_KPARTS)
1632
LIB_KWRITE='-lkwrite'
1633
AC_SUBST(LIB_KWRITE)
1635
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1636
AC_SUBST(LIB_KDECORE)
1637
LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1639
LIB_KFM='-lkfm $(LIB_KDECORE)'
1641
LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1643
LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1648
AC_DEFUN(AC_PATH_KDE,
1651
AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1653
if test "$enableval" = "no";
1654
then ac_use_path_checking="default"
1655
else ac_use_path_checking=""
1659
if test "$kde_qtver" = 1;
1660
then ac_use_path_checking=""
1661
else ac_use_path_checking="default"
1666
AC_CREATE_KFSSTND($ac_use_path_checking)
1669
KDE_CREATE_LIBS_ALIASES
1673
AC_DEFUN(AC_CHECK_SETENV,
1675
AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
1676
AC_CHECK_FUNCS([setenv unsetenv])
1679
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1681
AC_MSG_CHECKING(for getdomainname)
1682
AC_CACHE_VAL(ac_cv_func_getdomainname,
1686
save_CXXFLAGS="$CXXFLAGS"
1687
kde_safe_LIBS="$LIBS"
1688
LIBS="$LIBS $X_EXTRA_LIBS"
1689
if test "$GCC" = "yes"; then
1690
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1698
getdomainname(buffer, 200);
1700
ac_cv_func_getdomainname=yes,
1701
ac_cv_func_getdomainname=no)
1702
CXXFLAGS="$save_CXXFLAGS"
1706
AC_MSG_RESULT($ac_cv_func_getdomainname)
1708
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1709
AC_CACHE_VAL(ac_cv_proto_getdomainname,
1713
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1714
ac_cv_proto_getdomainname=no
1717
LIBS="$LIBS $X_EXTRA_LIBS"
1722
extern "C" int getdomainname (char *, int);
1726
getdomainname(buffer, 200);
1728
ac_cv_func_getdomainname=yes
1729
ac_cv_proto_getdomainname=yes,
1730
AC_MSG_RESULT([fatal error])
1731
AC_MSG_ERROR([getdomainname unavailable]))
1736
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1738
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1739
AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1741
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1742
AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1743
[Define if you have getdomainname prototype])
1748
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1751
AC_MSG_CHECKING([for gethostname])
1752
AC_CACHE_VAL(ac_cv_func_gethostname,
1756
save_CXXFLAGS="$CXXFLAGS"
1757
if test "$GCC" = "yes"; then
1758
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1766
gethostname(buffer, 200);
1768
ac_cv_func_gethostname=yes,
1769
ac_cv_func_gethostname=no)
1770
CXXFLAGS="$save_CXXFLAGS"
1773
AC_MSG_RESULT($ac_cv_func_gethostname)
1775
AC_MSG_CHECKING([if gethostname needs custom prototype])
1776
AC_CACHE_VAL(ac_cv_proto_gethostname,
1780
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1781
ac_cv_proto_gethostname=no
1787
extern "C" int gethostname (char *, int);
1791
gethostname(buffer, 200);
1793
ac_cv_func_gethostname=yes
1794
ac_cv_proto_gethostname=yes,
1795
AC_MSG_RESULT([fatal error])
1796
AC_MSG_ERROR(gethostname unavailable))
1800
AC_MSG_RESULT($ac_cv_proto_gethostname)
1802
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
1803
AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
1804
[Define if you have gethostname prototype])
1806
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1807
AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
1811
AC_DEFUN(AC_CHECK_USLEEP,
1813
AC_MSG_CHECKING([for usleep])
1814
AC_CACHE_VAL(ac_cv_func_usleep,
1818
ac_libs_safe="$LIBS"
1819
LIBS="$LIBS $LIBUCB"
1827
ac_cv_func_usleep=yes,
1828
ac_cv_func_usleep=no)
1829
LIBS="$ac_libs_safe"
1832
AC_MSG_RESULT($ac_cv_func_usleep)
1833
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1834
AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1838
AC_DEFUN(AC_CHECK_RANDOM,
1840
AC_MSG_CHECKING([for random])
1841
AC_CACHE_VAL(ac_cv_func_random,
1845
ac_libs_safe="$LIBS"
1846
LIBS="$LIBS $LIBUCB"
1853
ac_cv_func_random=yes,
1854
ac_cv_func_random=no)
1855
LIBS="$ac_libs_safe"
1858
AC_MSG_RESULT($ac_cv_func_random)
1859
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1860
AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1864
AC_DEFUN(AC_FIND_GIF,
1865
[AC_MSG_CHECKING([for giflib])
1866
AC_CACHE_VAL(ac_cv_lib_gif,
1867
[ac_save_LIBS="$LIBS"
1868
if test "x$kde_use_qt_emb" != "xyes"; then
1869
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1871
LIBS="$all_libraries -lgif"
1878
int GifLastError(void);
1882
/* We use char because int might match the return type of a gcc2
1883
builtin and then its argument prototype would still apply. */
1885
[return GifLastError();],
1886
eval "ac_cv_lib_gif=yes",
1887
eval "ac_cv_lib_gif=no")
1888
LIBS="$ac_save_LIBS"
1890
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1892
AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
1894
AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1898
AC_DEFUN(KDE_FIND_JPEG_HELPER,
1900
AC_MSG_CHECKING([for libjpeg$2])
1901
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1904
ac_save_LIBS="$LIBS"
1905
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
1906
ac_save_CFLAGS="$CFLAGS"
1907
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1909
[/* Override any gcc2 internal prototype to avoid an error. */
1910
struct jpeg_decompress_struct;
1911
typedef struct jpeg_decompress_struct * j_decompress_ptr;
1916
void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1917
int version, size_t structsize);
1921
/* We use char because int might match the return type of a gcc2
1922
builtin and then its argument prototype would still apply. */
1924
[jpeg_CreateDecompress(0L, 0, 0);],
1925
eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1926
eval "ac_cv_lib_jpeg_$1=no")
1927
LIBS="$ac_save_LIBS"
1928
CFLAGS="$ac_save_CFLAGS"
1931
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1932
LIBJPEG="$ac_cv_lib_jpeg_$1"
1933
AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1941
AC_DEFUN(AC_FIND_JPEG,
1943
dnl first look for libraries
1944
KDE_FIND_JPEG_HELPER(6b, 6b,
1945
KDE_FIND_JPEG_HELPER(normal, [],
1952
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
1953
dnl requires system dependent includes loaded before it)
1954
jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
1955
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
1956
test "x$jpeg_incdir" = xNO && jpeg_incdir=
1958
dnl if headers _and_ libraries are missing, this is no error, and we
1959
dnl continue with a warning (the user will get no jpeg support in khtml)
1960
dnl if only one is missing, it means a configuration error, but we still
1962
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
1963
AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
1965
if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
1967
There is an installation error in jpeg support. You seem to have only one
1968
of either the headers _or_ the libraries installed. You may need to either
1969
provide correct --with-extra-... options, or the development package of
1970
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
1971
Disabling JPEG support.
1974
AC_MSG_WARN([libjpeg not found. disable JPEG support.])
1983
AC_DEFUN(AC_FIND_ZLIB,
1985
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1986
AC_MSG_CHECKING([for libz])
1987
AC_CACHE_VAL(ac_cv_lib_z,
1990
kde_save_LIBS="$LIBS"
1991
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
1992
kde_save_CFLAGS="$CFLAGS"
1993
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1998
[return (zlibVersion() == ZLIB_VERSION); ],
1999
eval "ac_cv_lib_z='-lz'",
2000
eval "ac_cv_lib_z=no")
2001
LIBS="$kde_save_LIBS"
2002
CFLAGS="$kde_save_CFLAGS"
2004
if test ! "$ac_cv_lib_z" = no; then
2005
AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2008
AC_MSG_RESULT($ac_cv_lib_z)
2010
AC_MSG_ERROR(not found. Check your installation and look into config.log)
2016
AC_DEFUN(KDE_TRY_TIFFLIB,
2018
AC_MSG_CHECKING([for libtiff $1])
2020
AC_CACHE_VAL(kde_cv_libtiff_$1,
2024
kde_save_LIBS="$LIBS"
2025
if test "x$kde_use_qt_emb" != "xyes"; then
2026
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2028
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2030
kde_save_CXXFLAGS="$CXXFLAGS"
2031
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2037
[return (TIFFOpen( "", "r") == 0); ],
2039
kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2041
kde_cv_libtiff_$1=no
2044
LIBS="$kde_save_LIBS"
2045
CXXFLAGS="$kde_save_CXXFLAGS"
2049
if test "$kde_cv_libtiff_$1" = "no"; then
2054
LIBTIFF="$kde_cv_libtiff_$1"
2056
AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2062
AC_DEFUN(AC_FIND_TIFF,
2064
AC_REQUIRE([K_PATH_X])
2065
AC_REQUIRE([AC_FIND_ZLIB])
2066
AC_REQUIRE([AC_FIND_JPEG])
2067
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2069
KDE_TRY_TIFFLIB(tiff, [],
2070
KDE_TRY_TIFFLIB(tiff34))
2076
AC_DEFUN(AC_FIND_PNG,
2078
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2079
AC_REQUIRE([AC_FIND_ZLIB])
2080
AC_MSG_CHECKING([for libpng])
2081
AC_CACHE_VAL(ac_cv_lib_png,
2083
kde_save_LIBS="$LIBS"
2084
if test "x$kde_use_qt_emb" != "xyes"; then
2085
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2087
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2089
kde_save_CFLAGS="$CFLAGS"
2090
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2097
png_structp png_ptr = png_create_read_struct( /* image ptr */
2098
PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2099
return( png_ptr != 0 );
2101
eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2102
eval "ac_cv_lib_png=no"
2104
LIBS="$kde_save_LIBS"
2105
CFLAGS="$kde_save_CFLAGS"
2107
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2108
AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2109
LIBPNG="$ac_cv_lib_png"
2111
AC_MSG_RESULT($ac_cv_lib_png)
2119
AC_DEFUN(AC_CHECK_BOOL,
2121
AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2124
AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2126
AC_MSG_CHECKING(if you need GNU extensions)
2127
AC_CACHE_VAL(ac_cv_gnu_extensions,
2129
cat > conftest.c << EOF
2130
#include <features.h>
2132
#ifdef __GNU_LIBRARY__
2137
if (eval "$ac_cpp conftest.c") 2>&5 |
2138
egrep "yes" >/dev/null 2>&1; then
2140
ac_cv_gnu_extensions=yes
2142
ac_cv_gnu_extensions=no
2146
AC_MSG_RESULT($ac_cv_gnu_extensions)
2147
if test "$ac_cv_gnu_extensions" = "yes"; then
2148
AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2152
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2154
dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
2155
AC_MSG_CHECKING(whether $CXX supports -$1)
2156
kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
2157
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2159
echo 'int main() { return 0; }' >conftest.cc
2160
eval "kde_cv_prog_cxx_$kde_cache=no"
2161
if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
2162
if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
2163
eval "kde_cv_prog_cxx_$kde_cache=yes"
2168
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2179
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2180
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2181
dnl it's all white-space separated
2182
AC_DEFUN(AC_REMOVE_FORBIDDEN,
2185
if test -n "$__val"; then
2191
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2192
*) # Careful to not add spaces, where there were none, because otherwise
2193
# libtool gets confused, if we change e.g. CXX
2194
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2202
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2203
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2205
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2206
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2209
AC_DEFUN(AC_CHECK_COMPILERS,
2211
AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
2213
if test $enableval = "no"; dnl
2215
kde_use_debug_code="no"
2216
kde_use_debug_define=yes
2218
kde_use_debug_code="yes"
2219
kde_use_debug_define=no
2222
[kde_use_debug_code="no"
2223
kde_use_debug_define=no
2226
dnl Just for configure --help
2227
AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2229
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2231
if test $enableval = "no"; then
2232
kde_use_strict_options="no"
2234
kde_use_strict_options="yes"
2236
], [kde_use_strict_options="no"])
2238
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2239
[kde_use_profiling=$enableval],
2240
[kde_use_profiling="no"]
2243
dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2248
if test "$GCC" = "yes"; then
2249
if test "$kde_use_debug_code" = "yes"; then
2250
CFLAGS="-g -O2 $CFLAGS"
2253
CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2257
CFLAGS="-O2 $CFLAGS"
2261
if test "$kde_use_debug_define" = "yes"; then
2262
CFLAGS="-DNDEBUG $CFLAGS"
2266
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2267
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2270
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2274
CXXFLAGS=" $CXXFLAGS"
2278
if test "$GXX" = "yes"; then
2279
if test "$kde_use_debug_code" = "yes"; then
2280
CXXFLAGS="-g -O2 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2282
KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2283
KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2284
KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2288
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
2292
if test "$kde_use_strict_options" = "yes"; then
2293
CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
2296
if test "$kde_very_strict" = "yes"; then
2297
CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
2300
CXXFLAGS="-O2 $CXXFLAGS"
2304
if test "$kde_use_debug_define" = "yes"; then
2305
CXXFLAGS="-DNDEBUG $CXXFLAGS"
2308
if test "$kde_use_profiling" = "yes"; then
2309
KDE_CHECK_COMPILER_FLAG(pg,
2311
CFLAGS="-pg $CFLAGS"
2312
CXXFLAGS="-pg $CXXFLAGS"
2316
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2317
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2318
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
2319
AC_SUBST(USE_EXCEPTIONS)
2320
dnl obsolete macro - provided to keep things going
2325
*-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
2326
*-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
2327
*-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
2329
if test "$GXX" = yes; then
2330
libstdcpp=`$CXX -print-file-name=libstdc++.so`
2331
if test ! -f $libstdcpp; then
2332
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])
2338
AC_VALIDIFY_CXXFLAGS
2342
# the following is to allow programs, that are known to
2343
# have problems when compiled with -O2
2344
if test -n "$CXXFLAGS"; then
2348
for i in $CXXFLAGS; do
2353
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
2360
if test "x$kde_use_qt_emb" = "xyes"; then
2361
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS -DQWS"
2364
AC_SUBST(NOOPT_CXXFLAGS)
2368
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2371
AC_SUBST(KDE_CXXFLAGS)
2374
AC_DEFUN(KDE_ADD_DEPENDENCIES,
2376
[A]M_DEPENDENCIES(CC)
2377
[A]M_DEPENDENCIES(CXX)
2380
dnl just a wrapper to clean up configure.in
2381
AC_DEFUN(KDE_PROG_LIBTOOL,
2383
AC_REQUIRE([AC_CHECK_COMPILERS])
2384
AC_REQUIRE([AC_ENABLE_SHARED])
2385
AC_REQUIRE([AC_ENABLE_STATIC])
2387
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2398
LIBTOOL_SHELL="/bin/sh ./libtool"
2399
# LIBTOOL="$LIBTOOL --silent"
2400
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
2401
AC_SUBST(KDE_PLUGIN)
2404
AC_DEFUN(KDE_CHECK_TYPES,
2405
[ AC_CHECK_SIZEOF(int, 4)dnl
2406
AC_CHECK_SIZEOF(long, 4)dnl
2407
AC_CHECK_SIZEOF(char *, 4)dnl
2408
AC_CHECK_SIZEOF(char, 1)dnl
2411
AC_DEFUN(KDE_DO_IT_ALL,
2415
AM_INIT_AUTOMAKE($1, $2)
2416
AM_DISABLE_LIBRARIES
2417
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
2424
AC_DEFUN(AC_CHECK_RPATH,
2426
AC_MSG_CHECKING(for rpath)
2427
AC_ARG_ENABLE(rpath,
2428
[ --disable-rpath do not use the rpath feature of ld],
2429
USE_RPATH=$enableval, USE_RPATH=yes)
2431
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
2433
KDE_RPATH="-R \$(kde_libraries)"
2435
if test -n "$qt_libraries"; then
2436
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
2438
dnl $x_libraries is set to /usr/lib in case
2439
if test -n "$X_LDFLAGS"; then
2440
KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
2442
if test -n "$KDE_EXTRA_RPATH"; then
2443
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
2446
AC_SUBST(KDE_EXTRA_RPATH)
2448
AC_MSG_RESULT($USE_RPATH)
2451
dnl Check for the type of the third argument of getsockname
2452
AC_DEFUN(AC_CHECK_SOCKLEN_T, [
2453
AC_MSG_CHECKING(for socklen_t)
2454
AC_CACHE_VAL(ac_cv_socklen_t, [
2458
#include <sys/types.h>
2459
#include <sys/socket.h>
2462
getsockname(0,(struct sockaddr*)0, &a);
2464
ac_cv_socklen_t=socklen_t,
2466
#include <sys/types.h>
2467
#include <sys/socket.h>
2470
getsockname(0,(struct sockaddr*)0, &a);
2472
ac_cv_socklen_t=int,
2473
ac_cv_socklen_t=size_t
2479
AC_MSG_RESULT($ac_cv_socklen_t)
2480
if test "$ac_cv_socklen_t" != "socklen_t"; then
2481
AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
2482
[Define the real type of socklen_t])
2484
AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
2488
dnl This is a merge of some macros out of the gettext aclocal.m4
2489
dnl since we don't need anything, I took the things we need
2490
dnl the copyright for them is:
2492
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2493
dnl This Makefile.in is free software; the Free Software Foundation
2494
dnl gives unlimited permission to copy and/or distribute it,
2495
dnl with or without modifications, as long as this notice is preserved.
2497
dnl This program is distributed in the hope that it will be useful,
2498
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2499
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2500
dnl PARTICULAR PURPOSE.
2502
dnl for this file it is relicensed under LGPL
2504
AC_DEFUN(AM_KDE_WITH_NLS,
2506
dnl If we use NLS figure out what method
2508
AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
2509
[test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
2510
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2512
if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
2513
AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
2520
AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
2521
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2523
dnl Test whether we really found GNU xgettext.
2524
if test "$XGETTEXT" != ":"; then
2525
dnl If it is no GNU xgettext we define it as : so that the
2526
dnl Makefiles still can work.
2527
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2531
[found xgettext programs is not GNU xgettext; ignore it])
2539
# Search path for a program which passes the given test.
2540
# Ulrich Drepper <drepper@cygnus.com>, 1996.
2543
# Stephan Kulow: I appended a _KDE against name conflicts
2545
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
2546
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2547
AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
2548
[# Extract the first word of "$2", so it can be a program name with args.
2549
set dummy $2; ac_word=[$]2
2550
AC_MSG_CHECKING([for $ac_word])
2551
AC_CACHE_VAL(ac_cv_path_$1,
2554
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2557
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2558
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2559
test -z "$ac_dir" && ac_dir=.
2560
if test -f $ac_dir/$ac_word; then
2562
ac_cv_path_$1="$ac_dir/$ac_word"
2568
dnl If no 4th arg is given, leave the cache variable unset,
2569
dnl so AC_PATH_PROGS will keep looking.
2570
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2575
if test -n "[$]$1"; then
2576
AC_MSG_RESULT([$]$1)
2584
# Check whether LC_MESSAGES is available in <locale.h>.
2585
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2589
AC_DEFUN(AM_LC_MESSAGES,
2590
[if test $ac_cv_header_locale_h = yes; then
2591
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2592
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2593
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2594
if test $am_cv_val_LC_MESSAGES = yes; then
2595
AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2599
dnl From Jim Meyering.
2600
dnl FIXME: migrate into libit.
2602
AC_DEFUN([AM_FUNC_OBSTACK],
2603
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
2604
[AC_TRY_LINK([#include "obstack.h"],
2605
[struct obstack *mem;obstack_free(mem,(char *) 0)],
2606
am_cv_func_obstack=yes,
2607
am_cv_func_obstack=no)])
2608
if test $am_cv_func_obstack = yes; then
2609
AC_DEFINE(HAVE_OBSTACK)
2611
LIBOBJS="$LIBOBJS obstack.o"
2615
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
2616
dnl FIXME: Migrate into libit
2618
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
2619
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
2620
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
2621
am_cv_lib_error_at_line=yes,
2622
am_cv_lib_error_at_line=no)])
2623
if test $am_cv_lib_error_at_line = no; then
2624
LIBOBJS="$LIBOBJS error.o"
2626
AC_SUBST(LIBOBJS)dnl
2629
# Macro to add for using GNU gettext.
2630
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2633
# Stephan Kulow: I put a KDE in it to avoid name conflicts
2635
AC_DEFUN(AM_KDE_GNU_GETTEXT,
2636
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2637
AC_REQUIRE([AC_PROG_RANLIB])dnl
2638
AC_REQUIRE([AC_HEADER_STDC])dnl
2639
AC_REQUIRE([AC_TYPE_OFF_T])dnl
2640
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2641
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2642
AC_REQUIRE([AC_FUNC_MMAP])dnl
2643
AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2644
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
2645
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2646
__argz_count __argz_stringify __argz_next])
2648
AC_MSG_CHECKING(for stpcpy)
2649
AC_CACHE_VAL(kde_cv_func_stpcpy,
2651
kde_safe_cxxflags=$CXXFLAGS
2652
CXXFLAGS="-Wmissing-prototypes -Werror"
2660
stpcpy(buffer, buffer);
2662
kde_cv_func_stpcpy=yes,
2663
kde_cv_func_stpcpy=no)
2665
CXXFLAGS=$kde_safe_cxxflags
2667
AC_MSG_RESULT($kde_cv_func_stpcpy)
2668
if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
2669
AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
2674
if test "x$CATOBJEXT" != "x"; then
2675
if test "x$ALL_LINGUAS" = "x"; then
2678
AC_MSG_CHECKING(for catalogs to be installed)
2680
for lang in ${LINGUAS=$ALL_LINGUAS}; do
2681
case "$ALL_LINGUAS" in
2682
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2685
LINGUAS=$NEW_LINGUAS
2686
AC_MSG_RESULT($LINGUAS)
2689
dnl Construct list of names of catalog files to be constructed.
2690
if test -n "$LINGUAS"; then
2691
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2697
AC_DEFUN(AC_HAVE_XPM,
2698
[AC_REQUIRE_CPP()dnl
2699
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2701
test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
2702
test -z "$XPM_INCLUDE" && XPM_INCLUDE=
2704
AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
2705
xpm_test=$withval, xpm_test="yes")
2706
if test "x$xpm_test" = xno; then
2709
AC_MSG_CHECKING(for XPM)
2710
AC_CACHE_VAL(ac_cv_have_xpm,
2713
ac_save_ldflags="$LDFLAGS"
2714
ac_save_cflags="$CFLAGS"
2715
if test "x$kde_use_qt_emb" != "xyes"; then
2716
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
2718
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
2720
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
2721
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
2722
AC_TRY_LINK([#include <X11/xpm.h>],[],
2723
ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
2724
LDFLAGS="$ac_save_ldflags"
2725
CFLAGS="$ac_save_cflags"
2728
if test "$ac_cv_have_xpm" = no; then
2734
AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
2735
if test "$XPM_LDFLAGS" = ""; then
2736
XPMLIB='-lXpm $(LIB_X11)'
2738
XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
2740
if test "$XPM_INCLUDE" = ""; then
2743
XPMINC="-I$XPM_INCLUDE"
2753
AC_DEFUN(AC_HAVE_DPMS,
2754
[AC_REQUIRE_CPP()dnl
2755
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2757
test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
2758
test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
2761
AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
2762
dpms_test=$withval, dpms_test="yes")
2763
if test "x$dpms_test" = xno; then
2766
AC_MSG_CHECKING(for DPMS)
2767
dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
2768
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
2769
AC_CACHE_VAL(ac_cv_have_dpms,
2771
if test "x$kde_use_qt_emb" = "xyes"; then
2773
ac_cv_have_dpms="no"
2776
ac_save_ldflags="$LDFLAGS"
2777
ac_save_cflags="$CFLAGS"
2778
ac_save_libs="$LIBS"
2779
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2780
CFLAGS="$CFLAGS $X_INCLUDES"
2781
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2783
#include <X11/Xproto.h>
2785
#include <X11/Xlib.h>
2786
#include <X11/extensions/dpms.h>
2788
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2789
ac_cv_have_dpms="yes", [
2790
LDFLAGS="$ac_save_ldflags"
2791
CFLAGS="$ac_save_cflags"
2792
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2793
LIBS="$LIBS -lXdpms"
2794
CFLAGS="$CFLAGS $X_INCLUDES"
2795
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2797
#include <X11/Xproto.h>
2799
#include <X11/Xlib.h>
2800
#include <X11/extensions/dpms.h>
2802
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2804
ac_cv_have_dpms="-lXdpms"
2805
],ac_cv_have_dpms="no")
2807
LDFLAGS="$ac_save_ldflags"
2808
CFLAGS="$ac_save_cflags"
2809
LIBS="$ac_save_libs"
2813
if test "$ac_cv_have_dpms" = no; then
2819
AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
2820
if test "$ac_cv_have_dpms" = "-lXdpms"; then
2823
if test "$DPMS_LDFLAGS" = ""; then
2824
DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
2826
DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
2828
if test "$DPMS_INCLUDE" = ""; then
2831
DPMSINC="-I$DPMS_INCLUDE"
2841
AC_DEFUN(AC_HAVE_GL,
2842
[AC_REQUIRE_CPP()dnl
2843
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2845
test -z "$GL_LDFLAGS" && GL_LDFLAGS=
2846
test -z "$GL_INCLUDE" && GL_INCLUDE=
2848
AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
2849
gl_test=$withval, gl_test="yes")
2850
if test "x$kde_use_qt_emb" = "xyes"; then
2851
# GL and Qt Embedded is a no-go for now.
2853
elif test "x$gl_test" = xno; then
2856
AC_MSG_CHECKING(for GL)
2857
AC_CACHE_VAL(ac_cv_have_gl,
2860
ac_save_ldflags="$LDFLAGS"
2861
ac_save_cflags="$CFLAGS"
2862
LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
2863
test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
2864
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
2865
CFLAGS="$CFLAGS $X_INCLUDES"
2866
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2867
AC_TRY_LINK([#include <GL/gl.h>
2870
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
2871
if test "x$ac_cv_have_gl" = "xno"; then
2872
LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU"
2873
test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
2874
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
2875
CFLAGS="$ac_save_cflags $X_INCLUDES"
2876
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2877
AC_TRY_LINK([#include <GL/gl.h>
2880
ac_cv_have_gl="yes", ac_cv_have_gl="no")
2882
LDFLAGS="$ac_save_ldflags"
2883
CFLAGS="$ac_save_cflags"
2886
if test "$ac_cv_have_gl" = "no"; then
2892
AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
2893
if test "$GL_LDFLAGS" = ""; then
2894
if test "$ac_cv_have_gl" = "mesa"; then
2895
GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
2897
GLLIB='-lGL -lGLU $(LIB_X11)'
2900
if test "$ac_cv_have_gl" = "mesa"; then
2901
GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
2903
GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
2906
if test "$GL_INCLUDE" = ""; then
2909
GLINC="-I$GL_INCLUDE"
2911
AC_MSG_RESULT($ac_cv_have_gl)
2920
dnl shadow password and PAM magic - maintained by ossi@kde.org
2923
AC_REQUIRE([KDE_CHECK_LIBDL])
2926
[ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
2927
[ if test "x$withval" = "xyes"; then
2930
elif test "x$withval" = "xno"; then
2934
pam_service=$withval
2936
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
2938
AC_CACHE_VAL(ac_cv_path_pam,
2940
AC_CHECK_LIB(pam, pam_start,
2941
[ AC_CHECK_HEADER(security/pam_appl.h,
2945
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
2948
eval "$ac_cv_path_pam"
2950
AC_MSG_CHECKING(for PAM)
2951
if test "x$use_pam" = xno; then
2956
AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
2957
PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
2959
dnl test whether struct pam_message is const (Linux) or not (Sun)
2960
AC_MSG_CHECKING(for const pam_message)
2961
AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
2962
[ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
2963
[AC_MSG_RESULT([const: Linux-type PAM])],
2964
[AC_MSG_RESULT([nonconst: Sun-type PAM])
2965
AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
2967
[AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
2973
dnl DEF_PAM_SERVICE(arg name, full name, define name)
2974
AC_DEFUN(DEF_PAM_SERVICE, [
2976
[ --with-$1-pam=[val] override PAM service from --with-pam for $2],
2977
[ if test "x$use_pam" = xyes; then
2978
$3_PAM_SERVICE="$withval"
2980
AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
2981
You may want to enforce it by using --with-pam.])
2984
[ if test "x$use_pam" = xyes; then
2985
$3_PAM_SERVICE="$pam_service"
2988
if test -n "$$3_PAM_SERVICE"; then
2989
AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
2990
AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
2992
AC_SUBST($3_PAM_SERVICE)
2995
AC_DEFUN(KDE_SHADOWPASSWD, [
2996
AC_REQUIRE([KDE_PAM])
2998
AC_CHECK_LIB(shadow, getspent,
2999
[ LIBSHADOW="-lshadow"
3003
AC_CHECK_LIB(gen, getspent,
3007
[ AC_CHECK_FUNC(getspent,
3008
[ ac_use_shadow=yes ],
3009
[ ac_use_shadow=no ])
3015
AC_MSG_CHECKING([for shadow passwords])
3018
[ --with-shadow If you want shadow password support ],
3019
[ if test "x$withval" != "xno"; then
3025
use_shadow="$ac_use_shadow"
3028
if test "x$use_shadow" = xyes; then
3030
AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3037
dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3038
dnl this still applies, if we could use it indirectly through pam.
3039
if test "x$use_shadow" = xyes ||
3040
( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3042
*-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3043
SETUIDFLAGS="-m 4755 -o root";;
3045
SETUIDFLAGS="-m 4755";;
3048
AC_SUBST(SETUIDFLAGS)
3052
AC_DEFUN(KDE_PASSWDLIBS, [
3053
AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3054
AC_REQUIRE([KDE_PAM])
3055
AC_REQUIRE([KDE_SHADOWPASSWD])
3057
if test "x$use_pam" = "xyes"; then
3058
PASSWDLIBS="$PAMLIBS"
3060
PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3063
AC_SUBST(PASSWDLIBS)
3066
AC_DEFUN(KDE_CHECK_LIBDL,
3068
AC_CHECK_LIB(dl, dlopen, [
3070
ac_cv_have_dlfcn=yes
3073
AC_CHECK_LIB(dld, shl_unload, [
3075
ac_cv_have_shload=yes
3081
AC_DEFUN(KDE_CHECK_DLOPEN,
3084
AC_CHECK_HEADERS(dlfcn.h dl.h)
3085
if test "$ac_cv_header_dlfcn_h" = "no"; then
3089
if test "$ac_cv_header_dl_h" = "no"; then
3090
ac_cv_have_shload=no
3093
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3095
AC_ARG_ENABLE(dlopen,
3096
[ --disable-dlopen link statically [default=no]] ,
3097
enable_dlopen=$enableval,
3100
# override the user's opinion, if we know it better ;)
3101
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3105
if test "$ac_cv_have_dlfcn" = "yes"; then
3106
AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3109
if test "$ac_cv_have_shload" = "yes"; then
3110
AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3113
if test "$enable_dlopen" = no ; then
3114
test -n "$1" && eval $1
3116
test -n "$2" && eval $2
3121
AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3123
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3125
AC_MSG_CHECKING([dynamic loading])
3126
eval "`egrep '^build_libtool_libs=' libtool`"
3127
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3129
AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3133
AC_MSG_RESULT($dynamic_loading)
3134
if test "$dynamic_loading" = "yes"; then
3141
AC_DEFUN(KDE_ADD_INCLUDES,
3143
if test -z "$1"; then
3144
test_include="Pix.h"
3149
AC_MSG_CHECKING([for libg++ ($test_include)])
3151
AC_CACHE_VAL(kde_cv_libgpp_includes,
3153
kde_cv_libgpp_includes=no
3159
/usr/unsupported/include \
3164
if test -r "$ac_dir/$test_include"; then
3165
kde_cv_libgpp_includes=$ac_dir
3171
AC_MSG_RESULT($kde_cv_libgpp_includes)
3172
if test "$kde_cv_libgpp_includes" != "no"; then
3173
all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3179
AC_DEFUN(KDE_CHECK_MICO,
3181
AC_REQUIRE([KDE_CHECK_LIBDL])
3182
AC_REQUIRE([KDE_MISC_TESTS])
3183
AC_MSG_CHECKING(for MICO)
3185
if test -z "$MICODIR"; then
3186
kde_micodir=/usr/local
3188
kde_micodir="$MICODIR"
3191
AC_ARG_WITH(micodir,
3192
[ --with-micodir=micodir where mico is installed ],
3193
kde_micodir=$withval,
3194
kde_micodir=$kde_micodir
3197
AC_CACHE_VAL(kde_cv_mico_incdir,
3199
mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3200
AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3203
kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3205
if test ! -r $kde_micodir/include/CORBA.h; then
3206
AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3209
AC_MSG_RESULT($kde_micodir)
3211
MICO_INCLUDES=-I$kde_micodir/include
3212
AC_SUBST(MICO_INCLUDES)
3213
MICO_LDFLAGS=-L$kde_micodir/lib
3214
AC_SUBST(MICO_LDFLAGS)
3215
micodir=$kde_micodir
3218
AC_MSG_CHECKING([for MICO version])
3219
AC_CACHE_VAL(kde_cv_mico_version,
3222
cat >conftest.$ac_ext <<EOF
3224
#include <mico/version.h>
3227
printf("MICO_VERSION=%s\n",MICO_VERSION);
3231
ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3232
if AC_TRY_EVAL(ac_compile); then
3233
if eval `./conftest 2>&5`; then
3234
kde_cv_mico_version=$MICO_VERSION
3236
AC_MSG_ERROR([your system is not able to execute a small application to
3237
find MICO version! Check $kde_micodir/include/mico/version.h])
3240
AC_MSG_ERROR([your system is not able to compile a small application to
3241
find MICO version! Check $kde_micodir/include/mico/version.h])
3245
dnl installed MICO version
3246
mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3247
mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3248
mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3250
if test "x$1" = "x"; then
3256
dnl required MICO version
3257
req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3258
req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3259
req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3261
if test "$mico_v_maj" -lt "$req_v_maj" || \
3262
( test "$mico_v_maj" -eq "$req_v_maj" && \
3263
test "$mico_v_mid" -lt "$req_v_mid" ) || \
3264
( test "$mico_v_mid" -eq "$req_v_mid" && \
3265
test "$mico_v_min" -lt "$req_v_min" )
3268
AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3269
at least is required. You should upgrade MICO.])
3271
AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3274
LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3276
if test -z "$IDL"; then
3277
IDL='$(kde_bindir)/cuteidl'
3280
IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3281
AC_SUBST(IDL_DEPENDENCIES)
3283
idldir="\$(includedir)/idl"
3288
AC_DEFUN(KDE_CHECK_MINI_STL,
3290
AC_REQUIRE([KDE_CHECK_MICO])
3292
AC_MSG_CHECKING(if we use mico's mini-STL)
3293
AC_CACHE_VAL(kde_cv_have_mini_stl,
3297
kde_save_cxxflags="$CXXFLAGS"
3298
CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3301
#include <mico/config.h>
3304
#ifdef HAVE_MINI_STL
3308
kde_cv_have_mini_stl=no,
3309
kde_cv_have_mini_stl=yes)
3310
CXXFLAGS="$kde_save_cxxflags"
3314
if test "x$kde_cv_have_mini_stl" = "xyes"; then
3326
AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3328
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3329
AC_SUBST(LIBPTHREAD)
3332
AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3334
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3335
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3337
if test "$kde_use_kernthreads" = "yes"; then
3338
ac_save_CXXFLAGS="$CXXFLAGS"
3339
ac_save_CFLAGS="$CXXFLAGS"
3340
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3341
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3342
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3343
CXXFLAGS="$ac_save_CXXFLAGS"
3344
CFLAGS="$ac_save_CFLAGS"
3345
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3346
kde_use_kernthreads=no
3348
dnl Add proper -I and -l statements
3349
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3350
if test "x$LIBPTHREAD" = "x"; then
3351
kde_use_kernthreads=no
3353
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3358
if test -z "$LIBPTHREAD"; then
3359
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3365
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3366
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3367
echo "Setting Solaris pthread compilation options"
3370
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3371
echo "Setting FreeBSD pthread compilation options"
3374
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3375
LIBPTHREAD="$LIBPTHREAD -lc_r"
3376
echo "Setting AIX pthread compilation options"
3378
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3379
USE_THREADS="$USE_THREADS -DPIC -fPIC"
3380
echo "Setting Linux pthread compilation options"
3385
AC_SUBST(USE_THREADS)
3386
AC_SUBST(LIBPTHREAD)
3389
AC_DEFUN(KDE_CHECK_THREADING,
3391
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3392
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
3393
dnl default is yes if libpthread is found and no if no libpthread is available
3394
if test -z "$LIBPTHREAD"; then
3395
if test -z "$USE_THREADS"; then
3396
kde_check_threading_default=no
3398
kde_check_threading_default=yes
3401
kde_check_threading_default=yes
3403
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
3404
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
3405
if test "x$kde_use_threading" = "xyes"; then
3406
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
3410
AC_DEFUN(KDE_TRY_LINK_PYTHON,
3412
if test "$kde_python_link_found" = no; then
3414
if test "$1" = normal; then
3415
AC_MSG_CHECKING(if a Python application links)
3417
AC_MSG_CHECKING(if Python depends on $2)
3420
AC_CACHE_VAL(kde_cv_try_link_python_$1,
3424
kde_save_cflags="$CFLAGS"
3425
CFLAGS="$CFLAGS $PYTHONINC"
3426
kde_save_libs="$LIBS"
3427
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
3428
kde_save_ldflags="$LDFLAGS"
3429
LDFLAGS="$LDFLAGS $PYTHONLIB"
3435
PySys_SetArgv(1, 0);
3437
[kde_cv_try_link_python_$1=yes],
3438
[kde_cv_try_link_python_$1=no]
3440
CFLAGS="$kde_save_cflags"
3441
LIBS="$kde_save_libs"
3442
LDFLAGS="$kde_save_ldflags"
3445
if test "$kde_cv_try_link_python_$1" = "yes"; then
3447
kde_python_link_found=yes
3448
if test ! "$1" = normal; then
3449
LIBPYTHON="$LIBPYTHON $2"
3462
AC_DEFUN(KDE_CHECK_PYTHON_DIR,
3464
AC_MSG_CHECKING([for Python directory])
3466
AC_CACHE_VAL(kde_cv_pythondir,
3468
if test -z "$PYTHONDIR"; then
3469
kde_cv_pythondir=/usr/local
3471
kde_cv_pythondir="$PYTHONDIR"
3475
AC_ARG_WITH(pythondir,
3476
[ --with-pythondir=pythondir use python installed in pythondir ],
3478
ac_python_dir=$withval
3479
], ac_python_dir=$kde_cv_pythondir
3482
AC_MSG_RESULT($ac_python_dir)
3485
AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
3487
AC_REQUIRE([KDE_CHECK_LIBDL])
3488
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3489
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
3491
if test -z "$1"; then
3497
AC_MSG_CHECKING([for Python$version])
3499
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
3500
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
3501
if test ! -r $python_incdir/Python.h; then
3502
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
3503
python_incdir=$python_incdir/python$version
3504
if test ! -r $python_incdir/Python.h; then
3509
PYTHONINC=-I$python_incdir
3511
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3512
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
3513
if test ! -r $python_libdir/libpython$version.a; then
3514
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
3515
python_libdir=$python_libdir/python$version/config
3516
if test ! -r $python_libdir/libpython$version.a; then
3521
PYTHONLIB=-L$python_libdir
3522
kde_orig_LIBPYTHON=$LIBPYTHON
3523
if test -z "$LIBPYTHON"; then
3524
LIBPYTHON=-lpython$version
3527
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3528
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
3529
python_moddir=$python_moddir/python$version
3530
if test ! -r $python_moddir/copy.py; then
3534
PYTHONMODDIR=$python_moddir
3536
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
3538
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
3539
LIBPYTHON=$kde_orig_LIBPYTHON
3540
test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
3541
test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
3544
dnl Note: this test is very weak
3545
kde_python_link_found=no
3546
KDE_TRY_LINK_PYTHON(normal)
3547
KDE_TRY_LINK_PYTHON(m, -lm)
3548
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
3549
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
3550
KDE_TRY_LINK_PYTHON(db2, -ldb2)
3551
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
3552
KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
3553
KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
3554
KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
3555
KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
3556
KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
3557
[AC_MSG_WARN([it seems, Python depends on another library.
3558
Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
3559
and contact the authors to let them know about this problem])
3563
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
3567
AC_SUBST(PYTHONMODDIR)
3568
AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
3574
AC_DEFUN(KDE_CHECK_PYTHON,
3576
KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
3577
[ KDE_CHECK_PYTHON_INTERN($1, $2) ])
3581
AC_DEFUN(KDE_CHECK_STL_SGI,
3583
AC_MSG_CHECKING([if STL implementation is SGI like])
3584
AC_CACHE_VAL(kde_cv_stl_type_sgi,
3588
using namespace std;
3590
string astring="Hallo Welt.";
3591
astring.erase(0, 6); // now astring is "Welt"
3593
], kde_cv_stl_type_sgi=yes,
3594
kde_cv_stl_type_sgi=no)
3597
AC_MSG_RESULT($kde_cv_stl_type_sgi)
3599
if test "$kde_cv_stl_type_sgi" = "yes"; then
3600
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
3604
AC_DEFUN(KDE_CHECK_STL_HP,
3606
AC_MSG_CHECKING([if STL implementation is HP like])
3607
AC_CACHE_VAL(kde_cv_stl_type_hp,
3611
using namespace std;
3613
string astring="Hello World";
3614
astring.remove(0, 6); // now astring is "World"
3616
], kde_cv_stl_type_hp=yes,
3617
kde_cv_stl_type_hp=no)
3619
AC_MSG_RESULT($kde_cv_stl_type_hp)
3621
if test "$kde_cv_stl_type_hp" = "yes"; then
3622
AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
3626
AC_DEFUN(KDE_CHECK_STL,
3630
ac_save_CXXFLAGS="$CXXFLAGS"
3631
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
3634
if test "$kde_cv_stl_type_sgi" = "no"; then
3637
if test "$kde_cv_stl_type_hp" = "no"; then
3638
AC_MSG_ERROR("no known STL type found")
3642
CXXFLAGS="$ac_save_CXXFLAGS"
3646
AC_DEFUN(AC_FIND_QIMGIO,
3647
[AC_REQUIRE([AC_FIND_JPEG])
3648
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3649
AC_MSG_CHECKING([for qimgio])
3650
AC_CACHE_VAL(ac_cv_lib_qimgio,
3654
ac_save_LIBS="$LIBS"
3655
ac_save_CXXFLAGS="$CXXFLAGS"
3656
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
3657
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
3660
#include <qimageio.h>
3661
#include <qstring.h>
3663
QString t = "hallo";
3668
ac_cv_lib_qimgio=yes,
3669
ac_cv_lib_qimgio=no,
3670
ac_cv_lib_qimgio=no)
3671
LIBS="$ac_save_LIBS"
3672
CXXFLAGS="$ac_save_CXXFLAGS"
3675
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
3676
LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
3678
AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
3681
AC_MSG_RESULT(not found)
3685
AC_DEFUN(KDE_CHECK_ANSI,
3689
AC_DEFUN(KDE_CHECK_INSURE,
3691
AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
3693
if test $enableval = "no"; dnl
3694
then ac_use_insure="no"
3695
else ac_use_insure="yes"
3697
], [ac_use_insure="no"])
3699
AC_MSG_CHECKING(if we will use Insure++ to debug)
3700
AC_MSG_RESULT($ac_use_insure)
3701
if test "$ac_use_insure" = "yes"; dnl
3702
then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
3706
AC_DEFUN(AM_DISABLE_LIBRARIES,
3708
AC_PROVIDE([AM_ENABLE_STATIC])
3709
AC_PROVIDE([AM_ENABLE_SHARED])
3715
AC_DEFUN(AC_CHECK_UTMP_FILE,
3717
AC_MSG_CHECKING([for utmp file])
3719
AC_CACHE_VAL(kde_cv_utmp_file,
3730
if test -r "$ac_file"; then
3731
kde_cv_utmp_file=$ac_file
3737
if test "$kde_cv_utmp_file" != "no"; then
3738
AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
3740
AC_MSG_RESULT($kde_cv_utmp_file)
3743
AC_MSG_RESULT([non found])
3748
AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
3751
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
3753
if test ! -s $srcdir/subdirs; then
3754
dnl Note: Makefile.common creates subdirs, so this is just a fallback
3756
files=`cd $srcdir && ls -1`
3757
dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
3759
echo $i >> $srcdir/subdirs
3763
if test -s $srcdir/inst-apps; then
3764
ac_topsubdirs="`cat $srcdir/inst-apps`"
3766
ac_topsubdirs="`cat $srcdir/subdirs`"
3769
for i in $ac_topsubdirs; do
3770
AC_MSG_CHECKING([if $i should be compiled])
3771
if test -d $srcdir/$i; then
3773
for j in $DO_NOT_COMPILE; do
3774
if test $i = $j; then
3781
AC_MSG_RESULT($install_it)
3782
if test $install_it = "yes"; then
3783
TOPSUBDIRS="$TOPSUBDIRS $i"
3787
AC_SUBST(TOPSUBDIRS)
3790
AC_DEFUN(KDE_CHECK_NAMESPACES,
3792
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
3806
int Foo::Bar::i = 1;
3809
AC_DEFINE(HAVE_NAMESPACES)
3816
AC_DEFUN(KDE_CHECK_NEWLIBS,
3821
dnl ------------------------------------------------------------------------
3822
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
3823
dnl ------------------------------------------------------------------------
3825
AC_DEFUN(AC_CHECK_S_ISSOCK,
3827
AC_MSG_CHECKING(for S_ISSOCK)
3828
AC_CACHE_VAL(ac_cv_have_s_issock,
3834
#include <sys/stat.h>
3838
int b = S_ISSOCK( buff.st_mode );
3840
ac_cv_have_s_issock=yes,
3841
ac_cv_have_s_issock=no)
3844
AC_MSG_RESULT($ac_cv_have_s_issock)
3845
if test "$ac_cv_have_s_issock" = "yes"; then
3846
AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
3850
dnl ------------------------------------------------------------------------
3851
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
3852
dnl ------------------------------------------------------------------------
3854
AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
3856
AC_MSG_CHECKING(for MAXPATHLEN)
3857
AC_CACHE_VAL(ac_cv_maxpathlen,
3860
cat > conftest.$ac_ext <<EOF
3862
# include <stdlib.h>
3865
#include <sys/param.h>
3867
#define MAXPATHLEN 1024
3870
KDE_HELLO MAXPATHLEN
3874
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
3876
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
3877
ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
3879
ac_cv_maxpathlen=1024
3885
AC_MSG_RESULT($ac_cv_maxpathlen)
3886
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
3889
dnl -------------------------------------------------------------------------
3890
dnl See if the compiler supports a template repository bero@redhat.de
3891
dnl -------------------------------------------------------------------------
3892
AC_DEFUN(KDE_COMPILER_REPO,
3897
KDE_CHECK_COMPILER_FLAG(frepo,
3903
if test -z "$REPO"; then
3904
KDE_CHECK_COMPILER_FLAG(instances=explicit,
3906
REPO="-instances=explicit"
3907
NOREPO="-instances=extern"
3911
if test -n "$REPO"; then
3912
AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
3913
[C++ compiler supports template repository])
3921
AC_DEFUN(KDE_CHECK_HEADER,
3924
kde_safe_cppflags=$CPPFLAGS
3925
CPPFLAGS="$CPPFLAGS $all_includes"
3927
AC_CHECK_HEADER($1, $2, $3)
3928
CPPFLAGS=$kde_safe_cppflags
3932
AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
3934
KDE_CHECK_HEADER(QwSpriteField.h, ,
3936
AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
3937
QwSpriteField out of kdesupport.])
3942
AC_DEFUN(KDE_FAST_CONFIGURE,
3944
dnl makes configure fast (needs perl)
3945
AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
3946
with_fast_perl=$enableval, with_fast_perl=yes)
3949
AC_DEFUN(KDE_CONF_FILES,
3952
if test -f $srcdir/configure.files ; then
3953
val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
3956
if test -n "$val" ; then
3958
CONF_FILES="$CONF_FILES $i"
3961
AC_SUBST(CONF_FILES)
3964
AC_DEFUN(KDE_SET_PREFIX,
3967
dnl make $KDEDIR the default for the installation
3968
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3970
if test "x$prefix" = "xNONE"; then
3971
prefix=$ac_default_prefix
3972
ac_configure_args="$ac_configure_args --prefix $prefix"
3978
pushdef([AC_PROG_INSTALL],
3980
dnl our own version, testing for a -p flag
3981
popdef([AC_PROG_INSTALL])
3982
dnl as AC_PROG_INSTALL works as it works we first have
3983
dnl to save if the user didn't specify INSTALL, as the
3984
dnl autoconf one overwrites INSTALL and we have no chance to find
3986
test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
3987
test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
3988
test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
3991
if test -z "$kde_save_INSTALL_given" ; then
3992
# OK, user hasn't given any INSTALL, autoconf found one for us
3993
# now we test, if it supports the -p flag
3994
AC_MSG_CHECKING(for -p flag to install)
3995
rm -f confinst.$$.* > /dev/null 2>&1
3996
echo "Testtest" > confinst.$$.orig
3998
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
3999
if test -f confinst.$$.new ; then
4000
# OK, -p seems to do no harm to install
4001
INSTALL="${INSTALL} -p"
4006
AC_MSG_RESULT($ac_res)
4008
dnl the following tries to resolve some signs and wonders coming up
4009
dnl with different autoconf/automake versions
4011
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4012
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4013
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4014
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4015
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4016
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
4017
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4018
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
4019
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
4020
dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4021
dnl automake (due to broken Makefile.am or whatever) to install programs,
4022
dnl and so does not see the -s flag in automake > 1.4
4023
dnl to clean up that mess we:
4024
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4025
dnl which cleans KDE's program with automake > 1.4;
4026
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4027
dnl with automake<=1.4
4028
dnl note that dues to this sometimes two '-s' flags are used (if KDE
4029
dnl properly uses install-@DIR@PROGRAMS, but I don't care
4031
dnl And to all this comes, that I even can't write in comments variable
4032
dnl names used by automake, because it is so stupid to think I wanted to
4033
dnl _use_ them, therefor I have written A_M_... instead of AM_
4034
dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4036
if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4037
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4039
if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4040
INSTALL_SCRIPT='${INSTALL}'
4044
AC_DEFUN(KDE_LANG_CPLUSPLUS,
4046
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4047
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4050
pushdef([AC_LANG_CPLUSPLUS],
4051
[popdef([AC_LANG_CPLUSPLUS])
4055
AC_DEFUN(KDE_CHECK_LONG_LONG,
4057
AC_MSG_CHECKING(for long long)
4058
AC_CACHE_VAL(kde_cv_c_long_long,
4066
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4069
AC_MSG_RESULT($kde_cv_c_long_long)
4070
if test "$kde_cv_c_long_long" = yes; then
4071
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4075
AC_DEFUN(KDE_CHECK_LIB,
4077
kde_save_LIBS="$LIBS"
4078
LIBS="$LIBS $all_libraries"
4080
aix*) LIBS="-brtl $LIBS"
4081
test "$GCC" = yes && LIBS="-Wl,$LIBS"
4084
AC_CHECK_LIB($1, $2, $3, $4, $5)
4085
LIBS="$kde_save_LIBS"
4091
AC_DEFUN(KDE_CHECK_INITGROUPS,
4093
AC_REQUIRE([AC_CANONICAL_HOST])
4094
AC_CHECK_FUNCS(initgroups)
4095
if test "x$ac_cv_func_initgroups" = "xyes"; then
4099
AC_MSG_CHECKING([for initgroups prototype])
4100
AC_CACHE_VAL(kde_cv_check_initgroups_proto,
4106
int x = initgroups(buffer,id);
4108
kde_cv_check_initgroups_proto=yes,
4109
kde_cv_check_initgroups_proto=no)
4111
AC_MSG_RESULT($kde_cv_check_initgroups_proto)
4115
kde_cv_check_initgroups_proto=yes
4119
kde_cv_check_initgroups_proto=no
4121
if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
4122
kde_check_initgroups_proto=1
4124
kde_check_initgroups_proto=0
4126
AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
4127
[initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
4131
AC_DEFUN(KDE_CHECK_JAVA_DIR,
4133
AC_MSG_CHECKING([for Java directory])
4136
[ --with-java=javadir use java installed in javadir, --without-java disables ],
4137
[ ac_java_dir=$withval
4141
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4142
if test "x$ac_java_dir" = xno; then
4143
kde_cv_java_bindir=no
4144
kde_cv_java_includedir=no
4145
kde_cv_java_libjvmdir=no
4146
kde_cv_java_libhpidir=no
4148
if test "x$ac_java_dir" = x; then
4149
dnl No option set -> look in $PATH
4150
AC_CACHE_VAL(kde_cv_java_bindir,
4152
dnl First look for javac in $PATH. If not found we'll look at the option.
4153
KDE_FIND_PATH(javac, JAVAC, [], [])
4154
if test -n "$JAVAC"; then
4155
kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
4156
dnl this substitution might not work - well, we test for jni.h below
4157
kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
4159
kde_cv_java_bindir=no
4163
dnl config option set
4164
kde_cv_java_bindir=$ac_java_dir/bin
4165
kde_cv_java_includedir=$ac_java_dir/include
4169
dnl Look for libjvm.so
4170
kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4171
dnl Look for libhpi.so and avoid green threads
4172
kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
4174
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
4175
if test ! "x$kde_cv_java_bindir" = xno; then
4177
dnl Now check everything's fine under there
4179
if test ! -x "$kde_cv_java_bindir/javac"; then
4180
AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
4182
if test ! -x "$kde_cv_java_bindir/javah"; then
4183
AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4185
if test ! -x "$kde_cv_java_bindir/jar"; then
4186
AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4188
if test ! -r "$kde_cv_java_includedir/jni.h"; then
4189
AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
4191
if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
4192
AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
4194
if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
4195
AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
4198
jni_includes="-I$kde_cv_java_includedir"
4199
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4200
dnl and under linux here..
4201
test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
4202
test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
4204
dnl Check for JNI version
4207
ac_cxxflags_safe="$CXXFLAGS"
4208
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4214
#ifndef JNI_VERSION_1_2
4218
],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
4219
You need to have Java Development Kit (JDK) version 1.2.
4221
Use --with-java to specify another location.
4222
Use --without-java to configure without java support.
4223
Or download a newer JDK and try again.
4224
See e.g. http://java.sun.com/products/jdk/1.2 ])
4227
CXXFLAGS="$ac_cxxflags_safe"
4230
dnl All tests ok, inform and subst the variables
4231
AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
4233
JAVAC=$kde_cv_java_bindir/javac
4235
JAVAH=$kde_cv_java_bindir/javah
4237
JAR=$kde_cv_java_bindir/jar
4239
AC_SUBST(jni_includes)
4240
JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"