3
dnl This file is part of the KDE libraries/packages
4
dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5
dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
7
dnl This file is free software; you can redistribute it and/or
8
dnl modify it under the terms of the GNU Library General Public
9
dnl License as published by the Free Software Foundation; either
10
dnl version 2 of the License, or (at your option) any later version.
12
dnl This library is distributed in the hope that it will be useful,
13
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
dnl Library General Public License for more details.
17
dnl You should have received a copy of the GNU Library General Public License
18
dnl along with this library; see the file COPYING.LIB. If not, write to
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
dnl Boston, MA 02111-1307, USA.
23
dnl Please do not modify this file unless you expect your modifications to be
24
dnl carried into every other module in the repository. If you decide that you
25
dnl really want to modify it, contact coolo@kde.org mentioning that you have
26
dnl and that the modified file should be committed to every module.
28
dnl Single-module modifications are best placed in configure.in for kdelibs
29
dnl and kdebase or configure.in.in if present.
31
dnl ------------------------------------------------------------------------
32
dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
33
dnl thanks to Raja R Harinath.
34
dnl ------------------------------------------------------------------------
36
ifdef([_AC_PATH_X_DIRECT],[],
37
[AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
38
ifdef([_AC_PATH_X_XMKMF],[],
39
[AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
41
dnl ------------------------------------------------------------------------
42
dnl Find a file (or one of more files in a list of dirs)
43
dnl ------------------------------------------------------------------------
45
AC_DEFUN(AC_FIND_FILE,
52
echo "configure: __oline__: $i/$j" >&AC_FD_CC
53
if test -r "$i/$j"; then
54
echo "taking that" >&AC_FD_CC
62
dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
63
dnl if-not-found, test-parameter)
64
AC_DEFUN(KDE_FIND_PATH,
66
AC_MSG_CHECKING([for $1])
67
if test -n "$$2"; then
70
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
72
AC_CACHE_VAL(kde_cv_path_$kde_cache,
84
if test -x "$dir/$1"; then
87
evalstr="$dir/$1 $5 2>&1 "
88
if eval $evalstr; then
99
eval "kde_cv_path_$kde_cache=$kde_cv_path"
103
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
107
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
108
AC_MSG_RESULT(not found)
111
AC_MSG_RESULT($kde_cv_path)
117
AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
119
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
120
Please check whether you installed Qt correctly.
121
You need to have a running moc binary.
122
configure tried to run $ac_cv_path_moc and the test didn't
123
succeed. If configure shouldn't have tried this one, set
124
the environment variable MOC to the right one before running
129
AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
131
AC_MSG_WARN([No Qt ui compiler (uic) found!
132
Please check whether you installed Qt correctly.
133
You need to have a running uic binary.
134
configure tried to run $ac_cv_path_uic and the test didn't
135
succeed. If configure shouldn't have tried this one, set
136
the environment variable UIC to the right one before running
141
dnl ------------------------------------------------------------------------
142
dnl Find the meta object compiler and the ui compiler in the PATH,
143
dnl in $QTDIR/bin, and some more usual places
144
dnl ------------------------------------------------------------------------
146
AC_DEFUN(AC_PATH_QT_MOC_UIC,
149
for dir in $kde_qt_dirs; do
150
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
152
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
153
if test ! "$ac_qt_bindir" = "NO"; then
154
qt_bindirs="$ac_qt_bindir $qt_bindirs"
157
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
158
if test -z "$UIC_NOT_NEEDED"; then
159
KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
160
if test -z "$UIC" ; then
161
KDE_UIC_ERROR_MESSAGE
165
UIC="echo uic not available: "
172
AC_DEFUN(KDE_1_CHECK_PATHS,
174
KDE_1_CHECK_PATH_HEADERS
178
if test -n "$USE_RPATH"; then
180
if test -n "$kde_libraries"; then
181
KDE_TEST_RPATH="-R $kde_libraries"
184
if test -n "$qt_libraries"; then
185
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
188
if test -n "$x_libraries"; then
189
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
192
KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
195
AC_MSG_CHECKING([for KDE libraries installed])
196
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'
198
if AC_TRY_EVAL(ac_link) && test -s conftest; then
201
AC_MSG_ERROR([your system fails at linking a small KDE application!
202
Check, if your compiler is installed correctly and if you have used the
203
same compiler to compile Qt and kdelibs as you did use now.
204
For more details about this problem, look at the end of config.log.])
207
if eval `KDEDIR= ./conftest 2>&5`; then
213
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
214
kde_have_all_paths=yes
216
KDE_SET_PATHS($kde_result)
220
AC_DEFUN(KDE_SET_PATHS,
222
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
223
kde_htmldir=\"$kde_htmldir\" \
224
kde_appsdir=\"$kde_appsdir\" \
225
kde_icondir=\"$kde_icondir\" \
226
kde_sounddir=\"$kde_sounddir\" \
227
kde_datadir=\"$kde_datadir\" \
228
kde_locale=\"$kde_locale\" \
229
kde_cgidir=\"$kde_cgidir\" \
230
kde_confdir=\"$kde_confdir\" \
231
kde_mimedir=\"$kde_mimedir\" \
232
kde_toolbardir=\"$kde_toolbardir\" \
233
kde_wallpaperdir=\"$kde_wallpaperdir\" \
234
kde_templatesdir=\"$kde_templatesdir\" \
235
kde_bindir=\"$kde_bindir\" \
236
kde_servicesdir=\"$kde_servicesdir\" \
237
kde_servicetypesdir=\"$kde_servicetypesdir\" \
238
kde_moduledir=\"$kde_moduledir\" \
242
AC_DEFUN(KDE_SET_DEFAULT_PATHS,
244
if test "$1" = "default"; then
246
if test -z "$kde_htmldir"; then
247
kde_htmldir='\${prefix}/share/doc/HTML'
249
if test -z "$kde_appsdir"; then
250
kde_appsdir='\${prefix}/share/applnk'
252
if test -z "$kde_icondir"; then
253
kde_icondir='\${prefix}/share/icons'
255
if test -z "$kde_sounddir"; then
256
kde_sounddir='\${prefix}/share/sounds'
258
if test -z "$kde_datadir"; then
259
kde_datadir='\${prefix}/share/apps'
261
if test -z "$kde_locale"; then
262
kde_locale='\${prefix}/share/locale'
264
if test -z "$kde_cgidir"; then
265
kde_cgidir='\${exec_prefix}/cgi-bin'
267
if test -z "$kde_confdir"; then
268
kde_confdir='\${prefix}/share/config'
270
if test -z "$kde_mimedir"; then
271
kde_mimedir='\${prefix}/share/mimelnk'
273
if test -z "$kde_toolbardir"; then
274
kde_toolbardir='\${prefix}/share/toolbar'
276
if test -z "$kde_wallpaperdir"; then
277
kde_wallpaperdir='\${prefix}/share/wallpapers'
279
if test -z "$kde_templatesdir"; then
280
kde_templatesdir='\${prefix}/share/templates'
282
if test -z "$kde_bindir"; then
283
kde_bindir='\${exec_prefix}/bin'
285
if test -z "$kde_servicesdir"; then
286
kde_servicesdir='\${prefix}/share/services'
288
if test -z "$kde_servicetypesdir"; then
289
kde_servicetypesdir='\${prefix}/share/servicetypes'
291
if test -z "$kde_moduledir"; then
292
kde_moduledir='\${exec_prefix}/lib/kde2'
295
KDE_SET_PATHS(defaults)
299
if test $kde_qtver = 1; then
300
AC_MSG_RESULT([compiling])
303
AC_MSG_ERROR([path checking not yet supported for KDE 2])
309
AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
310
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
311
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
312
test -z "$kde_datadir" || test -z "$kde_locale" ||
313
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
314
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
315
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
316
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
317
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
318
test "$kde_have_all_paths" != "yes"; then
319
kde_have_all_paths=no
323
AC_DEFUN(KDE_MISSING_PROG_ERROR,
325
AC_MSG_ERROR([The important program $1 was not found!
326
Please check whether you installed KDE correctly.
330
AC_DEFUN(KDE_SUBST_PROGRAMS,
333
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"
334
if test -n "$KDEDIRS"; then
337
for dir in $KDEDIRS; do
338
kde_default_bindirs="$dir/bin $kde_default_bindirs "
342
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
343
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
344
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
345
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
346
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
347
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
348
KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
350
if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
351
kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
352
test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
353
AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
354
if test "$KDE_XSL_STYLESHEET" = "NO"; then
355
KDE_XSL_STYLESHEET=""
357
KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
361
DCOP_DEPENDENCIES='$(DCOPIDL)'
363
AC_SUBST(DCOPIDL2CPP)
364
AC_SUBST(DCOP_DEPENDENCIES)
366
AC_SUBST(ARTSCCONFIG)
369
AC_SUBST(KDE_XSL_STYLESHEET)
371
if test -x "$KDECONFIG"; then # it can be "compiled"
372
kde_libs_prefix=`$KDECONFIG --prefix`
373
if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
374
AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
375
This means it has been moved since you installed it.
376
This won't work. Please recompile kdelibs for the new prefix.
379
kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
381
kde_libs_prefix='$(prefix)'
382
kde_libs_htmldir='$(kde_htmldir)'
384
AC_SUBST(kde_libs_prefix)
385
AC_SUBST(kde_libs_htmldir)
388
AC_DEFUN(AC_CREATE_KFSSTND,
390
AC_REQUIRE([AC_CHECK_RPATH])
392
AC_MSG_CHECKING([for KDE paths])
395
AC_CACHE_VAL(kde_cv_all_paths,
397
KDE_SET_DEFAULT_PATHS($1)
400
eval "$kde_cv_all_paths"
401
KDE_CHECK_PATHS_FOR_COMPLETENESS
402
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
403
# wrong values were cached, may be, we can set better ones
405
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
406
kde_datadir= kde_locale= kde_cgidir= kde_confdir=
407
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
408
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
410
KDE_SET_DEFAULT_PATHS($1)
411
eval "$kde_cv_all_paths"
412
KDE_CHECK_PATHS_FOR_COMPLETENESS
413
kde_result="$kde_result (cache overridden)"
415
if test "$kde_have_all_paths" = "no"; then
416
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
417
Since it had compiled and linked before, it must be a strange problem on your system.
418
Look at config.log for details. If you are not able to fix this, look at
419
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
420
(If you're using an egcs version on Linux, you may update binutils!)
424
AC_MSG_RESULT($kde_result)
433
AC_DEFUN(AC_SUBST_KFSSTND,
435
AC_SUBST(kde_htmldir)
436
AC_SUBST(kde_appsdir)
437
AC_SUBST(kde_icondir)
438
AC_SUBST(kde_sounddir)
439
AC_SUBST(kde_datadir)
441
AC_SUBST(kde_confdir)
442
AC_SUBST(kde_mimedir)
443
AC_SUBST(kde_wallpaperdir)
446
AC_SUBST(kde_templatesdir)
447
AC_SUBST(kde_servicesdir)
448
AC_SUBST(kde_servicetypesdir)
449
AC_SUBST(kde_moduledir)
450
if test "$kde_qtver" = 1; then
451
kde_minidir="$kde_icondir/mini"
453
# for KDE 1 - this breaks KDE2 apps using minidir, but
454
# that's the plan ;-/
455
kde_minidir="/dev/null"
457
dnl AC_SUBST(kde_minidir)
458
dnl AC_SUBST(kde_cgidir)
459
dnl AC_SUBST(kde_toolbardir)
462
AC_DEFUN(KDE_MISC_TESTS,
465
dnl Checks for libraries.
466
AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
468
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
471
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
472
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
473
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
474
You should install libcrypt from another source or configure with PAM
479
if test $kde_have_crypt = yes; then
480
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
484
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
485
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
486
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
487
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
489
AC_CHECK_FUNC(inet_ntoa)
490
if test $ac_cv_func_inet_ntoa = no; then
491
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
493
AC_CHECK_FUNC(connect)
494
if test $ac_cv_func_connect = no; then
495
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
499
AC_CHECK_FUNC(remove)
500
if test $ac_cv_func_remove = no; then
501
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
504
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
505
AC_CHECK_FUNC(shmat, ,
506
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
508
# Solaris 2.6 and others need -lresolv for res_init
509
AC_CHECK_FUNCS(res_init, , [
510
kde_libs_safe="$LIBS"
511
LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
520
X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
521
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
526
LIBSOCKET="$X_EXTRA_LIBS"
529
AC_SUBST(X_EXTRA_LIBS)
530
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
533
case $host in dnl this *is* LynxOS specific
535
AC_MSG_CHECKING([LynxOS header file wrappers])
536
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
537
AC_MSG_RESULT(disabled)
538
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
546
dnl ------------------------------------------------------------------------
547
dnl Find the header files and libraries for X-Windows. Extended the
549
dnl ------------------------------------------------------------------------
553
AC_REQUIRE([AC_PROG_CPP])dnl
554
AC_REQUIRE([KDE_MISC_TESTS])dnl
555
AC_MSG_CHECKING(for X)
558
AC_CACHE_VAL(kde_cv_have_x,
559
[# One or both of the vars are not set, and there is no cached value.
560
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
563
kde_x_includes=$x_includes
565
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
568
kde_x_libraries=$x_libraries
571
# below we use the standard autoconf calls
572
ac_x_libraries=$kde_x_libraries
573
ac_x_includes=$kde_x_includes
576
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
577
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
578
dnl location. The correct location is /usr/lib32 or an undefined value
579
dnl (the linker is smart enough to pick the correct default library).
580
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
581
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
582
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
583
dnl x_includes should be left alone.
591
if test -z "$ac_x_includes"; then
594
if test -z "$ac_x_libraries"; then
595
ac_x_libraries="/usr/lib"
598
#from now on we use our own again
600
# when the user already gave --x-includes, we ignore
601
# what the standard autoconf macros told us.
602
if test "$kde_x_includes" = NO; then
603
kde_x_includes=$ac_x_includes
606
# for --x-libraries too
607
if test "$kde_x_libraries" = NO; then
608
kde_x_libraries=$ac_x_libraries
611
if test "$kde_x_includes" = NO; then
612
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
615
if test "$kde_x_libraries" = NO; then
616
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
619
# Record where we found X for the cache.
620
kde_cv_have_x="have_x=yes \
621
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
624
eval "$kde_cv_have_x"
626
if test "$have_x" != yes; then
627
AC_MSG_RESULT($have_x)
630
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
633
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
635
x_includes="."; dnl better than nothing :-
637
x_includes=$kde_x_includes
638
X_INCLUDES="-I$x_includes"
641
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
643
x_libraries="/usr/lib"; dnl better than nothing :-
645
x_libraries=$kde_x_libraries
646
X_LDFLAGS="-L$x_libraries"
648
all_includes="$X_INCLUDES"
649
all_libraries="$X_LDFLAGS"
653
AC_SUBST(x_libraries)
656
# Check for libraries that X11R6 Xt/Xaw programs need.
657
ac_save_LDFLAGS="$LDFLAGS"
658
LDFLAGS="$LDFLAGS $X_LDFLAGS"
659
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
660
# check for ICE first), but we must link in the order -lSM -lICE or
661
# we get undefined symbols. So assume we have SM if we have ICE.
662
# These have to be linked with before -lX11, unlike the other
663
# libraries we check for below, so use a different variable.
664
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
665
AC_CHECK_LIB(ICE, IceConnectionNumber,
666
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
668
LDFLAGS="$ac_save_LDFLAGS"
672
LIB_X11='-lX11 $(LIBSOCKET)'
675
AC_MSG_CHECKING(for libXext)
676
AC_CACHE_VAL(kde_cv_have_libXext,
678
kde_ldflags_safe="$LDFLAGS"
679
kde_libs_safe="$LIBS"
681
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
682
LIBS="-lXext -lX11 $LIBSOCKET"
691
printf("hello Xext\n");
693
kde_cv_have_libXext=yes,
694
kde_cv_have_libXext=no
697
LDFLAGS=$kde_ldflags_safe
701
AC_MSG_RESULT($kde_cv_have_libXext)
703
if test "$kde_cv_have_libXext" = "no"; then
704
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
705
can't find it itself, we stop here assuming that make wouldn't find
709
AC_MSG_CHECKING(for Xinerama)
711
AC_ARG_WITH(xinerama,
712
[ --with-xinerama enable support for Xinerama ],
720
kde_save_LDFLAGS="$LDFLAGS"
721
kde_save_CFLAGS="$CFLAGS"
722
kde_save_LIBS="$LIBS"
723
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
724
CFLAGS="$CFLAGS -I$x_includes"
725
LIBS="-lXinerama -lXext"
727
if test "x$no_xinerama" = "xno"; then
729
AC_CACHE_VAL(ac_cv_have_xinerama,
731
AC_TRY_LINK([#include <X11/Xlib.h>
732
#include <X11/extensions/Xinerama.h>],
733
[XineramaIsActive(NULL);],
734
[ac_cv_have_xinerama="yes"],
735
[ac_cv_have_xinerama="no"])
738
ac_cv_have_xinerama=no;
741
AC_MSG_RESULT($ac_cv_have_xinerama)
745
if test "$ac_cv_have_xinerama" = "yes"; then
746
AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
747
LIBXINERAMA="-lXinerama"
750
AC_SUBST(LIBXINERAMA)
752
LDFLAGS="$kde_save_LDFLAGS"
753
CFLAGS="$kde_save_CFLAGS"
754
LIBS="$kde_save_LIBS"
760
AC_DEFUN(KDE_PRINT_QT_PROGRAM,
762
AC_REQUIRE([KDE_USE_QT])
763
cat > conftest.$ac_ext <<EOF
764
#include "confdefs.h"
766
#include <qapplication.h>
768
if test "$kde_qtver" = "2"; then
769
cat >> conftest.$ac_ext <<EOF
775
if test $kde_qtsubver -gt 0; then
776
cat >> conftest.$ac_ext <<EOF
777
#include <qiconview.h>
783
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
784
cat >> conftest.$ac_ext <<EOF
790
if test "$kde_qtver" = "2"; then
791
cat >> conftest.$ac_ext <<EOF
792
QStringList *t = new QStringList();
794
if test $kde_qtsubver -gt 0; then
795
cat >> conftest.$ac_ext <<EOF
797
iv.setWordWrapIconText(false);
799
s.setLatin1("Elvis is alive", 14);
800
int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
804
cat >> conftest.$ac_ext <<EOF
813
if test -z "$1"; then
817
kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
818
# following is the check if subversion isn�t found in passed argument
819
if test "$kde_qtsubver" = "$1"; then
822
kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
823
if test "$kde_qtver" = "1"; then
826
# this is the version number fallback to 2.1, unless major version is 1 or 2
827
if test "$kde_qtver" != "2"; then
834
if test -z "$2"; then
835
if test $kde_qtver = 2; then
836
if test $kde_qtsubver -gt 0; then
837
kde_qt_minversion=">= Qt 2.2.2"
839
kde_qt_minversion=">= Qt 2.0.2"
842
kde_qt_minversion=">= 1.42 and < 2.0"
848
if test -z "$3"; then
849
if test $kde_qtver = 2; then
850
if test $kde_qtsubver -gt 0; then
851
kde_qt_verstring="QT_VERSION >= 222"
853
kde_qt_verstring="QT_VERSION >= 200"
856
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
862
if test $kde_qtver = 2; then
863
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
865
kde_qt_dirs="$QTDIR /usr/lib/qt"
869
AC_DEFUN(KDE_CHECK_QT_DIRECT,
871
AC_REQUIRE([KDE_USE_QT])
872
AC_MSG_CHECKING([if Qt compiles without flags])
873
AC_CACHE_VAL(kde_cv_qt_direct,
877
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
878
ac_LIBRARY_PATH="$LIBRARY_PATH"
879
ac_cxxflags_safe="$CXXFLAGS"
880
ac_ldflags_safe="$LDFLAGS"
883
CXXFLAGS="$CXXFLAGS -I$qt_includes"
884
LDFLAGS="$LDFLAGS $X_LDFLAGS"
885
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
887
export LD_LIBRARY_PATH
893
if AC_TRY_EVAL(ac_link) && test -s conftest; then
894
kde_cv_qt_direct="yes"
896
kde_cv_qt_direct="no"
897
echo "configure: failed program was:" >&AC_FD_CC
898
cat conftest.$ac_ext >&AC_FD_CC
902
CXXFLAGS="$ac_cxxflags_safe"
903
LDFLAGS="$ac_ldflags_safe"
906
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
907
export LD_LIBRARY_PATH
908
LIBRARY_PATH="$ac_LIBRARY_PATH"
913
if test "$kde_cv_qt_direct" = "yes"; then
922
dnl ------------------------------------------------------------------------
923
dnl Try to find the Qt headers and libraries.
924
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
925
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
926
dnl ------------------------------------------------------------------------
928
AC_DEFUN(AC_PATH_QT_1_3,
930
AC_REQUIRE([K_PATH_X])
931
AC_REQUIRE([KDE_USE_QT])
933
dnl ------------------------------------------------------------------------
934
dnl Add configure flag to enable linking to MT version of Qt library.
935
dnl ------------------------------------------------------------------------
939
[ --enable-mt link to threaded Qt (experimental)],
940
kde_use_qt_mt=$enableval,
946
dnl ------------------------------------------------------------------------
947
dnl If we got --enable-qt-mt then adjust some vars for the host.
948
dnl ------------------------------------------------------------------------
950
if test "x$kde_use_qt_mt" = "xyes"; then
954
if test "x$GCC" = "xyes"; then
955
CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
956
X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
958
AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
962
AC_MSG_WARN([MT not yet supported on $host - disabled.])
970
dnl ------------------------------------------------------------------------
971
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
972
dnl ------------------------------------------------------------------------
974
if test -z "$LIBQT_GLOB"; then
980
if test -z "$LIBQT"; then
985
dnl ------------------------------------------------------------------------
986
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
987
dnl ------------------------------------------------------------------------
989
if test "x$kde_use_qt_mt" = "xyes"; then
993
if test "x$GCC" = "xyes"; then
996
LIBQT_GLOB="libqt-mt.*"
997
USING_QT_MT="using -mt"
1009
if test $kde_qtver = 2; then
1011
AC_REQUIRE([AC_FIND_PNG])
1012
AC_REQUIRE([AC_FIND_JPEG])
1013
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1016
AC_MSG_CHECKING([for Qt])
1018
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1019
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1023
[ --with-qt-dir=DIR where the root of Qt is installed ],
1024
[ ac_qt_includes="$withval"/include
1025
ac_qt_libraries="$withval"/lib
1026
ac_qt_bindir="$withval"/bin
1029
AC_ARG_WITH(qt-includes,
1030
[ --with-qt-includes=DIR where the Qt includes are. ],
1032
ac_qt_includes="$withval"
1035
kde_qt_libs_given=no
1037
AC_ARG_WITH(qt-libraries,
1038
[ --with-qt-libraries=DIR where the Qt library is installed.],
1039
[ ac_qt_libraries="$withval"
1040
kde_qt_libs_given=yes
1043
AC_CACHE_VAL(ac_cv_have_qt,
1044
[#try to guess Qt locations
1047
for dir in $kde_qt_dirs; do
1048
qt_incdirs="$qt_incdirs $dir/include $dir"
1050
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes"
1051
if test ! "$ac_qt_includes" = "NO"; then
1052
qt_incdirs="$ac_qt_includes $qt_incdirs"
1055
if test "$kde_qtver" = "2"; then
1056
kde_qt_header=qstyle.h
1058
kde_qt_header=qglobal.h
1061
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1062
ac_qt_includes="$qt_incdir"
1065
for dir in $kde_qt_dirs; do
1066
qt_libdirs="$qt_libdirs $dir/lib $dir"
1068
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1069
if test ! "$ac_qt_libraries" = "NO"; then
1070
qt_libdir=$ac_qt_libraries
1072
qt_libdirs="$ac_qt_libraries $qt_libdirs"
1073
# if the Qt was given, the chance is too big that libqt.* doesn't exist
1075
for dir in $qt_libdirs; do
1076
try="ls -1 $dir/${LIBQT_GLOB}"
1077
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1081
ac_qt_libraries="$qt_libdir"
1086
ac_cxxflags_safe="$CXXFLAGS"
1087
ac_ldflags_safe="$LDFLAGS"
1088
ac_libs_safe="$LIBS"
1090
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1091
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
1094
KDE_PRINT_QT_PROGRAM
1096
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1099
echo "configure: failed program was:" >&AC_FD_CC
1100
cat conftest.$ac_ext >&AC_FD_CC
1101
ac_qt_libraries="NO"
1104
CXXFLAGS="$ac_cxxflags_safe"
1105
LDFLAGS="$ac_ldflags_safe"
1106
LIBS="$ac_libs_safe"
1109
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1110
ac_cv_have_qt="have_qt=no"
1112
if test "$ac_qt_includes" = NO; then
1113
if test "$ac_qt_libraries" = NO; then
1114
ac_qt_notfound="(headers and libraries)";
1116
ac_qt_notfound="(headers)";
1119
ac_qt_notfound="(libraries)";
1122
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1123
For more details about this problem, look at the end of config.log.])
1129
eval "$ac_cv_have_qt"
1131
if test "$have_qt" != yes; then
1132
AC_MSG_RESULT([$have_qt]);
1134
ac_cv_have_qt="have_qt=yes \
1135
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1136
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1138
qt_libraries="$ac_qt_libraries"
1139
qt_includes="$ac_qt_includes"
1142
if test ! "$kde_qt_libs_given" = "yes"; then
1143
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1146
AC_SUBST(qt_libraries)
1147
AC_SUBST(qt_includes)
1149
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1152
QT_INCLUDES="-I$qt_includes"
1153
all_includes="$QT_INCLUDES $all_includes"
1156
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1159
QT_LDFLAGS="-L$qt_libraries"
1160
all_libraries="$all_libraries $QT_LDFLAGS"
1163
AC_SUBST(QT_INCLUDES)
1164
AC_SUBST(QT_LDFLAGS)
1167
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
1172
AC_DEFUN(AC_PATH_QT,
1177
AC_DEFUN(KDE_CHECK_FINAL,
1179
AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1180
kde_use_final=$enableval, kde_use_final=no)
1183
if test "x$kde_use_final" = "xyes"; then
1184
KDE_USE_FINAL_TRUE=""
1185
KDE_USE_FINAL_FALSE="#"
1187
KDE_USE_FINAL_TRUE="#"
1188
KDE_USE_FINAL_FALSE=""
1190
AC_SUBST(KDE_USE_FINAL_TRUE)
1191
AC_SUBST(KDE_USE_FINAL_FALSE)
1193
AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
1194
kde_use_closure=$enableval, kde_use_closure=yes)
1196
if test "x$kde_use_closure" = "xyes"; then
1197
KDE_USE_CLOSURE_TRUE=""
1198
KDE_USE_CLOSURE_FALSE="#"
1199
# CXXFLAGS="$CXXFLAGS $REPO"
1201
KDE_USE_CLOSURE_TRUE="#"
1202
KDE_USE_CLOSURE_FALSE=""
1204
AC_SUBST(KDE_USE_CLOSURE_TRUE)
1205
AC_SUBST(KDE_USE_CLOSURE_FALSE)
1208
dnl ------------------------------------------------------------------------
1209
dnl Now, the same with KDE
1210
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1211
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1212
dnl ------------------------------------------------------------------------
1214
AC_DEFUN(AC_BASE_PATH_KDE,
1217
AC_REQUIRE([AC_PATH_QT])dnl
1219
AC_MSG_CHECKING([for KDE])
1221
if test "${prefix}" != NONE; then
1222
kde_includes=${prefix}/include
1223
ac_kde_includes=$prefix/include
1225
if test "${exec_prefix}" != NONE; then
1226
kde_libraries=${exec_prefix}/lib
1227
ac_kde_libraries=$exec_prefix/lib
1229
kde_libraries=${prefix}/lib
1230
ac_kde_libraries=$prefix/lib
1239
AC_CACHE_VAL(ac_cv_have_kde,
1240
[#try to guess kde locations
1242
if test "$kde_qtver" = 1; then
1243
kde_check_header="ksock.h"
1244
kde_check_lib="libkdecore.la"
1246
kde_check_header="ksharedptr.h"
1247
kde_check_lib="libkio.la"
1250
if test -z "$1"; then
1252
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
1253
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1254
kde_incdirs="$ac_kde_includes $kde_incdirs"
1255
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1256
ac_kde_includes="$kde_incdir"
1258
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1260
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1261
So, check this please and use another prefix!])
1264
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
1265
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
1266
kde_libdirs="$ac_kde_libraries $kde_libdirs"
1267
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1268
ac_kde_libraries="$kde_libdir"
1270
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1272
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1273
So, check this please and use another prefix!])
1275
ac_kde_libraries="$kde_libdir"
1277
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
1278
ac_cv_have_kde="have_kde=no"
1280
ac_cv_have_kde="have_kde=yes \
1281
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1286
ac_cv_have_kde="have_kde=no"
1291
eval "$ac_cv_have_kde"
1293
if test "$have_kde" != "yes"; then
1294
if test "${prefix}" = NONE; then
1295
ac_kde_prefix="$ac_default_prefix"
1297
ac_kde_prefix="$prefix"
1299
if test "$exec_prefix" = NONE; then
1300
ac_kde_exec_prefix="$ac_kde_prefix"
1301
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1303
ac_kde_exec_prefix="$exec_prefix"
1304
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1307
kde_libraries="${ac_kde_exec_prefix}/lib"
1308
kde_includes=${ac_kde_prefix}/include
1311
ac_cv_have_kde="have_kde=yes \
1312
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1313
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1315
kde_libraries="$ac_kde_libraries"
1316
kde_includes="$ac_kde_includes"
1318
AC_SUBST(kde_libraries)
1319
AC_SUBST(kde_includes)
1321
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include" ; then
1324
KDE_INCLUDES="-I$kde_includes"
1325
all_includes="$KDE_INCLUDES $all_includes"
1328
KDE_LDFLAGS="-L$kde_libraries"
1329
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1330
all_libraries="$all_libraries $KDE_LDFLAGS"
1333
AC_SUBST(KDE_LDFLAGS)
1334
AC_SUBST(KDE_INCLUDES)
1336
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1338
all_libraries="$all_libraries $USER_LDFLAGS"
1339
all_includes="$all_includes $USER_INCLUDES"
1340
AC_SUBST(all_includes)
1341
AC_SUBST(all_libraries)
1346
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1348
AC_MSG_CHECKING(for extra includes)
1349
AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1350
adds non standard include paths],
1351
kde_use_extra_includes="$withval",
1352
kde_use_extra_includes=NONE
1355
if test -n "$kde_use_extra_includes" && \
1356
test "$kde_use_extra_includes" != "NONE"; then
1360
for dir in $kde_use_extra_includes; do
1361
kde_extra_includes="$kde_extra_includes $dir"
1362
USER_INCLUDES="$USER_INCLUDES -I$dir"
1365
kde_use_extra_includes="added"
1367
kde_use_extra_includes="no"
1369
AC_SUBST(USER_INCLUDES)
1371
AC_MSG_RESULT($kde_use_extra_includes)
1374
AC_MSG_CHECKING(for extra libs)
1375
AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1376
kde_use_extra_libs=$withval,
1377
kde_use_extra_libs=NONE
1379
if test -n "$kde_use_extra_libs" && \
1380
test "$kde_use_extra_libs" != "NONE"; then
1384
for dir in $kde_use_extra_libs; do
1385
kde_extra_libs="$kde_extra_libs $dir"
1386
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1387
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1390
kde_use_extra_libs="added"
1392
kde_use_extra_libs="no"
1395
AC_SUBST(USER_LDFLAGS)
1397
AC_MSG_RESULT($kde_use_extra_libs)
1401
AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1403
AC_MSG_CHECKING([for KDE headers installed])
1406
cat > conftest.$ac_ext <<EOF
1408
# include <stdlib.h>
1411
#include "confdefs.h"
1415
printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1416
printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1417
printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1418
printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1419
printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1420
printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1421
printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1422
printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1423
printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1424
printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1425
printf("kde_wallpaperdir=\\"%s\\"\n",
1426
KApplication::kde_wallpaperdir().data());
1427
printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1428
printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1429
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1430
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1431
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1436
ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1437
if AC_TRY_EVAL(ac_compile); then
1440
AC_MSG_ERROR([your system is not able to compile a small KDE application!
1441
Check, if you installed the KDE header files correctly.
1442
For more details about this problem, look at the end of config.log.])
1448
AC_DEFUN(KDE_CHECK_KDEQTADDON,
1450
AC_MSG_CHECKING(for kde-qt-addon)
1451
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1453
kde_ldflags_safe="$LDFLAGS"
1454
kde_libs_safe="$LIBS"
1455
kde_cxxflags_safe="$CXXFLAGS"
1457
LIBS="-lkde-qt-addon $LIBQT $LIBS"
1458
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1459
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1467
kde_cv_have_kdeqtaddon=yes,
1468
kde_cv_have_kdeqtaddon=no
1471
LDFLAGS=$kde_ldflags_safe
1473
kde_cxxflags_safe="$CXXFLAGS"
1476
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1478
if test "$kde_cv_have_kdeqtaddon" = "no"; then
1479
AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1480
It is a separate package (and CVS module) named kde-qt-addon.])
1484
AC_DEFUN(KDE_CHECK_KIMGIO,
1486
AC_REQUIRE([AC_BASE_PATH_KDE])
1487
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1488
AC_REQUIRE([AC_FIND_TIFF])
1489
AC_REQUIRE([AC_FIND_JPEG])
1490
AC_REQUIRE([AC_FIND_PNG])
1491
AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1493
if test "$1" = "existance"; then
1496
kde_save_LIBS="$LIBS"
1497
LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1498
AC_CHECK_LIB(kimgio, kimgioRegister, [
1499
LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1500
LIBS="$kde_save_LIBS"
1503
LIBKIMGIO_EXISTS=yes
1506
if test "$LIBKIMGIO_EXISTS" = "yes"; then
1507
LIB_KIMGIO='-lkimgio'
1511
AC_SUBST(LIB_KIMGIO)
1514
AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1516
AC_REQUIRE([KDE_MISC_TESTS])
1517
AC_REQUIRE([KDE_CHECK_LIBDL])
1518
AC_REQUIRE([K_PATH_X])
1520
if test $kde_qtver = 2; then
1521
LIB_KDECORE='-lkdecore'
1522
AC_SUBST(LIB_KDECORE)
1525
LIB_KFORMULA='-lkformula'
1526
AC_SUBST(LIB_KFORMULA)
1529
LIB_KSYCOCA='-lksycoca'
1530
AC_SUBST(LIB_KSYCOCA)
1539
LIB_KSPELL='-lkspell'
1540
AC_SUBST(LIB_KSPELL)
1541
LIB_KPARTS='-lkparts'
1542
AC_SUBST(LIB_KPARTS)
1543
LIB_KWRITE='-lkwrite'
1544
AC_SUBST(LIB_KWRITE)
1546
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1547
AC_SUBST(LIB_KDECORE)
1548
LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1550
LIB_KFM='-lkfm $(LIB_KDECORE)'
1552
LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1554
LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1559
AC_DEFUN(AC_PATH_KDE,
1562
AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1564
if test "$enableval" = "no";
1565
then ac_use_path_checking="default"
1566
else ac_use_path_checking=""
1570
if test "$kde_qtver" = 1;
1571
then ac_use_path_checking=""
1572
else ac_use_path_checking="default"
1577
AC_CREATE_KFSSTND($ac_use_path_checking)
1580
KDE_CREATE_LIBS_ALIASES
1584
AC_DEFUN(AC_CHECK_SETENV,
1586
AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
1587
AC_CHECK_FUNCS([setenv unsetenv])
1590
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1592
AC_MSG_CHECKING(for getdomainname)
1593
AC_CACHE_VAL(ac_cv_func_getdomainname,
1597
save_CXXFLAGS="$CXXFLAGS"
1598
kde_safe_LIBS="$LIBS"
1599
LIBS="$LIBS $X_EXTRA_LIBS"
1600
if test "$GCC" = "yes"; then
1601
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1609
getdomainname(buffer, 200);
1611
ac_cv_func_getdomainname=yes,
1612
ac_cv_func_getdomainname=no)
1613
CXXFLAGS="$save_CXXFLAGS"
1617
AC_MSG_RESULT($ac_cv_func_getdomainname)
1619
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1620
AC_CACHE_VAL(ac_cv_proto_getdomainname,
1624
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1625
ac_cv_proto_getdomainname=no
1628
LIBS="$LIBS $X_EXTRA_LIBS"
1633
extern "C" int getdomainname (char *, int);
1637
getdomainname(buffer, 200);
1639
ac_cv_func_getdomainname=yes
1640
ac_cv_proto_getdomainname=yes,
1641
AC_MSG_RESULT([fatal error])
1642
AC_MSG_ERROR([getdomainname unavailable]))
1647
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1649
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1650
AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1652
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1653
AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1654
[Define if you have getdomainname prototype])
1659
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1662
AC_MSG_CHECKING([for gethostname])
1663
AC_CACHE_VAL(ac_cv_func_gethostname,
1667
save_CXXFLAGS="$CXXFLAGS"
1668
if test "$GCC" = "yes"; then
1669
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1677
gethostname(buffer, 200);
1679
ac_cv_func_gethostname=yes,
1680
ac_cv_func_gethostname=no)
1681
CXXFLAGS="$save_CXXFLAGS"
1684
AC_MSG_RESULT($ac_cv_func_gethostname)
1686
AC_MSG_CHECKING([if gethostname needs custom prototype])
1687
AC_CACHE_VAL(ac_cv_proto_gethostname,
1691
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1692
ac_cv_proto_gethostname=no
1698
extern "C" int gethostname (char *, int);
1702
gethostname(buffer, 200);
1704
ac_cv_func_gethostname=yes
1705
ac_cv_proto_gethostname=yes,
1706
AC_MSG_RESULT([fatal error])
1707
AC_MSG_ERROR(gethostname unavailable))
1711
AC_MSG_RESULT($ac_cv_proto_gethostname)
1713
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
1714
AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
1715
[Define if you have gethostname prototype])
1717
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1718
AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
1722
AC_DEFUN(AC_CHECK_USLEEP,
1724
AC_MSG_CHECKING([for usleep])
1725
AC_CACHE_VAL(ac_cv_func_usleep,
1729
ac_libs_safe="$LIBS"
1730
LIBS="$LIBS $LIBUCB"
1738
ac_cv_func_usleep=yes,
1739
ac_cv_func_usleep=no)
1740
LIBS="$ac_libs_safe"
1743
AC_MSG_RESULT($ac_cv_func_usleep)
1744
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1745
AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1749
AC_DEFUN(AC_CHECK_RANDOM,
1751
AC_MSG_CHECKING([for random])
1752
AC_CACHE_VAL(ac_cv_func_random,
1756
ac_libs_safe="$LIBS"
1757
LIBS="$LIBS $LIBUCB"
1764
ac_cv_func_random=yes,
1765
ac_cv_func_random=no)
1766
LIBS="$ac_libs_safe"
1769
AC_MSG_RESULT($ac_cv_func_random)
1770
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1771
AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1775
AC_DEFUN(AC_FIND_GIF,
1776
[AC_MSG_CHECKING([for giflib])
1777
AC_CACHE_VAL(ac_cv_lib_gif,
1778
[ac_save_LIBS="$LIBS"
1779
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1785
int GifLastError(void);
1789
/* We use char because int might match the return type of a gcc2
1790
builtin and then its argument prototype would still apply. */
1792
[return GifLastError();],
1793
eval "ac_cv_lib_gif=yes",
1794
eval "ac_cv_lib_gif=no")
1795
LIBS="$ac_save_LIBS"
1797
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1799
AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
1801
AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
1805
AC_DEFUN(KDE_FIND_JPEG_HELPER,
1807
AC_MSG_CHECKING([for libjpeg$2])
1808
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
1811
ac_save_LIBS="$LIBS"
1812
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
1813
ac_save_CFLAGS="$CFLAGS"
1814
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1816
[/* Override any gcc2 internal prototype to avoid an error. */
1817
struct jpeg_decompress_struct;
1818
typedef struct jpeg_decompress_struct * j_decompress_ptr;
1823
void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1824
int version, size_t structsize);
1828
/* We use char because int might match the return type of a gcc2
1829
builtin and then its argument prototype would still apply. */
1831
[jpeg_CreateDecompress(0L, 0, 0);],
1832
eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
1833
eval "ac_cv_lib_jpeg_$1=no")
1834
LIBS="$ac_save_LIBS"
1835
CFLAGS="$ac_save_CFLAGS"
1838
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
1839
LIBJPEG="$ac_cv_lib_jpeg_$1"
1840
AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
1848
AC_DEFUN(AC_FIND_JPEG,
1850
dnl first look for libraries
1851
KDE_FIND_JPEG_HELPER(6b, 6b,
1852
KDE_FIND_JPEG_HELPER(normal, [],
1859
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
1860
dnl requires system dependent includes loaded before it)
1861
jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
1862
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
1863
test "x$jpeg_incdir" = xNO && jpeg_incdir=
1865
dnl if headers _and_ libraries are missing, this is no error, and we
1866
dnl continue with a warning (the user will get no jpeg support in khtml)
1867
dnl if only one is missing, it means a configuration error, but we still
1869
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
1870
AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
1872
if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
1874
There is an installation error in jpeg support. You seem to have only one
1875
of either the headers _or_ the libraries installed. You may need to either
1876
provide correct --with-extra-... options, or the development package of
1877
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
1878
Disabling JPEG support.
1881
AC_MSG_WARN([libjpeg not found. disable JPEG support.])
1890
AC_DEFUN(AC_FIND_ZLIB,
1892
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1893
AC_MSG_CHECKING([for libz])
1894
AC_CACHE_VAL(ac_cv_lib_z,
1897
kde_save_LIBS="$LIBS"
1898
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
1899
kde_save_CFLAGS="$CFLAGS"
1900
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1905
[return (zlibVersion() == ZLIB_VERSION); ],
1906
eval "ac_cv_lib_z='-lz'",
1907
eval "ac_cv_lib_z=no")
1908
LIBS="$kde_save_LIBS"
1909
CFLAGS="$kde_save_CFLAGS"
1911
if test ! "$ac_cv_lib_z" = no; then
1912
AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
1915
AC_MSG_RESULT($ac_cv_lib_z)
1917
AC_MSG_ERROR(not found. Check your installation and look into config.log)
1923
AC_DEFUN(KDE_TRY_TIFFLIB,
1925
AC_MSG_CHECKING([for libtiff $1])
1927
AC_CACHE_VAL(kde_cv_libtiff_$1,
1931
kde_save_LIBS="$LIBS"
1932
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
1933
kde_save_CXXFLAGS="$CXXFLAGS"
1934
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
1940
[return (TIFFOpen( "", "r") == 0); ],
1942
kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
1944
kde_cv_libtiff_$1=no
1947
LIBS="$kde_save_LIBS"
1948
CXXFLAGS="$kde_save_CXXFLAGS"
1952
if test "$kde_cv_libtiff_$1" = "no"; then
1957
LIBTIFF="$kde_cv_libtiff_$1"
1959
AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
1965
AC_DEFUN(AC_FIND_TIFF,
1967
AC_REQUIRE([K_PATH_X])
1968
AC_REQUIRE([AC_FIND_ZLIB])
1969
AC_REQUIRE([AC_FIND_JPEG])
1970
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1972
KDE_TRY_TIFFLIB(tiff, [],
1973
KDE_TRY_TIFFLIB(tiff34))
1979
AC_DEFUN(AC_FIND_PNG,
1981
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1982
AC_REQUIRE([AC_FIND_ZLIB])
1983
AC_MSG_CHECKING([for libpng])
1984
AC_CACHE_VAL(ac_cv_lib_png,
1986
kde_save_LIBS="$LIBS"
1987
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1988
kde_save_CFLAGS="$CFLAGS"
1989
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
1996
png_structp png_ptr = png_create_read_struct( /* image ptr */
1997
PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1998
return( png_ptr != 0 );
2000
eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2001
eval "ac_cv_lib_png=no"
2003
LIBS="$kde_save_LIBS"
2004
CFLAGS="$kde_save_CFLAGS"
2006
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2007
AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2008
LIBPNG="$ac_cv_lib_png"
2010
AC_MSG_RESULT($ac_cv_lib_png)
2018
AC_DEFUN(AC_CHECK_BOOL,
2020
AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2023
AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2025
AC_MSG_CHECKING(if you need GNU extensions)
2026
AC_CACHE_VAL(ac_cv_gnu_extensions,
2028
cat > conftest.c << EOF
2029
#include <features.h>
2031
#ifdef __GNU_LIBRARY__
2036
if (eval "$ac_cpp conftest.c") 2>&5 |
2037
egrep "yes" >/dev/null 2>&1; then
2039
ac_cv_gnu_extensions=yes
2041
ac_cv_gnu_extensions=no
2045
AC_MSG_RESULT($ac_cv_gnu_extensions)
2046
if test "$ac_cv_gnu_extensions" = "yes"; then
2047
AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2051
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2053
dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
2054
AC_MSG_CHECKING(whether $CXX supports -$1)
2055
kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
2056
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2058
echo 'int main() { return 0; }' >conftest.cc
2059
eval "kde_cv_prog_cxx_$kde_cache=no"
2060
if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
2061
if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
2062
eval "kde_cv_prog_cxx_$kde_cache=yes"
2067
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2078
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2079
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2080
dnl it's all white-space separated
2081
AC_DEFUN(AC_REMOVE_FORBIDDEN,
2084
if test -n "$__val"; then
2090
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2091
*) # Careful to not add spaces, where there were none, because otherwise
2092
# libtool gets confused, if we change e.g. CXX
2093
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2101
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2102
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2104
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2105
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2108
AC_DEFUN(AC_CHECK_COMPILERS,
2110
AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
2112
if test $enableval = "no"; dnl
2114
kde_use_debug_code="no"
2115
kde_use_debug_define=yes
2117
kde_use_debug_code="yes"
2118
kde_use_debug_define=no
2121
[kde_use_debug_code="no"
2122
kde_use_debug_define=no
2125
dnl Just for configure --help
2126
AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2128
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2130
if test $enableval = "no"; then
2131
kde_use_strict_options="no"
2133
kde_use_strict_options="yes"
2135
], [kde_use_strict_options="no"])
2137
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2138
[kde_use_profiling=$enableval],
2139
[kde_use_profiling="no"]
2142
dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2147
if test "$GCC" = "yes"; then
2148
if test "$kde_use_debug_code" = "yes"; then
2149
CFLAGS="-g -O2 $CFLAGS"
2152
CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2156
CFLAGS="-O2 $CFLAGS"
2160
if test "$kde_use_debug_define" = "yes"; then
2161
CFLAGS="-DNDEBUG $CFLAGS"
2165
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2166
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2169
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2173
CXXFLAGS=" $CXXFLAGS"
2177
if test "$GXX" = "yes"; then
2178
if test "$kde_use_debug_code" = "yes"; then
2179
CXXFLAGS="-g -O2 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2181
KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2182
KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2183
KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2187
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
2191
if test "$kde_use_strict_options" = "yes"; then
2192
CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
2195
if test "$kde_very_strict" = "yes"; then
2196
CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
2199
CXXFLAGS="-O2 $CXXFLAGS"
2203
if test "$kde_use_debug_define" = "yes"; then
2204
CXXFLAGS="-DNDEBUG $CXXFLAGS"
2207
if test "$kde_use_profiling" = "yes"; then
2208
KDE_CHECK_COMPILER_FLAG(pg,
2210
CFLAGS="-pg $CFLAGS"
2211
CXXFLAGS="-pg $CXXFLAGS"
2215
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2216
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2217
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
2218
AC_SUBST(USE_EXCEPTIONS)
2219
dnl obsolete macro - provided to keep things going
2224
*-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
2225
*-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
2226
*-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
2228
if test "$GXX" = yes; then
2229
libstdcpp=`$CXX -print-file-name=libstdc++.so`
2230
if test ! -f $libstdcpp; then
2231
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])
2237
AC_VALIDIFY_CXXFLAGS
2241
# the following is to allow programs, that are known to
2242
# have problems when compiled with -O2
2243
if test -n "$CXXFLAGS"; then
2247
for i in $CXXFLAGS; do
2252
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
2259
AC_SUBST(NOOPT_CXXFLAGS)
2263
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2266
AC_SUBST(KDE_CXXFLAGS)
2269
AC_DEFUN(KDE_ADD_DEPENDENCIES,
2271
[A]M_DEPENDENCIES(CC)
2272
[A]M_DEPENDENCIES(CXX)
2275
dnl just a wrapper to clean up configure.in
2276
AC_DEFUN(KDE_PROG_LIBTOOL,
2278
AC_REQUIRE([AC_CHECK_COMPILERS])
2279
AC_REQUIRE([AC_ENABLE_SHARED])
2280
AC_REQUIRE([AC_ENABLE_STATIC])
2282
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2293
LIBTOOL_SHELL="/bin/sh ./libtool"
2294
# LIBTOOL="$LIBTOOL --silent"
2295
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH)"
2296
AC_SUBST(KDE_PLUGIN)
2299
AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps (experimental, needs objprelink in path)],
2300
kde_use_objprelink=$enableval, kde_use_objprelink=no)
2301
if test "x$kde_use_objprelink" = "xyes"; then
2302
echo Patching libtool to run objprelink.
2303
mv libtool libtool.orig
2304
cat > libtool <<\EOF
2306
for n ; do case $n in
2307
*.o) test -r $n && echo objprelink $n && objprelink $n ;;
2308
*.lo) m=`basename $n .lo`".o" && test -r $m && echo objprelink $m && objprelink $m
2309
m=".libs/$m" && test -r $m && echo objprelink $m && objprelink $m ;;
2312
cat >> libtool libtool.orig
2318
AC_DEFUN(KDE_CHECK_TYPES,
2319
[ AC_CHECK_SIZEOF(int, 4)dnl
2320
AC_CHECK_SIZEOF(long, 4)dnl
2321
AC_CHECK_SIZEOF(char *, 4)dnl
2322
AC_CHECK_SIZEOF(char, 1)dnl
2325
AC_DEFUN(KDE_DO_IT_ALL,
2329
AM_INIT_AUTOMAKE($1, $2)
2330
AM_DISABLE_LIBRARIES
2331
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
2338
AC_DEFUN(AC_CHECK_RPATH,
2340
AC_MSG_CHECKING(for rpath)
2341
AC_ARG_ENABLE(rpath,
2342
[ --disable-rpath do not use the rpath feature of ld],
2343
USE_RPATH=$enableval, USE_RPATH=yes)
2345
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
2347
KDE_RPATH="-R \$(kde_libraries)"
2349
if test -n "$qt_libraries"; then
2350
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
2352
dnl $x_libraries is set to /usr/lib in case
2353
if test -n "$X_LDFLAGS"; then
2354
KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
2356
if test -n "$KDE_EXTRA_RPATH"; then
2357
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
2360
AC_SUBST(KDE_EXTRA_RPATH)
2362
AC_MSG_RESULT($USE_RPATH)
2365
dnl Check for the type of the third argument of getsockname
2366
AC_DEFUN(AC_CHECK_SOCKLEN_T, [
2367
AC_MSG_CHECKING(for socklen_t)
2368
AC_CACHE_VAL(ac_cv_socklen_t, [
2372
#include <sys/types.h>
2373
#include <sys/socket.h>
2376
getsockname(0,(struct sockaddr*)0, &a);
2378
ac_cv_socklen_t=socklen_t,
2380
#include <sys/types.h>
2381
#include <sys/socket.h>
2384
getsockname(0,(struct sockaddr*)0, &a);
2386
ac_cv_socklen_t=int,
2387
ac_cv_socklen_t=size_t
2393
AC_MSG_RESULT($ac_cv_socklen_t)
2394
if test "$ac_cv_socklen_t" != "socklen_t"; then
2395
AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
2396
[Define the real type of socklen_t])
2398
AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
2402
dnl This is a merge of some macros out of the gettext aclocal.m4
2403
dnl since we don't need anything, I took the things we need
2404
dnl the copyright for them is:
2406
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2407
dnl This Makefile.in is free software; the Free Software Foundation
2408
dnl gives unlimited permission to copy and/or distribute it,
2409
dnl with or without modifications, as long as this notice is preserved.
2411
dnl This program is distributed in the hope that it will be useful,
2412
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2413
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2414
dnl PARTICULAR PURPOSE.
2416
dnl for this file it is relicensed under LGPL
2418
AC_DEFUN(AM_KDE_WITH_NLS,
2420
dnl If we use NLS figure out what method
2422
AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
2423
[test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
2424
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2426
if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
2427
AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
2434
AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
2435
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2437
dnl Test whether we really found GNU xgettext.
2438
if test "$XGETTEXT" != ":"; then
2439
dnl If it is no GNU xgettext we define it as : so that the
2440
dnl Makefiles still can work.
2441
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2445
[found xgettext programs is not GNU xgettext; ignore it])
2453
# Search path for a program which passes the given test.
2454
# Ulrich Drepper <drepper@cygnus.com>, 1996.
2457
# Stephan Kulow: I appended a _KDE against name conflicts
2459
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
2460
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2461
AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
2462
[# Extract the first word of "$2", so it can be a program name with args.
2463
set dummy $2; ac_word=[$]2
2464
AC_MSG_CHECKING([for $ac_word])
2465
AC_CACHE_VAL(ac_cv_path_$1,
2468
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2471
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2472
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2473
test -z "$ac_dir" && ac_dir=.
2474
if test -f $ac_dir/$ac_word; then
2476
ac_cv_path_$1="$ac_dir/$ac_word"
2482
dnl If no 4th arg is given, leave the cache variable unset,
2483
dnl so AC_PATH_PROGS will keep looking.
2484
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2489
if test -n "[$]$1"; then
2490
AC_MSG_RESULT([$]$1)
2498
# Check whether LC_MESSAGES is available in <locale.h>.
2499
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2503
AC_DEFUN(AM_LC_MESSAGES,
2504
[if test $ac_cv_header_locale_h = yes; then
2505
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2506
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2507
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2508
if test $am_cv_val_LC_MESSAGES = yes; then
2509
AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2513
dnl From Jim Meyering.
2514
dnl FIXME: migrate into libit.
2516
AC_DEFUN(AM_FUNC_OBSTACK,
2517
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
2518
[AC_TRY_LINK([#include "obstack.h"],
2519
[struct obstack *mem;obstack_free(mem,(char *) 0)],
2520
am_cv_func_obstack=yes,
2521
am_cv_func_obstack=no)])
2522
if test $am_cv_func_obstack = yes; then
2523
AC_DEFINE(HAVE_OBSTACK)
2525
LIBOBJS="$LIBOBJS obstack.o"
2529
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
2530
dnl FIXME: Migrate into libit
2532
AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
2533
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
2534
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
2535
am_cv_lib_error_at_line=yes,
2536
am_cv_lib_error_at_line=no)])
2537
if test $am_cv_lib_error_at_line = no; then
2538
LIBOBJS="$LIBOBJS error.o"
2540
AC_SUBST(LIBOBJS)dnl
2543
# Macro to add for using GNU gettext.
2544
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2547
# Stephan Kulow: I put a KDE in it to avoid name conflicts
2549
AC_DEFUN(AM_KDE_GNU_GETTEXT,
2550
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2551
AC_REQUIRE([AC_PROG_RANLIB])dnl
2552
AC_REQUIRE([AC_HEADER_STDC])dnl
2553
AC_REQUIRE([AC_TYPE_OFF_T])dnl
2554
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2555
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2556
AC_REQUIRE([AC_FUNC_MMAP])dnl
2557
AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2558
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
2559
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2560
__argz_count __argz_stringify __argz_next])
2562
AC_MSG_CHECKING(for stpcpy)
2563
AC_CACHE_VAL(kde_cv_func_stpcpy,
2565
kde_safe_cxxflags=$CXXFLAGS
2566
CXXFLAGS="-Wmissing-prototypes -Werror"
2574
stpcpy(buffer, buffer);
2576
kde_cv_func_stpcpy=yes,
2577
kde_cv_func_stpcpy=no)
2579
CXXFLAGS=$kde_safe_cxxflags
2581
AC_MSG_RESULT($kde_cv_func_stpcpy)
2582
if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
2583
AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
2588
if test "x$CATOBJEXT" != "x"; then
2589
if test "x$ALL_LINGUAS" = "x"; then
2592
AC_MSG_CHECKING(for catalogs to be installed)
2594
for lang in ${LINGUAS=$ALL_LINGUAS}; do
2595
case "$ALL_LINGUAS" in
2596
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2599
LINGUAS=$NEW_LINGUAS
2600
AC_MSG_RESULT($LINGUAS)
2603
dnl Construct list of names of catalog files to be constructed.
2604
if test -n "$LINGUAS"; then
2605
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2611
AC_DEFUN(AC_HAVE_XPM,
2612
[AC_REQUIRE_CPP()dnl
2613
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2615
test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
2616
test -z "$XPM_INCLUDE" && XPM_INCLUDE=
2618
AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
2619
xpm_test=$withval, xpm_test="yes")
2620
if test "x$xpm_test" = xno; then
2623
AC_MSG_CHECKING(for XPM)
2624
AC_CACHE_VAL(ac_cv_have_xpm,
2627
ac_save_ldflags="$LDFLAGS"
2628
ac_save_cflags="$CFLAGS"
2629
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
2630
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
2631
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
2632
AC_TRY_LINK([#include <X11/xpm.h>],[],
2633
ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
2634
LDFLAGS="$ac_save_ldflags"
2635
CFLAGS="$ac_save_cflags"
2638
if test "$ac_cv_have_xpm" = no; then
2644
AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
2645
if test "$XPM_LDFLAGS" = ""; then
2646
XPMLIB='-lXpm $(LIB_X11)'
2648
XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
2650
if test "$XPM_INCLUDE" = ""; then
2653
XPMINC="-I$XPM_INCLUDE"
2663
AC_DEFUN(AC_HAVE_DPMS,
2664
[AC_REQUIRE_CPP()dnl
2665
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2667
test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
2668
test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
2671
AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
2672
dpms_test=$withval, dpms_test="yes")
2673
if test "x$dpms_test" = xno; then
2676
AC_MSG_CHECKING(for DPMS)
2677
dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
2678
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
2679
AC_CACHE_VAL(ac_cv_have_dpms,
2682
ac_save_ldflags="$LDFLAGS"
2683
ac_save_cflags="$CFLAGS"
2684
ac_save_libs="$LIBS"
2685
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2686
CFLAGS="$CFLAGS $X_INCLUDES"
2687
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2689
#include <X11/Xproto.h>
2691
#include <X11/Xlib.h>
2692
#include <X11/extensions/dpms.h>
2694
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2695
ac_cv_have_dpms="yes", [
2696
LDFLAGS="$ac_save_ldflags"
2697
CFLAGS="$ac_save_cflags"
2698
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
2699
LIBS="$LIBS -lXdpms"
2700
CFLAGS="$CFLAGS $X_INCLUDES"
2701
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
2703
#include <X11/Xproto.h>
2705
#include <X11/Xlib.h>
2706
#include <X11/extensions/dpms.h>
2708
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
2710
ac_cv_have_dpms="-lXdpms"
2711
],ac_cv_have_dpms="no")
2713
LDFLAGS="$ac_save_ldflags"
2714
CFLAGS="$ac_save_cflags"
2715
LIBS="$ac_save_libs"
2718
if test "$ac_cv_have_dpms" = no; then
2724
AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
2725
if test "$ac_cv_have_dpms" = "-lXdpms"; then
2728
if test "$DPMS_LDFLAGS" = ""; then
2729
DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
2731
DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
2733
if test "$DPMS_INCLUDE" = ""; then
2736
DPMSINC="-I$DPMS_INCLUDE"
2746
AC_DEFUN(AC_HAVE_GL,
2747
[AC_REQUIRE_CPP()dnl
2748
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2750
test -z "$GL_LDFLAGS" && GL_LDFLAGS=
2751
test -z "$GL_INCLUDE" && GL_INCLUDE=
2753
AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
2754
gl_test=$withval, gl_test="yes")
2755
if test "x$gl_test" = xno; then
2758
AC_MSG_CHECKING(for GL)
2759
AC_CACHE_VAL(ac_cv_have_gl,
2762
ac_save_ldflags="$LDFLAGS"
2763
ac_save_cflags="$CFLAGS"
2764
LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
2765
CFLAGS="$CFLAGS $X_INCLUDES"
2766
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2767
AC_TRY_LINK([#include <GL/gl.h>
2770
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
2771
if test "x$ac_cv_have_gl" = "xno"; then
2772
LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
2773
CFLAGS="$ac_save_cflags $X_INCLUDES"
2774
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2775
AC_TRY_LINK([#include <GL/gl.h>
2778
ac_cv_have_gl="yes", ac_cv_have_gl="no")
2780
LDFLAGS="$ac_save_ldflags"
2781
CFLAGS="$ac_save_cflags"
2784
if test "$ac_cv_have_gl" = "no"; then
2790
AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
2791
if test "$GL_LDFLAGS" = ""; then
2792
if test "$ac_cv_have_gl" = "mesa"; then
2793
GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
2795
GLLIB='-lGL -lGLU $(LIB_X11)'
2798
if test "$ac_cv_have_gl" = "mesa"; then
2799
GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
2801
GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
2804
if test "$GL_INCLUDE" = ""; then
2807
GLINC="-I$GL_INCLUDE"
2809
AC_MSG_RESULT($ac_cv_have_gl)
2818
dnl shadow password and PAM magic - maintained by ossi@kde.org
2821
AC_REQUIRE([KDE_CHECK_LIBDL])
2824
[ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
2825
[ if test "x$withval" = "xyes"; then
2828
elif test "x$withval" = "xno"; then
2832
pam_service=$withval
2834
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
2836
AC_CACHE_VAL(ac_cv_path_pam,
2838
AC_CHECK_LIB(pam, pam_start,
2839
[ AC_CHECK_HEADER(security/pam_appl.h,
2843
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
2846
eval "$ac_cv_path_pam"
2848
AC_MSG_CHECKING(for PAM)
2849
if test "x$use_pam" = xno; then
2854
AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
2855
PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
2857
dnl test whether struct pam_message is const (Linux) or not (Sun)
2858
AC_MSG_CHECKING(for const pam_message)
2859
AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
2860
[ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
2861
[AC_MSG_RESULT([const: Linux-type PAM])],
2862
[AC_MSG_RESULT([nonconst: Sun-type PAM])
2863
AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
2865
[AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
2871
dnl DEF_PAM_SERVICE(arg name, full name, define name)
2872
AC_DEFUN(DEF_PAM_SERVICE, [
2874
[ --with-$1-pam=[val] override PAM service from --with-pam for $2],
2875
[ if test "x$use_pam" = xyes; then
2876
$3_PAM_SERVICE="$withval"
2878
AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
2879
You may want to enforce it by using --with-pam.])
2882
[ if test "x$use_pam" = xyes; then
2883
$3_PAM_SERVICE="$pam_service"
2886
if test -n "$$3_PAM_SERVICE"; then
2887
AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
2888
AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
2890
AC_SUBST($3_PAM_SERVICE)
2893
AC_DEFUN(KDE_SHADOWPASSWD, [
2894
AC_REQUIRE([KDE_PAM])
2896
AC_CHECK_LIB(shadow, getspent,
2897
[ LIBSHADOW="-lshadow"
2901
AC_CHECK_LIB(gen, getspent,
2905
[ AC_CHECK_FUNC(getspent,
2906
[ ac_use_shadow=yes ],
2907
[ ac_use_shadow=no ])
2913
AC_MSG_CHECKING([for shadow passwords])
2916
[ --with-shadow If you want shadow password support ],
2917
[ if test "x$withval" != "xno"; then
2923
use_shadow="$ac_use_shadow"
2926
if test "x$use_shadow" = xyes; then
2928
AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
2935
dnl finally make the relevant binaries setuid root, if we have shadow passwds.
2936
dnl this still applies, if we could use it indirectly through pam.
2937
if test "x$use_shadow" = xyes ||
2938
( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
2940
*-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
2941
SETUIDFLAGS="-m 4755 -o root";;
2943
SETUIDFLAGS="-m 4755";;
2946
AC_SUBST(SETUIDFLAGS)
2950
AC_DEFUN(KDE_PASSWDLIBS, [
2951
AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
2952
AC_REQUIRE([KDE_PAM])
2953
AC_REQUIRE([KDE_SHADOWPASSWD])
2955
if test "x$use_pam" = "xyes"; then
2956
PASSWDLIBS="$PAMLIBS"
2958
PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
2961
AC_SUBST(PASSWDLIBS)
2964
AC_DEFUN(KDE_CHECK_LIBDL,
2966
AC_CHECK_LIB(dl, dlopen, [
2968
ac_cv_have_dlfcn=yes
2971
AC_CHECK_LIB(dld, shl_unload, [
2973
ac_cv_have_shload=yes
2979
AC_DEFUN(KDE_CHECK_DLOPEN,
2982
AC_CHECK_HEADERS(dlfcn.h dl.h)
2983
if test "$ac_cv_header_dlfcn_h" = "no"; then
2987
if test "$ac_cv_header_dl_h" = "no"; then
2988
ac_cv_have_shload=no
2991
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
2993
AC_ARG_ENABLE(dlopen,
2994
[ --disable-dlopen link statically [default=no]] ,
2995
enable_dlopen=$enableval,
2998
# override the user's opinion, if we know it better ;)
2999
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3003
if test "$ac_cv_have_dlfcn" = "yes"; then
3004
AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3007
if test "$ac_cv_have_shload" = "yes"; then
3008
AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3011
if test "$enable_dlopen" = no ; then
3012
test -n "$1" && eval $1
3014
test -n "$2" && eval $2
3019
AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3021
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3023
AC_MSG_CHECKING([dynamic loading])
3024
eval "`egrep '^build_libtool_libs=' libtool`"
3025
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3027
AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3031
AC_MSG_RESULT($dynamic_loading)
3032
if test "$dynamic_loading" = "yes"; then
3039
AC_DEFUN(KDE_ADD_INCLUDES,
3041
if test -z "$1"; then
3042
test_include="Pix.h"
3047
AC_MSG_CHECKING([for libg++ ($test_include)])
3049
AC_CACHE_VAL(kde_cv_libgpp_includes,
3051
kde_cv_libgpp_includes=no
3057
/usr/unsupported/include \
3062
if test -r "$ac_dir/$test_include"; then
3063
kde_cv_libgpp_includes=$ac_dir
3069
AC_MSG_RESULT($kde_cv_libgpp_includes)
3070
if test "$kde_cv_libgpp_includes" != "no"; then
3071
all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3077
AC_DEFUN(KDE_CHECK_MICO,
3079
AC_REQUIRE([KDE_CHECK_LIBDL])
3080
AC_REQUIRE([KDE_MISC_TESTS])
3081
AC_MSG_CHECKING(for MICO)
3083
if test -z "$MICODIR"; then
3084
kde_micodir=/usr/local
3086
kde_micodir="$MICODIR"
3089
AC_ARG_WITH(micodir,
3090
[ --with-micodir=micodir where mico is installed ],
3091
kde_micodir=$withval,
3092
kde_micodir=$kde_micodir
3095
AC_CACHE_VAL(kde_cv_mico_incdir,
3097
mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3098
AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3101
kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3103
if test ! -r $kde_micodir/include/CORBA.h; then
3104
AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3107
AC_MSG_RESULT($kde_micodir)
3109
MICO_INCLUDES=-I$kde_micodir/include
3110
AC_SUBST(MICO_INCLUDES)
3111
MICO_LDFLAGS=-L$kde_micodir/lib
3112
AC_SUBST(MICO_LDFLAGS)
3113
micodir=$kde_micodir
3116
AC_MSG_CHECKING([for MICO version])
3117
AC_CACHE_VAL(kde_cv_mico_version,
3120
cat >conftest.$ac_ext <<EOF
3122
#include <mico/version.h>
3125
printf("MICO_VERSION=%s\n",MICO_VERSION);
3129
ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3130
if AC_TRY_EVAL(ac_compile); then
3131
if eval `./conftest 2>&5`; then
3132
kde_cv_mico_version=$MICO_VERSION
3134
AC_MSG_ERROR([your system is not able to execute a small application to
3135
find MICO version! Check $kde_micodir/include/mico/version.h])
3138
AC_MSG_ERROR([your system is not able to compile a small application to
3139
find MICO version! Check $kde_micodir/include/mico/version.h])
3143
dnl installed MICO version
3144
mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3145
mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3146
mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3148
if test "x$1" = "x"; then
3154
dnl required MICO version
3155
req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3156
req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3157
req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3159
if test "$mico_v_maj" -lt "$req_v_maj" || \
3160
( test "$mico_v_maj" -eq "$req_v_maj" && \
3161
test "$mico_v_mid" -lt "$req_v_mid" ) || \
3162
( test "$mico_v_mid" -eq "$req_v_mid" && \
3163
test "$mico_v_min" -lt "$req_v_min" )
3166
AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3167
at least is required. You should upgrade MICO.])
3169
AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3172
LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3174
if test -z "$IDL"; then
3175
IDL='$(kde_bindir)/cuteidl'
3178
IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3179
AC_SUBST(IDL_DEPENDENCIES)
3181
idldir="\$(includedir)/idl"
3186
AC_DEFUN(KDE_CHECK_MINI_STL,
3188
AC_REQUIRE([KDE_CHECK_MICO])
3190
AC_MSG_CHECKING(if we use mico's mini-STL)
3191
AC_CACHE_VAL(kde_cv_have_mini_stl,
3195
kde_save_cxxflags="$CXXFLAGS"
3196
CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3199
#include <mico/config.h>
3202
#ifdef HAVE_MINI_STL
3206
kde_cv_have_mini_stl=no,
3207
kde_cv_have_mini_stl=yes)
3208
CXXFLAGS="$kde_save_cxxflags"
3212
if test "x$kde_cv_have_mini_stl" = "xyes"; then
3224
AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3226
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3227
AC_SUBST(LIBPTHREAD)
3230
AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3232
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3233
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3235
if test "$kde_use_kernthreads" = "yes"; then
3236
ac_save_CXXFLAGS="$CXXFLAGS"
3237
ac_save_CFLAGS="$CXXFLAGS"
3238
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3239
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3240
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3241
CXXFLAGS="$ac_save_CXXFLAGS"
3242
CFLAGS="$ac_save_CFLAGS"
3243
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3244
kde_use_kernthreads=no
3246
dnl Add proper -I and -l statements
3247
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3248
if test "x$LIBPTHREAD" = "x"; then
3249
kde_use_kernthreads=no
3251
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3256
if test -z "$LIBPTHREAD"; then
3257
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3263
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3264
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3265
echo "Setting Solaris pthread compilation options"
3268
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3269
echo "Setting FreeBSD pthread compilation options"
3272
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3273
LIBPTHREAD="$LIBPTHREAD -lc_r"
3274
echo "Setting AIX pthread compilation options"
3276
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3277
USE_THREADS="$USE_THREADS -DPIC -fPIC"
3278
echo "Setting Linux pthread compilation options"
3283
AC_SUBST(USE_THREADS)
3284
AC_SUBST(LIBPTHREAD)
3287
AC_DEFUN(KDE_CHECK_THREADING,
3289
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3290
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
3291
dnl default is yes if libpthread is found and no if no libpthread is available
3292
if test -z "$LIBPTHREAD"; then
3293
kde_check_threading_default=no
3295
kde_check_threading_default=yes
3297
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
3298
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
3300
if test "x$kde_use_threading" = "xyes"; then
3301
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
3305
AC_DEFUN(KDE_TRY_LINK_PYTHON,
3307
if test "$kde_python_link_found" = no; then
3309
if test "$1" = normal; then
3310
AC_MSG_CHECKING(if a Python application links)
3312
AC_MSG_CHECKING(if Python depends on $2)
3315
AC_CACHE_VAL(kde_cv_try_link_python_$1,
3319
kde_save_cflags="$CFLAGS"
3320
CFLAGS="$CFLAGS $PYTHONINC"
3321
kde_save_libs="$LIBS"
3322
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
3323
kde_save_ldflags="$LDFLAGS"
3324
LDFLAGS="$LDFLAGS $PYTHONLIB"
3330
PySys_SetArgv(1, 0);
3332
[kde_cv_try_link_python_$1=yes],
3333
[kde_cv_try_link_python_$1=no]
3335
CFLAGS="$kde_save_cflags"
3336
LIBS="$kde_save_libs"
3337
LDFLAGS="$kde_save_ldflags"
3340
if test "$kde_cv_try_link_python_$1" = "yes"; then
3342
kde_python_link_found=yes
3343
if test ! "$1" = normal; then
3344
LIBPYTHON="$LIBPYTHON $2"
3357
AC_DEFUN(KDE_CHECK_PYTHON_DIR,
3359
AC_MSG_CHECKING([for Python directory])
3361
AC_CACHE_VAL(kde_cv_pythondir,
3363
if test -z "$PYTHONDIR"; then
3364
kde_cv_pythondir=/usr/local
3366
kde_cv_pythondir="$PYTHONDIR"
3370
AC_ARG_WITH(pythondir,
3371
[ --with-pythondir=pythondir use python installed in pythondir ],
3373
ac_python_dir=$withval
3374
], ac_python_dir=$kde_cv_pythondir
3377
AC_MSG_RESULT($ac_python_dir)
3380
AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
3382
AC_REQUIRE([KDE_CHECK_LIBDL])
3383
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3384
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
3386
if test -z "$1"; then
3392
AC_MSG_CHECKING([for Python$version])
3394
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
3395
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
3396
if test ! -r $python_incdir/Python.h; then
3397
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
3398
python_incdir=$python_incdir/python$version
3399
if test ! -r $python_incdir/Python.h; then
3404
PYTHONINC=-I$python_incdir
3406
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3407
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
3408
if test ! -r $python_libdir/libpython$version.a; then
3409
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
3410
python_libdir=$python_libdir/python$version/config
3411
if test ! -r $python_libdir/libpython$version.a; then
3416
PYTHONLIB=-L$python_libdir
3417
kde_orig_LIBPYTHON=$LIBPYTHON
3418
if test -z "$LIBPYTHON"; then
3419
LIBPYTHON=-lpython$version
3422
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3423
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
3424
python_moddir=$python_moddir/python$version
3425
if test ! -r $python_moddir/copy.py; then
3429
PYTHONMODDIR=$python_moddir
3431
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
3433
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
3434
LIBPYTHON=$kde_orig_LIBPYTHON
3435
test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
3436
test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
3439
dnl Note: this test is very weak
3440
kde_python_link_found=no
3441
KDE_TRY_LINK_PYTHON(normal)
3442
KDE_TRY_LINK_PYTHON(m, -lm)
3443
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
3444
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
3445
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
3446
KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
3447
KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
3448
KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
3449
KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
3450
KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
3451
[AC_MSG_WARN([it seems, Python depends on another library.
3452
Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
3453
and contact the authors to let them know about this problem])
3457
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
3461
AC_SUBST(PYTHONMODDIR)
3462
AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
3468
AC_DEFUN(KDE_CHECK_PYTHON,
3470
KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
3471
[ KDE_CHECK_PYTHON_INTERN($1, $2) ])
3475
AC_DEFUN(KDE_CHECK_STL_SGI,
3477
AC_MSG_CHECKING([if STL implementation is SGI like])
3478
AC_CACHE_VAL(kde_cv_stl_type_sgi,
3482
using namespace std;
3484
string astring="Hallo Welt.";
3485
astring.erase(0, 6); // now astring is "Welt"
3487
], kde_cv_stl_type_sgi=yes,
3488
kde_cv_stl_type_sgi=no)
3491
AC_MSG_RESULT($kde_cv_stl_type_sgi)
3493
if test "$kde_cv_stl_type_sgi" = "yes"; then
3494
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
3498
AC_DEFUN(KDE_CHECK_STL_HP,
3500
AC_MSG_CHECKING([if STL implementation is HP like])
3501
AC_CACHE_VAL(kde_cv_stl_type_hp,
3505
using namespace std;
3507
string astring="Hello World";
3508
astring.remove(0, 6); // now astring is "World"
3510
], kde_cv_stl_type_hp=yes,
3511
kde_cv_stl_type_hp=no)
3513
AC_MSG_RESULT($kde_cv_stl_type_hp)
3515
if test "$kde_cv_stl_type_hp" = "yes"; then
3516
AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
3520
AC_DEFUN(KDE_CHECK_STL,
3524
ac_save_CXXFLAGS="$CXXFLAGS"
3525
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
3528
if test "$kde_cv_stl_type_sgi" = "no"; then
3531
if test "$kde_cv_stl_type_hp" = "no"; then
3532
AC_MSG_ERROR("no known STL type found")
3536
CXXFLAGS="$ac_save_CXXFLAGS"
3540
AC_DEFUN(AC_FIND_QIMGIO,
3541
[AC_REQUIRE([AC_FIND_JPEG])
3542
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3543
AC_MSG_CHECKING([for qimgio])
3544
AC_CACHE_VAL(ac_cv_lib_qimgio,
3548
ac_save_LIBS="$LIBS"
3549
ac_save_CXXFLAGS="$CXXFLAGS"
3550
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
3551
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
3554
#include <qimageio.h>
3555
#include <qstring.h>
3557
QString t = "hallo";
3562
ac_cv_lib_qimgio=yes,
3563
ac_cv_lib_qimgio=no,
3564
ac_cv_lib_qimgio=no)
3565
LIBS="$ac_save_LIBS"
3566
CXXFLAGS="$ac_save_CXXFLAGS"
3569
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
3570
LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
3572
AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
3575
AC_MSG_RESULT(not found)
3579
AC_DEFUN(KDE_CHECK_ANSI,
3583
AC_DEFUN(KDE_CHECK_INSURE,
3585
AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
3587
if test $enableval = "no"; dnl
3588
then ac_use_insure="no"
3589
else ac_use_insure="yes"
3591
], [ac_use_insure="no"])
3593
AC_MSG_CHECKING(if we will use Insure++ to debug)
3594
AC_MSG_RESULT($ac_use_insure)
3595
if test "$ac_use_insure" = "yes"; dnl
3596
then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
3600
AC_DEFUN(AM_DISABLE_LIBRARIES,
3602
AC_PROVIDE([AM_ENABLE_STATIC])
3603
AC_PROVIDE([AM_ENABLE_SHARED])
3609
AC_DEFUN(AC_CHECK_UTMP_FILE,
3611
AC_MSG_CHECKING([for utmp file])
3613
AC_CACHE_VAL(kde_cv_utmp_file,
3624
if test -r "$ac_file"; then
3625
kde_cv_utmp_file=$ac_file
3631
if test "$kde_cv_utmp_file" != "no"; then
3632
AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
3634
AC_MSG_RESULT($kde_cv_utmp_file)
3637
AC_MSG_RESULT([non found])
3642
AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
3645
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
3647
if test ! -s $srcdir/subdirs; then
3648
dnl Note: Makefile.common creates subdirs, so this is just a fallback
3650
files=`cd $srcdir && ls -1`
3651
dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
3653
echo $i >> $srcdir/subdirs
3657
if test -s $srcdir/inst-apps; then
3658
ac_topsubdirs="`cat $srcdir/inst-apps`"
3660
ac_topsubdirs="`cat $srcdir/subdirs`"
3663
for i in $ac_topsubdirs; do
3664
AC_MSG_CHECKING([if $i should be compiled])
3665
if test -d $srcdir/$i; then
3667
for j in $DO_NOT_COMPILE; do
3668
if test $i = $j; then
3675
AC_MSG_RESULT($install_it)
3676
if test $install_it = "yes"; then
3677
TOPSUBDIRS="$TOPSUBDIRS $i"
3681
AC_SUBST(TOPSUBDIRS)
3684
AC_DEFUN(KDE_CHECK_NAMESPACES,
3686
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
3700
int Foo::Bar::i = 1;
3703
AC_DEFINE(HAVE_NAMESPACES)
3710
AC_DEFUN(KDE_CHECK_NEWLIBS,
3715
dnl ------------------------------------------------------------------------
3716
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
3717
dnl ------------------------------------------------------------------------
3719
AC_DEFUN(AC_CHECK_S_ISSOCK,
3721
AC_MSG_CHECKING(for S_ISSOCK)
3722
AC_CACHE_VAL(ac_cv_have_s_issock,
3728
#include <sys/stat.h>
3732
int b = S_ISSOCK( buff.st_mode );
3734
ac_cv_have_s_issock=yes,
3735
ac_cv_have_s_issock=no)
3738
AC_MSG_RESULT($ac_cv_have_s_issock)
3739
if test "$ac_cv_have_s_issock" = "yes"; then
3740
AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
3744
dnl ------------------------------------------------------------------------
3745
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
3746
dnl ------------------------------------------------------------------------
3748
AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
3750
AC_MSG_CHECKING(for MAXPATHLEN)
3751
AC_CACHE_VAL(ac_cv_maxpathlen,
3754
cat > conftest.$ac_ext <<EOF
3756
# include <stdlib.h>
3759
#include <sys/param.h>
3761
#define MAXPATHLEN 1024
3764
KDE_HELLO MAXPATHLEN
3768
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
3770
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
3771
ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
3773
ac_cv_maxpathlen=1024
3779
AC_MSG_RESULT($ac_cv_maxpathlen)
3780
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
3783
dnl -------------------------------------------------------------------------
3784
dnl See if the compiler supports a template repository bero@redhat.de
3785
dnl -------------------------------------------------------------------------
3786
AC_DEFUN(KDE_COMPILER_REPO,
3791
KDE_CHECK_COMPILER_FLAG(frepo,
3797
if test -z "$REPO"; then
3798
KDE_CHECK_COMPILER_FLAG(instances=explicit,
3800
REPO="-instances=explicit"
3801
NOREPO="-instances=extern"
3805
if test -n "$REPO"; then
3806
AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
3807
[C++ compiler supports template repository])
3815
AC_DEFUN(KDE_CHECK_HEADER,
3818
kde_safe_cppflags=$CPPFLAGS
3819
CPPFLAGS="$CPPFLAGS $all_includes"
3821
AC_CHECK_HEADER($1, $2, $3)
3822
CPPFLAGS=$kde_safe_cppflags
3826
AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
3828
KDE_CHECK_HEADER(QwSpriteField.h, ,
3830
AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
3831
QwSpriteField out of kdesupport.])
3836
AC_DEFUN(KDE_FAST_CONFIGURE,
3838
dnl makes configure fast (needs perl)
3839
AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
3840
with_fast_perl=$enableval, with_fast_perl=yes)
3843
AC_DEFUN(KDE_CONF_FILES,
3846
if test -f $srcdir/configure.files ; then
3847
val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
3850
if test -n "$val" ; then
3852
CONF_FILES="$CONF_FILES $i"
3855
AC_SUBST(CONF_FILES)
3858
AC_DEFUN(KDE_SET_PREFIX,
3861
dnl make $KDEDIR the default for the installation
3862
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3864
if test "x$prefix" = "xNONE"; then
3865
prefix=$ac_default_prefix
3866
ac_configure_args="$ac_configure_args --prefix $prefix"
3872
pushdef([AC_PROG_INSTALL],
3874
dnl our own version, testing for a -p flag
3875
popdef([AC_PROG_INSTALL])
3876
dnl as AC_PROG_INSTALL works as it works we first have
3877
dnl to save if the user didn't specify INSTALL, as the
3878
dnl autoconf one overwrites INSTALL and we have no chance to find
3880
test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
3881
test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
3882
test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
3885
if test -z "$kde_save_INSTALL_given" ; then
3886
# OK, user hasn't given any INSTALL, autoconf found one for us
3887
# now we test, if it supports the -p flag
3888
AC_MSG_CHECKING(for -p flag to install)
3889
rm -f confinst.$$.* > /dev/null 2>&1
3890
echo "Testtest" > confinst.$$.orig
3892
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
3893
if test -f confinst.$$.new ; then
3894
# OK, -p seems to do no harm to install
3895
INSTALL="${INSTALL} -p"
3900
AC_MSG_RESULT($ac_res)
3902
dnl the following tries to resolve some signs and wonders coming up
3903
dnl with different autoconf/automake versions
3905
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
3906
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
3907
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
3908
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
3909
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
3910
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
3911
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
3912
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
3913
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
3914
dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
3915
dnl automake (due to broken Makefile.am or whatever) to install programs,
3916
dnl and so does not see the -s flag in automake > 1.4
3917
dnl to clean up that mess we:
3918
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
3919
dnl which cleans KDE's program with automake > 1.4;
3920
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
3921
dnl with automake<=1.4
3922
dnl note that dues to this sometimes two '-s' flags are used (if KDE
3923
dnl properly uses install-@DIR@PROGRAMS, but I don't care
3925
dnl And to all this comes, that I even can't write in comments variable
3926
dnl names used by automake, because it is so stupid to think I wanted to
3927
dnl _use_ them, therefor I have written A_M_... instead of AM_
3928
dnl hmm, I wanted to say something ... ahh yes: Arghhh.
3930
if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
3931
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
3933
if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
3934
INSTALL_SCRIPT='${INSTALL}'
3938
AC_DEFUN(KDE_LANG_CPLUSPLUS,
3940
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
3941
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
3944
pushdef([AC_LANG_CPLUSPLUS],
3945
[popdef([AC_LANG_CPLUSPLUS])
3949
AC_DEFUN(KDE_CHECK_LONG_LONG,
3951
AC_MSG_CHECKING(for long long)
3952
AC_CACHE_VAL(kde_cv_c_long_long,
3960
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
3962
AC_MSG_RESULT($kde_cv_c_long_long)
3963
if test "$kde_cv_c_long_long" = yes; then
3964
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
3968
AC_DEFUN(KDE_CHECK_LIB,
3970
kde_save_LIBS="$LIBS"
3971
LIBS="$LIBS $all_libraries"
3973
aix*) LIBS="-brtl $LIBS"
3974
test "$GCC" = yes && LIBS="-Wl,$LIBS"
3977
AC_CHECK_LIB($1, $2, $3, $4, $5)
3978
LIBS="$kde_save_LIBS"
3984
AC_DEFUN(KDE_CHECK_INITGROUPS,
3986
AC_REQUIRE([AC_CANONICAL_HOST])
3987
AC_CHECK_FUNCS(initgroups)
3988
if test "x$ac_cv_func_initgroups" = "xyes"; then
3992
AC_MSG_CHECKING([for initgroups prototype])
3993
AC_CACHE_VAL(kde_cv_check_initgroups_proto,
3999
int x = initgroups(buffer,id);
4001
kde_cv_check_initgroups_proto=yes,
4002
kde_cv_check_initgroups_proto=no)
4004
AC_MSG_RESULT($kde_cv_check_initgroups_proto)
4008
kde_cv_check_initgroups_proto=yes
4012
kde_cv_check_initgroups_proto=no
4014
if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
4015
kde_check_initgroups_proto=1
4017
kde_check_initgroups_proto=0
4019
AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
4020
[initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
4024
AC_DEFUN(KDE_CHECK_JAVA_DIR,
4026
AC_MSG_CHECKING([for Java directory])
4029
[ --with-java=javadir use java installed in javadir, --without-java disables ],
4030
[ ac_java_dir=$withval
4034
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4035
if test "x$ac_java_dir" = xno; then
4036
kde_cv_java_bindir=no
4037
kde_cv_java_includedir=no
4038
kde_cv_java_libjvmdir=no
4039
kde_cv_java_libhpidir=no
4041
if test "x$ac_java_dir" = x; then
4042
dnl No option set -> look in $PATH
4043
AC_CACHE_VAL(kde_cv_java_bindir,
4045
dnl First look for javac in $PATH. If not found we'll look at the option.
4046
KDE_FIND_PATH(javac, JAVAC, [], [])
4047
if test -n "$JAVAC"; then
4048
kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
4049
dnl this substitution might not work - well, we test for jni.h below
4050
kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
4052
kde_cv_java_bindir=no
4056
dnl config option set
4057
kde_cv_java_bindir=$ac_java_dir/bin
4058
kde_cv_java_includedir=$ac_java_dir/include
4062
dnl Look for libjvm.so
4063
kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4064
dnl Look for libhpi.so and avoid green threads
4065
kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
4067
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
4068
if test ! "x$kde_cv_java_bindir" = xno; then
4070
dnl Now check everything's fine under there
4072
if test ! -x "$kde_cv_java_bindir/javac"; then
4073
AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
4075
if test ! -x "$kde_cv_java_bindir/javah"; then
4076
AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4078
if test ! -x "$kde_cv_java_bindir/jar"; then
4079
AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4081
if test ! -r "$kde_cv_java_includedir/jni.h"; then
4082
AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
4084
if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
4085
AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
4087
if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
4088
AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
4091
jni_includes="-I$kde_cv_java_includedir"
4092
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4093
dnl and under linux here..
4094
test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
4095
test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
4097
dnl Check for JNI version
4100
ac_cxxflags_safe="$CXXFLAGS"
4101
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4107
#ifndef JNI_VERSION_1_2
4111
],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
4112
You need to have Java Development Kit (JDK) version 1.2.
4114
Use --with-java to specify another location.
4115
Use --without-java to configure without java support.
4116
Or download a newer JDK and try again.
4117
See e.g. http://java.sun.com/products/jdk/1.2 ])
4120
CXXFLAGS="$ac_cxxflags_safe"
4123
dnl All tests ok, inform and subst the variables
4124
AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
4126
JAVAC=$kde_cv_java_bindir/javac
4128
JAVAH=$kde_cv_java_bindir/javah
4130
JAR=$kde_cv_java_bindir/jar
4132
AC_SUBST(jni_includes)
4133
JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"