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.
32
dnl ------------------------------------------------------------------------
33
dnl Find a file (or one of more files in a list of dirs)
34
dnl ------------------------------------------------------------------------
36
AC_DEFUN(AC_FIND_FILE,
43
if test -r "$i/$j"; then
51
dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
52
dnl if-not-found, test-parameter)
53
AC_DEFUN(KDE_FIND_PATH,
55
AC_MSG_CHECKING([for $1])
56
if test -n "$$2"; then
59
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
61
AC_CACHE_VAL(kde_cv_path_$kde_cache,
73
if test -x "$dir/$1"; then
76
evalstr="$dir/$1 $5 2>&1 "
77
if eval $evalstr; then
88
eval "kde_cv_path_$kde_cache=$kde_cv_path"
92
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
96
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
97
AC_MSG_RESULT(not found)
100
AC_MSG_RESULT($kde_cv_path)
106
AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
108
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
109
Please check whether you installed Qt correctly.
110
You need to have a running moc binary.
111
configure tried to run $ac_cv_path_moc and the test didn't
112
succeed. If configure shouldn't have tried this one, set
113
the environment variable MOC to the right one before running
118
AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
120
AC_MSG_WARN([No Qt ui compiler (uic) found!
121
Please check whether you installed Qt correctly.
122
You need to have a running uic binary.
123
configure tried to run $ac_cv_path_uic and the test didn't
124
succeed. If configure shouldn't have tried this one, set
125
the environment variable UIC to the right one before running
130
dnl ------------------------------------------------------------------------
131
dnl Find the meta object compiler and the ui compiler in the PATH,
132
dnl in $QTDIR/bin, and some more usual places
133
dnl ------------------------------------------------------------------------
135
AC_DEFUN(AC_PATH_QT_MOC_UIC,
138
for dir in $kde_qt_dirs; do
139
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
141
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
142
if test ! "$ac_qt_bindir" = "NO"; then
143
qt_bindirs="$ac_qt_bindir $qt_bindirs"
146
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
147
KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC="" ; KDE_UIC_ERROR_MESSAGE])
148
if test -z "$UIC" ; then
149
if test -z "$UIC_NOT_NEEDED" ; then
152
UIC="echo uic not available: "
159
AC_DEFUN(KDE_1_CHECK_PATHS,
161
KDE_1_CHECK_PATH_HEADERS
165
if test -n "$USE_RPATH"; then
167
if test -n "$kde_libraries"; then
168
KDE_TEST_RPATH="-R $kde_libraries"
171
if test -n "$qt_libraries"; then
172
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
175
if test -n "$x_libraries"; then
176
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
179
KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
182
AC_MSG_CHECKING([for KDE libraries installed])
183
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'
185
if AC_TRY_EVAL(ac_link) && test -s conftest; then
188
AC_MSG_ERROR([your system fails at linking a small KDE application!
189
Check, if your compiler is installed correctly and if you have used the
190
same compiler to compile Qt and kdelibs as you did use now.
191
For more details about this problem, look at the end of config.log.])
194
if eval `KDEDIR= ./conftest 2>&5`; then
200
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
201
kde_have_all_paths=yes
203
KDE_SET_PATHS($kde_result)
207
AC_DEFUN(KDE_SET_PATHS,
209
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
210
kde_htmldir=\"$kde_htmldir\" \
211
kde_appsdir=\"$kde_appsdir\" \
212
kde_icondir=\"$kde_icondir\" \
213
kde_sounddir=\"$kde_sounddir\" \
214
kde_datadir=\"$kde_datadir\" \
215
kde_locale=\"$kde_locale\" \
216
kde_cgidir=\"$kde_cgidir\" \
217
kde_confdir=\"$kde_confdir\" \
218
kde_mimedir=\"$kde_mimedir\" \
219
kde_toolbardir=\"$kde_toolbardir\" \
220
kde_wallpaperdir=\"$kde_wallpaperdir\" \
221
kde_templatesdir=\"$kde_templatesdir\" \
222
kde_bindir=\"$kde_bindir\" \
223
kde_servicesdir=\"$kde_servicesdir\" \
224
kde_servicetypesdir=\"$kde_servicetypesdir\" \
225
kde_moduledir=\"$kde_moduledir\" \
229
AC_DEFUN(KDE_SET_DEFAULT_PATHS,
231
if test "$1" = "default"; then
233
if test -z "$kde_htmldir"; then
234
kde_htmldir='\${prefix}/share/doc/HTML'
236
if test -z "$kde_appsdir"; then
237
kde_appsdir='\${prefix}/share/applnk'
239
if test -z "$kde_icondir"; then
240
kde_icondir='\${prefix}/share/icons'
242
if test -z "$kde_sounddir"; then
243
kde_sounddir='\${prefix}/share/sounds'
245
if test -z "$kde_datadir"; then
246
kde_datadir='\${prefix}/share/apps'
248
if test -z "$kde_locale"; then
249
kde_locale='\${prefix}/share/locale'
251
if test -z "$kde_cgidir"; then
252
kde_cgidir='\${exec_prefix}/cgi-bin'
254
if test -z "$kde_confdir"; then
255
kde_confdir='\${prefix}/share/config'
257
if test -z "$kde_mimedir"; then
258
kde_mimedir='\${prefix}/share/mimelnk'
260
if test -z "$kde_toolbardir"; then
261
kde_toolbardir='\${prefix}/share/toolbar'
263
if test -z "$kde_wallpaperdir"; then
264
kde_wallpaperdir='\${prefix}/share/wallpapers'
266
if test -z "$kde_templatesdir"; then
267
kde_templatesdir='\${prefix}/share/templates'
269
if test -z "$kde_bindir"; then
270
kde_bindir='\${exec_prefix}/bin'
272
if test -z "$kde_servicesdir"; then
273
kde_servicesdir='\${prefix}/share/services'
275
if test -z "$kde_servicetypesdir"; then
276
kde_servicetypesdir='\${prefix}/share/servicetypes'
278
if test -z "$kde_moduledir"; then
279
kde_moduledir='\${prefix}/lib/kde2'
282
KDE_SET_PATHS(defaults)
286
if test $kde_qtver = 1; then
287
AC_MSG_RESULT([compiling])
290
AC_MSG_ERROR([path checking not yet supported for KDE 2])
296
AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
297
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
298
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
299
test -z "$kde_datadir" || test -z "$kde_locale" ||
300
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
301
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
302
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
303
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
304
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
305
test "$kde_have_all_paths" != "yes"; then
306
kde_have_all_paths=no
310
AC_DEFUN(KDE_MISSING_PROG_ERROR,
312
AC_MSG_ERROR([The important program $1 was not found!
313
Please check whether you installed KDE correctly.
317
AC_DEFUN(KDE_SUBST_PROGRAMS,
318
[AC_REQUIRE([AC_CREATE_KFSSTND])dnl
320
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"
321
if test -n "$KDEDIRS"; then
324
for dir in $KDEDIRS; do
325
kde_default_bindirs="$dir/bin $kde_default_bindirs "
329
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
330
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
331
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
332
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
333
KDE_FIND_PATH(kdb2html, KDB2HTML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kdb2html)])
334
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
335
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)])
337
DCOP_DEPENDENCIES='$(DCOPIDL)'
339
AC_SUBST(DCOPIDL2CPP)
340
AC_SUBST(DCOP_DEPENDENCIES)
343
AC_SUBST(ARTSCCONFIG)
346
if test -x "$KDECONFIG"; then # it can be "compiled"
347
kde_libs_prefix=`$KDECONFIG --prefix`
348
if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
349
AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
350
This means it has been moved since you installed it.
351
This won't work. Please recompile kdelibs for the new prefix.
354
kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
356
kde_libs_prefix='$(prefix)'
357
kde_libs_htmldir='$(kde_htmldir)'
359
AC_SUBST(kde_libs_prefix)
360
AC_SUBST(kde_libs_htmldir)
363
AC_DEFUN(AC_CREATE_KFSSTND,
365
AC_REQUIRE([AC_CHECK_RPATH])
367
AC_MSG_CHECKING([for KDE paths])
370
AC_CACHE_VAL(kde_cv_all_paths,
372
KDE_SET_DEFAULT_PATHS($1)
375
eval "$kde_cv_all_paths"
376
KDE_CHECK_PATHS_FOR_COMPLETENESS
377
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
378
# wrong values were cached, may be, we can set better ones
380
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
381
kde_datadir= kde_locale= kde_cgidir= kde_confdir=
382
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
383
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
385
KDE_SET_DEFAULT_PATHS($1)
386
eval "$kde_cv_all_paths"
387
KDE_CHECK_PATHS_FOR_COMPLETENESS
388
kde_result="$kde_result (cache overridden)"
390
if test "$kde_have_all_paths" = "no"; then
391
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
392
Since it had compiled and linked before, it must be a strange problem on your system.
393
Look at config.log for details. If you are not able to fix this, look at
394
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
395
(If you're using an egcs version on Linux, you may update binutils!)
399
AC_MSG_RESULT($kde_result)
408
AC_DEFUN(AC_SUBST_KFSSTND,
410
AC_SUBST(kde_htmldir)
411
AC_SUBST(kde_appsdir)
412
AC_SUBST(kde_icondir)
413
AC_SUBST(kde_sounddir)
414
AC_SUBST(kde_datadir)
416
AC_SUBST(kde_confdir)
417
AC_SUBST(kde_mimedir)
418
AC_SUBST(kde_wallpaperdir)
421
AC_SUBST(kde_templatesdir)
422
AC_SUBST(kde_servicesdir)
423
AC_SUBST(kde_servicetypesdir)
424
AC_SUBST(kde_moduledir)
425
if test "$kde_qtver" = 1; then
426
kde_minidir="$kde_icondir/mini"
428
# for KDE 1 - this breaks KDE2 apps using minidir, but
429
# that's the plan ;-/
430
kde_minidir="/dev/null"
432
dnl AC_SUBST(kde_minidir)
433
dnl AC_SUBST(kde_cgidir)
434
dnl AC_SUBST(kde_toolbardir)
437
AC_DEFUN(KDE_MISC_TESTS,
440
dnl Checks for libraries.
441
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
444
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
445
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
446
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
447
You should install libcrypt from another source or configure with PAM
452
if test $kde_have_crypt = yes; then
453
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
457
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
458
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
459
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
460
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
462
AC_CHECK_FUNC(inet_ntoa)
463
if test $ac_cv_func_inet_ntoa = no; then
464
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
466
AC_CHECK_FUNC(connect)
467
if test $ac_cv_func_connect = no; then
468
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
472
AC_CHECK_FUNC(remove)
473
if test $ac_cv_func_remove = no; then
474
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
477
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
478
AC_CHECK_FUNC(shmat, ,
479
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
481
# Solaris 2.6 needs -lresolv for res_init
482
AC_CHECK_FUNC(res_init, ,
483
AC_CHECK_LIB(resolv, res_init, X_EXTRA_LIBS="$X_EXTRA_LIBS -lresolv"))
485
LIBSOCKET="$X_EXTRA_LIBS"
487
AC_SUBST(X_EXTRA_LIBS)
488
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
491
case $host in dnl this *is* LynxOS specific
493
AC_MSG_CHECKING([LynxOS header file wrappers])
494
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
495
AC_MSG_RESULT(disabled)
496
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
504
dnl ------------------------------------------------------------------------
505
dnl Find the header files and libraries for X-Windows. Extended the
507
dnl ------------------------------------------------------------------------
511
AC_REQUIRE([AC_PROG_CPP])dnl
512
AC_REQUIRE([KDE_MISC_TESTS])dnl
513
AC_MSG_CHECKING(for X)
516
AC_CACHE_VAL(kde_cv_have_x,
517
[# One or both of the vars are not set, and there is no cached value.
518
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
521
kde_x_includes=$x_includes
523
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
526
kde_x_libraries=$x_libraries
529
# below we use the standard autoconf calls
530
ac_x_libraries=$kde_x_libraries
531
ac_x_includes=$kde_x_includes
534
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
535
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
536
dnl location. The correct location is /usr/lib32 or an undefined value
537
dnl (the linker is smart enough to pick the correct default library).
538
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
544
if test -z "$ac_x_includes"; then
547
if test -z "$ac_x_libraries"; then
548
ac_x_libraries="/usr/lib"
551
#from now on we use our own again
553
# when the user already gave --x-includes, we ignore
554
# what the standard autoconf macros told us.
555
if test "$kde_x_includes" = NO; then
556
kde_x_includes=$ac_x_includes
559
# for --x-libraries too
560
if test "$kde_x_libraries" = NO; then
561
kde_x_libraries=$ac_x_libraries
564
if test "$kde_x_includes" = NO; then
565
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
568
if test "$kde_x_libraries" = NO; then
569
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
572
# Record where we found X for the cache.
573
kde_cv_have_x="have_x=yes \
574
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
576
eval "$kde_cv_have_x"
578
if test "$have_x" != yes; then
579
AC_MSG_RESULT($have_x)
582
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
585
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
587
x_includes="."; dnl better than nothing :-
589
x_includes=$kde_x_includes
590
X_INCLUDES="-I$x_includes"
593
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
595
x_libraries="/usr/lib"; dnl better than nothing :-
597
x_libraries=$kde_x_libraries
598
X_LDFLAGS="-L$x_libraries"
600
all_includes="$X_INCLUDES"
601
all_libraries="$X_LDFLAGS"
605
AC_SUBST(x_libraries)
608
# Check for libraries that X11R6 Xt/Xaw programs need.
609
ac_save_LDFLAGS="$LDFLAGS"
610
LDFLAGS="$LDFLAGS $X_LDFLAGS"
611
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
612
# check for ICE first), but we must link in the order -lSM -lICE or
613
# we get undefined symbols. So assume we have SM if we have ICE.
614
# These have to be linked with before -lX11, unlike the other
615
# libraries we check for below, so use a different variable.
616
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
617
AC_CHECK_LIB(ICE, IceConnectionNumber,
618
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
620
LDFLAGS="$ac_save_LDFLAGS"
624
LIB_X11='-lX11 $(LIBSOCKET)'
627
AC_MSG_CHECKING(for libXext)
628
AC_CACHE_VAL(kde_cv_have_libXext,
630
kde_ldflags_safe="$LDFLAGS"
631
kde_libs_safe="$LIBS"
633
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
634
LIBS="-lXext -lX11 $LIBSOCKET"
640
printf("hello Xext\n");
642
kde_cv_have_libXext=yes,
643
kde_cv_have_libXext=no
646
LDFLAGS=$kde_ldflags_safe
650
AC_MSG_RESULT($kde_cv_have_libXext)
652
if test "$kde_cv_have_libXext" = "no"; then
653
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
654
can't find it itself, we stop here assuming that make wouldn't find
663
AC_DEFUN(KDE_PRINT_QT_PROGRAM,
665
AC_REQUIRE([KDE_USE_QT])
666
cat > conftest.$ac_ext <<EOF
667
#include "confdefs.h"
669
#include <qapplication.h>
671
#include <qobjcoll.h>
673
if test "$kde_qtver" = "2"; then
674
cat >> conftest.$ac_ext <<EOF
680
if test $kde_qtsubver -gt 0; then
681
cat >> conftest.$ac_ext <<EOF
682
#include <qiconview.h>
688
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
689
cat >> conftest.$ac_ext <<EOF
695
if test "$kde_qtver" = "2"; then
696
cat >> conftest.$ac_ext <<EOF
697
QStringList *t = new QStringList();
699
if test $kde_qtsubver -gt 0; then
700
cat >> conftest.$ac_ext <<EOF
702
iv.setWordWrapIconText(false);
704
s.setLatin1("Elvis is alive", 14);
705
int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
709
cat >> conftest.$ac_ext <<EOF
718
if test -z "$1"; then
722
kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
723
# following is the check if subversion isnļæ½t found in passed argument
724
if test "$kde_qtsubver" = "$1"; then
727
kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
728
if test "$kde_qtver" = "1"; then
731
# this is the version number fallback to 2.1, unless major version is 1 or 2
732
if test "$kde_qtver" != "2"; then
739
if test -z "$2"; then
740
if test $kde_qtver = 2; then
741
if test $kde_qtsubver -gt 0; then
742
kde_qt_minversion=">= Qt 2.2.2"
744
kde_qt_minversion=">= Qt 2.0.2"
747
kde_qt_minversion=">= 1.42 and < 2.0"
753
if test -z "$3"; then
754
if test $kde_qtver = 2; then
755
if test $kde_qtsubver -gt 0; then
756
kde_qt_verstring="QT_VERSION >= 222"
758
kde_qt_verstring="QT_VERSION >= 200"
761
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
767
if test $kde_qtver = 2; then
768
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
770
kde_qt_dirs="$QTDIR /usr/lib/qt"
774
AC_DEFUN(KDE_CHECK_QT_DIRECT,
776
AC_REQUIRE([KDE_USE_QT])
777
AC_MSG_CHECKING([if Qt compiles without flags])
778
AC_CACHE_VAL(kde_cv_qt_direct,
782
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
783
ac_LIBRARY_PATH="$LIBRARY_PATH"
784
ac_cxxflags_safe="$CXXFLAGS"
785
ac_ldflags_safe="$LDFLAGS"
788
CXXFLAGS="$CXXFLAGS -I$qt_includes"
789
LDFLAGS="$LDFLAGS $X_LDFLAGS"
790
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
792
export LD_LIBRARY_PATH
798
if AC_TRY_EVAL(ac_link) && test -s conftest; then
799
kde_cv_qt_direct="yes"
801
kde_cv_qt_direct="no"
802
echo "configure: failed program was:" >&AC_FD_CC
803
cat conftest.$ac_ext >&AC_FD_CC
807
CXXFLAGS="$ac_cxxflags_safe"
808
LDFLAGS="$ac_ldflags_safe"
811
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
812
export LD_LIBRARY_PATH
813
LIBRARY_PATH="$ac_LIBRARY_PATH"
818
if test "$kde_cv_qt_direct" = "yes"; then
827
dnl ------------------------------------------------------------------------
828
dnl Try to find the Qt headers and libraries.
829
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
830
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
831
dnl ------------------------------------------------------------------------
833
AC_DEFUN(AC_PATH_QT_1_3,
835
AC_REQUIRE([K_PATH_X])
836
AC_REQUIRE([KDE_USE_QT])
838
dnl ------------------------------------------------------------------------
839
dnl Add configure flag to enable linking to MT version of Qt library.
840
dnl ------------------------------------------------------------------------
844
[ --enable-mt link to threaded Qt (experimental)],
845
kde_use_qt_mt=$enableval,
851
dnl ------------------------------------------------------------------------
852
dnl If we got --enable-qt-mt then adjust some vars for the host.
853
dnl ------------------------------------------------------------------------
855
if test "x$kde_use_qt_mt" = "xyes"; then
859
if test "x$GCC" = "xyes"; then
860
CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
861
X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
863
AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
867
AC_MSG_WARN([MT not yet supported on $host - disabled.])
875
dnl ------------------------------------------------------------------------
876
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
877
dnl ------------------------------------------------------------------------
879
if test -z "$LIBQT_GLOB"; then
885
if test -z "$LIBQT"; then
890
dnl ------------------------------------------------------------------------
891
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
892
dnl ------------------------------------------------------------------------
894
if test "x$kde_use_qt_mt" = "xyes"; then
898
if test "x$GCC" = "xyes"; then
901
LIBQT_GLOB="libqt-mt.*"
902
USING_QT_MT="using -mt"
914
if test $kde_qtver = 2; then
916
AC_REQUIRE([AC_FIND_PNG])
917
AC_REQUIRE([AC_FIND_JPEG])
918
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
921
AC_MSG_CHECKING([for Qt])
923
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
924
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
928
[ --with-qt-dir=DIR where the root of Qt is installed ],
929
[ ac_qt_includes="$withval"/include
930
ac_qt_libraries="$withval"/lib
931
ac_qt_bindir="$withval"/bin
934
AC_ARG_WITH(qt-includes,
935
[ --with-qt-includes=DIR where the Qt includes are. ],
937
ac_qt_includes="$withval"
942
AC_ARG_WITH(qt-libraries,
943
[ --with-qt-libraries=DIR where the Qt library is installed.],
944
[ ac_qt_libraries="$withval"
945
kde_qt_libs_given=yes
948
AC_CACHE_VAL(ac_cv_have_qt,
949
[#try to guess Qt locations
952
for dir in $kde_qt_dirs; do
953
qt_incdirs="$qt_incdirs $dir/include $dir"
955
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
956
if test ! "$ac_qt_includes" = "NO"; then
957
qt_incdirs="$ac_qt_includes $qt_incdirs"
960
if test "$kde_qtver" = "2"; then
961
kde_qt_header=qstyle.h
963
kde_qt_header=qglobal.h
966
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
967
ac_qt_includes="$qt_incdir"
970
for dir in $kde_qt_dirs; do
971
qt_libdirs="$qt_libdirs $dir/lib $dir"
973
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
974
if test ! "$ac_qt_libraries" = "NO"; then
975
qt_libdir=$ac_qt_libraries
977
qt_libdirs="$ac_qt_libraries $qt_libdirs"
978
# if the Qt was given, the chance is too big that libqt.* doesn't exist
980
for dir in $qt_libdirs; do
981
try="ls -1 $dir/${LIBQT_GLOB}"
982
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
986
ac_qt_libraries="$qt_libdir"
991
ac_cxxflags_safe="$CXXFLAGS"
992
ac_ldflags_safe="$LDFLAGS"
995
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
996
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
1001
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1004
echo "configure: failed program was:" >&AC_FD_CC
1005
cat conftest.$ac_ext >&AC_FD_CC
1006
ac_qt_libraries="NO"
1009
CXXFLAGS="$ac_cxxflags_safe"
1010
LDFLAGS="$ac_ldflags_safe"
1011
LIBS="$ac_libs_safe"
1014
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1015
ac_cv_have_qt="have_qt=no"
1017
if test "$ac_qt_includes" = NO; then
1018
if test "$ac_qt_libraries" = NO; then
1019
ac_qt_notfound="(headers and libraries)";
1021
ac_qt_notfound="(headers)";
1024
ac_qt_notfound="(libraries)";
1027
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1028
For more details about this problem, look at the end of config.log.])
1034
eval "$ac_cv_have_qt"
1036
if test "$have_qt" != yes; then
1037
AC_MSG_RESULT([$have_qt]);
1039
ac_cv_have_qt="have_qt=yes \
1040
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1041
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1043
qt_libraries="$ac_qt_libraries"
1044
qt_includes="$ac_qt_includes"
1047
if test ! "$kde_qt_libs_given" = "yes"; then
1048
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1051
AC_SUBST(qt_libraries)
1052
AC_SUBST(qt_includes)
1054
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1057
QT_INCLUDES="-I$qt_includes"
1058
all_includes="$QT_INCLUDES $all_includes"
1061
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1064
QT_LDFLAGS="-L$qt_libraries"
1065
all_libraries="$all_libraries $QT_LDFLAGS"
1068
AC_SUBST(QT_INCLUDES)
1069
AC_SUBST(QT_LDFLAGS)
1072
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
1077
AC_DEFUN(AC_PATH_QT,
1082
AC_DEFUN(KDE_CHECK_FINAL,
1084
AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1085
kde_use_final=$enableval, kde_use_final=no)
1088
if test "x$kde_use_final" = "xyes"; then
1089
KDE_USE_FINAL_TRUE=""
1090
KDE_USE_FINAL_FALSE="#"
1092
KDE_USE_FINAL_TRUE="#"
1093
KDE_USE_FINAL_FALSE=""
1095
AC_SUBST(KDE_USE_FINAL_TRUE)
1096
AC_SUBST(KDE_USE_FINAL_FALSE)
1098
AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
1099
kde_use_closure=$enableval, kde_use_closure=yes)
1101
if test "x$kde_use_closure" = "xyes"; then
1102
KDE_USE_CLOSURE_TRUE=""
1103
KDE_USE_CLOSURE_FALSE="#"
1104
# CXXFLAGS="$CXXFLAGS $REPO"
1106
KDE_USE_CLOSURE_TRUE="#"
1107
KDE_USE_CLOSURE_FALSE=""
1109
AC_SUBST(KDE_USE_CLOSURE_TRUE)
1110
AC_SUBST(KDE_USE_CLOSURE_FALSE)
1113
dnl ------------------------------------------------------------------------
1114
dnl Now, the same with KDE
1115
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1116
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1117
dnl ------------------------------------------------------------------------
1119
AC_DEFUN(AC_BASE_PATH_KDE,
1122
AC_REQUIRE([AC_PATH_QT])dnl
1124
AC_MSG_CHECKING([for KDE])
1126
if test "${prefix}" != NONE; then
1127
kde_includes=${prefix}/include
1128
ac_kde_includes=$prefix/include
1130
if test "${exec_prefix}" != NONE; then
1131
kde_libraries=${exec_prefix}/lib
1132
ac_kde_libraries=$exec_prefix/lib
1134
kde_libraries=${prefix}/lib
1135
ac_kde_libraries=$prefix/lib
1144
AC_CACHE_VAL(ac_cv_have_kde,
1145
[#try to guess kde locations
1147
if test "$kde_qtver" = 1; then
1148
kde_check_header="ksock.h"
1149
kde_check_lib="libkdecore.la"
1151
kde_check_header="ksharedptr.h"
1152
kde_check_lib="libkio.la"
1155
if test -z "$1"; then
1157
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
1158
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1159
kde_incdirs="$ac_kde_includes $kde_incdirs"
1160
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1161
ac_kde_includes="$kde_incdir"
1163
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1165
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1166
So, check this please and use another prefix!])
1169
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
1170
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
1171
kde_libdirs="$ac_kde_libraries $kde_libdirs"
1172
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1173
ac_kde_libraries="$kde_libdir"
1175
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1177
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1178
So, check this please and use another prefix!])
1180
ac_kde_libraries="$kde_libdir"
1182
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
1183
ac_cv_have_kde="have_kde=no"
1185
ac_cv_have_kde="have_kde=yes \
1186
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1191
ac_cv_have_kde="have_kde=no"
1196
eval "$ac_cv_have_kde"
1198
if test "$have_kde" != "yes"; then
1199
if test "${prefix}" = NONE; then
1200
ac_kde_prefix="$ac_default_prefix"
1202
ac_kde_prefix="$prefix"
1204
if test "$exec_prefix" = NONE; then
1205
ac_kde_exec_prefix="$ac_kde_prefix"
1206
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1208
ac_kde_exec_prefix="$exec_prefix"
1209
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1212
kde_libraries="${ac_kde_exec_prefix}/lib"
1213
kde_includes=${ac_kde_prefix}/include
1216
ac_cv_have_kde="have_kde=yes \
1217
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1218
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1220
kde_libraries="$ac_kde_libraries"
1221
kde_includes="$ac_kde_includes"
1223
AC_SUBST(kde_libraries)
1224
AC_SUBST(kde_includes)
1226
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
1229
KDE_INCLUDES="-I$kde_includes"
1230
all_includes="$KDE_INCLUDES $all_includes"
1233
KDE_LDFLAGS="-L$kde_libraries"
1234
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1235
all_libraries="$all_libraries $KDE_LDFLAGS"
1238
AC_SUBST(KDE_LDFLAGS)
1239
AC_SUBST(KDE_INCLUDES)
1241
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1243
all_libraries="$all_libraries $USER_LDFLAGS"
1244
all_includes="$all_includes $USER_INCLUDES"
1245
AC_SUBST(all_includes)
1246
AC_SUBST(all_libraries)
1251
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1253
AC_MSG_CHECKING(for extra includes)
1254
AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1255
adds non standard include paths],
1256
kde_use_extra_includes="$withval",
1257
kde_use_extra_includes=NONE
1260
if test -n "$kde_use_extra_includes" && \
1261
test "$kde_use_extra_includes" != "NONE"; then
1265
for dir in $kde_use_extra_includes; do
1266
kde_extra_includes="$kde_extra_includes $dir"
1267
USER_INCLUDES="$USER_INCLUDES -I$dir"
1270
kde_use_extra_includes="added"
1272
kde_use_extra_includes="no"
1274
AC_SUBST(USER_INCLUDES)
1276
AC_MSG_RESULT($kde_use_extra_includes)
1279
AC_MSG_CHECKING(for extra libs)
1280
AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1281
kde_use_extra_libs=$withval,
1282
kde_use_extra_libs=NONE
1284
if test -n "$kde_use_extra_libs" && \
1285
test "$kde_use_extra_libs" != "NONE"; then
1289
for dir in $kde_use_extra_libs; do
1290
kde_extra_libs="$kde_extra_libs $dir"
1291
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1292
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1295
kde_use_extra_libs="added"
1297
kde_use_extra_libs="no"
1300
AC_SUBST(USER_LDFLAGS)
1302
AC_MSG_RESULT($kde_use_extra_libs)
1306
AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1308
AC_MSG_CHECKING([for KDE headers installed])
1311
cat > conftest.$ac_ext <<EOF
1313
#include "confdefs.h"
1317
printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1318
printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1319
printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1320
printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1321
printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1322
printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1323
printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1324
printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1325
printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1326
printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1327
printf("kde_wallpaperdir=\\"%s\\"\n",
1328
KApplication::kde_wallpaperdir().data());
1329
printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1330
printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1331
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1332
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1333
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1338
ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1339
if AC_TRY_EVAL(ac_compile); then
1342
AC_MSG_ERROR([your system is not able to compile a small KDE application!
1343
Check, if you installed the KDE header files correctly.
1344
For more details about this problem, look at the end of config.log.])
1350
AC_DEFUN(KDE_CHECK_KDEQTADDON,
1352
AC_MSG_CHECKING(for kde-qt-addon)
1353
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1355
kde_ldflags_safe="$LDFLAGS"
1356
kde_libs_safe="$LIBS"
1357
kde_cxxflags_safe="$CXXFLAGS"
1359
LIBS="-lkde-qt-addon $LIBQT $LIBS"
1360
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1361
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1369
kde_cv_have_kdeqtaddon=yes,
1370
kde_cv_have_kdeqtaddon=no
1373
LDFLAGS=$kde_ldflags_safe
1375
kde_cxxflags_safe="$CXXFLAGS"
1378
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1380
if test "$kde_cv_have_kdeqtaddon" = "no"; then
1381
AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1382
It is a separate package (and CVS module) named kde-qt-addon.])
1386
AC_DEFUN(KDE_CHECK_KIMGIO,
1388
AC_REQUIRE([AC_BASE_PATH_KDE])
1389
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1390
AC_REQUIRE([AC_FIND_TIFF])
1391
AC_REQUIRE([AC_FIND_JPEG])
1392
AC_REQUIRE([AC_FIND_PNG])
1393
AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1395
if test "$1" = "existance"; then
1398
kde_save_LIBS="$LIBS"
1399
LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1400
AC_CHECK_LIB(kimgio, kimgioRegister, [
1401
LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1402
LIBS="$kde_save_LIBS"
1405
LIBKIMGIO_EXISTS=yes
1408
if test "$LIBKIMGIO_EXISTS" = "yes"; then
1409
LIB_KIMGIO='-lkimgio'
1413
AC_SUBST(LIB_KIMGIO)
1416
AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1418
AC_REQUIRE([KDE_MISC_TESTS])
1419
AC_REQUIRE([KDE_CHECK_LIBDL])
1420
AC_REQUIRE([K_PATH_X])
1422
if test $kde_qtver = 2; then
1423
LIB_KDECORE='-lkdecore'
1424
AC_SUBST(LIB_KDECORE)
1427
LIB_KFORMULA='-lkformula'
1428
AC_SUBST(LIB_KFORMULA)
1431
LIB_KSYCOCA='-lksycoca'
1432
AC_SUBST(LIB_KSYCOCA)
1441
LIB_KSPELL='-lkspell'
1442
AC_SUBST(LIB_KSPELL)
1443
LIB_KPARTS='-lkparts'
1444
AC_SUBST(LIB_KPARTS)
1445
LIB_KWRITE='-lkwrite'
1446
AC_SUBST(LIB_KWRITE)
1448
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1449
AC_SUBST(LIB_KDECORE)
1450
LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1452
LIB_KFM='-lkfm $(LIB_KDECORE)'
1454
LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1456
LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1461
AC_DEFUN(AC_PATH_KDE,
1464
AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1466
if test "$enableval" = "no";
1467
then ac_use_path_checking="default"
1468
else ac_use_path_checking=""
1472
if test "$kde_qtver" = 1;
1473
then ac_use_path_checking=""
1474
else ac_use_path_checking="default"
1479
AC_CREATE_KFSSTND($ac_use_path_checking)
1482
KDE_CREATE_LIBS_ALIASES
1486
AC_DEFUN(AC_CHECK_SETENV,
1488
AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
1489
AC_CHECK_FUNCS([setenv unsetenv])
1492
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1494
AC_MSG_CHECKING(for getdomainname)
1495
AC_CACHE_VAL(ac_cv_func_getdomainname,
1499
save_CXXFLAGS="$CXXFLAGS"
1500
kde_safe_LIBS="$LIBS"
1501
LIBS="$LIBS $X_EXTRA_LIBS"
1502
if test "$GCC" = "yes"; then
1503
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1511
getdomainname(buffer, 200);
1513
ac_cv_func_getdomainname=yes,
1514
ac_cv_func_getdomainname=no)
1515
CXXFLAGS="$save_CXXFLAGS"
1519
AC_MSG_RESULT($ac_cv_func_getdomainname)
1521
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1522
AC_CACHE_VAL(ac_cv_proto_getdomainname,
1526
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1527
ac_cv_proto_getdomainname=no
1530
LIBS="$LIBS $X_EXTRA_LIBS"
1535
extern "C" int getdomainname (char *, int);
1539
getdomainname(buffer, 200);
1541
ac_cv_func_getdomainname=yes
1542
ac_cv_proto_getdomainname=yes,
1543
AC_MSG_RESULT([fatal error])
1544
AC_MSG_ERROR([getdomainname unavailable]))
1549
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1551
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1552
AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1554
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1555
AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1556
[Define if you have getdomainname prototype])
1561
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1564
AC_MSG_CHECKING([for gethostname])
1565
AC_CACHE_VAL(ac_cv_func_gethostname,
1569
save_CXXFLAGS="$CXXFLAGS"
1570
if test "$GCC" = "yes"; then
1571
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1579
gethostname(buffer, 200);
1581
ac_cv_func_gethostname=yes,
1582
ac_cv_func_gethostname=no)
1583
CXXFLAGS="$save_CXXFLAGS"
1586
AC_MSG_RESULT($ac_cv_func_gethostname)
1588
AC_MSG_CHECKING([if gethostname needs custom prototype])
1589
AC_CACHE_VAL(ac_cv_proto_gethostname,
1593
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1594
ac_cv_proto_gethostname=no
1600
extern "C" int gethostname (char *, int);
1604
gethostname(buffer, 200);
1606
ac_cv_func_gethostname=yes
1607
ac_cv_proto_gethostname=yes,
1608
AC_MSG_RESULT([fatal error])
1609
AC_MSG_ERROR(gethostname unavailable))
1613
AC_MSG_RESULT($ac_cv_proto_gethostname)
1615
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
1616
AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
1617
[Define if you have gethostname prototype])
1619
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1620
AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have getdomainname])
1624
AC_DEFUN(AC_CHECK_USLEEP,
1626
AC_MSG_CHECKING([for usleep])
1627
AC_CACHE_VAL(ac_cv_func_usleep,
1631
ac_libs_safe="$LIBS"
1632
LIBS="$LIBS $LIBUCB"
1640
ac_cv_func_usleep=yes,
1641
ac_cv_func_usleep=no)
1642
LIBS="$ac_libs_safe"
1645
AC_MSG_RESULT($ac_cv_func_usleep)
1646
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1647
AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1651
AC_DEFUN(AC_CHECK_RANDOM,
1653
AC_MSG_CHECKING([for random])
1654
AC_CACHE_VAL(ac_cv_func_random,
1658
ac_libs_safe="$LIBS"
1659
LIBS="$LIBS $LIBUCB"
1666
ac_cv_func_random=yes,
1667
ac_cv_func_random=no)
1668
LIBS="$ac_libs_safe"
1671
AC_MSG_RESULT($ac_cv_func_random)
1672
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1673
AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1677
AC_DEFUN(AC_FIND_GIF,
1678
[AC_MSG_CHECKING([for giflib])
1679
AC_CACHE_VAL(ac_cv_lib_gif,
1680
[ac_save_LIBS="$LIBS"
1681
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1687
int GifLastError(void);
1691
/* We use char because int might match the return type of a gcc2
1692
builtin and then its argument prototype would still apply. */
1694
[return GifLastError();],
1695
eval "ac_cv_lib_gif=yes",
1696
eval "ac_cv_lib_gif=no")
1697
LIBS="$ac_save_LIBS"
1699
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1701
AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
1703
AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1707
AC_DEFUN(KDE_FIND_JPEG_HELPER,
1709
AC_MSG_CHECKING([for libjpeg$2])
1710
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1713
ac_save_LIBS="$LIBS"
1714
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
1715
ac_save_CFLAGS="$CFLAGS"
1716
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1718
[/* Override any gcc2 internal prototype to avoid an error. */
1719
struct jpeg_decompress_struct;
1720
typedef struct jpeg_decompress_struct * j_decompress_ptr;
1725
void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1726
int version, size_t structsize);
1730
/* We use char because int might match the return type of a gcc2
1731
builtin and then its argument prototype would still apply. */
1733
[jpeg_CreateDecompress(0L, 0, 0);],
1734
eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1735
eval "ac_cv_lib_jpeg_$1=no")
1736
LIBS="$ac_save_LIBS"
1737
CFLAGS="$ac_save_CFLAGS"
1740
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1741
LIBJPEG="$ac_cv_lib_jpeg_$1"
1742
AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1750
AC_DEFUN(AC_FIND_JPEG,
1752
dnl first look for libraries
1753
KDE_FIND_JPEG_HELPER(6b, 6b,
1754
KDE_FIND_JPEG_HELPER(normal, [],
1756
dnl what to do, if the normal way fails:
1757
if test -f "$kde_libraries/libjpeg.so"; then
1758
test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1759
ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1760
else if test -f "$kde_libraries/libjpeg.sl"; then
1761
test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1762
ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1763
else if test -f "$kde_libraries/libjpeg.a"; then
1764
test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1765
ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1772
LIBJPEG=$ac_cv_lib_jpeg
1775
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
1776
dnl requires system dependent includes loaded before it)
1777
jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
1778
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
1779
test "x$jpeg_incdir" = xNO && jpeg_incdir=
1781
dnl if headers _and_ libraries are missing, this is no error, and we
1782
dnl continue with a warning (the user will get no jpeg support in khtml)
1783
dnl if only one is missing, it means a configuration error, but we still
1785
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
1786
AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
1788
if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
1790
There is an installation error in jpeg support. You seem to have only one
1791
of either the headers _or_ the libraries installed. You may need to either
1792
provide correct --with-extra-... options, or the development package of
1793
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
1794
Disabling JPEG support.
1797
AC_MSG_WARN([libjpeg not found. disable JPEG support.])
1806
AC_DEFUN(AC_FIND_ZLIB,
1808
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1809
AC_MSG_CHECKING([for libz])
1810
AC_CACHE_VAL(ac_cv_lib_z,
1813
kde_save_LIBS="$LIBS"
1814
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
1815
kde_save_CFLAGS="$CFLAGS"
1816
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1821
[return (zlibVersion() == ZLIB_VERSION); ],
1822
eval "ac_cv_lib_z='-lz'",
1823
eval "ac_cv_lib_z=no")
1824
LIBS="$kde_save_LIBS"
1825
CFLAGS="$kde_save_CFLAGS"
1827
if test ! "$ac_cv_lib_z" = no; then
1828
AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
1831
AC_MSG_RESULT($ac_cv_lib_z)
1833
AC_MSG_ERROR(not found. Check your installation and look into config.log)
1839
AC_DEFUN(KDE_TRY_TIFFLIB,
1841
AC_MSG_CHECKING([for libtiff $1])
1843
AC_CACHE_VAL(kde_cv_libtiff_$1,
1847
kde_save_LIBS="$LIBS"
1848
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
1849
kde_save_CXXFLAGS="$CXXFLAGS"
1850
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
1856
[return (TIFFOpen( "", "r") == 0); ],
1858
kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
1860
kde_cv_libtiff_$1=no
1863
LIBS="$kde_save_LIBS"
1864
CXXFLAGS="$kde_save_CXXFLAGS"
1868
if test "$kde_cv_libtiff_$1" = "no"; then
1873
LIBTIFF="$kde_cv_libtiff_$1"
1875
AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
1881
AC_DEFUN(AC_FIND_TIFF,
1883
AC_REQUIRE([K_PATH_X])
1884
AC_REQUIRE([AC_FIND_ZLIB])
1885
AC_REQUIRE([AC_FIND_JPEG])
1886
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1888
KDE_TRY_TIFFLIB(tiff, [],
1889
KDE_TRY_TIFFLIB(tiff34))
1895
AC_DEFUN(AC_FIND_PNG,
1897
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1898
AC_REQUIRE([AC_FIND_ZLIB])
1899
AC_MSG_CHECKING([for libpng])
1900
AC_CACHE_VAL(ac_cv_lib_png,
1902
kde_save_LIBS="$LIBS"
1903
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1904
kde_save_CFLAGS="$CFLAGS"
1905
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1912
png_structp png_ptr = png_create_read_struct( /* image ptr */
1913
PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1914
return( png_ptr != 0 );
1916
eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1917
eval "ac_cv_lib_png=no"
1919
LIBS="$kde_save_LIBS"
1920
CFLAGS="$kde_save_CFLAGS"
1922
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1923
AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
1924
LIBPNG="$ac_cv_lib_png"
1926
AC_MSG_RESULT($ac_cv_lib_png)
1934
AC_DEFUN(AC_CHECK_BOOL,
1936
AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
1939
AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1941
AC_MSG_CHECKING(if you need GNU extensions)
1942
AC_CACHE_VAL(ac_cv_gnu_extensions,
1944
cat > conftest.c << EOF
1945
#include <features.h>
1947
#ifdef __GNU_LIBRARY__
1952
if (eval "$ac_cpp conftest.c") 2>&5 |
1953
egrep "yes" >/dev/null 2>&1; then
1955
ac_cv_gnu_extensions=yes
1957
ac_cv_gnu_extensions=no
1961
AC_MSG_RESULT($ac_cv_gnu_extensions)
1962
if test "$ac_cv_gnu_extensions" = "yes"; then
1963
AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
1967
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
1969
AC_REQUIRE([AC_CHECK_COMPILERS])
1970
AC_MSG_CHECKING(whether $CXX supports -$1)
1971
kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
1972
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
1974
echo 'int main() { return 0; }' >conftest.cc
1975
eval "kde_cv_prog_cxx_$kde_cache=no"
1976
if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
1977
if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
1978
eval "kde_cv_prog_cxx_$kde_cache=yes"
1983
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
1994
AC_DEFUN(KDE_PROG_CC_PG,
1995
[ AC_CACHE_CHECK(whether ${CC-cc} accepts -pg, kde_cv_prog_cc_pg,
1996
[echo 'void f(){}' > conftest.c
1997
if test -z "`${CC-cc} -pg -c conftest.c 2>&1`"; then
1998
kde_cv_prog_cc_pg=yes
2000
kde_cv_prog_cc_pg=no
2005
AC_DEFUN(KDE_PROG_CXX_PG,
2006
[ AC_CACHE_CHECK(whether ${CXX-g++} accepts -pg, kde_cv_prog_cxx_pg,
2007
[echo 'void f(){}' > conftest.cc
2008
if test -z "`${CXX-g++} -pg -c conftest.cc 2>&1`"; then
2009
kde_cv_prog_cxx_pg=yes
2011
kde_cv_prog_cxx_pg=no
2016
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2017
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2018
dnl it's all white-space separated
2019
AC_DEFUN(AC_REMOVE_FORBIDDEN,
2022
if test -n "$__val"; then
2028
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2029
*) # Careful to not add spaces, where there were none, because otherwise
2030
# libtool gets confused, if we change e.g. CXX
2031
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2039
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2040
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2042
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2043
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2046
AC_DEFUN(AC_CHECK_COMPILERS,
2048
dnl this is somehow a fat lie, but prevents other macros from double checking
2049
AC_PROVIDE([AC_PROG_CC])
2050
AC_PROVIDE([AC_PROG_CPP])
2051
AC_PROVIDE([AC_PROG_CXX])
2052
AC_PROVIDE([AC_PROG_CXXCPP])
2054
AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
2056
if test $enableval = "no"; dnl
2058
kde_use_debug_code="no"
2059
kde_use_debug_define=yes
2061
kde_use_debug_code="yes"
2062
kde_use_debug_define=no
2064
], [kde_use_debug_code="no"
2065
kde_use_debug_define=no
2067
dnl Just for configure --help
2068
AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2070
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2072
if test $enableval = "no"; then
2073
kde_use_strict_options="no"
2075
kde_use_strict_options="yes"
2077
], [kde_use_strict_options="no"])
2079
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2080
[kde_use_profiling=$enableval],
2081
[kde_use_profiling="no"]
2084
dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
2085
AC_MSG_CHECKING(for a C-Compiler)
2086
dnl if there is one, print out. if not, don't matter
2089
if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
2090
if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
2091
if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
2092
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
2097
if test $ac_cv_prog_gcc = yes; then
2106
if test -z "$CFLAGS"; then
2107
if test "$kde_use_debug_code" = "yes"; then
2109
if test $ac_cv_prog_cc_g = yes; then
2113
CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE"
2118
if test "$GCC" = "yes"; then
2123
if test "$kde_use_debug_define" = "yes"; then
2124
CFLAGS="$CFLAGS -DNDEBUG"
2125
dnl damn buggy compilers :-(
2126
dnl if test "$GCC" = "yes"; then
2127
dnl CFLAGS="$CFLAGS -fomit-frame-pointer"
2128
dnl CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
2133
if test "$kde_use_profiling" = yes; then
2135
if test "$kde_cv_prog_cc_pg" = yes; then
2136
CFLAGS="$CFLAGS -pg"
2140
if test "$GCC" = "yes"; then
2143
if test "$kde_use_strict_options" = "yes"; then
2144
CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
2151
*-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
2152
*-*-sysv5uw7*) CFLAGS="$CFLAGS -D_UNIXWARE7";;
2155
if test -n "$USER_CFLAGS"; then
2156
CFLAGS="$CFLAGS $USER_CFLAGS"
2159
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2164
dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
2165
dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
2167
AC_MSG_CHECKING(how to run the C preprocessor)
2168
# On Suns, sometimes $CPP names a directory.
2169
if test -n "$CPP" && test -d "$CPP"; then
2172
if test -z "$CPP"; then
2173
AC_CACHE_VAL(ac_cv_prog_CPP,
2174
[ # This must be in double quotes, not single quotes, because CPP may get
2175
# substituted into the Makefile and "${CC-cc}" will confuse make.
2177
# On the NeXT, cc -E runs the code through the compiler's parser,
2178
# not just through cpp.
2179
dnl Use a header file that comes with gcc, so configuring glibc
2180
dnl with a fresh cross-compiler works.
2181
AC_TRY_CPP([#include <assert.h>
2183
CPP="${CC-cc} -E -traditional-cpp"
2184
AC_TRY_CPP([#include <assert.h>
2185
Syntax Error], , CPP=/lib/cpp))
2186
ac_cv_prog_CPP="$CPP"])dnl
2187
CPP="$ac_cv_prog_CPP"
2189
ac_cv_prog_CPP="$CPP"
2195
AC_MSG_CHECKING(for a C++-Compiler)
2196
dnl if there is one, print out. if not, don't matter
2199
if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
2200
if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
2201
if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
2202
if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
2203
test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
2208
if test $ac_cv_prog_gxx = yes; then
2212
USER_CXXFLAGS=$CXXFLAGS
2215
if test -z "$CXXFLAGS"; then
2216
if test "$kde_use_debug_code" = "yes"; then
2218
if test $ac_cv_prog_cxx_g = yes; then
2222
CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion"
2227
if test "$GXX" = "yes"; then
2230
if test "$kde_use_debug_define" = "yes"; then
2231
CXXFLAGS="$CXXFLAGS -DNDEBUG"
2235
if test "$kde_use_profiling" = yes; then
2237
if test "$kde_cv_prog_cxx_pg" = yes; then
2238
CXXFLAGS="$CXXFLAGS -pg"
2242
KDE_CHECK_COMPILER_FLAG(fno-exceptions,
2244
CXXFLAGS="$CXXFLAGS -fno-exceptions"
2247
dnl WABA: Nothing wrong with RTTI, keep it on.
2248
dnl KDE_CHECK_COMPILER_FLAG(fno-rtti,
2250
dnl CXXFLAGS="$CXXFLAGS -fno-rtti"
2253
KDE_CHECK_COMPILER_FLAG(fno-check-new,
2255
CXXFLAGS="$CXXFLAGS -fno-check-new"
2258
if test "$GXX" = "yes"; then
2259
CXXFLAGS="$CXXFLAGS"
2261
if test true || test "$kde_use_debug_code" = "yes"; then
2262
CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
2264
KDE_CHECK_COMPILER_FLAG(Wno-long-long,
2266
CXXFLAGS="$CXXFLAGS -Wno-long-long"
2268
KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,
2270
CXXFLAGS="$CXXFLAGS -Wnon-virtual-dtor"
2272
KDE_CHECK_COMPILER_FLAG(fno-builtin,
2274
CXXFLAGS="$CXXFLAGS -fno-builtin"
2279
if test "$kde_use_strict_options" = "yes"; then
2280
CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align"
2283
if test "$kde_very_strict" = "yes"; then
2284
CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
2289
KDE_CHECK_COMPILER_FLAG(fexceptions,
2291
USE_EXCEPTIONS="-fexceptions"
2295
AC_SUBST(USE_EXCEPTIONS)
2297
KDE_CHECK_COMPILER_FLAG(frtti,
2306
*-*-irix*) test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;;
2307
*-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
2308
*-*-sysv5uw7*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE7";;
2310
if test "$GXX" = yes; then
2311
libstdcpp=`gcc -print-file-name=libstdc++.so`
2312
if test ! -f $libstdcpp; then
2313
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])
2319
if test -n "$USER_CXXFLAGS"; then
2320
CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
2323
AC_VALIDIFY_CXXFLAGS
2325
AC_MSG_CHECKING(how to run the C++ preprocessor)
2326
if test -z "$CXXCPP"; then
2327
AC_CACHE_VAL(ac_cv_prog_CXXCPP,
2330
AC_LANG_CPLUSPLUS[]dnl
2331
CXXCPP="${CXX-g++} -E"
2332
AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
2333
ac_cv_prog_CXXCPP="$CXXCPP"
2334
AC_LANG_RESTORE[]dnl
2336
CXXCPP="$ac_cv_prog_CXXCPP"
2338
AC_MSG_RESULT($CXXCPP)
2341
# the following is to allow programs, that are known to
2342
# have problems when compiled with -O2
2343
if test -n "$CXXFLAGS"; then
2347
for i in $CXXFLAGS; do
2352
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
2358
AC_SUBST(NOOPT_CXXFLAGS)
2362
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2365
AC_SUBST(KDE_CXXFLAGS)
2368
AC_DEFUN(KDE_ADD_DEPENDENCIES,
2370
[A]M_DEPENDENCIES(CC)
2371
[A]M_DEPENDENCIES(CXX)
2374
dnl just a wrapper to clean up configure.in
2375
AC_DEFUN(KDE_PROG_LIBTOOL,
2377
AC_REQUIRE([AC_CHECK_COMPILERS])
2378
AC_REQUIRE([AC_ENABLE_SHARED])
2379
AC_REQUIRE([AC_ENABLE_STATIC])
2381
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2392
LIBTOOL_SHELL="/bin/sh ./libtool"
2393
# LIBTOOL="$LIBTOOL --silent"
2394
KDE_PLUGIN="-avoid-version -module -no-undefined"
2395
AC_SUBST(KDE_PLUGIN)
2398
AC_DEFUN(KDE_CHECK_TYPES,
2399
[ AC_CHECK_SIZEOF(int, 4)dnl
2400
AC_CHECK_SIZEOF(long, 4)dnl
2401
AC_CHECK_SIZEOF(char *, 4)dnl
2404
AC_DEFUN(KDE_DO_IT_ALL,
2408
AM_INIT_AUTOMAKE($1, $2)
2409
AM_DISABLE_LIBRARIES
2410
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
2417
AC_DEFUN(AC_CHECK_RPATH,
2419
AC_MSG_CHECKING(for rpath)
2420
AC_ARG_ENABLE(rpath,
2421
[ --disable-rpath do not use the rpath feature of ld],
2422
USE_RPATH=$enableval, USE_RPATH=yes)
2424
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
2426
KDE_RPATH="-R \$(kde_libraries)"
2428
if test -n "$qt_libraries"; then
2429
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
2431
dnl $x_libraries is set to /usr/lib in case
2432
if test -n "$X_LDFLAGS"; then
2433
KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
2435
if test -n "$KDE_EXTRA_RPATH"; then
2436
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
2439
AC_SUBST(KDE_EXTRA_RPATH)
2441
AC_MSG_RESULT($USE_RPATH)
2444
dnl Check for the type of the third argument of getsockname
2445
AC_DEFUN(AC_CHECK_KSIZE_T,
2446
[AC_MSG_CHECKING(for the third argument of getsockname)
2447
AC_CACHE_VAL(ac_cv_ksize_t,
2451
#include <sys/types.h>
2452
#include <sys/socket.h>
2455
getsockname(0,(struct sockaddr*)0, &a);
2457
ac_cv_ksize_t=socklen_t,
2459
if test -z "$ac_cv_ksize_t"; then
2460
ac_safe_cxxflags="$CXXFLAGS"
2461
if test "$GCC" = "yes"; then
2462
CXXFLAGS="-Werror $CXXFLAGS"
2465
#include <sys/types.h>
2466
#include <sys/socket.h>
2469
getsockname(0,(struct sockaddr*)0, &a);
2472
ac_cv_ksize_t=size_t)
2473
CXXFLAGS="$ac_safe_cxxflags"
2478
if test -z "$ac_cv_ksize_t"; then
2482
AC_MSG_RESULT($ac_cv_ksize_t)
2483
AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t,
2484
[Define the type of the third argument for getsockname]
2489
dnl This is a merge of some macros out of the gettext aclocal.m4
2490
dnl since we don't need anything, I took the things we need
2491
dnl the copyright for them is:
2493
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2494
dnl This Makefile.in is free software; the Free Software Foundation
2495
dnl gives unlimited permission to copy and/or distribute it,
2496
dnl with or without modifications, as long as this notice is preserved.
2498
dnl This program is distributed in the hope that it will be useful,
2499
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2500
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2501
dnl PARTICULAR PURPOSE.
2503
dnl for this file it is relicensed under LGPL
2505
AC_DEFUN(AM_KDE_WITH_NLS,
2507
dnl If we use NLS figure out what method
2509
AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
2510
[test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
2511
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2513
if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
2514
AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
2521
AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
2522
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2524
dnl Test whether we really found GNU xgettext.
2525
if test "$XGETTEXT" != ":"; then
2526
dnl If it is no GNU xgettext we define it as : so that the
2527
dnl Makefiles still can work.
2528
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2532
[found xgettext programs is not GNU xgettext; ignore it])
2540
# Search path for a program which passes the given test.
2541
# Ulrich Drepper <drepper@cygnus.com>, 1996.
2544
# Stephan Kulow: I appended a _KDE against name conflicts
2546
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
2547
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2548
AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
2549
[# Extract the first word of "$2", so it can be a program name with args.
2550
set dummy $2; ac_word=[$]2
2551
AC_MSG_CHECKING([for $ac_word])
2552
AC_CACHE_VAL(ac_cv_path_$1,
2555
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2558
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2559
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2560
test -z "$ac_dir" && ac_dir=.
2561
if test -f $ac_dir/$ac_word; then
2563
ac_cv_path_$1="$ac_dir/$ac_word"
2569
dnl If no 4th arg is given, leave the cache variable unset,
2570
dnl so AC_PATH_PROGS will keep looking.
2571
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2576
if test -n "[$]$1"; then
2577
AC_MSG_RESULT([$]$1)
2585
# Check whether LC_MESSAGES is available in <locale.h>.
2586
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2590
AC_DEFUN(AM_LC_MESSAGES,
2591
[if test $ac_cv_header_locale_h = yes; then
2592
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2593
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2594
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2595
if test $am_cv_val_LC_MESSAGES = yes; then
2596
AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2600
dnl From Jim Meyering.
2601
dnl FIXME: migrate into libit.
2603
AC_DEFUN(AM_FUNC_OBSTACK,
2604
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
2605
[AC_TRY_LINK([#include "obstack.h"],
2606
[struct obstack *mem;obstack_free(mem,(char *) 0)],
2607
am_cv_func_obstack=yes,
2608
am_cv_func_obstack=no)])
2609
if test $am_cv_func_obstack = yes; then
2610
AC_DEFINE(HAVE_OBSTACK)
2612
LIBOBJS="$LIBOBJS obstack.o"
2616
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
2617
dnl FIXME: Migrate into libit
2619
AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
2620
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
2621
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
2622
am_cv_lib_error_at_line=yes,
2623
am_cv_lib_error_at_line=no)])
2624
if test $am_cv_lib_error_at_line = no; then
2625
LIBOBJS="$LIBOBJS error.o"
2627
AC_SUBST(LIBOBJS)dnl
2630
# Macro to add for using GNU gettext.
2631
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2634
# Stephan Kulow: I put a KDE in it to avoid name conflicts
2636
AC_DEFUN(AM_KDE_GNU_GETTEXT,
2637
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2638
AC_REQUIRE([AC_PROG_RANLIB])dnl
2639
AC_REQUIRE([AC_HEADER_STDC])dnl
2640
AC_REQUIRE([AC_TYPE_OFF_T])dnl
2641
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2642
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2643
AC_REQUIRE([AC_FUNC_MMAP])dnl
2644
AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2645
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
2646
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2647
__argz_count __argz_stringify __argz_next])
2649
AC_MSG_CHECKING(for stpcpy)
2650
AC_CACHE_VAL(kde_cv_func_stpcpy,
2652
kde_safe_cxxflags=$CXXFLAGS
2653
CXXFLAGS="-Wmissing-prototypes -Werror"
2661
stpcpy(buffer, buffer);
2663
kde_cv_func_stpcpy=yes,
2664
kde_cv_func_stpcpy=no)
2666
CXXFLAGS=$kde_safe_cxxflags
2668
AC_MSG_RESULT($kde_cv_func_stpcpy)
2669
if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
2670
AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
2675
if test "x$CATOBJEXT" != "x"; then
2676
if test "x$ALL_LINGUAS" = "x"; then
2679
AC_MSG_CHECKING(for catalogs to be installed)
2681
for lang in ${LINGUAS=$ALL_LINGUAS}; do
2682
case "$ALL_LINGUAS" in
2683
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2686
LINGUAS=$NEW_LINGUAS
2687
AC_MSG_RESULT($LINGUAS)
2690
dnl Construct list of names of catalog files to be constructed.
2691
if test -n "$LINGUAS"; then
2692
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2698
AC_DEFUN(AC_HAVE_XPM,
2699
[AC_REQUIRE_CPP()dnl
2700
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2702
test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
2703
test -z "$XPM_INCLUDE" && XPM_INCLUDE=
2705
AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
2706
xpm_test=$withval, xpm_test="yes")
2707
if test "x$xpm_test" = xno; then
2710
AC_MSG_CHECKING(for XPM)
2711
AC_CACHE_VAL(ac_cv_have_xpm,
2714
ac_save_ldflags="$LDFLAGS"
2715
ac_save_cflags="$CFLAGS"
2716
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
2717
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
2718
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
2719
AC_TRY_LINK([#include <X11/xpm.h>],[],
2720
ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
2721
LDFLAGS="$ac_save_ldflags"
2722
CFLAGS="$ac_save_cflags"
2725
if test "$ac_cv_have_xpm" = no; then
2731
AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
2732
if test "$XPM_LDFLAGS" = ""; then
2733
XPMLIB='-lXpm $(LIB_X11)'
2735
XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
2737
if test "$XPM_INCLUDE" = ""; then
2740
XPMINC="-I$XPM_INCLUDE"
2750
AC_DEFUN(AC_HAVE_DPMS,
2751
[AC_REQUIRE_CPP()dnl
2752
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2754
test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
2755
test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
2758
AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
2759
dpms_test=$withval, dpms_test="yes")
2760
if test "x$dpms_test" = xno; then
2763
AC_MSG_CHECKING(for DPMS)
2764
dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
2765
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
2766
AC_CACHE_VAL(ac_cv_have_dpms,
2769
ac_save_ldflags="$LDFLAGS"
2770
ac_save_cflags="$CFLAGS"
2771
ac_save_libs="$LIBS"
2772
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2773
CFLAGS="$CFLAGS $X_INCLUDES"
2774
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2776
#include <X11/Xproto.h>
2778
#include <X11/Xlib.h>
2779
#include <X11/extensions/dpms.h>
2781
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2782
ac_cv_have_dpms="yes", [
2783
LDFLAGS="$ac_save_ldflags"
2784
CFLAGS="$ac_save_cflags"
2785
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2786
LIBS="$LIBS -lXdpms"
2787
CFLAGS="$CFLAGS $X_INCLUDES"
2788
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2790
#include <X11/Xproto.h>
2792
#include <X11/Xlib.h>
2793
#include <X11/extensions/dpms.h>
2795
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2797
ac_cv_have_dpms="-lXdpms"
2798
],ac_cv_have_dpms="no")
2800
LDFLAGS="$ac_save_ldflags"
2801
CFLAGS="$ac_save_cflags"
2802
LIBS="$ac_save_libs"
2805
if test "$ac_cv_have_dpms" = no; then
2811
AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
2812
if test "$ac_cv_have_dpms" = "-lXdpms"; then
2815
if test "$DPMS_LDFLAGS" = ""; then
2816
DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
2818
DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
2820
if test "$DPMS_INCLUDE" = ""; then
2823
DPMSINC="-I$DPMS_INCLUDE"
2833
AC_DEFUN(AC_HAVE_GL,
2834
[AC_REQUIRE_CPP()dnl
2835
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2837
test -z "$GL_LDFLAGS" && GL_LDFLAGS=
2838
test -z "$GL_INCLUDE" && GL_INCLUDE=
2840
AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
2841
gl_test=$withval, gl_test="yes")
2842
if test "x$gl_test" = xno; then
2845
AC_MSG_CHECKING(for GL)
2846
AC_CACHE_VAL(ac_cv_have_gl,
2849
ac_save_ldflags="$LDFLAGS"
2850
ac_save_cflags="$CFLAGS"
2851
LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
2852
CFLAGS="$CFLAGS $X_INCLUDES"
2853
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2854
AC_TRY_LINK([#include <GL/gl.h>
2857
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
2858
if test "x$ac_cv_have_gl" = "xno"; then
2859
LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
2860
CFLAGS="$ac_save_cflags $X_INCLUDES"
2861
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2862
AC_TRY_LINK([#include <GL/gl.h>
2865
ac_cv_have_gl="yes", ac_cv_have_gl="no")
2867
LDFLAGS="$ac_save_ldflags"
2868
CFLAGS="$ac_save_cflags"
2871
if test "$ac_cv_have_gl" = "no"; then
2877
AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
2878
if test "$GL_LDFLAGS" = ""; then
2879
if test "$ac_cv_have_gl" = "mesa"; then
2880
GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
2882
GLLIB='-lGL -lGLU $(LIB_X11)'
2885
if test "$ac_cv_have_gl" = "mesa"; then
2886
GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
2888
GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
2891
if test "$GL_INCLUDE" = ""; then
2894
GLINC="-I$GL_INCLUDE"
2896
AC_MSG_RESULT($ac_cv_have_gl)
2906
dnl Should test for PAM (Pluggable Authentication Modules)
2907
AC_DEFUN(AC_PATH_PAM_DIRECT,
2909
test -z "$pam_direct_test_library" && pam_direct_test_library=pam
2910
test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
2914
/usr/local/include \
2916
/usr/unsupported/include \
2919
/usr/local/pam/include \
2920
/usr/lib/pam/include \
2925
if test -r "$ac_dir/$pam_direct_test_include"; then
2926
no_pam= ac_pam_includes=$ac_dir
2931
# First see if replacing the include by lib works.
2932
for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
2937
/usr/unsupported/lib \
2943
for ac_extension in a so sl; do
2944
if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
2945
no_pam= ac_pam_libraries=$ac_dir
2952
AC_DEFUN(AC_PATH_PAM,
2954
AC_REQUIRE([KDE_CHECK_LIBDL])
2957
dnl AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"
2958
dnl AC_DEFINE_UNQUOTED(HAVE_PAM_MISC, 1, [Define if you have a PAM implementation with the pam_misc library])], [], [-lpam $LIBDL])
2960
AC_MSG_CHECKING(for PAM)
2962
[ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
2964
if test "x$withval" = "xyes"; then
2967
elif test "x$withval" = "xno"; then
2971
pam_service="$withval"
2972
if test -z "$pam_service"; then
2981
if test ! "$no_pam" = yes; then
2983
AC_CACHE_VAL(ac_cv_path_pam,
2985
ac_pam_includes=NONE
2986
ac_pam_libraries=NONE
2987
if test -z "$pam_libraries"; then
2990
if test -z "$pam_includes"; then
2996
test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
2997
test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
2999
if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
3000
ac_pam_libs="-lpam $PAM_MISC_LIB $LIBDL"
3001
ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
3003
ac_cv_path_pam="no_pam=yes"
3007
eval "$ac_cv_path_pam"
3011
if test "$no_pam" = yes; then
3014
AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules); Redhat-Users!])
3015
PAMLIBS="$ac_pam_libs"
3016
test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
3017
test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
3018
AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
3019
if test "$default_pam" = yes; then
3020
AC_MSG_RESULT(["default pam service name will be used"])
3022
AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service", [Define to change the default name of the PAM service used by KDE])
3023
AC_MSG_RESULT(["pam service name will be: " $pam_service])
3025
dnl test whether struct pam_message is const (Linux) or not (Sun)
3026
pam_appl_h="$ac_pam_includes/security/pam_appl.h"
3027
AC_MSG_CHECKING(for const pam_message)
3028
AC_EGREP_HEADER([struct pam_message],
3030
[ AC_EGREP_HEADER([const struct pam_message],
3032
[AC_MSG_RESULT(["const: Linux-type PAM"]) ],
3033
[AC_MSG_RESULT(["nonconst: Sun-type PAM"])
3034
AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3036
[AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
3040
if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
3041
PAMLIBPATHS="-L$pam_libraries"
3043
if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
3044
PAMINC="-I$pam_includes"
3049
AC_SUBST(PAMLIBPATHS)
3053
AC_DEFUN(KDE_CHECK_LIBDL,
3055
AC_CHECK_LIB(dl, dlopen, [
3057
ac_cv_have_dlfcn=yes
3060
AC_CHECK_LIB(dld, shl_unload, [
3062
ac_cv_have_shload=yes
3068
AC_DEFUN(KDE_CHECK_DLOPEN,
3071
AC_CHECK_HEADERS(dlfcn.h dl.h)
3072
if test "$ac_cv_header_dlfcn_h" = "no"; then
3076
if test "$ac_cv_header_dl_h" = "no"; then
3077
ac_cv_have_shload=no
3080
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3082
AC_ARG_ENABLE(dlopen,
3083
[ --disable-dlopen link statically [default=no]] ,
3084
enable_dlopen=$enableval,
3087
# override the user's opinion, if we know it better ;)
3088
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3092
if test "$ac_cv_have_dlfcn" = "yes"; then
3093
AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3096
if test "$ac_cv_have_shload" = "yes"; then
3097
AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3100
if test "$enable_dlopen" = no ; then
3101
test -n "$1" && eval $1
3103
test -n "$2" && eval $2
3108
AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3110
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3112
AC_MSG_CHECKING([dynamic loading])
3113
eval "`egrep '^build_libtool_libs=' libtool`"
3114
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3116
AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3120
AC_MSG_RESULT($dynamic_loading)
3121
if test "$dynamic_loading" = "yes"; then
3128
AC_DEFUN(KDE_ADD_INCLUDES,
3130
if test -z "$1"; then
3131
test_include="Pix.h"
3136
AC_MSG_CHECKING([for libg++ ($test_include)])
3138
AC_CACHE_VAL(kde_cv_libgpp_includes,
3140
kde_cv_libgpp_includes=no
3146
/usr/unsupported/include \
3151
if test -r "$ac_dir/$test_include"; then
3152
kde_cv_libgpp_includes=$ac_dir
3158
AC_MSG_RESULT($kde_cv_libgpp_includes)
3159
if test "$kde_cv_libgpp_includes" != "no"; then
3160
all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3166
AC_DEFUN(KDE_CHECK_MICO,
3168
AC_REQUIRE([KDE_CHECK_LIBDL])
3169
AC_REQUIRE([KDE_MISC_TESTS])
3170
AC_MSG_CHECKING(for MICO)
3172
if test -z "$MICODIR"; then
3173
kde_micodir=/usr/local
3175
kde_micodir="$MICODIR"
3178
AC_ARG_WITH(micodir,
3179
[ --with-micodir=micodir where mico is installed ],
3180
kde_micodir=$withval,
3181
kde_micodir=$kde_micodir
3184
AC_CACHE_VAL(kde_cv_mico_incdir,
3186
mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3187
AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3190
kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3192
if test ! -r $kde_micodir/include/CORBA.h; then
3193
AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3196
AC_MSG_RESULT($kde_micodir)
3198
MICO_INCLUDES=-I$kde_micodir/include
3199
AC_SUBST(MICO_INCLUDES)
3200
MICO_LDFLAGS=-L$kde_micodir/lib
3201
AC_SUBST(MICO_LDFLAGS)
3202
micodir=$kde_micodir
3205
AC_MSG_CHECKING([for MICO version])
3206
AC_CACHE_VAL(kde_cv_mico_version,
3209
cat >conftest.$ac_ext <<EOF
3211
#include <mico/version.h>
3214
printf("MICO_VERSION=%s\n",MICO_VERSION);
3218
ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3219
if AC_TRY_EVAL(ac_compile); then
3220
if eval `./conftest 2>&5`; then
3221
kde_cv_mico_version=$MICO_VERSION
3223
AC_MSG_ERROR([your system is not able to execute a small application to
3224
find MICO version! Check $kde_micodir/include/mico/version.h])
3227
AC_MSG_ERROR([your system is not able to compile a small application to
3228
find MICO version! Check $kde_micodir/include/mico/version.h])
3232
dnl installed MICO version
3233
mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3234
mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3235
mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3237
if test "x$1" = "x"; then
3243
dnl required MICO version
3244
req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3245
req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3246
req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3248
if test "$mico_v_maj" -lt "$req_v_maj" || \
3249
( test "$mico_v_maj" -eq "$req_v_maj" && \
3250
test "$mico_v_mid" -lt "$req_v_mid" ) || \
3251
( test "$mico_v_mid" -eq "$req_v_mid" && \
3252
test "$mico_v_min" -lt "$req_v_min" )
3255
AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3256
at least is required. You should upgrade MICO.])
3258
AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3261
LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3263
if test -z "$IDL"; then
3264
IDL='$(kde_bindir)/cuteidl'
3267
IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3268
AC_SUBST(IDL_DEPENDENCIES)
3270
idldir="\$(includedir)/idl"
3275
AC_DEFUN(KDE_CHECK_MINI_STL,
3277
AC_REQUIRE([KDE_CHECK_MICO])
3279
AC_MSG_CHECKING(if we use mico's mini-STL)
3280
AC_CACHE_VAL(kde_cv_have_mini_stl,
3284
kde_save_cxxflags="$CXXFLAGS"
3285
CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3288
#include <mico/config.h>
3291
#ifdef HAVE_MINI_STL
3295
kde_cv_have_mini_stl=no,
3296
kde_cv_have_mini_stl=yes)
3297
CXXFLAGS="$kde_save_cxxflags"
3301
if test "x$kde_cv_have_mini_stl" = "xyes"; then
3313
AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3315
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3316
AC_SUBST(LIBPTHREAD)
3319
AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3321
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3322
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3324
if test "$kde_use_kernthreads" = "yes"; then
3325
ac_save_CXXFLAGS="$CXXFLAGS"
3326
ac_save_CFLAGS="$CXXFLAGS"
3327
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3328
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3329
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3330
CXXFLAGS="$ac_save_CXXFLAGS"
3331
CFLAGS="$ac_save_CFLAGS"
3332
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3333
kde_use_kernthreads=no
3335
dnl Add proper -I and -l statements
3336
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3337
if test "x$LIBPTHREAD" = "x"; then
3338
kde_use_kernthreads=no
3340
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3345
if test -z "$LIBPTHREAD"; then
3346
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3352
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3353
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS"
3354
echo "Setting Solaris pthread compilation options"
3357
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3358
echo "Setting FreeBSD pthread compilation options"
3361
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3362
LIBPTHREAD="$LIBPTHREAD -lc_r"
3363
echo "Setting AIX pthread compilation options"
3365
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3366
USE_THREADS="$USE_THREADS -DPIC -fPIC"
3367
echo "Setting Linux pthread compilation options"
3372
AC_SUBST(USE_THREADS)
3373
AC_SUBST(LIBPTHREAD)
3376
AC_DEFUN(KDE_CHECK_THREADING,
3378
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3379
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
3380
dnl default is yes if libpthread is found and no if no libpthread is available
3381
if test -z "$LIBPTHREAD"; then
3382
kde_check_threading_default=no
3384
kde_check_threading_default=yes
3386
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
3387
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
3389
if test "x$kde_use_threading" = "xyes"; then
3390
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
3394
AC_DEFUN(KDE_TRY_LINK_PYTHON,
3396
if test "$kde_python_link_found" = no; then
3398
if test "$1" = normal; then
3399
AC_MSG_CHECKING(if a Python application links)
3401
AC_MSG_CHECKING(if Python depends on $2)
3404
AC_CACHE_VAL(kde_cv_try_link_python_$1,
3408
kde_save_cflags="$CFLAGS"
3409
CFLAGS="$CFLAGS $PYTHONINC"
3410
kde_save_libs="$LIBS"
3411
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
3412
kde_save_ldflags="$LDFLAGS"
3413
LDFLAGS="$LDFLAGS $PYTHONLIB"
3419
PySys_SetArgv(1, 0);
3421
[kde_cv_try_link_python_$1=yes],
3422
[kde_cv_try_link_python_$1=no]
3424
CFLAGS="$kde_save_cflags"
3425
LIBS="$kde_save_libs"
3426
LDFLAGS="$kde_save_ldflags"
3429
if test "$kde_cv_try_link_python_$1" = "yes"; then
3431
kde_python_link_found=yes
3432
if test ! "$1" = normal; then
3433
LIBPYTHON="$LIBPYTHON $2"
3446
AC_DEFUN(KDE_CHECK_PYTHON,
3448
AC_REQUIRE([KDE_CHECK_LIBDL])
3449
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3451
AC_MSG_CHECKING([for Python directory])
3453
AC_CACHE_VAL(kde_cv_pythondir,
3455
if test -z "$PYTHONDIR"; then
3456
kde_cv_pythondir=/usr/local
3458
kde_cv_pythondir="$PYTHONDIR"
3462
AC_ARG_WITH(pythondir,
3463
[ --with-pythondir=pythondir use python installed in pythondir ],
3465
ac_python_dir=$withval
3466
], ac_python_dir=$kde_cv_pythondir
3469
AC_MSG_RESULT($ac_python_dir)
3471
if test -z "$1"; then
3477
AC_MSG_CHECKING([for Python$version])
3479
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
3480
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
3481
if test ! -r $python_incdir/Python.h; then
3482
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
3483
python_incdir=$python_incdir/python$version
3484
if test ! -r $python_incdir/Python.h; then
3485
AC_MSG_ERROR(Python.h not found.)
3489
PYTHONINC=-I$python_incdir
3491
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3492
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
3493
if test ! -r $python_libdir/libpython$version.a; then
3494
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
3495
python_libdir=$python_libdir/python$version/config
3496
if test ! -r $python_libdir/libpython$version.a; then
3497
AC_MSG_ERROR(libpython$version.a not found.)
3501
PYTHONLIB=-L$python_libdir
3502
if test -z "$LIBPYTHON"; then
3503
LIBPYTHON=-lpython$version
3506
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3507
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
3508
python_moddir=$python_moddir/python$version
3509
if test ! -r $python_moddir/copy.py; then
3510
AC_MSG_ERROR(python module directory not found.)
3513
PYTHONMODDIR=$python_moddir
3515
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
3517
dnl Note: this test is very weak
3518
kde_python_link_found=no
3519
KDE_TRY_LINK_PYTHON(normal)
3520
KDE_TRY_LINK_PYTHON(m, -lm)
3521
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
3522
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
3523
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm], [],
3524
[AC_MSG_WARN([it seems, Python depends on another library.
3525
Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
3526
and contact the authors to let them know about this problem])
3529
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
3533
AC_SUBST(PYTHONMODDIR)
3538
AC_DEFUN(KDE_CHECK_STL_SGI,
3540
AC_MSG_CHECKING([if STL implementation is SGI like])
3541
AC_CACHE_VAL(kde_cv_stl_type_sgi,
3545
using namespace std;
3547
string astring="Hallo Welt.";
3548
astring.erase(0, 6); // now astring is "Welt"
3550
], kde_cv_stl_type_sgi=yes,
3551
kde_cv_stl_type_sgi=no)
3554
AC_MSG_RESULT($kde_cv_stl_type_sgi)
3556
if test "$kde_cv_stl_type_sgi" = "yes"; then
3557
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
3561
AC_DEFUN(KDE_CHECK_STL_HP,
3563
AC_MSG_CHECKING([if STL implementation is HP like])
3564
AC_CACHE_VAL(kde_cv_stl_type_hp,
3568
using namespace std;
3570
string astring="Hello World";
3571
astring.remove(0, 6); // now astring is "World"
3573
], kde_cv_stl_type_hp=yes,
3574
kde_cv_stl_type_hp=no)
3576
AC_MSG_RESULT($kde_cv_stl_type_hp)
3578
if test "$kde_cv_stl_type_hp" = "yes"; then
3579
AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by SGI])
3583
AC_DEFUN(KDE_CHECK_STL,
3587
ac_save_CXXFLAGS="$CXXFLAGS"
3588
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
3591
if test "$kde_cv_stl_type_sgi" = "no"; then
3594
if test "$kde_cv_stl_type_hp" = "no"; then
3595
AC_MSG_ERROR("no known STL type found")
3599
CXXFLAGS="$ac_save_CXXFLAGS"
3603
AC_DEFUN(AC_FIND_QIMGIO,
3604
[AC_REQUIRE([AC_FIND_JPEG])
3605
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3606
AC_MSG_CHECKING([for qimgio])
3607
AC_CACHE_VAL(ac_cv_lib_qimgio,
3611
ac_save_LIBS="$LIBS"
3612
ac_save_CXXFLAGS="$CXXFLAGS"
3613
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
3614
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
3617
#include <qimageio.h>
3618
#include <qstring.h>
3620
QString t = "hallo";
3625
ac_cv_lib_qimgio=yes,
3626
ac_cv_lib_qimgio=no,
3627
ac_cv_lib_qimgio=no)
3628
LIBS="$ac_save_LIBS"
3629
CXXFLAGS="$ac_save_CXXFLAGS"
3632
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
3633
LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
3635
AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
3638
AC_MSG_RESULT(not found)
3642
AC_DEFUN(KDE_CHECK_ANSI,
3646
AC_DEFUN(KDE_CHECK_INSURE,
3648
AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
3650
if test $enableval = "no"; dnl
3651
then ac_use_insure="no"
3652
else ac_use_insure="yes"
3654
], [ac_use_insure="no"])
3656
AC_MSG_CHECKING(if we will use Insure++ to debug)
3657
AC_MSG_RESULT($ac_use_insure)
3658
if test "$ac_use_insure" = "yes"; dnl
3659
then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
3663
AC_DEFUN(AM_DISABLE_LIBRARIES,
3665
AC_PROVIDE([AM_ENABLE_STATIC])
3666
AC_PROVIDE([AM_ENABLE_SHARED])
3672
AC_DEFUN(AC_CHECK_UTMP_FILE,
3674
AC_MSG_CHECKING([for utmp file])
3676
AC_CACHE_VAL(kde_cv_utmp_file,
3687
if test -r "$ac_file"; then
3688
kde_cv_utmp_file=$ac_file
3694
if test "$kde_cv_utmp_file" != "no"; then
3695
AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
3697
AC_MSG_RESULT($kde_cv_utmp_file)
3700
AC_MSG_RESULT([non found])
3705
AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
3708
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
3710
if test ! -s $srcdir/subdirs; then
3711
dnl Note: Makefile.common creates subdirs, so this is just a fallback
3713
files=`cd $srcdir && ls -1`
3714
dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
3716
echo $i >> $srcdir/subdirs
3720
if test -s $srcdir/inst-apps; then
3721
ac_topsubdirs="`cat $srcdir/inst-apps`"
3723
ac_topsubdirs="`cat $srcdir/subdirs`"
3726
for i in $ac_topsubdirs; do
3727
AC_MSG_CHECKING([if $i should be compiled])
3728
if test -d $srcdir/$i; then
3730
for j in $DO_NOT_COMPILE; do
3731
if test $i = $j; then
3738
AC_MSG_RESULT($install_it)
3739
if test $install_it = "yes"; then
3740
TOPSUBDIRS="$TOPSUBDIRS $i"
3744
AC_SUBST(TOPSUBDIRS)
3747
AC_DEFUN(KDE_CHECK_NAMESPACES,
3749
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
3763
int Foo::Bar::i = 1;
3766
AC_DEFINE(HAVE_NAMESPACES)
3773
AC_DEFUN(KDE_CHECK_NEWLIBS,
3778
dnl ------------------------------------------------------------------------
3779
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
3780
dnl ------------------------------------------------------------------------
3782
AC_DEFUN(AC_CHECK_S_ISSOCK,
3784
AC_MSG_CHECKING(for S_ISSOCK)
3785
AC_CACHE_VAL(ac_cv_have_s_issock,
3791
#include <sys/stat.h>
3795
int b = S_ISSOCK( buff.st_mode );
3797
ac_cv_have_s_issock=yes,
3798
ac_cv_have_s_issock=no)
3801
AC_MSG_RESULT($ac_cv_have_s_issock)
3802
if test "$ac_cv_have_s_issock" = "yes"; then
3803
AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
3807
dnl ------------------------------------------------------------------------
3808
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
3809
dnl ------------------------------------------------------------------------
3811
AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
3813
AC_MSG_CHECKING(for MAXPATHLEN)
3814
AC_CACHE_VAL(ac_cv_maxpathlen,
3817
cat > conftest.$ac_ext <<EOF
3819
#include <sys/param.h>
3821
#define MAXPATHLEN 1024
3824
KDE_HELLO MAXPATHLEN
3828
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
3830
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
3831
ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
3833
ac_cv_maxpathlen=1024
3839
AC_MSG_RESULT($ac_cv_maxpathlen)
3840
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
3843
dnl -------------------------------------------------------------------------
3844
dnl See if the compiler supports a template repository bero@redhat.de
3845
dnl -------------------------------------------------------------------------
3846
AC_DEFUN(KDE_COMPILER_REPO,
3851
KDE_CHECK_COMPILER_FLAG(frepo,
3857
if test -z "$REPO"; then
3858
KDE_CHECK_COMPILER_FLAG(instances=explicit,
3860
REPO="-instances=explicit"
3861
NOREPO="-instances=extern"
3865
if test -n "$REPO"; then
3866
AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
3867
[C++ compiler supports template repository])
3875
AC_DEFUN(KDE_CHECK_HEADER,
3878
kde_safe_cppflags=$CPPFLAGS
3879
CPPFLAGS="$CPPFLAGS $all_includes"
3881
AC_CHECK_HEADER($1, $2, $3)
3882
CPPFLAGS=$kde_safe_cppflags
3886
AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
3888
KDE_CHECK_HEADER(QwSpriteField.h, ,
3890
AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
3891
QwSpriteField out of kdesupport.])
3896
AC_DEFUN(KDE_FAST_CONFIGURE,
3898
dnl makes configure fast (needs perl)
3899
AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
3900
with_fast_perl=$enableval, with_fast_perl=yes)
3903
AC_DEFUN(KDE_CONF_FILES,
3906
if test -f $srcdir/configure.files ; then
3907
val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
3910
if test -n "$val" ; then
3912
CONF_FILES="$CONF_FILES $i"
3915
AC_SUBST(CONF_FILES)
3918
AC_DEFUN(KDE_SET_PREFIX,
3921
dnl make $KDEDIR the default for the installation
3922
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3924
if test "x$prefix" = "xNONE"; then
3925
prefix=$ac_default_prefix
3926
ac_configure_args="$ac_configure_args --prefix $prefix"
3932
pushdef([AC_PROG_INSTALL],
3934
dnl our own version, testing for a -p flag
3935
popdef([AC_PROG_INSTALL])
3936
dnl as AC_PROG_INSTALL works as it works we first have
3937
dnl to save if the user didn't specify INSTALL, as the
3938
dnl autoconf one overwrites INSTALL and we have no chance to find
3940
test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
3941
test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
3942
test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
3945
if test -z "$kde_save_INSTALL_given" ; then
3946
# OK, user hasn't given any INSTALL, autoconf found one for us
3947
# now we test, if it supports the -p flag
3948
AC_MSG_CHECKING(for -p flag to install)
3949
rm -f confinst.$$.* > /dev/null 2>&1
3950
echo "Testtest" > confinst.$$.orig
3952
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
3953
if test -f confinst.$$.new ; then
3954
# OK, -p seems to do no harm to install
3955
INSTALL="${INSTALL} -p"
3960
AC_MSG_RESULT($ac_res)
3962
dnl the following tries to resolve some signs and wonders coming up
3963
dnl with different autoconf/automake versions
3965
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
3966
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
3967
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
3968
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
3969
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
3970
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
3971
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
3972
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
3973
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
3974
dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
3975
dnl automake (due to broken Makefile.am or whatever) to install programs,
3976
dnl and so does not see the -s flag in automake > 1.4
3977
dnl to clean up that mess we:
3978
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
3979
dnl which cleans KDE's program with automake > 1.4;
3980
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
3981
dnl with automake<=1.4
3982
dnl note that dues to this sometimes two '-s' flags are used (if KDE
3983
dnl properly uses install-@DIR@PROGRAMS, but I don't care
3985
dnl And to all this comes, that I even can't write in comments variable
3986
dnl names used by automake, because it is so stupid to think I wanted to
3987
dnl _use_ them, therefor I have written A_M_... instead of AM_
3988
dnl hmm, I wanted to say something ... ahh yes: Arghhh.
3990
if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
3991
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
3993
if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
3994
INSTALL_SCRIPT='${INSTALL}'
3998
AC_DEFUN(KDE_LANG_CPLUSPLUS,
4000
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4001
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4004
pushdef([AC_LANG_CPLUSPLUS],
4005
[popdef([AC_LANG_CPLUSPLUS])
4009
AC_DEFUN(KDE_CHECK_LONG_LONG,
4011
AC_MSG_CHECKING(for long long)
4012
AC_CACHE_VAL(kde_cv_c_long_long,
4020
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4022
AC_MSG_RESULT($kde_cv_c_long_long)
4023
if test "$kde_cv_c_long_long" = yes; then
4024
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])