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.
26
dnl Single-module modifications are best placed in configure.in for kdelibs
27
dnl and kdebase or configure.in.in if present.
30
dnl Internal subroutine of AC_PATH_X.
31
dnl Set ac_x_includes and/or ac_x_libraries.
32
AC_DEFUN([KDE_PATH_X_DIRECT],
34
AC_REQUIRE([KDE_CHECK_LIB64])
36
if test "$ac_x_includes" = NO; then
37
# Guess where to find include files, by looking for this one X11 .h file.
38
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
40
# First, try using that file with no special directory specified.
41
AC_TRY_CPP([#include <$x_direct_test_include>],
42
[# We can compile using X headers with no special include directory.
44
[# Look for the header file in a standard set of common directories.
45
# Check X11 before X11Rn because it is often a symlink to the current release.
57
/usr/local/X11/include \
58
/usr/local/X11R6/include \
59
/usr/local/X11R5/include \
60
/usr/local/X11R4/include \
62
/usr/local/include/X11 \
63
/usr/local/include/X11R6 \
64
/usr/local/include/X11R5 \
65
/usr/local/include/X11R4 \
69
/usr/XFree86/include/X11 \
73
/usr/unsupported/include \
75
/usr/local/x11r5/include \
76
/usr/lpp/Xamples/include \
78
/usr/openwin/include \
79
/usr/openwin/share/include \
82
if test -r "$ac_dir/$x_direct_test_include"; then
87
fi # $ac_x_includes = NO
89
if test "$ac_x_libraries" = NO; then
90
# Check for the libraries.
92
test -z "$x_direct_test_library" && x_direct_test_library=Xt
93
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
95
# See if we find them without any special options.
96
# Don't add to $LIBS permanently.
98
LIBS="-l$x_direct_test_library $LIBS"
99
AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100
[LIBS="$ac_save_LIBS"
101
# We can link X programs with no special library path.
103
[LIBS="$ac_save_LIBS"
104
# First see if replacing the include by lib works.
105
# Check X11 before X11Rn because it is often a symlink to the current release.
106
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
107
/usr/X11/lib${kdelibsuff} \
108
/usr/X11R6/lib${kdelibsuff} \
109
/usr/X11R5/lib${kdelibsuff} \
110
/usr/X11R4/lib${kdelibsuff} \
112
/usr/lib${kdelibsuff}/X11 \
113
/usr/lib${kdelibsuff}/X11R6 \
114
/usr/lib${kdelibsuff}/X11R5 \
115
/usr/lib${kdelibsuff}/X11R4 \
117
/usr/local/X11/lib${kdelibsuff} \
118
/usr/local/X11R6/lib${kdelibsuff} \
119
/usr/local/X11R5/lib${kdelibsuff} \
120
/usr/local/X11R4/lib${kdelibsuff} \
122
/usr/local/lib${kdelibsuff}/X11 \
123
/usr/local/lib${kdelibsuff}/X11R6 \
124
/usr/local/lib${kdelibsuff}/X11R5 \
125
/usr/local/lib${kdelibsuff}/X11R4 \
127
/usr/X386/lib${kdelibsuff} \
128
/usr/x386/lib${kdelibsuff} \
129
/usr/XFree86/lib${kdelibsuff}/X11 \
131
/usr/lib${kdelibsuff} \
132
/usr/local/lib${kdelibsuff} \
133
/usr/unsupported/lib${kdelibsuff} \
134
/usr/athena/lib${kdelibsuff} \
135
/usr/local/x11r5/lib${kdelibsuff} \
136
/usr/lpp/Xamples/lib${kdelibsuff} \
137
/lib/usr/lib${kdelibsuff}/X11 \
139
/usr/openwin/lib${kdelibsuff} \
140
/usr/openwin/share/lib${kdelibsuff} \
143
dnl Don't even attempt the hair of trying to link an X program!
144
for ac_extension in a so sl; do
145
if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
146
ac_x_libraries=$ac_dir
151
fi # $ac_x_libraries = NO
155
dnl ------------------------------------------------------------------------
156
dnl Find a file (or one of more files in a list of dirs)
157
dnl ------------------------------------------------------------------------
159
AC_DEFUN([AC_FIND_FILE],
166
echo "configure: __oline__: $i/$j" >&AC_FD_CC
167
if test -r "$i/$j"; then
168
echo "taking that" >&AC_FD_CC
176
dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177
dnl if-not-found, test-parameter, prepend-path)
179
dnl Look for program-name in list-of-dirs+$PATH.
180
dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
181
dnl If found, $variable-name is set. If not, if-not-found is evaluated.
182
dnl test-parameter: if set, the program is executed with this arg,
183
dnl and only a successful exit code is required.
184
AC_DEFUN([KDE_FIND_PATH],
186
AC_MSG_CHECKING([for $1])
187
if test -n "$$2"; then
190
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
192
AC_CACHE_VAL(kde_cv_path_$kde_cache,
201
if test -z "$6"; then dnl Append dirs in PATH (default)
203
else dnl Prepend dirs in PATH (if 6th arg is set)
209
if test -x "$dir/$1"; then
212
evalstr="$dir/$1 $5 2>&1 "
213
if eval $evalstr; then
214
kde_cv_path="$dir/$1"
218
kde_cv_path="$dir/$1"
224
eval "kde_cv_path_$kde_cache=$kde_cv_path"
228
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
232
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
233
AC_MSG_RESULT(not found)
236
AC_MSG_RESULT($kde_cv_path)
242
AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
244
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
245
Please check whether you installed Qt correctly.
246
You need to have a running moc binary.
247
configure tried to run $ac_cv_path_moc and the test didn't
248
succeed. If configure shouldn't have tried this one, set
249
the environment variable MOC to the right one before running
254
AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
256
AC_MSG_WARN([No Qt ui compiler (uic) found!
257
Please check whether you installed Qt correctly.
258
You need to have a running uic binary.
259
configure tried to run $ac_cv_path_uic and the test didn't
260
succeed. If configure shouldn't have tried this one, set
261
the environment variable UIC to the right one before running
267
AC_DEFUN([KDE_CHECK_UIC_FLAG],
269
AC_MSG_CHECKING([whether uic supports -$1 ])
270
kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
271
AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
273
cat >conftest.ui <<EOT
274
<!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
276
ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
277
if AC_TRY_EVAL(ac_uic_testrun); then
278
eval "kde_cv_prog_uic_$kde_cache=yes"
280
eval "kde_cv_prog_uic_$kde_cache=no"
285
if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
297
dnl ------------------------------------------------------------------------
298
dnl Find the meta object compiler and the ui compiler in the PATH,
299
dnl in $QTDIR/bin, and some more usual places
300
dnl ------------------------------------------------------------------------
302
AC_DEFUN([AC_PATH_QT_MOC_UIC],
304
AC_REQUIRE([KDE_CHECK_PERL])
306
for dir in $kde_qt_dirs; do
307
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
309
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
310
if test ! "$ac_qt_bindir" = "NO"; then
311
qt_bindirs="$ac_qt_bindir $qt_bindirs"
314
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
315
if test -z "$UIC_NOT_NEEDED"; then
316
KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
317
if test -z "$UIC_PATH" ; then
318
KDE_UIC_ERROR_MESSAGE
323
if test $kde_qtver = 3; then
324
KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
325
KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
327
if test x$ac_uic_supports_libpath = xyes; then
328
UIC="$UIC -L \$(kde_widgetdir)"
330
if test x$ac_uic_supports_nounload = xyes; then
336
UIC="echo uic not available: "
343
if test $kde_qtver = 3; then
350
AC_DEFUN([KDE_1_CHECK_PATHS],
352
KDE_1_CHECK_PATH_HEADERS
356
if test -n "$USE_RPATH"; then
358
if test -n "$kde_libraries"; then
359
KDE_TEST_RPATH="-R $kde_libraries"
362
if test -n "$qt_libraries"; then
363
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
366
if test -n "$x_libraries"; then
367
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
370
KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
373
AC_MSG_CHECKING([for KDE libraries installed])
374
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'
376
if AC_TRY_EVAL(ac_link) && test -s conftest; then
379
AC_MSG_ERROR([your system fails at linking a small KDE application!
380
Check, if your compiler is installed correctly and if you have used the
381
same compiler to compile Qt and kdelibs as you did use now.
382
For more details about this problem, look at the end of config.log.])
385
if eval `KDEDIR= ./conftest 2>&5`; then
391
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392
kde_have_all_paths=yes
394
KDE_SET_PATHS($kde_result)
398
AC_DEFUN([KDE_SET_PATHS],
400
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
401
kde_htmldir=\"$kde_htmldir\" \
402
kde_appsdir=\"$kde_appsdir\" \
403
kde_icondir=\"$kde_icondir\" \
404
kde_sounddir=\"$kde_sounddir\" \
405
kde_datadir=\"$kde_datadir\" \
406
kde_locale=\"$kde_locale\" \
407
kde_cgidir=\"$kde_cgidir\" \
408
kde_confdir=\"$kde_confdir\" \
409
kde_kcfgdir=\"$kde_kcfgdir\" \
410
kde_mimedir=\"$kde_mimedir\" \
411
kde_toolbardir=\"$kde_toolbardir\" \
412
kde_wallpaperdir=\"$kde_wallpaperdir\" \
413
kde_templatesdir=\"$kde_templatesdir\" \
414
kde_bindir=\"$kde_bindir\" \
415
kde_servicesdir=\"$kde_servicesdir\" \
416
kde_servicetypesdir=\"$kde_servicetypesdir\" \
417
kde_moduledir=\"$kde_moduledir\" \
418
kde_styledir=\"$kde_styledir\" \
419
kde_widgetdir=\"$kde_widgetdir\" \
420
xdg_appsdir=\"$xdg_appsdir\" \
421
xdg_menudir=\"$xdg_menudir\" \
422
xdg_directorydir=\"$xdg_directorydir\" \
426
AC_DEFUN([KDE_SET_DEFAULT_PATHS],
428
if test "$1" = "default"; then
430
if test -z "$kde_htmldir"; then
431
kde_htmldir='\${datadir}/doc/HTML'
433
if test -z "$kde_appsdir"; then
434
kde_appsdir='\${datadir}/applnk'
436
if test -z "$kde_icondir"; then
437
kde_icondir='\${datadir}/icons'
439
if test -z "$kde_sounddir"; then
440
kde_sounddir='\${datadir}/sounds'
442
if test -z "$kde_datadir"; then
443
kde_datadir='\${datadir}/apps'
445
if test -z "$kde_locale"; then
446
kde_locale='\${datadir}/locale'
448
if test -z "$kde_cgidir"; then
449
kde_cgidir='\${exec_prefix}/cgi-bin'
451
if test -z "$kde_confdir"; then
452
kde_confdir='\${datadir}/config'
454
if test -z "$kde_kcfgdir"; then
455
kde_kcfgdir='\${datadir}/config.kcfg'
457
if test -z "$kde_mimedir"; then
458
kde_mimedir='\${datadir}/mimelnk'
460
if test -z "$kde_toolbardir"; then
461
kde_toolbardir='\${datadir}/toolbar'
463
if test -z "$kde_wallpaperdir"; then
464
kde_wallpaperdir='\${datadir}/wallpapers'
466
if test -z "$kde_templatesdir"; then
467
kde_templatesdir='\${datadir}/templates'
469
if test -z "$kde_bindir"; then
470
kde_bindir='\${exec_prefix}/bin'
472
if test -z "$kde_servicesdir"; then
473
kde_servicesdir='\${datadir}/services'
475
if test -z "$kde_servicetypesdir"; then
476
kde_servicetypesdir='\${datadir}/servicetypes'
478
if test -z "$kde_moduledir"; then
479
if test "$kde_qtver" = "2"; then
480
kde_moduledir='\${libdir}/kde2'
482
kde_moduledir='\${libdir}/kde3'
485
if test -z "$kde_styledir"; then
486
kde_styledir='\${libdir}/kde3/plugins/styles'
488
if test -z "$kde_widgetdir"; then
489
kde_widgetdir='\${libdir}/kde3/plugins/designer'
491
if test -z "$xdg_appsdir"; then
492
xdg_appsdir='\${datadir}/applications/kde'
494
if test -z "$xdg_menudir"; then
495
xdg_menudir='\${sysconfdir}/xdg/menus'
497
if test -z "$xdg_directorydir"; then
498
xdg_directorydir='\${datadir}/desktop-directories'
501
KDE_SET_PATHS(defaults)
505
if test $kde_qtver = 1; then
506
AC_MSG_RESULT([compiling])
509
AC_MSG_ERROR([path checking not yet supported for KDE 2])
515
AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
516
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
517
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
518
test -z "$kde_datadir" || test -z "$kde_locale" ||
519
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
520
test -z "$kde_kcfgdir" ||
521
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
522
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
523
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
524
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
525
test -z "$kde_styledir" || test -z "kde_widgetdir" ||
526
test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
527
test "x$kde_have_all_paths" != "xyes"; then
528
kde_have_all_paths=no
532
AC_DEFUN([KDE_MISSING_PROG_ERROR],
534
AC_MSG_ERROR([The important program $1 was not found!
535
Please check whether you installed KDE correctly.
539
AC_DEFUN([KDE_MISSING_ARTS_ERROR],
541
AC_MSG_ERROR([The important program $1 was not found!
542
Please check whether you installed aRts correctly or use
543
--without-arts to compile without aRts support (this will remove functionality).
547
AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
549
kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
550
test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
551
if test -n "$KDEDIRS"; then
554
for dir in $KDEDIRS; do
555
kde_default_bindirs="$dir/bin $kde_default_bindirs "
561
AC_DEFUN([KDE_SUBST_PROGRAMS],
564
AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565
[build_arts=$withval],
568
AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
569
if test "$build_arts" = "no"; then
570
AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
573
KDE_SET_DEFAULT_BINDIRS
574
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577
if test "$build_arts" '!=' "no"; then
578
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
581
KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
585
if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
589
if test "$kde_qtver" = "3"; then
590
if test "$kde_qtsubver" -le 1; then
593
if test "$kde_qtsubver" -le 2; then
599
if test -n "$kde32ornewer"; then
600
KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
601
KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
603
if test -n "$kde33ornewer"; then
604
KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
605
AC_SUBST(MAKEKDEWIDGETS)
607
KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
609
if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
610
kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
611
test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
612
AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
613
if test "$KDE_XSL_STYLESHEET" = "NO"; then
614
KDE_XSL_STYLESHEET=""
616
KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
620
DCOP_DEPENDENCIES='$(DCOPIDL)'
621
if test -n "$kde32ornewer"; then
622
KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
623
DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
624
AC_SUBST(KCONFIG_COMPILER)
625
AC_SUBST(KCFG_DEPENDENCIES)
629
AC_SUBST(DCOPIDL2CPP)
630
AC_SUBST(DCOP_DEPENDENCIES)
632
AC_SUBST(ARTSCCONFIG)
634
AC_SUBST(KDE_XSL_STYLESHEET)
638
AC_DEFUN([AC_CREATE_KFSSTND],
640
AC_REQUIRE([AC_CHECK_RPATH])
642
AC_MSG_CHECKING([for KDE paths])
645
AC_CACHE_VAL(kde_cv_all_paths,
647
KDE_SET_DEFAULT_PATHS($1)
650
eval "$kde_cv_all_paths"
651
KDE_CHECK_PATHS_FOR_COMPLETENESS
652
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
653
# wrong values were cached, may be, we can set better ones
655
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
656
kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
657
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
658
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
662
xdg_appsdir = xdg_menudir= xdg_directorydir=
663
KDE_SET_DEFAULT_PATHS($1)
664
eval "$kde_cv_all_paths"
665
KDE_CHECK_PATHS_FOR_COMPLETENESS
666
kde_result="$kde_result (cache overridden)"
668
if test "$kde_have_all_paths" = "no"; then
669
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
670
Since it had compiled and linked before, it must be a strange problem on your system.
671
Look at config.log for details. If you are not able to fix this, look at
672
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
673
(If you're using an egcs version on Linux, you may update binutils!)
677
AC_MSG_RESULT($kde_result)
686
AC_DEFUN([AC_SUBST_KFSSTND],
688
AC_SUBST(kde_htmldir)
689
AC_SUBST(kde_appsdir)
690
AC_SUBST(kde_icondir)
691
AC_SUBST(kde_sounddir)
692
AC_SUBST(kde_datadir)
694
AC_SUBST(kde_confdir)
695
AC_SUBST(kde_kcfgdir)
696
AC_SUBST(kde_mimedir)
697
AC_SUBST(kde_wallpaperdir)
699
dnl X Desktop Group standards
700
AC_SUBST(xdg_appsdir)
701
AC_SUBST(xdg_menudir)
702
AC_SUBST(xdg_directorydir)
704
AC_SUBST(kde_templatesdir)
705
AC_SUBST(kde_servicesdir)
706
AC_SUBST(kde_servicetypesdir)
707
AC_SUBST(kde_moduledir)
708
AC_SUBST(kdeinitdir, '$(kde_moduledir)')
709
AC_SUBST(kde_styledir)
710
AC_SUBST(kde_widgetdir)
711
if test "$kde_qtver" = 1; then
712
kde_minidir="$kde_icondir/mini"
714
# for KDE 1 - this breaks KDE2 apps using minidir, but
715
# that's the plan ;-/
716
kde_minidir="/dev/null"
718
dnl AC_SUBST(kde_minidir)
719
dnl AC_SUBST(kde_cgidir)
720
dnl AC_SUBST(kde_toolbardir)
723
AC_DEFUN([KDE_MISC_TESTS],
725
dnl Checks for libraries.
726
AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
728
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
731
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
732
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
733
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
734
You should install libcrypt from another source or configure with PAM
739
if test $kde_have_crypt = yes; then
740
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
743
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
744
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
745
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
746
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
748
AC_CHECK_FUNC(inet_ntoa)
749
if test $ac_cv_func_inet_ntoa = no; then
750
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
752
AC_CHECK_FUNC(connect)
753
if test $ac_cv_func_connect = no; then
754
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
758
AC_CHECK_FUNC(remove)
759
if test $ac_cv_func_remove = no; then
760
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
763
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
764
AC_CHECK_FUNC(shmat, ,
765
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
767
# more headers that need to be explicitly included on darwin
768
AC_CHECK_HEADERS(sys/types.h stdint.h)
770
# sys/bitypes.h is needed for uint32_t and friends on Tru64
771
AC_CHECK_HEADERS(sys/bitypes.h)
773
# darwin requires a poll emulation library
774
AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
776
# CoreAudio framework
777
AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
778
AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
779
FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
784
AC_SUBST(FRAMEWORK_COREAUDIO)
785
LIBSOCKET="$X_EXTRA_LIBS"
787
AC_SUBST(X_EXTRA_LIBS)
788
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
791
case $host in dnl this *is* LynxOS specific
793
AC_MSG_CHECKING([LynxOS header file wrappers])
794
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
795
AC_MSG_RESULT(disabled)
796
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
804
# darwin needs this to initialize the environment
805
AC_CHECK_HEADERS(crt_externs.h)
806
AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
808
AH_VERBATIM(_DARWIN_ENVIRON,
810
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
811
# include <sys/time.h>
812
# include <crt_externs.h>
813
# define environ (*_NSGetEnviron())
817
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
820
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
821
* that defines bzero.
829
AC_CHECK_FUNCS([vsnprintf snprintf])
833
* On HP-UX, the declaration of vsnprintf() is needed every time !
836
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
846
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
850
int snprintf(char *str, size_t n, char const *fmt, ...);
856
dnl ------------------------------------------------------------------------
857
dnl Find the header files and libraries for X-Windows. Extended the
859
dnl ------------------------------------------------------------------------
863
AC_REQUIRE([KDE_MISC_TESTS])dnl
864
AC_REQUIRE([KDE_CHECK_LIB64])
868
AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
869
kde_use_qt_emb=$enableval,
875
AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
876
kde_use_qt_emb_palm=$enableval,
877
kde_use_qt_emb_palm=no
882
AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
883
kde_use_qt_mac=$enableval,
887
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
889
AC_MSG_CHECKING(for X)
891
AC_CACHE_VAL(kde_cv_have_x,
892
[# One or both of the vars are not set, and there is no cached value.
893
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
896
kde_x_includes=$x_includes
898
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
901
kde_x_libraries=$x_libraries
904
# below we use the standard autoconf calls
905
ac_x_libraries=$kde_x_libraries
906
ac_x_includes=$kde_x_includes
909
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
910
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
911
dnl location. The correct location is /usr/lib32 or an undefined value
912
dnl (the linker is smart enough to pick the correct default library).
913
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
914
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
915
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
916
dnl x_includes should be left alone.
924
if test -z "$ac_x_includes"; then
927
if test -z "$ac_x_libraries"; then
928
ac_x_libraries="/usr/lib${kdelibsuff}"
931
#from now on we use our own again
933
# when the user already gave --x-includes, we ignore
934
# what the standard autoconf macros told us.
935
if test "$kde_x_includes" = NO; then
936
kde_x_includes=$ac_x_includes
939
# for --x-libraries too
940
if test "$kde_x_libraries" = NO; then
941
kde_x_libraries=$ac_x_libraries
944
if test "$kde_x_includes" = NO; then
945
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
948
if test "$kde_x_libraries" = NO; then
949
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
952
# Record where we found X for the cache.
953
kde_cv_have_x="have_x=yes \
954
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
957
eval "$kde_cv_have_x"
959
if test "$have_x" != yes; then
960
AC_MSG_RESULT($have_x)
963
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
966
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
968
x_includes="."; dnl better than nothing :-
970
x_includes=$kde_x_includes
971
X_INCLUDES="-I$x_includes"
974
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
976
x_libraries="/usr/lib"; dnl better than nothing :-
978
x_libraries=$kde_x_libraries
979
X_LDFLAGS="-L$x_libraries"
981
all_includes="$X_INCLUDES"
982
all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED"
984
# Check for libraries that X11R6 Xt/Xaw programs need.
985
ac_save_LDFLAGS="$LDFLAGS"
986
LDFLAGS="$LDFLAGS $X_LDFLAGS"
987
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
988
# check for ICE first), but we must link in the order -lSM -lICE or
989
# we get undefined symbols. So assume we have SM if we have ICE.
990
# These have to be linked with before -lX11, unlike the other
991
# libraries we check for below, so use a different variable.
992
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
993
AC_CHECK_LIB(ICE, IceConnectionNumber,
994
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
995
LDFLAGS="$ac_save_LDFLAGS"
997
LIB_X11='-lX11 $(LIBSOCKET)'
999
AC_MSG_CHECKING(for libXext)
1000
AC_CACHE_VAL(kde_cv_have_libXext,
1002
kde_ldflags_safe="$LDFLAGS"
1003
kde_libs_safe="$LIBS"
1005
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1006
LIBS="-lXext -lX11 $LIBSOCKET"
1011
# include <stdlib.h>
1015
printf("hello Xext\n");
1017
kde_cv_have_libXext=yes,
1018
kde_cv_have_libXext=no
1021
LDFLAGS=$kde_ldflags_safe
1025
AC_MSG_RESULT($kde_cv_have_libXext)
1027
if test "$kde_cv_have_libXext" = "no"; then
1028
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1029
can't find it itself, we stop here assuming that make wouldn't find
1036
elif test "$kde_use_qt_emb" = "yes"; then
1037
dnl We're using QT Embedded
1039
CXXFLAGS="$CXXFLAGS -fno-rtti"
1040
QTE_NORTTI="-fno-rtti -DQWS"
1050
elif test "$kde_use_qt_mac" = "yes"; then
1051
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1052
dnl be included to get the information) --Sam
1053
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1054
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1065
AC_SUBST(X_PRE_LIBS)
1067
AC_SUBST(LIB_XRENDER)
1069
AC_SUBST(X_INCLUDES)
1071
AC_SUBST(x_includes)
1072
AC_SUBST(x_libraries)
1073
AC_SUBST(QTE_NORTTI)
1078
AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1080
AC_REQUIRE([KDE_USE_QT])
1081
cat > conftest.$ac_ext <<EOF
1082
#include "confdefs.h"
1083
#include <qglobal.h>
1084
#include <qapplication.h>
1086
if test "$kde_qtver" = "2"; then
1087
cat >> conftest.$ac_ext <<EOF
1089
#include <qstring.h>
1093
if test $kde_qtsubver -gt 0; then
1094
cat >> conftest.$ac_ext <<EOF
1095
#if QT_VERSION < 210
1102
if test "$kde_qtver" = "3"; then
1103
cat >> conftest.$ac_ext <<EOF
1104
#include <qcursor.h>
1105
#include <qstylefactory.h>
1106
#include <private/qucomextra_p.h>
1110
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1111
cat >> conftest.$ac_ext <<EOF
1117
if test "$kde_qtver" = "2"; then
1118
cat >> conftest.$ac_ext <<EOF
1119
QStringList *t = new QStringList();
1122
if test $kde_qtsubver -gt 0; then
1123
cat >> conftest.$ac_ext <<EOF
1125
s.setLatin1("Elvis is alive", 14);
1129
if test "$kde_qtver" = "3"; then
1130
cat >> conftest.$ac_ext <<EOF
1131
(void)QStyleFactory::create(QString::null);
1132
QCursor c(Qt::WhatsThisCursor);
1135
cat >> conftest.$ac_ext <<EOF
1141
AC_DEFUN([KDE_USE_QT],
1143
if test -z "$1"; then
1144
# Current default Qt version: 3.3
1148
kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1149
# following is the check if subversion isnt found in passed argument
1150
if test "$kde_qtsubver" = "$1"; then
1153
kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1154
if test "$kde_qtver" = "1"; then
1159
if test -z "$2"; then
1160
if test "$kde_qtver" = "2"; then
1161
if test $kde_qtsubver -gt 0; then
1162
kde_qt_minversion=">= Qt 2.2.2"
1164
kde_qt_minversion=">= Qt 2.0.2"
1167
if test "$kde_qtver" = "3"; then
1168
if test $kde_qtsubver -gt 0; then
1169
if test $kde_qtsubver -gt 1; then
1170
if test $kde_qtsubver -gt 2; then
1171
kde_qt_minversion=">= Qt 3.3"
1173
kde_qt_minversion=">= Qt 3.2"
1176
kde_qt_minversion=">= Qt 3.1 (20021021)"
1179
kde_qt_minversion=">= Qt 3.0"
1182
if test "$kde_qtver" = "1"; then
1183
kde_qt_minversion=">= 1.42 and < 2.0"
1186
kde_qt_minversion="$2"
1189
if test -z "$3"; then
1190
if test $kde_qtver = 3; then
1191
if test $kde_qtsubver -gt 0; then
1192
kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
1193
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1194
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1196
kde_qt_verstring="QT_VERSION >= 300"
1199
if test $kde_qtver = 2; then
1200
if test $kde_qtsubver -gt 0; then
1201
kde_qt_verstring="QT_VERSION >= 222"
1203
kde_qt_verstring="QT_VERSION >= 200"
1206
if test $kde_qtver = 1; then
1207
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1210
kde_qt_verstring="$3"
1213
if test $kde_qtver = 3; then
1214
kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1216
if test $kde_qtver = 2; then
1217
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1219
if test $kde_qtver = 1; then
1220
kde_qt_dirs="$QTDIR /usr/lib/qt"
1224
AC_DEFUN([KDE_CHECK_QT_DIRECT],
1226
AC_REQUIRE([KDE_USE_QT])
1227
AC_MSG_CHECKING([if Qt compiles without flags])
1228
AC_CACHE_VAL(kde_cv_qt_direct,
1232
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1233
ac_LIBRARY_PATH="$LIBRARY_PATH"
1234
ac_cxxflags_safe="$CXXFLAGS"
1235
ac_ldflags_safe="$LDFLAGS"
1236
ac_libs_safe="$LIBS"
1238
CXXFLAGS="$CXXFLAGS -I$qt_includes"
1239
LDFLAGS="$LDFLAGS $X_LDFLAGS"
1240
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1241
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1243
LIBS="$LIBQT $LIBSOCKET"
1246
export LD_LIBRARY_PATH
1250
KDE_PRINT_QT_PROGRAM
1252
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1253
kde_cv_qt_direct="yes"
1255
kde_cv_qt_direct="no"
1256
echo "configure: failed program was:" >&AC_FD_CC
1257
cat conftest.$ac_ext >&AC_FD_CC
1261
CXXFLAGS="$ac_cxxflags_safe"
1262
LDFLAGS="$ac_ldflags_safe"
1263
LIBS="$ac_libs_safe"
1265
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1266
export LD_LIBRARY_PATH
1267
LIBRARY_PATH="$ac_LIBRARY_PATH"
1272
if test "$kde_cv_qt_direct" = "yes"; then
1281
dnl ------------------------------------------------------------------------
1282
dnl Try to find the Qt headers and libraries.
1283
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1284
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1285
dnl ------------------------------------------------------------------------
1287
AC_DEFUN([AC_PATH_QT_1_3],
1289
AC_REQUIRE([K_PATH_X])
1290
AC_REQUIRE([KDE_USE_QT])
1291
AC_REQUIRE([KDE_CHECK_LIB64])
1293
dnl ------------------------------------------------------------------------
1294
dnl Add configure flag to enable linking to MT version of Qt library.
1295
dnl ------------------------------------------------------------------------
1299
AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1300
kde_use_qt_mt=$enableval,
1302
if test $kde_qtver = 3; then
1312
dnl ------------------------------------------------------------------------
1313
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1314
dnl ------------------------------------------------------------------------
1318
if test "x$kde_use_qt_mt" = "xyes"; then
1320
if test "x$kde_use_threading" = "xyes"; then
1321
CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1322
KDE_MT_LDFLAGS="$USE_THREADS"
1323
KDE_MT_LIBS="$LIBPTHREAD"
1328
AC_SUBST(KDE_MT_LDFLAGS)
1329
AC_SUBST(KDE_MT_LIBS)
1331
kde_qt_was_given=yes
1333
dnl ------------------------------------------------------------------------
1334
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1335
dnl ------------------------------------------------------------------------
1336
if test -z "$LIBQT_GLOB"; then
1337
if test "x$kde_use_qt_emb" = "xyes"; then
1338
LIBQT_GLOB="libqte.*"
1340
LIBQT_GLOB="libqt.*"
1344
if test -z "$LIBQT"; then
1345
dnl ------------------------------------------------------------
1346
dnl If we got --enable-embedded then adjust the Qt library name.
1347
dnl ------------------------------------------------------------
1348
if test "x$kde_use_qt_emb" = "xyes"; then
1354
kde_int_qt="-l$qtlib"
1360
if test -z "$LIBQPE"; then
1361
dnl ------------------------------------------------------------
1362
dnl If we got --enable-palmtop then add -lqpe to the link line
1363
dnl ------------------------------------------------------------
1364
if test "x$kde_use_qt_emb" = "xyes"; then
1365
if test "x$kde_use_qt_emb_palm" = "xyes"; then
1375
dnl ------------------------------------------------------------------------
1376
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1377
dnl ------------------------------------------------------------------------
1379
if test "x$kde_use_qt_mt" = "xyes"; then
1380
if test -z "$LIBQT"; then
1382
kde_int_qt="-l$qtlib-mt"
1385
kde_int_qt="$qtlib-mt"
1387
LIBQT_GLOB="lib$qtlib-mt.*"
1388
USING_QT_MT="using -mt"
1393
if test $kde_qtver != 1; then
1395
AC_REQUIRE([AC_FIND_PNG])
1396
AC_REQUIRE([AC_FIND_JPEG])
1397
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1400
if test $kde_qtver = 3; then
1401
AC_REQUIRE([KDE_CHECK_LIBDL])
1402
LIBQT="$LIBQT $LIBDL"
1405
AC_MSG_CHECKING([for Qt])
1407
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1408
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1410
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1414
AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1415
[ ac_qt_includes="$withval"/include
1416
ac_qt_libraries="$withval"/lib${kdelibsuff}
1417
ac_qt_bindir="$withval"/bin
1420
AC_ARG_WITH(qt-includes,
1421
AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1423
ac_qt_includes="$withval"
1426
kde_qt_libs_given=no
1428
AC_ARG_WITH(qt-libraries,
1429
AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1430
[ ac_qt_libraries="$withval"
1431
kde_qt_libs_given=yes
1434
AC_CACHE_VAL(ac_cv_have_qt,
1435
[#try to guess Qt locations
1438
for dir in $kde_qt_dirs; do
1439
qt_incdirs="$qt_incdirs $dir/include $dir"
1441
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 /usr/include/qt3 $x_includes"
1442
if test ! "$ac_qt_includes" = "NO"; then
1443
qt_incdirs="$ac_qt_includes $qt_incdirs"
1446
if test "$kde_qtver" != "1"; then
1447
kde_qt_header=qstyle.h
1449
kde_qt_header=qglobal.h
1452
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1453
ac_qt_includes="$qt_incdir"
1456
for dir in $kde_qt_dirs; do
1457
qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1459
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1460
if test ! "$ac_qt_libraries" = "NO"; then
1461
qt_libdir=$ac_qt_libraries
1463
qt_libdirs="$ac_qt_libraries $qt_libdirs"
1464
# if the Qt was given, the chance is too big that libqt.* doesn't exist
1466
for dir in $qt_libdirs; do
1467
try="ls -1 $dir/${LIBQT_GLOB}"
1468
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1471
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1472
if test -e "$a"; then
1473
LIBQT="$LIBQT ${kde_int_qt}_incremental"
1478
ac_qt_libraries="$qt_libdir"
1483
ac_cxxflags_safe="$CXXFLAGS"
1484
ac_ldflags_safe="$LDFLAGS"
1485
ac_libs_safe="$LIBS"
1487
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1488
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1489
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1491
KDE_PRINT_QT_PROGRAM
1493
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1496
echo "configure: failed program was:" >&AC_FD_CC
1497
cat conftest.$ac_ext >&AC_FD_CC
1498
ac_qt_libraries="NO"
1501
CXXFLAGS="$ac_cxxflags_safe"
1502
LDFLAGS="$ac_ldflags_safe"
1503
LIBS="$ac_libs_safe"
1506
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1507
ac_cv_have_qt="have_qt=no"
1510
if test "$ac_qt_includes" = NO; then
1511
if test "$ac_qt_libraries" = NO; then
1512
ac_qt_notfound="(headers and libraries)";
1514
ac_qt_notfound="(headers)";
1517
if test "x$kde_use_qt_mt" = "xyes"; then
1519
Make sure that you have compiled Qt with thread support!"
1520
ac_qt_notfound="(library $qtlib-mt)";
1522
ac_qt_notfound="(library $qtlib)";
1526
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1527
For more details about this problem, look at the end of config.log.$missing_qt_mt])
1533
eval "$ac_cv_have_qt"
1535
if test "$have_qt" != yes; then
1536
AC_MSG_RESULT([$have_qt]);
1538
ac_cv_have_qt="have_qt=yes \
1539
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1540
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1542
qt_libraries="$ac_qt_libraries"
1543
qt_includes="$ac_qt_includes"
1546
if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1547
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1550
AC_SUBST(qt_libraries)
1551
AC_SUBST(qt_includes)
1553
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1556
QT_INCLUDES="-I$qt_includes"
1557
all_includes="$QT_INCLUDES $all_includes"
1560
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1563
QT_LDFLAGS="-L$qt_libraries"
1564
all_libraries="$QT_LDFLAGS $all_libraries"
1566
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1568
AC_SUBST(QT_INCLUDES)
1569
AC_SUBST(QT_LDFLAGS)
1574
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1575
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1577
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1579
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1580
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1581
if test -e "$a"; then
1582
LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1593
AC_DEFUN([AC_PATH_QT],
1598
AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1600
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1602
if test x$ac_uic_supports_libpath = xyes; then
1604
AC_MSG_CHECKING([if UIC has KDE plugins available])
1605
AC_CACHE_VAL(kde_cv_uic_plugins,
1607
cat > actest.ui << EOF
1608
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1609
<class>NewConnectionDialog</class>
1610
<widget class="QDialog">
1611
<widget class="KLineEdit">
1612
<property name="name">
1613
<cstring>testInput</cstring>
1622
kde_cv_uic_plugins=no
1623
kde_line="$UIC_PATH -L $kde_widgetdir"
1624
if test x$ac_uic_supports_nounload = xyes; then
1625
kde_line="$kde_line -nounload"
1627
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1628
if AC_TRY_EVAL(kde_line); then
1629
# if you're trying to debug this check and think it's incorrect,
1630
# better check your installation. The check _is_ correct - your
1631
# installation is not.
1632
if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1633
kde_cv_uic_plugins=yes
1636
rm -f actest.ui actest.cpp
1639
AC_MSG_RESULT([$kde_cv_uic_plugins])
1640
if test "$kde_cv_uic_plugins" != yes; then
1641
AC_MSG_ERROR([you need to install kdelibs first.])
1646
AC_DEFUN([KDE_CHECK_FINAL],
1648
AC_ARG_ENABLE(final,
1649
AC_HELP_STRING([--enable-final],
1650
[build size optimized apps (experimental - needs lots of memory)]),
1651
kde_use_final=$enableval, kde_use_final=no)
1653
if test "x$kde_use_final" = "xyes"; then
1654
KDE_USE_FINAL_TRUE=""
1655
KDE_USE_FINAL_FALSE="#"
1657
KDE_USE_FINAL_TRUE="#"
1658
KDE_USE_FINAL_FALSE=""
1660
AC_SUBST(KDE_USE_FINAL_TRUE)
1661
AC_SUBST(KDE_USE_FINAL_FALSE)
1664
AC_DEFUN([KDE_CHECK_CLOSURE],
1666
AC_ARG_ENABLE(closure,
1667
AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1668
kde_use_closure=$enableval, kde_use_closure=no)
1671
if test "x$kde_use_closure" = "xyes"; then
1672
KDE_USE_CLOSURE_TRUE=""
1673
KDE_USE_CLOSURE_FALSE="#"
1674
# CXXFLAGS="$CXXFLAGS $REPO"
1676
KDE_USE_CLOSURE_TRUE="#"
1677
KDE_USE_CLOSURE_FALSE=""
1681
KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1682
[KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1683
[KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1684
[KDE_NO_UNDEFINED=""])],
1685
[KDE_NO_UNDEFINED=""])
1689
AC_SUBST(KDE_USE_CLOSURE_TRUE)
1690
AC_SUBST(KDE_USE_CLOSURE_FALSE)
1691
AC_SUBST(KDE_NO_UNDEFINED)
1694
dnl Check for the linker if it supports --as-needed
1695
AC_DEFUN([KDE_CHECK_AS_NEEDED],
1697
AC_ARG_ENABLE(as_needed,
1698
AC_HELP_STRING([--disable-as-needed],[disable the --as-needed flag for the linker]),
1699
kde_use_as_needed=$enableval, kde_use_as_needed=yes)
1701
LDFLAGS_AS_NEEDED=""
1702
if test "x$kde_use_as_needed" = "xyes"; then
1703
KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1704
[LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1706
AC_SUBST(LDFLAGS_AS_NEEDED)
1710
AC_DEFUN([KDE_CHECK_NMCHECK],
1712
AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1713
kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1715
if test "$kde_use_nmcheck" = "yes"; then
1716
KDE_USE_NMCHECK_TRUE=""
1717
KDE_USE_NMCHECK_FALSE="#"
1719
KDE_USE_NMCHECK_TRUE="#"
1720
KDE_USE_NMCHECK_FALSE=""
1722
AC_SUBST(KDE_USE_NMCHECK_TRUE)
1723
AC_SUBST(KDE_USE_NMCHECK_FALSE)
1726
AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1728
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1730
while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1734
dnl ------------------------------------------------------------------------
1735
dnl Now, the same with KDE
1736
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1737
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1738
dnl ------------------------------------------------------------------------
1740
AC_DEFUN([AC_BASE_PATH_KDE],
1742
AC_REQUIRE([KDE_CHECK_STL])
1743
AC_REQUIRE([AC_PATH_QT])dnl
1744
AC_REQUIRE([KDE_CHECK_LIB64])
1747
AC_MSG_CHECKING([for KDE])
1749
if test "${prefix}" != NONE; then
1750
kde_includes=${includedir}
1751
KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1753
kde_libraries=${libdir}
1754
KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1763
AC_CACHE_VAL(ac_cv_have_kde,
1764
[#try to guess kde locations
1766
if test "$kde_qtver" = 1; then
1767
kde_check_header="ksock.h"
1768
kde_check_lib="libkdecore.la"
1770
kde_check_header="ksharedptr.h"
1771
kde_check_lib="libkio.la"
1774
if test -z "$1"; then
1776
kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1777
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1778
kde_incdirs="$ac_kde_includes $kde_incdirs"
1779
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1780
ac_kde_includes="$kde_incdir"
1782
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1784
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1785
So, check this please and use another prefix!])
1788
kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1789
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1790
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1791
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1792
ac_kde_libraries="$kde_libdir"
1795
dnl this might be somewhere else
1796
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1798
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1800
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1801
So, check this please and use another prefix!])
1804
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1806
I can't find the designer plugins. These are required and should have been installed
1810
if test -n "$kde_widgetdir"; then
1811
kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1815
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1816
ac_cv_have_kde="have_kde=no"
1818
ac_cv_have_kde="have_kde=yes \
1819
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1822
else dnl test -z $1, e.g. from kdelibs
1824
ac_cv_have_kde="have_kde=no"
1829
eval "$ac_cv_have_kde"
1831
if test "$have_kde" != "yes"; then
1832
if test "${prefix}" = NONE; then
1833
ac_kde_prefix="$ac_default_prefix"
1835
ac_kde_prefix="$prefix"
1837
if test "$exec_prefix" = NONE; then
1838
ac_kde_exec_prefix="$ac_kde_prefix"
1839
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1841
ac_kde_exec_prefix="$exec_prefix"
1842
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1845
kde_libraries="${libdir}"
1846
kde_includes="${includedir}"
1849
ac_cv_have_kde="have_kde=yes \
1850
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1851
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1853
kde_libraries="$ac_kde_libraries"
1854
kde_includes="$ac_kde_includes"
1856
AC_SUBST(kde_libraries)
1857
AC_SUBST(kde_includes)
1859
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1862
KDE_INCLUDES="-I$kde_includes"
1863
all_includes="$KDE_INCLUDES $all_includes"
1866
KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1868
KDE_LDFLAGS="-L$kde_libraries"
1869
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1870
all_libraries="$KDE_LDFLAGS $all_libraries"
1873
AC_SUBST(KDE_LDFLAGS)
1874
AC_SUBST(KDE_INCLUDES)
1876
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1878
all_libraries="$USER_LDFLAGS $all_libraries"
1879
all_includes="$all_includes $USER_INCLUDES"
1880
AC_SUBST(all_includes)
1881
AC_SUBST(all_libraries)
1883
if test -z "$1"; then
1884
KDE_CHECK_UIC_PLUGINS
1887
ac_kde_libraries="$kde_libdir"
1894
AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1896
AC_MSG_CHECKING(for extra includes)
1897
AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1898
kde_use_extra_includes="$withval",
1899
kde_use_extra_includes=NONE
1902
if test -n "$kde_use_extra_includes" && \
1903
test "$kde_use_extra_includes" != "NONE"; then
1907
for dir in $kde_use_extra_includes; do
1908
kde_extra_includes="$kde_extra_includes $dir"
1909
USER_INCLUDES="$USER_INCLUDES -I$dir"
1912
kde_use_extra_includes="added"
1914
kde_use_extra_includes="no"
1916
AC_SUBST(USER_INCLUDES)
1918
AC_MSG_RESULT($kde_use_extra_includes)
1921
AC_MSG_CHECKING(for extra libs)
1922
AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1923
kde_use_extra_libs=$withval,
1924
kde_use_extra_libs=NONE
1926
if test -n "$kde_use_extra_libs" && \
1927
test "$kde_use_extra_libs" != "NONE"; then
1931
for dir in $kde_use_extra_libs; do
1932
kde_extra_libs="$kde_extra_libs $dir"
1933
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1934
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1937
kde_use_extra_libs="added"
1939
kde_use_extra_libs="no"
1942
AC_SUBST(USER_LDFLAGS)
1944
AC_MSG_RESULT($kde_use_extra_libs)
1948
AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1950
AC_MSG_CHECKING([for KDE headers installed])
1953
cat > conftest.$ac_ext <<EOF
1955
# include <stdlib.h>
1958
#include "confdefs.h"
1962
printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1963
printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1964
printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1965
printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1966
printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1967
printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1968
printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1969
printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1970
printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1971
printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1972
printf("kde_wallpaperdir=\\"%s\\"\n",
1973
KApplication::kde_wallpaperdir().data());
1974
printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1975
printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1976
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1977
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1978
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1979
printf("kde_styledir=\\"/tmp/dummy\\"\n");
1980
printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1981
printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
1982
printf("xdg_menudir=\\"/tmp/dummy\\"\n");
1983
printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
1984
printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
1989
ac_save_CPPFLAGS=$CPPFLAGS
1990
CPPFLAGS="$all_includes $CPPFLAGS"
1991
if AC_TRY_EVAL(ac_compile); then
1994
AC_MSG_ERROR([your system is not able to compile a small KDE application!
1995
Check, if you installed the KDE header files correctly.
1996
For more details about this problem, look at the end of config.log.])
1998
CPPFLAGS=$ac_save_CPPFLAGS
2003
AC_DEFUN([KDE_CHECK_KDEQTADDON],
2005
AC_MSG_CHECKING(for kde-qt-addon)
2006
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2008
kde_ldflags_safe="$LDFLAGS"
2009
kde_libs_safe="$LIBS"
2010
kde_cxxflags_safe="$CXXFLAGS"
2012
LIBS="-lkde-qt-addon $LIBQT $LIBS"
2013
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2014
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2022
kde_cv_have_kdeqtaddon=yes,
2023
kde_cv_have_kdeqtaddon=no
2026
LDFLAGS=$kde_ldflags_safe
2028
CXXFLAGS=$kde_cxxflags_safe
2031
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2033
if test "$kde_cv_have_kdeqtaddon" = "no"; then
2034
AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2035
It is a separate package (and CVS module) named kde-qt-addon.])
2039
AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2041
AC_REQUIRE([KDE_MISC_TESTS])
2042
AC_REQUIRE([KDE_CHECK_LIBDL])
2043
AC_REQUIRE([K_PATH_X])
2045
if test $kde_qtver = 3; then
2046
AC_SUBST(LIB_KDECORE, "-lkdecore")
2047
AC_SUBST(LIB_KDEUI, "-lkdeui")
2048
AC_SUBST(LIB_KIO, "-lkio")
2049
AC_SUBST(LIB_SMB, "-lsmb")
2050
AC_SUBST(LIB_KAB, "-lkab")
2051
AC_SUBST(LIB_KABC, "-lkabc")
2052
AC_SUBST(LIB_KHTML, "-lkhtml")
2053
AC_SUBST(LIB_KSPELL, "-lkspell")
2054
AC_SUBST(LIB_KPARTS, "-lkparts")
2055
AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2056
AC_SUBST(LIB_KUTILS, "-lkutils")
2057
AC_SUBST(LIB_KDEPIM, "-lkdepim")
2058
AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2059
AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2060
# these are for backward compatibility
2061
AC_SUBST(LIB_KSYCOCA, "-lkio")
2062
AC_SUBST(LIB_KFILE, "-lkio")
2063
elif test $kde_qtver = 2; then
2064
AC_SUBST(LIB_KDECORE, "-lkdecore")
2065
AC_SUBST(LIB_KDEUI, "-lkdeui")
2066
AC_SUBST(LIB_KIO, "-lkio")
2067
AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2068
AC_SUBST(LIB_SMB, "-lsmb")
2069
AC_SUBST(LIB_KFILE, "-lkfile")
2070
AC_SUBST(LIB_KAB, "-lkab")
2071
AC_SUBST(LIB_KHTML, "-lkhtml")
2072
AC_SUBST(LIB_KSPELL, "-lkspell")
2073
AC_SUBST(LIB_KPARTS, "-lkparts")
2074
AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2076
AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2077
AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2078
AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2079
AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2080
AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2084
AC_DEFUN([AC_PATH_KDE],
2087
AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2089
if test "$enableval" = "no";
2090
then ac_use_path_checking="default"
2091
else ac_use_path_checking=""
2095
if test "$kde_qtver" = 1;
2096
then ac_use_path_checking=""
2097
else ac_use_path_checking="default"
2102
AC_CREATE_KFSSTND($ac_use_path_checking)
2105
KDE_CREATE_LIBS_ALIASES
2108
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2109
AC_DEFUN([KDE_CHECK_FUNC_EXT],
2111
AC_MSG_CHECKING(for $1)
2112
AC_CACHE_VAL(kde_cv_func_$1,
2116
save_CXXFLAGS="$CXXFLAGS"
2117
kde_safe_LIBS="$LIBS"
2118
LIBS="$LIBS $X_EXTRA_LIBS"
2119
if test "$GXX" = "yes"; then
2120
CXXFLAGS="$CXXFLAGS -pedantic-errors"
2130
CXXFLAGS="$save_CXXFLAGS"
2131
LIBS="$kde_safe_LIBS"
2135
AC_MSG_RESULT($kde_cv_func_$1)
2137
AC_MSG_CHECKING([if $1 needs custom prototype])
2138
AC_CACHE_VAL(kde_cv_proto_$1,
2140
if test "x$kde_cv_func_$1" = xyes; then
2144
setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2145
kde_cv_proto_$1="yes - in libkdefakes"
2148
kde_cv_proto_$1=unknown
2153
if test "x$kde_cv_proto_$1" = xunknown; then
2158
LIBS="$LIBS $X_EXTRA_LIBS"
2167
[ kde_cv_func_$1=yes
2168
kde_cv_proto_$1=yes ],
2169
[kde_cv_proto_$1="$1 unavailable"]
2175
AC_MSG_RESULT($kde_cv_proto_$1)
2177
if test "x$kde_cv_func_$1" = xyes; then
2178
AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2181
if test "x$kde_cv_proto_$1" = xno; then
2182
AC_DEFINE(HAVE_$5_PROTO, 1,
2183
[Define if you have the $1 prototype])
2186
AH_VERBATIM([_HAVE_$5_PROTO],
2188
#if !defined(HAVE_$5_PROTO)
2200
AC_DEFUN([AC_CHECK_SETENV],
2202
KDE_CHECK_FUNC_EXT(setenv, [
2205
[setenv("VAR", "VALUE", 1);],
2206
[int setenv (const char *, const char *, int)],
2210
AC_DEFUN([AC_CHECK_UNSETENV],
2212
KDE_CHECK_FUNC_EXT(unsetenv, [
2216
[void unsetenv (const char *)],
2220
AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2222
KDE_CHECK_FUNC_EXT(getdomainname, [
2229
getdomainname(buffer, 200);
2231
[#include <sys/types.h>
2232
int getdomainname (char *, size_t)],
2236
AC_DEFUN([AC_CHECK_GETHOSTNAME],
2238
KDE_CHECK_FUNC_EXT(gethostname, [
2244
gethostname(buffer, 200);
2246
[int gethostname (char *, unsigned int)],
2250
AC_DEFUN([AC_CHECK_USLEEP],
2252
KDE_CHECK_FUNC_EXT(usleep, [
2258
[int usleep (unsigned int)],
2263
AC_DEFUN([AC_CHECK_RANDOM],
2265
KDE_CHECK_FUNC_EXT(random, [
2271
[long int random(void)],
2274
KDE_CHECK_FUNC_EXT(srandom, [
2280
[void srandom(unsigned int)],
2285
AC_DEFUN([AC_CHECK_INITGROUPS],
2287
KDE_CHECK_FUNC_EXT(initgroups, [
2288
#include <sys/types.h>
2294
initgroups(buffer, 27);
2296
[int initgroups(const char *, gid_t)],
2300
AC_DEFUN([AC_CHECK_MKSTEMPS],
2302
KDE_CHECK_FUNC_EXT(mkstemps, [
2307
mkstemps("/tmp/aaaXXXXXX", 6);
2309
[int mkstemps(char *, int)],
2313
AC_DEFUN([AC_CHECK_MKSTEMP],
2315
KDE_CHECK_FUNC_EXT(mkstemp, [
2320
mkstemp("/tmp/aaaXXXXXX");
2322
[int mkstemp(char *)],
2326
AC_DEFUN([AC_CHECK_MKDTEMP],
2328
KDE_CHECK_FUNC_EXT(mkdtemp, [
2333
mkdtemp("/tmp/aaaXXXXXX");
2335
[char *mkdtemp(char *)],
2340
AC_DEFUN([AC_CHECK_RES_INIT],
2342
AC_MSG_CHECKING([if res_init needs -lresolv])
2343
kde_libs_safe="$LIBS"
2344
LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2347
#include <sys/types.h>
2348
#include <netinet/in.h>
2349
#include <arpa/nameser.h>
2356
LIBRESOLV="-lresolv"
2358
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2360
[ AC_MSG_RESULT(no) ]
2365
KDE_CHECK_FUNC_EXT(res_init,
2367
#include <sys/types.h>
2368
#include <netinet/in.h>
2369
#include <arpa/nameser.h>
2373
[int res_init(void)],
2377
AC_DEFUN([AC_CHECK_STRLCPY],
2379
KDE_CHECK_FUNC_EXT(strlcpy, [
2383
strlcpy(buf, "KDE function test", sizeof(buf));
2385
[unsigned long strlcpy(char*, const char*, unsigned long)],
2389
AC_DEFUN([AC_CHECK_STRLCAT],
2391
KDE_CHECK_FUNC_EXT(strlcat, [
2396
strlcat(buf, "KDE function test", sizeof(buf));
2398
[unsigned long strlcat(char*, const char*, unsigned long)],
2402
AC_DEFUN([AC_CHECK_RES_QUERY],
2404
KDE_CHECK_FUNC_EXT(res_query, [
2405
#include <sys/types.h>
2406
#include <netinet/in.h>
2407
#include <arpa/nameser.h>
2412
res_query(NULL, 0, 0, NULL, 0);
2414
[int res_query(const char *, int, int, unsigned char *, int)],
2418
AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2420
KDE_CHECK_FUNC_EXT(dn_skipname, [
2421
#include <sys/types.h>
2422
#include <netinet/in.h>
2423
#include <arpa/nameser.h>
2427
dn_skipname (NULL, NULL);
2429
[int dn_skipname (unsigned char *, unsigned char *)],
2434
AC_DEFUN([AC_FIND_GIF],
2435
[AC_MSG_CHECKING([for giflib])
2436
AC_CACHE_VAL(ac_cv_lib_gif,
2437
[ac_save_LIBS="$LIBS"
2438
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2439
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2441
LIBS="$all_libraries -lgif"
2448
int GifLastError(void);
2452
/* We use char because int might match the return type of a gcc2
2453
builtin and then its argument prototype would still apply. */
2455
[return GifLastError();],
2456
eval "ac_cv_lib_gif=yes",
2457
eval "ac_cv_lib_gif=no")
2458
LIBS="$ac_save_LIBS"
2460
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2462
AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2464
AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2468
AC_DEFUN([KDE_FIND_JPEG_HELPER],
2470
AC_MSG_CHECKING([for libjpeg$2])
2471
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2473
ac_save_LIBS="$LIBS"
2474
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2475
ac_save_CFLAGS="$CFLAGS"
2476
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2478
[/* Override any gcc2 internal prototype to avoid an error. */
2479
struct jpeg_decompress_struct;
2480
typedef struct jpeg_decompress_struct * j_decompress_ptr;
2485
void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2486
int version, size_t structsize);
2490
/* We use char because int might match the return type of a gcc2
2491
builtin and then its argument prototype would still apply. */
2493
[jpeg_CreateDecompress(0L, 0, 0);],
2494
eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2495
eval "ac_cv_lib_jpeg_$1=no")
2496
LIBS="$ac_save_LIBS"
2497
CFLAGS="$ac_save_CFLAGS"
2500
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2501
LIBJPEG="$ac_cv_lib_jpeg_$1"
2502
AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2510
AC_DEFUN([AC_FIND_JPEG],
2512
dnl first look for libraries
2513
KDE_FIND_JPEG_HELPER(6b, 6b,
2514
KDE_FIND_JPEG_HELPER(normal, [],
2521
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2522
dnl requires system dependent includes loaded before it)
2523
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2524
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2525
test "x$jpeg_incdir" = xNO && jpeg_incdir=
2527
dnl if headers _and_ libraries are missing, this is no error, and we
2528
dnl continue with a warning (the user will get no jpeg support in khtml)
2529
dnl if only one is missing, it means a configuration error, but we still
2531
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2532
AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2534
if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2536
There is an installation error in jpeg support. You seem to have only one
2537
of either the headers _or_ the libraries installed. You may need to either
2538
provide correct --with-extra-... options, or the development package of
2539
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2540
Disabling JPEG support.
2543
AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2550
AH_VERBATIM(_AC_CHECK_JPEG,
2552
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2553
* headers and I'm too lazy to write a configure test as long as only
2554
* unixware is related
2557
#define HAVE_BOOLEAN
2562
AC_DEFUN([KDE_CHECK_QT_JPEG],
2564
if test -n "$LIBJPEG"; then
2565
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2566
AC_CACHE_VAL(kde_cv_qt_jpeg,
2570
ac_save_LIBS="$LIBS"
2571
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2572
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2573
ac_save_CXXFLAGS="$CXXFLAGS"
2574
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2576
[#include <qapplication.h>],
2580
QApplication app(argc, argv);],
2581
eval "kde_cv_qt_jpeg=no",
2582
eval "kde_cv_qt_jpeg=yes")
2583
LIBS="$ac_save_LIBS"
2584
CXXFLAGS="$ac_save_CXXFLAGS"
2589
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2591
LIBJPEG_QT='$(LIBJPEG)'
2599
AC_DEFUN([AC_FIND_ZLIB],
2601
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2602
AC_MSG_CHECKING([for libz])
2603
AC_CACHE_VAL(ac_cv_lib_z,
2605
kde_save_LIBS="$LIBS"
2606
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2607
kde_save_CFLAGS="$CFLAGS"
2608
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2615
gzFile f = (gzFile) 0;
2616
/* this would segfault.. but we only link, don't run */
2617
(void) gzgets(f, buf, sizeof(buf));
2619
return (zlibVersion() == ZLIB_VERSION);
2621
eval "ac_cv_lib_z='-lz'",
2622
eval "ac_cv_lib_z=no")
2623
LIBS="$kde_save_LIBS"
2624
CFLAGS="$kde_save_CFLAGS"
2626
if test ! "$ac_cv_lib_z" = no; then
2627
AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2629
AC_MSG_RESULT($ac_cv_lib_z)
2631
AC_MSG_ERROR(not found.
2632
Possibly configure picks up an outdated version
2633
installed by XFree86. Remove it from your system.
2635
Check your installation and look into config.log)
2641
AC_DEFUN([KDE_TRY_TIFFLIB],
2643
AC_MSG_CHECKING([for libtiff $1])
2645
AC_CACHE_VAL(kde_cv_libtiff_$1,
2649
kde_save_LIBS="$LIBS"
2650
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2651
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2653
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2655
kde_save_CXXFLAGS="$CXXFLAGS"
2656
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2662
[return (TIFFOpen( "", "r") == 0); ],
2664
kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2666
kde_cv_libtiff_$1=no
2669
LIBS="$kde_save_LIBS"
2670
CXXFLAGS="$kde_save_CXXFLAGS"
2674
if test "$kde_cv_libtiff_$1" = "no"; then
2679
LIBTIFF="$kde_cv_libtiff_$1"
2681
AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2687
AC_DEFUN([AC_FIND_TIFF],
2689
AC_REQUIRE([K_PATH_X])
2690
AC_REQUIRE([AC_FIND_ZLIB])
2691
AC_REQUIRE([AC_FIND_JPEG])
2692
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2694
KDE_TRY_TIFFLIB(tiff, [],
2695
KDE_TRY_TIFFLIB(tiff34))
2701
AC_DEFUN([AC_FIND_PNG],
2703
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2704
AC_REQUIRE([AC_FIND_ZLIB])
2705
AC_MSG_CHECKING([for libpng])
2706
AC_CACHE_VAL(ac_cv_lib_png,
2708
kde_save_LIBS="$LIBS"
2709
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2710
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2712
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2714
kde_save_CFLAGS="$CFLAGS"
2715
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2722
png_structp png_ptr = png_create_read_struct( /* image ptr */
2723
PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2724
return( png_ptr != 0 );
2726
eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2727
eval "ac_cv_lib_png=no"
2729
LIBS="$kde_save_LIBS"
2730
CFLAGS="$kde_save_CFLAGS"
2732
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2733
AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2734
LIBPNG="$ac_cv_lib_png"
2736
AC_MSG_RESULT($ac_cv_lib_png)
2745
AC_DEFUN([AC_FIND_JASPER],
2747
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2748
AC_REQUIRE([AC_FIND_JPEG])
2749
AC_MSG_CHECKING([for jasper])
2750
AC_CACHE_VAL(ac_cv_jasper,
2752
kde_save_LIBS="$LIBS"
2753
LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2754
kde_save_CFLAGS="$CFLAGS"
2755
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2759
#include<jasper/jasper.h>
2762
return( jas_init() );
2764
eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2765
eval "ac_cv_jasper=no"
2767
LIBS="$kde_save_LIBS"
2768
CFLAGS="$kde_save_CFLAGS"
2770
if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2771
AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2772
LIB_JASPER="$ac_cv_jasper"
2773
AC_MSG_RESULT($ac_cv_jasper)
2778
AC_SUBST(LIB_JASPER)
2781
AC_DEFUN([AC_CHECK_BOOL],
2783
AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2786
AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2788
AC_MSG_CHECKING(if you need GNU extensions)
2789
AC_CACHE_VAL(ac_cv_gnu_extensions,
2791
cat > conftest.c << EOF
2792
#include <features.h>
2794
#ifdef __GNU_LIBRARY__
2799
if (eval "$ac_cpp conftest.c") 2>&5 |
2800
egrep "yes" >/dev/null 2>&1; then
2802
ac_cv_gnu_extensions=yes
2804
ac_cv_gnu_extensions=no
2808
AC_MSG_RESULT($ac_cv_gnu_extensions)
2809
if test "$ac_cv_gnu_extensions" = "yes"; then
2810
AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2814
AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2816
AC_MSG_CHECKING([whether $CXX supports -$1])
2817
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2818
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2822
save_CXXFLAGS="$CXXFLAGS"
2823
CXXFLAGS="$CXXFLAGS -$1"
2824
AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2825
CXXFLAGS="$save_CXXFLAGS"
2828
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2839
AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2841
AC_MSG_CHECKING([whether $CC supports -$1])
2842
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2843
AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2847
save_CFLAGS="$CFLAGS"
2848
CFLAGS="$CFLAGS -$1"
2849
AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2850
CFLAGS="$save_CFLAGS"
2853
if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2865
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2866
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2867
dnl it's all white-space separated
2868
AC_DEFUN([AC_REMOVE_FORBIDDEN],
2871
if test -n "$__val"; then
2877
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2878
*) # Careful to not add spaces, where there were none, because otherwise
2879
# libtool gets confused, if we change e.g. CXX
2880
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2888
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2889
AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
2891
if test "x$kde_use_qt_emb" != "xyes"; then
2892
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2893
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2895
AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2896
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2900
AC_DEFUN([AC_CHECK_COMPILERS],
2902
AC_ARG_ENABLE(debug,
2903
AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
2907
kde_use_debug_code="yes"
2908
kde_use_debug_define=no
2911
kde_use_debug_code="full"
2912
kde_use_debug_define=no
2915
kde_use_debug_code="no"
2916
kde_use_debug_define=yes
2920
[kde_use_debug_code="no"
2921
kde_use_debug_define=no
2924
dnl Just for configure --help
2925
AC_ARG_ENABLE(dummyoption,
2926
AC_HELP_STRING([--disable-debug],
2927
[disables debug output and debug symbols [default=no]]),
2930
AC_ARG_ENABLE(strict,
2931
AC_HELP_STRING([--enable-strict],
2932
[compiles with strict compiler options (may not work!)]),
2934
if test $enableval = "no"; then
2935
kde_use_strict_options="no"
2937
kde_use_strict_options="yes"
2939
], [kde_use_strict_options="no"])
2941
AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similiar]),
2943
if test $enableval = "no"; then
2944
kde_use_warnings="no"
2946
kde_use_warnings="yes"
2948
], [kde_use_warnings="yes"])
2950
dnl enable warnings for debug build
2951
if test "$kde_use_debug_code" != "no"; then
2952
kde_use_warnings=yes
2955
AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
2956
[kde_use_profiling=$enableval],
2957
[kde_use_profiling="no"]
2960
dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2967
if test "$GCC" = "yes"; then
2968
if test "$kde_use_debug_code" != "no"; then
2969
if test $kde_use_debug_code = "full"; then
2970
CFLAGS="-g3 -fno-inline $CFLAGS"
2972
CFLAGS="-g -O2 $CFLAGS"
2975
CFLAGS="-O2 $CFLAGS"
2979
if test "$kde_use_debug_define" = "yes"; then
2980
CFLAGS="-DNDEBUG $CFLAGS"
2985
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2986
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2989
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2993
CXXFLAGS=" $CXXFLAGS"
2997
if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2998
if test "$kde_use_debug_code" != "no"; then
2999
if test "$CXX" = "KCC"; then
3000
CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3002
if test "$kde_use_debug_code" = "full"; then
3003
CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3005
CXXFLAGS="-g -O2 $CXXFLAGS"
3008
KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3010
dnl convenience compiler flags
3011
KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3012
AC_SUBST(WOVERLOADED_VIRTUAL)
3014
if test "$CXX" = "KCC"; then
3015
CXXFLAGS="+K3 $CXXFLAGS"
3017
CXXFLAGS="-O2 $CXXFLAGS"
3022
if test "$kde_use_debug_define" = "yes"; then
3023
CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3026
if test "$kde_use_profiling" = "yes"; then
3027
KDE_CHECK_COMPILER_FLAG(pg,
3029
CFLAGS="-pg $CFLAGS"
3030
CXXFLAGS="-pg $CXXFLAGS"
3034
if test "$kde_use_warnings" = "yes"; then
3035
if test "$GCC" = "yes"; then
3036
CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3039
CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3040
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
3041
KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3042
KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3045
KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3046
KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3047
KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
3051
if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3052
CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3056
AC_HELP_STRING([--enable-pch],
3057
[enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3058
[ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3060
HAVE_GCC_VISIBILITY=0
3061
AC_SUBST([HAVE_GCC_VISIBILITY])
3063
if test "$GXX" = "yes"; then
3064
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3065
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3066
KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3067
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
3068
ENABLE_PERMISSIVE_FLAG="-fpermissive"
3070
if test "$kde_use_pch" = "yes"; then
3071
AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3073
if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3074
kde_gcc_supports_pch=yes
3077
kde_gcc_supports_pch=no
3080
if test "$kde_gcc_supports_pch" = "yes"; then
3081
AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3082
if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3083
kde_gcc_supports_pch=yes
3086
kde_gcc_supports_pch=no
3090
rm -f conftest.h conftest.h.gch
3092
AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3094
if test "$CXX" = "KCC"; then
3095
dnl unfortunately we currently cannot disable exception support in KCC
3096
dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3097
dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3098
dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
3100
if test "$kde_use_pch" = "yes"; then
3101
dnl TODO: support --pch-dir!
3102
KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3103
dnl the below works (but the dir must exist), but it's
3104
dnl useless for a whole package.
3105
dnl The are precompiled headers for each source file, so when compiling
3106
dnl from scratch, it doesn't make a difference, and they take up
3107
dnl around ~5Mb _per_ sourcefile.
3108
dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3109
dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3111
dnl this flag controls inlining. by default KCC inlines in optimisation mode
3112
dnl all implementations that are defined inside the class {} declaration.
3113
dnl because of templates-compatibility with broken gcc compilers, this
3114
dnl can cause excessive inlining. This flag limits it to a sane level
3115
KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3116
KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3117
KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3118
KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3119
dnl Some source files are shared between multiple executables
3120
dnl (or libraries) and some of those need template instantiations.
3121
dnl In that case KCC needs to compile those sources with
3122
dnl --one_instantiation_per_object. To make it easy for us we compile
3123
dnl _all_ objects with that flag (--one_per is a shorthand).
3124
KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3126
AC_SUBST(USE_EXCEPTIONS)
3127
dnl obsolete macro - provided to keep things going
3132
*-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3133
*-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3134
*-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3136
if test "$GXX" = yes; then
3137
libstdcpp=`$CXX -print-file-name=libstdc++.so`
3138
if test ! -f $libstdcpp; then
3139
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])
3145
AC_VALIDIFY_CXXFLAGS
3149
if test "$GCC" = yes; then
3152
KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3154
AC_SUBST(NOOPT_CXXFLAGS)
3155
AC_SUBST(NOOPT_CFLAGS)
3156
AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3163
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3166
AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
3168
if test "$GXX" = "yes"; then
3169
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3170
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3171
KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3172
KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
3174
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
3175
HAVE_GCC_VISIBILITY=1
3176
AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3181
AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3183
AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
3186
AC_DEFUN([KDE_ADD_DEPENDENCIES],
3188
[A]M_DEPENDENCIES(CC)
3189
[A]M_DEPENDENCIES(CXX)
3192
dnl just a wrapper to clean up configure.in
3193
AC_DEFUN([KDE_PROG_LIBTOOL],
3195
AC_REQUIRE([AC_CHECK_COMPILERS])
3196
AC_REQUIRE([AC_ENABLE_SHARED])
3197
AC_REQUIRE([AC_ENABLE_STATIC])
3199
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3200
AC_REQUIRE([KDE_CHECK_LIB64])
3208
LIBTOOL_SHELL="/bin/sh ./libtool"
3209
# LIBTOOL="$LIBTOOL --silent"
3210
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3211
AC_SUBST(KDE_PLUGIN)
3213
# we patch configure quite some so we better keep that consistent for incremental runs
3214
AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3217
AC_DEFUN([KDE_CHECK_LIB64],
3220
AC_ARG_ENABLE(libsuffix,
3221
AC_HELP_STRING([--enable-libsuffix],
3222
[/lib directory suffix (64,32,none[=default])]),
3223
kdelibsuff=$enableval)
3224
# TODO: add an auto case that compiles a little C app to check
3225
# where the glibc is
3226
if test "$kdelibsuff" = "no"; then
3229
if test -z "$kdelibsuff"; then
3230
AC_MSG_RESULT([not using lib directory suffix])
3231
AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3233
if test "$libdir" = '${exec_prefix}/lib'; then
3234
libdir="$libdir${kdelibsuff}"
3235
AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
3237
AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3238
AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3242
AC_DEFUN([KDE_CHECK_TYPES],
3243
[ AC_CHECK_SIZEOF(int, 4)dnl
3244
AC_CHECK_SIZEOF(short)dnl
3245
AC_CHECK_SIZEOF(long, 4)dnl
3246
AC_CHECK_SIZEOF(char *, 4)dnl
3249
dnl Not used - kept for compat only?
3250
AC_DEFUN([KDE_DO_IT_ALL],
3254
AM_INIT_AUTOMAKE($1, $2)
3255
AM_DISABLE_LIBRARIES
3256
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3263
AC_DEFUN([AC_CHECK_RPATH],
3265
AC_MSG_CHECKING(for rpath)
3266
AC_ARG_ENABLE(rpath,
3267
AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3268
USE_RPATH=$enableval, USE_RPATH=yes)
3270
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3272
KDE_RPATH="-R \$(kde_libraries)"
3274
if test -n "$qt_libraries"; then
3275
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3277
dnl $x_libraries is set to /usr/lib in case
3278
if test -n "$X_LDFLAGS"; then
3279
X_RPATH="-R \$(x_libraries)"
3280
KDE_RPATH="$KDE_RPATH $X_RPATH"
3282
if test -n "$KDE_EXTRA_RPATH"; then
3283
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3286
AC_SUBST(KDE_EXTRA_RPATH)
3289
AC_MSG_RESULT($USE_RPATH)
3292
dnl Check for the type of the third argument of getsockname
3293
AC_DEFUN([AC_CHECK_SOCKLEN_T],
3295
AC_MSG_CHECKING(for socklen_t)
3296
AC_CACHE_VAL(kde_cv_socklen_t,
3301
#include <sys/types.h>
3302
#include <sys/socket.h>
3306
getpeername(0,0,&len);
3309
kde_cv_socklen_t=yes
3310
kde_cv_socklen_t_equiv=socklen_t
3314
AC_MSG_RESULT($kde_cv_socklen_t)
3315
if test $kde_cv_socklen_t = no; then
3316
AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3317
AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3319
kde_cv_socklen_t_equiv=int
3321
for t in int size_t unsigned long "unsigned long"; do
3323
#include <sys/types.h>
3324
#include <sys/socket.h>
3328
getpeername(0,0,&len);
3331
kde_cv_socklen_t_equiv="$t"
3337
AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3339
AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3340
[type to use in place of socklen_t if not defined])
3341
AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3342
[type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3345
dnl This is a merge of some macros out of the gettext aclocal.m4
3346
dnl since we don't need anything, I took the things we need
3347
dnl the copyright for them is:
3349
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3350
dnl This Makefile.in is free software; the Free Software Foundation
3351
dnl gives unlimited permission to copy and/or distribute it,
3352
dnl with or without modifications, as long as this notice is preserved.
3354
dnl This program is distributed in the hope that it will be useful,
3355
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3356
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3357
dnl PARTICULAR PURPOSE.
3359
dnl for this file it is relicensed under LGPL
3361
AC_DEFUN([AM_KDE_WITH_NLS],
3363
dnl If we use NLS figure out what method
3365
AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3366
[test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3367
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3369
if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3370
AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3377
AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3378
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3380
dnl Test whether we really found GNU xgettext.
3381
if test "$XGETTEXT" != ":"; then
3382
dnl If it is no GNU xgettext we define it as : so that the
3383
dnl Makefiles still can work.
3384
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3388
[found xgettext programs is not GNU xgettext; ignore it])
3396
# Search path for a program which passes the given test.
3397
# Ulrich Drepper <drepper@cygnus.com>, 1996.
3400
# Stephan Kulow: I appended a _KDE against name conflicts
3402
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3403
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3404
AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3405
[# Extract the first word of "$2", so it can be a program name with args.
3406
set dummy $2; ac_word=[$]2
3407
AC_MSG_CHECKING([for $ac_word])
3408
AC_CACHE_VAL(ac_cv_path_$1,
3411
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3414
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3415
for ac_dir in ifelse([$5], , $PATH, [$5]); do
3416
test -z "$ac_dir" && ac_dir=.
3417
if test -f $ac_dir/$ac_word; then
3419
ac_cv_path_$1="$ac_dir/$ac_word"
3425
dnl If no 4th arg is given, leave the cache variable unset,
3426
dnl so AC_PATH_PROGS will keep looking.
3427
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3432
if test -n "[$]$1"; then
3433
AC_MSG_RESULT([$]$1)
3441
# Check whether LC_MESSAGES is available in <locale.h>.
3442
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3446
AC_DEFUN([AM_LC_MESSAGES],
3447
[if test $ac_cv_header_locale_h = yes; then
3448
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3449
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3450
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3451
if test $am_cv_val_LC_MESSAGES = yes; then
3452
AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3456
dnl From Jim Meyering.
3457
dnl FIXME: migrate into libit.
3459
AC_DEFUN([AM_FUNC_OBSTACK],
3460
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3461
[AC_TRY_LINK([#include "obstack.h"],
3462
[struct obstack *mem;obstack_free(mem,(char *) 0)],
3463
am_cv_func_obstack=yes,
3464
am_cv_func_obstack=no)])
3465
if test $am_cv_func_obstack = yes; then
3466
AC_DEFINE(HAVE_OBSTACK)
3468
LIBOBJS="$LIBOBJS obstack.o"
3472
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3473
dnl FIXME: Migrate into libit
3475
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3476
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3477
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3478
am_cv_lib_error_at_line=yes,
3479
am_cv_lib_error_at_line=no)])
3480
if test $am_cv_lib_error_at_line = no; then
3481
LIBOBJS="$LIBOBJS error.o"
3483
AC_SUBST(LIBOBJS)dnl
3486
# Macro to add for using GNU gettext.
3487
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3490
# Stephan Kulow: I put a KDE in it to avoid name conflicts
3492
AC_DEFUN([AM_KDE_GNU_GETTEXT],
3493
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3494
AC_REQUIRE([AC_PROG_RANLIB])dnl
3495
AC_REQUIRE([AC_HEADER_STDC])dnl
3496
AC_REQUIRE([AC_TYPE_OFF_T])dnl
3497
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3498
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3499
AC_REQUIRE([AC_FUNC_MMAP])dnl
3500
AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3501
AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3502
AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3503
__argz_count __argz_stringify __argz_next])
3505
AC_MSG_CHECKING(for stpcpy)
3506
AC_CACHE_VAL(kde_cv_func_stpcpy,
3508
kde_safe_cxxflags=$CXXFLAGS
3517
stpcpy(buffer, buffer);
3519
kde_cv_func_stpcpy=yes,
3520
kde_cv_func_stpcpy=no)
3522
CXXFLAGS=$kde_safe_cxxflags
3524
AC_MSG_RESULT($kde_cv_func_stpcpy)
3525
if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3526
AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3531
if test "x$CATOBJEXT" != "x"; then
3532
if test "x$ALL_LINGUAS" = "x"; then
3535
AC_MSG_CHECKING(for catalogs to be installed)
3537
for lang in ${LINGUAS=$ALL_LINGUAS}; do
3538
case "$ALL_LINGUAS" in
3539
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3542
LINGUAS=$NEW_LINGUAS
3543
AC_MSG_RESULT($LINGUAS)
3546
dnl Construct list of names of catalog files to be constructed.
3547
if test -n "$LINGUAS"; then
3548
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3554
AC_DEFUN([AC_HAVE_XPM],
3555
[AC_REQUIRE_CPP()dnl
3556
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3558
test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3559
test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3561
AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3562
xpm_test=$withval, xpm_test="yes")
3563
if test "x$xpm_test" = xno; then
3566
AC_MSG_CHECKING(for XPM)
3567
AC_CACHE_VAL(ac_cv_have_xpm,
3569
ac_save_ldflags="$LDFLAGS"
3570
ac_save_cflags="$CFLAGS"
3571
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3572
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3574
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3576
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3577
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3578
AC_TRY_LINK([#include <X11/xpm.h>],[],
3579
ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3580
LDFLAGS="$ac_save_ldflags"
3581
CFLAGS="$ac_save_cflags"
3584
if test "$ac_cv_have_xpm" = no; then
3590
AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3591
if test "$XPM_LDFLAGS" = ""; then
3592
XPMLIB='-lXpm $(LIB_X11)'
3594
XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3596
if test "$XPM_INCLUDE" = ""; then
3599
XPMINC="-I$XPM_INCLUDE"
3609
AC_DEFUN([AC_HAVE_DPMS],
3610
[AC_REQUIRE_CPP()dnl
3611
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3613
test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3614
test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3617
AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3618
dpms_test=$withval, dpms_test="yes")
3619
if test "x$dpms_test" = xno; then
3622
AC_MSG_CHECKING(for DPMS)
3623
dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3624
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3625
AC_CACHE_VAL(ac_cv_have_dpms,
3627
if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3629
ac_cv_have_dpms="no"
3631
ac_save_ldflags="$LDFLAGS"
3632
ac_save_cflags="$CFLAGS"
3633
ac_save_libs="$LIBS"
3634
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3635
CFLAGS="$CFLAGS $X_INCLUDES"
3636
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3638
#include <X11/Xproto.h>
3640
#include <X11/Xlib.h>
3641
#include <X11/extensions/dpms.h>
3643
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3644
ac_cv_have_dpms="yes", [
3645
LDFLAGS="$ac_save_ldflags"
3646
CFLAGS="$ac_save_cflags"
3647
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3648
LIBS="$LIBS -lXdpms"
3649
CFLAGS="$CFLAGS $X_INCLUDES"
3650
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3652
#include <X11/Xproto.h>
3654
#include <X11/Xlib.h>
3655
#include <X11/extensions/dpms.h>
3657
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3659
ac_cv_have_dpms="-lXdpms"
3660
],ac_cv_have_dpms="no")
3662
LDFLAGS="$ac_save_ldflags"
3663
CFLAGS="$ac_save_cflags"
3664
LIBS="$ac_save_libs"
3668
if test "$ac_cv_have_dpms" = no; then
3674
AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3675
if test "$ac_cv_have_dpms" = "-lXdpms"; then
3678
if test "$DPMS_LDFLAGS" = ""; then
3679
DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3681
DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3683
if test "$DPMS_INCLUDE" = ""; then
3686
DPMSINC="-I$DPMS_INCLUDE"
3692
ac_save_cflags="$CFLAGS"
3693
CFLAGS="$CFLAGS $X_INCLUDES"
3694
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3695
AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
3696
[Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
3697
AC_CHECK_DECL(DPMSCapable,
3698
AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
3699
[#include <X11/extensions/dpms.h>])
3700
AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
3701
[Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
3702
AC_CHECK_DECL(DPMSInfo,
3703
AC_DEFINE(HAVE_DPMSINFO_PROTO),,
3704
[#include <X11/extensions/dpms.h>])
3705
CFLAGS="$ac_save_cflags"
3710
AC_DEFUN([AC_HAVE_GL],
3711
[AC_REQUIRE_CPP()dnl
3712
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3714
test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3715
test -z "$GL_INCLUDE" && GL_INCLUDE=
3717
AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
3718
gl_test=$withval, gl_test="yes")
3719
if test "x$kde_use_qt_emb" = "xyes"; then
3720
# GL and Qt Embedded is a no-go for now.
3722
elif test "x$gl_test" = xno; then
3725
AC_MSG_CHECKING(for GL)
3726
AC_CACHE_VAL(ac_cv_have_gl,
3730
ac_save_ldflags="$LDFLAGS"
3731
ac_save_cxxflags="$CXXFLAGS"
3732
LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3733
test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3734
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3735
CXXFLAGS="$CFLAGS $X_INCLUDES"
3736
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3737
AC_TRY_LINK([#include <GL/gl.h>
3740
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3741
if test "x$ac_cv_have_gl" = "xno"; then
3742
LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3743
test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3744
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3745
CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3746
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3747
AC_TRY_LINK([#include <GL/gl.h>
3750
ac_cv_have_gl="yes", ac_cv_have_gl="no")
3753
LDFLAGS="$ac_save_ldflags"
3754
CXXFLAGS="$ac_save_cxxflags"
3757
if test "$ac_cv_have_gl" = "no"; then
3763
AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3764
if test "$GL_LDFLAGS" = ""; then
3765
if test "$ac_cv_have_gl" = "mesa"; then
3766
GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3768
GLLIB='-lGLU -lGL $(LIB_X11)'
3771
if test "$ac_cv_have_gl" = "mesa"; then
3772
GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3774
GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3777
if test "$GL_INCLUDE" = ""; then
3780
GLINC="-I$GL_INCLUDE"
3782
AC_MSG_RESULT($ac_cv_have_gl)
3791
dnl shadow password and PAM magic - maintained by ossi@kde.org
3793
AC_DEFUN([KDE_PAM], [
3794
AC_REQUIRE([KDE_CHECK_LIBDL])
3798
AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
3799
[ if test "x$withval" = "xyes"; then
3802
elif test "x$withval" = "xno"; then
3806
pam_service=$withval
3808
], [ pam_service=kde ])
3812
if test "x$want_pam" != xno; then
3813
AC_CHECK_LIB(pam, pam_start, [
3814
AC_CHECK_HEADER(security/pam_appl.h,
3815
[ pam_header=security/pam_appl.h ],
3816
[ AC_CHECK_HEADER(pam/pam_appl.h,
3817
[ pam_header=pam/pam_appl.h ],
3819
AC_MSG_WARN([PAM detected, but no headers found!
3820
Make sure you have the necessary development packages installed.])
3826
if test -z "$pam_header"; then
3827
if test "x$want_pam" = xyes; then
3828
AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
3831
AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3832
PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3835
dnl darwin claims to be something special
3836
if test "$pam_header" = "pam/pam_appl.h"; then
3837
AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
3840
dnl test whether struct pam_message is const (Linux) or not (Sun)
3841
AC_MSG_CHECKING(for const pam_message)
3842
AC_EGREP_HEADER([struct pam_message], $pam_header,
3843
[ AC_EGREP_HEADER([const struct pam_message], $pam_header,
3844
[AC_MSG_RESULT([const: Linux-type PAM])],
3845
[AC_MSG_RESULT([nonconst: Sun-type PAM])
3846
AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3848
[AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3855
dnl DEF_PAM_SERVICE(arg name, full name, define name)
3856
AC_DEFUN([DEF_PAM_SERVICE], [
3858
AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
3859
[ if test "x$use_pam" = xyes; then
3860
$3_PAM_SERVICE=$withval
3862
AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3863
You may want to enforce it by using --with-pam.])
3866
[ if test "x$use_pam" = xyes; then
3867
$3_PAM_SERVICE="$pam_service"
3870
if test -n "$$3_PAM_SERVICE"; then
3871
AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3872
AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3874
AC_SUBST($3_PAM_SERVICE)
3877
AC_DEFUN([KDE_SHADOWPASSWD], [
3878
AC_REQUIRE([KDE_PAM])
3880
AC_CHECK_LIB(shadow, getspent,
3881
[ LIBSHADOW="-lshadow"
3885
AC_CHECK_LIB(gen, getspent,
3889
[ AC_CHECK_FUNC(getspent,
3890
[ ac_use_shadow=yes ],
3891
[ ac_use_shadow=no ])
3897
AC_MSG_CHECKING([for shadow passwords])
3900
AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
3901
[ if test "x$withval" != "xno"; then
3907
use_shadow="$ac_use_shadow"
3910
if test "x$use_shadow" = xyes; then
3912
AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3919
dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3920
dnl this still applies, if we could use it indirectly through pam.
3921
if test "x$use_shadow" = xyes ||
3922
( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3924
*-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3925
SETUIDFLAGS="-m 4755 -o root";;
3927
SETUIDFLAGS="-m 4755";;
3930
AC_SUBST(SETUIDFLAGS)
3934
AC_DEFUN([KDE_PASSWDLIBS], [
3935
AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3936
AC_REQUIRE([KDE_PAM])
3937
AC_REQUIRE([KDE_SHADOWPASSWD])
3939
if test "x$use_pam" = "xyes"; then
3940
PASSWDLIBS="$PAMLIBS"
3942
PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3945
dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3946
dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
3947
dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3948
dnl may need to read /etc/master.passwd).
3951
SETUIDFLAGS="-m 4755 -o root"
3957
AC_SUBST(PASSWDLIBS)
3960
AC_DEFUN([KDE_CHECK_LIBDL],
3962
AC_CHECK_LIB(dl, dlopen, [
3964
ac_cv_have_dlfcn=yes
3967
AC_CHECK_LIB(dld, shl_unload, [
3969
ac_cv_have_shload=yes
3975
AC_DEFUN([KDE_CHECK_DLOPEN],
3978
AC_CHECK_HEADERS(dlfcn.h dl.h)
3979
if test "$ac_cv_header_dlfcn_h" = "no"; then
3983
if test "$ac_cv_header_dl_h" = "no"; then
3984
ac_cv_have_shload=no
3987
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3989
AC_ARG_ENABLE(dlopen,
3990
AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
3991
enable_dlopen=$enableval,
3994
# override the user's opinion, if we know it better ;)
3995
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3999
if test "$ac_cv_have_dlfcn" = "yes"; then
4000
AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4003
if test "$ac_cv_have_shload" = "yes"; then
4004
AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4007
if test "$enable_dlopen" = no ; then
4008
test -n "$1" && eval $1
4010
test -n "$2" && eval $2
4015
AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4017
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4019
AC_MSG_CHECKING([dynamic loading])
4020
eval "`egrep '^build_libtool_libs=' libtool`"
4021
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4023
AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4027
AC_MSG_RESULT($dynamic_loading)
4028
if test "$dynamic_loading" = "yes"; then
4035
AC_DEFUN([KDE_ADD_INCLUDES],
4037
if test -z "$1"; then
4038
test_include="Pix.h"
4043
AC_MSG_CHECKING([for libg++ ($test_include)])
4045
AC_CACHE_VAL(kde_cv_libgpp_includes,
4047
kde_cv_libgpp_includes=no
4053
/usr/unsupported/include \
4058
if test -r "$ac_dir/$test_include"; then
4059
kde_cv_libgpp_includes=$ac_dir
4065
AC_MSG_RESULT($kde_cv_libgpp_includes)
4066
if test "$kde_cv_libgpp_includes" != "no"; then
4067
all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4072
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4074
dnl This code is here specifically to handle the
4075
dnl various flavors of threading library on FreeBSD
4076
dnl 4-, 5-, and 6-, and the (weird) rules around it.
4077
dnl There may be an environment PTHREAD_LIBS that
4078
dnl specifies what to use; otherwise, search for it.
4079
dnl -pthread is special cased and unsets LIBPTHREAD
4083
if test -n "$PTHREAD_LIBS"; then
4084
if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4085
LIBPTHREAD="PTHREAD"
4087
PTHREAD_LIBS_save="$PTHREAD_LIBS"
4088
PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4089
AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4090
KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4091
LIBPTHREAD="$PTHREAD_LIBS_save"])
4092
PTHREAD_LIBS="$PTHREAD_LIBS_save"
4096
dnl Is this test really needed, in the face of the Tru64 test below?
4097
if test -z "$LIBPTHREAD"; then
4098
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4101
dnl This is a special Tru64 check, see BR 76171 issue #18.
4102
if test -z "$LIBPTHREAD" ; then
4103
AC_MSG_CHECKING([for pthread_create in -lpthread])
4105
LIBS="$LIBS -lpthread"
4106
AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4108
LIBPTHREAD="-lpthread"],[
4113
dnl Un-special-case for FreeBSD.
4114
if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4118
AC_SUBST(LIBPTHREAD)
4121
AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4124
if test -z "$LIBPTHREAD"; then
4125
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4128
AH_VERBATIM(__svr_define, [
4129
#if defined(__SVR4) && !defined(__svr4__)
4135
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4136
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4139
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4142
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4143
LIBPTHREAD="$LIBPTHREAD -lc_r"
4145
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4146
if test "$CXX" = "KCC"; then
4147
CXXFLAGS="$CXXFLAGS --thread_safe"
4148
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4154
AC_SUBST(USE_THREADS)
4155
AC_SUBST(LIBPTHREAD)
4158
AC_DEFUN([KDE_CHECK_THREADING],
4160
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4161
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4162
dnl default is yes if libpthread is found and no if no libpthread is available
4163
if test -z "$LIBPTHREAD"; then
4164
if test -z "$USE_THREADS"; then
4165
kde_check_threading_default=no
4167
kde_check_threading_default=yes
4170
kde_check_threading_default=yes
4172
AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4173
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4174
if test "x$kde_use_threading" = "xyes"; then
4175
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4179
AC_DEFUN([KDE_TRY_LINK_PYTHON],
4181
if test "$kde_python_link_found" = no; then
4183
if test "$1" = normal; then
4184
AC_MSG_CHECKING(if a Python application links)
4186
AC_MSG_CHECKING(if Python depends on $2)
4189
AC_CACHE_VAL(kde_cv_try_link_python_$1,
4191
kde_save_cflags="$CFLAGS"
4192
CFLAGS="$CFLAGS $PYTHONINC"
4193
kde_save_libs="$LIBS"
4194
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4195
kde_save_ldflags="$LDFLAGS"
4196
LDFLAGS="$LDFLAGS $PYTHONLIB"
4202
PySys_SetArgv(1, 0);
4204
[kde_cv_try_link_python_$1=yes],
4205
[kde_cv_try_link_python_$1=no]
4207
CFLAGS="$kde_save_cflags"
4208
LIBS="$kde_save_libs"
4209
LDFLAGS="$kde_save_ldflags"
4212
if test "$kde_cv_try_link_python_$1" = "yes"; then
4214
kde_python_link_found=yes
4215
if test ! "$1" = normal; then
4216
LIBPYTHON="$LIBPYTHON $2"
4228
AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4230
AC_MSG_CHECKING([for Python directory])
4232
AC_CACHE_VAL(kde_cv_pythondir,
4234
if test -z "$PYTHONDIR"; then
4235
kde_cv_pythondir=/usr/local
4237
kde_cv_pythondir="$PYTHONDIR"
4241
AC_ARG_WITH(pythondir,
4242
AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4244
ac_python_dir=$withval
4245
], ac_python_dir=$kde_cv_pythondir
4248
AC_MSG_RESULT($ac_python_dir)
4251
AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4253
AC_REQUIRE([KDE_CHECK_LIBDL])
4254
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4255
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4257
if test -z "$1"; then
4263
AC_MSG_CHECKING([for Python$version])
4265
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4266
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4267
if test ! -r $python_incdir/Python.h; then
4268
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4269
python_incdir=$python_incdir/python$version
4270
if test ! -r $python_incdir/Python.h; then
4275
PYTHONINC=-I$python_incdir
4277
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4278
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4279
if test ! -r $python_libdir/libpython$version.so; then
4280
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4281
if test ! -r $python_libdir/libpython$version.a; then
4282
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4283
python_libdir=$python_libdir/python$version/config
4284
if test ! -r $python_libdir/libpython$version.a; then
4290
PYTHONLIB=-L$python_libdir
4291
kde_orig_LIBPYTHON=$LIBPYTHON
4292
if test -z "$LIBPYTHON"; then
4293
LIBPYTHON=-lpython$version
4296
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4297
python_moddir=$python_moddir/python$version
4298
if test ! -r $python_moddir/copy.py; then
4302
PYTHONMODDIR=$python_moddir
4304
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4306
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
4307
LIBPYTHON=$kde_orig_LIBPYTHON
4308
test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4309
test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4312
dnl Note: this test is very weak
4313
kde_python_link_found=no
4314
KDE_TRY_LINK_PYTHON(normal)
4315
KDE_TRY_LINK_PYTHON(m, -lm)
4316
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4317
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4318
KDE_TRY_LINK_PYTHON(db2, -ldb2)
4319
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4320
KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4321
KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4322
KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4323
KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4324
KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4325
KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4326
KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4327
[AC_MSG_WARN([it seems, Python depends on another library.
4328
Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4329
and contact the authors to let them know about this problem])
4332
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4336
AC_SUBST(PYTHONMODDIR)
4337
AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4343
AC_DEFUN([KDE_CHECK_PYTHON],
4345
KDE_CHECK_PYTHON_INTERN("2.4",
4346
KDE_CHECK_PYTHON_INTERN("2.3",
4347
[KDE_CHECK_PYTHON_INTERN("2.2",
4348
[KDE_CHECK_PYTHON_INTERN("2.1",
4349
[KDE_CHECK_PYTHON_INTERN("2.0",
4350
[KDE_CHECK_PYTHON_INTERN($1, $2) ])
4357
AC_DEFUN([KDE_CHECK_STL],
4361
ac_save_CXXFLAGS="$CXXFLAGS"
4362
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4364
AC_MSG_CHECKING([if C++ programs can be compiled])
4365
AC_CACHE_VAL(kde_cv_stl_works,
4369
using namespace std;
4371
string astring="Hallo Welt.";
4372
astring.erase(0, 6); // now astring is "Welt"
4374
], kde_cv_stl_works=yes,
4375
kde_cv_stl_works=no)
4378
AC_MSG_RESULT($kde_cv_stl_works)
4380
if test "$kde_cv_stl_works" = "yes"; then
4382
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4384
AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4385
Check config.log for details - if you're using a Linux distribution you might miss
4386
a package named similiar to libstd++-dev.])
4389
CXXFLAGS="$ac_save_CXXFLAGS"
4393
AC_DEFUN([AC_FIND_QIMGIO],
4394
[AC_REQUIRE([AC_FIND_JPEG])
4395
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4396
AC_MSG_CHECKING([for qimgio])
4397
AC_CACHE_VAL(ac_cv_lib_qimgio,
4401
ac_save_LIBS="$LIBS"
4402
ac_save_CXXFLAGS="$CXXFLAGS"
4403
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4404
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4407
#include <qimageio.h>
4408
#include <qstring.h>
4410
QString t = "hallo";
4415
ac_cv_lib_qimgio=yes,
4416
ac_cv_lib_qimgio=no,
4417
ac_cv_lib_qimgio=no)
4418
LIBS="$ac_save_LIBS"
4419
CXXFLAGS="$ac_save_CXXFLAGS"
4422
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4423
LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4425
AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4428
AC_MSG_RESULT(not found)
4432
AC_DEFUN([AM_DISABLE_LIBRARIES],
4434
AC_PROVIDE([AM_ENABLE_STATIC])
4435
AC_PROVIDE([AM_ENABLE_SHARED])
4441
AC_DEFUN([AC_CHECK_UTMP_FILE],
4443
AC_MSG_CHECKING([for utmp file])
4445
AC_CACHE_VAL(kde_cv_utmp_file,
4456
if test -r "$ac_file"; then
4457
kde_cv_utmp_file=$ac_file
4463
if test "$kde_cv_utmp_file" != "no"; then
4464
AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4466
AC_MSG_RESULT($kde_cv_utmp_file)
4469
AC_MSG_RESULT([non found])
4474
AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4477
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4480
if test ! -s $srcdir/subdirs; then
4481
dnl Note: Makefile.common creates subdirs, so this is just a fallback
4482
files=`cd $srcdir && ls -1`
4483
dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4485
echo $i >> $srcdir/subdirs
4490
if test -s $srcdir/inst-apps; then
4491
ac_topsubdirs="`cat $srcdir/inst-apps`"
4492
elif test -s $srcdir/subdirs; then
4493
ac_topsubdirs="`cat $srcdir/subdirs`"
4496
for i in $ac_topsubdirs; do
4497
AC_MSG_CHECKING([if $i should be compiled])
4498
if test -d $srcdir/$i; then
4500
for j in $DO_NOT_COMPILE; do
4501
if test $i = $j; then
4508
AC_MSG_RESULT($install_it)
4509
vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4510
if test $install_it = "yes"; then
4511
TOPSUBDIRS="$TOPSUBDIRS $i"
4512
eval "$vari""_SUBDIR_included=yes"
4514
eval "$vari""_SUBDIR_included=no"
4518
AC_SUBST(TOPSUBDIRS)
4521
AC_DEFUN([KDE_CHECK_NAMESPACES],
4523
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4537
int Foo::Bar::i = 1;
4540
AC_DEFINE(HAVE_NAMESPACES)
4547
dnl ------------------------------------------------------------------------
4548
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4549
dnl ------------------------------------------------------------------------
4551
AC_DEFUN([AC_CHECK_S_ISSOCK],
4553
AC_MSG_CHECKING(for S_ISSOCK)
4554
AC_CACHE_VAL(ac_cv_have_s_issock,
4558
#include <sys/stat.h>
4562
int b = S_ISSOCK( buff.st_mode );
4564
ac_cv_have_s_issock=yes,
4565
ac_cv_have_s_issock=no)
4567
AC_MSG_RESULT($ac_cv_have_s_issock)
4568
if test "$ac_cv_have_s_issock" = "yes"; then
4569
AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4572
AH_VERBATIM(_ISSOCK,
4574
#ifndef HAVE_S_ISSOCK
4575
#define HAVE_S_ISSOCK
4576
#define S_ISSOCK(mode) (1==0)
4582
dnl ------------------------------------------------------------------------
4583
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4584
dnl ------------------------------------------------------------------------
4586
AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4588
AC_MSG_CHECKING(for MAXPATHLEN)
4589
AC_CACHE_VAL(ac_cv_maxpathlen,
4591
cat > conftest.$ac_ext <<EOF
4593
# include <stdlib.h>
4596
#include <sys/param.h>
4598
#define MAXPATHLEN 1024
4601
KDE_HELLO MAXPATHLEN
4605
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4607
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4608
ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4610
ac_cv_maxpathlen=1024
4616
AC_MSG_RESULT($ac_cv_maxpathlen)
4617
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4620
AC_DEFUN([KDE_CHECK_HEADER],
4623
kde_safe_cppflags=$CPPFLAGS
4624
CPPFLAGS="$CPPFLAGS $all_includes"
4626
AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4627
CPPFLAGS=$kde_safe_cppflags
4631
AC_DEFUN([KDE_CHECK_HEADERS],
4633
AH_CHECK_HEADERS([$1])
4635
kde_safe_cppflags=$CPPFLAGS
4636
CPPFLAGS="$CPPFLAGS $all_includes"
4638
AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4639
CPPFLAGS=$kde_safe_cppflags
4643
AC_DEFUN([KDE_FAST_CONFIGURE],
4645
dnl makes configure fast (needs perl)
4646
AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4647
with_fast_perl=$enableval, with_fast_perl=yes)
4650
AC_DEFUN([KDE_CONF_FILES],
4653
if test -f $srcdir/configure.files ; then
4654
val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4657
if test -n "$val" ; then
4659
CONF_FILES="$CONF_FILES $i"
4662
AC_SUBST(CONF_FILES)
4665
dnl This sets the prefix, for arts and kdelibs
4666
dnl Do NOT use in any other module.
4667
dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4668
AC_DEFUN([KDE_SET_PREFIX_CORE],
4671
dnl make $KDEDIR the default for the installation
4672
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4674
if test "x$prefix" = "xNONE"; then
4675
prefix=$ac_default_prefix
4676
ac_configure_args="$ac_configure_args --prefix=$prefix"
4678
# And delete superfluous '/' to make compares easier
4679
prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4680
exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4682
kde_libs_prefix='$(prefix)'
4683
kde_libs_htmldir='$(kde_htmldir)'
4684
AC_SUBST(kde_libs_prefix)
4685
AC_SUBST(kde_libs_htmldir)
4691
AC_DEFUN([KDE_SET_PREFIX],
4694
dnl We can't give real code to that macro, only a value.
4695
dnl It only matters for --help, since we set the prefix in this function anyway.
4696
AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
4698
KDE_SET_DEFAULT_BINDIRS
4699
if test "x$prefix" = "xNONE"; then
4700
dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
4701
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4703
dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
4704
kde_save_PATH="$PATH"
4705
PATH="$exec_prefix/bin:$prefix/bin:$PATH"
4706
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4707
PATH="$kde_save_PATH"
4710
kde_libs_prefix=`$KDECONFIG --prefix`
4711
if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
4712
AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
4713
This means it has been moved since you installed it.
4714
This won't work. Please recompile kdelibs for the new prefix.
4717
kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
4719
AC_MSG_CHECKING([where to install])
4720
if test "x$prefix" = "xNONE"; then
4721
prefix=$kde_libs_prefix
4722
AC_MSG_RESULT([$prefix (as returned by kde-config)])
4724
dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
4725
given_prefix=$prefix
4726
AC_MSG_RESULT([$prefix (as requested)])
4729
# And delete superfluous '/' to make compares easier
4730
prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4731
exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4732
given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4735
AC_SUBST(kde_libs_prefix)
4736
AC_SUBST(kde_libs_htmldir)
4742
pushdef([AC_PROG_INSTALL],
4744
dnl our own version, testing for a -p flag
4745
popdef([AC_PROG_INSTALL])
4746
dnl as AC_PROG_INSTALL works as it works we first have
4747
dnl to save if the user didn't specify INSTALL, as the
4748
dnl autoconf one overwrites INSTALL and we have no chance to find
4750
test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4751
test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4752
test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4755
if test -z "$kde_save_INSTALL_given" ; then
4756
# OK, user hasn't given any INSTALL, autoconf found one for us
4757
# now we test, if it supports the -p flag
4758
AC_MSG_CHECKING(for -p flag to install)
4759
rm -f confinst.$$.* > /dev/null 2>&1
4760
echo "Testtest" > confinst.$$.orig
4762
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4763
if test -f confinst.$$.new ; then
4764
# OK, -p seems to do no harm to install
4765
INSTALL="${INSTALL} -p"
4770
AC_MSG_RESULT($ac_res)
4772
dnl the following tries to resolve some signs and wonders coming up
4773
dnl with different autoconf/automake versions
4775
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4776
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4777
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4778
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4779
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4780
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
4781
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4782
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
4783
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
4784
dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4785
dnl automake (due to broken Makefile.am or whatever) to install programs,
4786
dnl and so does not see the -s flag in automake > 1.4
4787
dnl to clean up that mess we:
4788
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4789
dnl which cleans KDE's program with automake > 1.4;
4790
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4791
dnl with automake<=1.4
4792
dnl note that dues to this sometimes two '-s' flags are used (if KDE
4793
dnl properly uses install-@DIR@PROGRAMS, but I don't care
4795
dnl And to all this comes, that I even can't write in comments variable
4796
dnl names used by automake, because it is so stupid to think I wanted to
4797
dnl _use_ them, therefor I have written A_M_... instead of AM_
4798
dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4800
if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4801
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4803
if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4804
INSTALL_SCRIPT='${INSTALL}'
4808
AC_DEFUN([KDE_LANG_CPLUSPLUS],
4810
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4811
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4814
pushdef([AC_LANG_CPLUSPLUS],
4815
[popdef([AC_LANG_CPLUSPLUS])
4819
AC_DEFUN([KDE_CHECK_LONG_LONG],
4821
AC_MSG_CHECKING(for long long)
4822
AC_CACHE_VAL(kde_cv_c_long_long,
4830
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4833
AC_MSG_RESULT($kde_cv_c_long_long)
4834
if test "$kde_cv_c_long_long" = yes; then
4835
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4839
AC_DEFUN([KDE_CHECK_LIB],
4841
kde_save_LDFLAGS="$LDFLAGS"
4842
dnl AC_CHECK_LIB modifies LIBS, so save it here
4843
kde_save_LIBS="$LIBS"
4844
LDFLAGS="$LDFLAGS $all_libraries"
4846
aix*) LDFLAGS="-brtl $LDFLAGS"
4847
test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4850
AC_CHECK_LIB($1, $2, $3, $4, $5)
4851
LDFLAGS="$kde_save_LDFLAGS"
4852
LIBS="$kde_save_LIBS"
4855
AC_DEFUN([KDE_JAVA_PREFIX],
4858
base=`basename "$1"`
4859
list=`ls -1 $dir 2> /dev/null`
4860
for entry in $list; do
4861
if test -d $dir/$entry/bin; then
4864
javadirs="$javadirs $dir/$entry/bin"
4867
elif test -d $dir/$entry/jre/bin; then
4870
javadirs="$javadirs $dir/$entry/jre/bin"
4877
dnl KDE_CHEC_JAVA_DIR(onlyjre)
4878
AC_DEFUN([KDE_CHECK_JAVA_DIR],
4882
AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
4883
[ ac_java_dir=$withval
4887
AC_MSG_CHECKING([for Java])
4889
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4890
if test "x$ac_java_dir" = "xno"; then
4892
kde_java_includedir=no
4893
kde_java_libjvmdir=no
4894
kde_java_libgcjdir=no
4895
kde_java_libhpidir=no
4897
if test "x$ac_java_dir" = "x"; then
4900
dnl No option set -> collect list of candidate paths
4901
if test -n "$JAVA_HOME"; then
4902
KDE_JAVA_PREFIX($JAVA_HOME)
4904
KDE_JAVA_PREFIX(/usr/j2se)
4905
KDE_JAVA_PREFIX(/usr/lib/j2se)
4906
KDE_JAVA_PREFIX(/usr/j*dk*)
4907
KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4908
KDE_JAVA_PREFIX(/opt/j*sdk*)
4909
KDE_JAVA_PREFIX(/usr/lib/java*)
4910
KDE_JAVA_PREFIX(/usr/java*)
4911
KDE_JAVA_PREFIX(/usr/java/j*dk*)
4912
KDE_JAVA_PREFIX(/usr/java/j*re*)
4913
KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4914
KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4915
KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4916
KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4917
KDE_JAVA_PREFIX(/opt/java*)
4922
for dir in $PATH; do
4923
if test -d "$dir"; then
4924
javadirs="$javadirs $dir"
4930
dnl Now javadirs contains a list of paths that exist, all ending with bin/
4931
for dir in $javadirs; do
4932
dnl Check for the java executable
4933
if test -x "$dir/java"; then
4934
dnl And also check for a libjvm.so somewhere under there
4935
dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
4936
if test "$dir" != "/usr/bin"; then
4937
libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4938
if test ! -f $libjvmdir/libjvm.so; then continue; fi
4939
jredirs="$jredirs $dir"
4944
dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
4948
for dir in $jredirs; do
4950
kde_java_bindir=$dir
4951
if test -x "$dir/javac"; then
4957
if test -n "$JAVAC"; then
4958
dnl this substitution might not work - well, we test for jni.h below
4959
kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4961
kde_java_includedir=no
4964
dnl config option set
4965
kde_java_bindir=$ac_java_dir/bin
4966
if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4967
kde_java_includedir=no
4969
kde_java_includedir=$ac_java_dir/include
4974
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4975
if test "x$kde_java_bindir" != "xno"; then
4977
dnl Look for libjvm.so
4978
kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4979
dnl Look for libgcj.so
4980
kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
4981
dnl Look for libhpi.so and avoid green threads
4982
kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4984
dnl Now check everything's fine under there
4985
dnl the include dir is our flag for having the JDK
4986
if test -d "$kde_java_includedir"; then
4987
if test ! -x "$kde_java_bindir/javac"; then
4988
AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4990
if test ! -x "$kde_java_bindir/javah"; then
4991
AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4993
if test ! -x "$kde_java_bindir/jar"; then
4994
AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4996
if test ! -r "$kde_java_includedir/jni.h"; then
4997
AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5000
jni_includes="-I$kde_java_includedir"
5001
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5002
dnl and under linux here..
5004
dnl not needed for gcj
5006
if test "x$kde_java_libgcjdir" = "x"; then
5007
test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5008
test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5009
test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5017
if test "x$kde_java_libgcjdir" = "x"; then
5018
if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5019
AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5022
if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5023
AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5027
if test ! -x "$kde_java_bindir/java"; then
5028
AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5031
dnl not needed for gcj compile
5033
if test "x$kde_java_libgcjdir" = "x"; then
5034
if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5035
AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5039
if test -n "$jni_includes"; then
5040
dnl Check for JNI version
5043
ac_cxxflags_safe="$CXXFLAGS"
5044
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5050
#ifndef JNI_VERSION_1_2
5053
],[ kde_jni_works=yes ],
5054
[ kde_jni_works=no ])
5056
if test $kde_jni_works = no; then
5057
AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5058
You need to have Java Development Kit (JDK) version 1.2.
5060
Use --with-java to specify another location.
5061
Use --without-java to configure without java support.
5062
Or download a newer JDK and try again.
5063
See e.g. http://java.sun.com/products/jdk/1.2 ])
5066
CXXFLAGS="$ac_cxxflags_safe"
5069
dnl All tests ok, inform and subst the variables
5071
JAVAC=$kde_java_bindir/javac
5072
JAVAH=$kde_java_bindir/javah
5073
JAR=$kde_java_bindir/jar
5074
AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5075
if test "x$kde_java_libgcjdir" = "x"; then
5076
JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5078
JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5080
AC_MSG_RESULT([java JDK in $kde_java_bindir])
5083
AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5084
AC_MSG_RESULT([java JRE in $kde_java_bindir])
5086
elif test -d "/Library/Java/Home"; then
5087
kde_java_bindir="/Library/Java/Home/bin"
5088
jni_includes="-I/Library/Java/Home/include"
5090
JAVAC=$kde_java_bindir/javac
5091
JAVAH=$kde_java_bindir/javah
5092
JAR=$kde_java_bindir/jar
5093
JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
5095
AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5096
AC_MSG_RESULT([Apple Java Framework])
5098
AC_MSG_RESULT([none found])
5105
AC_SUBST(jni_includes)
5107
# for backward compat
5108
kde_cv_java_includedir=$kde_java_includedir
5109
kde_cv_java_bindir=$kde_java_bindir
5112
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5113
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5114
dnl big packages, m4_foreach is dog-slow. So use our own version of
5115
dnl it. (matz@kde.org)
5116
m4_define([mm_foreach],
5117
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5118
m4_define([mm_car], [[$1]])
5119
m4_define([mm_car2], [[$@]])
5120
m4_define([_mm_foreach],
5121
[m4_if(m4_quote($2), [], [],
5122
[m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5123
mm_car2(m4_shift($2)),
5125
m4_define([AC_FOREACH],
5126
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5128
AC_DEFUN([KDE_NEED_FLEX],
5131
LIBS="$LIBS $USER_LDFLAGS"
5134
if test -z "$LEXLIB"; then
5135
AC_MSG_ERROR([You need to have flex installed.])
5140
AC_DEFUN([AC_PATH_QTOPIA],
5142
dnl TODO: use AC_CACHE_VAL
5144
if test -z "$1"; then
5149
qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5150
qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5151
qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5154
qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5155
qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5157
AC_REQUIRE([AC_PATH_QT])
5159
AC_MSG_CHECKING([for Qtopia])
5162
AC_SUBST(LIB_QTOPIA)
5164
kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5168
AC_ARG_WITH(qtopia-dir,
5169
AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5170
[ ac_qtopia_incdir="$withval"/include] )
5173
for dir in $kde_qtopia_dirs; do
5174
qtopia_incdirs="$qtopia_incdirs $dir/include"
5177
if test ! "$ac_qtopia_incdir" = "NO"; then
5178
qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5182
AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5183
ac_qtopia_incdir="$qtopia_incdir"
5185
if test -z "$qtopia_incdir"; then
5186
AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5189
qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5190
qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5191
qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5193
qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5194
qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5195
if test "$qtopia_ver" -lt "$qtopia_minver"; then
5196
AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5203
ac_cxxflags_safe="$CXXFLAGS"
5204
ac_ldflags_safe="$LDFLAGS"
5205
ac_libs_safe="$LIBS"
5207
CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5208
LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5209
LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5211
cat > conftest.$ac_ext <<EOF
5212
#include "confdefs.h"
5213
#include <qpe/qpeapplication.h>
5214
#include <qpe/version.h>
5216
int main( int argc, char **argv )
5218
QPEApplication app( argc, argv );
5223
if AC_TRY_EVAL(ac_link) && test -s conftest; then
5227
AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5228
the end of config.log])
5231
CXXFLAGS="$ac_cxxflags_safe"
5232
LDFLAGS="$ac_ldflags_safe"
5233
LIBS="$ac_libs_safe"
5237
QTOPIA_INCLUDES="-I$qtopia_incdir"
5238
AC_SUBST(QTOPIA_INCLUDES)
5240
AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5244
AC_DEFUN([KDE_INIT_DOXYGEN],
5246
AC_MSG_CHECKING([for Qt docs])
5248
if test "${with_qt_dir+set}" = set; then
5249
kde_qtdir="$with_qt_dir"
5252
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
5253
AC_MSG_RESULT($QTDOCDIR)
5257
KDE_FIND_PATH(dot, DOT, [], [])
5258
if test -n "$DOT"; then
5263
AC_SUBST(KDE_HAVE_DOT)
5264
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5267
DOXYGEN_PROJECT_NAME="$1"
5268
DOXYGEN_PROJECT_NUMBER="$2"
5269
AC_SUBST(DOXYGEN_PROJECT_NAME)
5270
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5273
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5276
AC_SUBST(KDE_HAS_DOXYGEN)
5281
AC_DEFUN([AC_FIND_BZIP2],
5283
AC_MSG_CHECKING([for bzDecompress in libbz2])
5284
AC_CACHE_VAL(ac_cv_lib_bzip2,
5288
kde_save_LIBS="$LIBS"
5289
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5290
kde_save_CXXFLAGS="$CXXFLAGS"
5291
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5297
[ bz_stream s; (void) bzDecompress(&s); ],
5298
eval "ac_cv_lib_bzip2='-lbz2'",
5299
eval "ac_cv_lib_bzip2=no")
5300
LIBS="$kde_save_LIBS"
5301
CXXFLAGS="$kde_save_CXXFLAGS"
5304
AC_MSG_RESULT($ac_cv_lib_bzip2)
5306
if test ! "$ac_cv_lib_bzip2" = no; then
5309
LIBBZ2="$ac_cv_lib_bzip2"
5316
KDE_CHECK_COMPILER_FLAG(shared, [
5317
ld_shared_flag="-shared"
5319
KDE_CHECK_COMPILER_FLAG(fPIC, [
5320
cxx_shared_flag="-fPIC"
5323
AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5324
AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5328
kde_save_LIBS="$LIBS"
5329
LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5330
kde_save_CXXFLAGS="$CXXFLAGS"
5331
CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5338
[ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5339
eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5340
eval "ac_cv_lib_bzip2_prefix=no")
5341
LIBS="$kde_save_LIBS"
5342
CXXFLAGS="$kde_save_CXXFLAGS"
5346
AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5348
if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5351
LIBBZ2="$ac_cv_lib_bzip2_prefix"
5354
AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5355
dnl else, we just ignore this
5359
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5362
dnl ------------------------------------------------------------------------
5363
dnl Try to find the SSL headers and libraries.
5364
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5365
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5366
dnl ------------------------------------------------------------------------
5368
AC_DEFUN([KDE_CHECK_SSL],
5370
LIBSSL="-lssl -lcrypto"
5371
AC_REQUIRE([KDE_CHECK_LIB64])
5373
ac_ssl_includes=NO ac_ssl_libraries=NO
5376
AC_ARG_WITH(ssl-dir,
5377
AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5378
[ ac_ssl_includes="$withval"/include
5379
ac_ssl_libraries="$withval"/lib$kdelibsuff
5384
AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5385
[want_ssl=$withval])
5387
if test $want_ssl = yes; then
5389
AC_MSG_CHECKING(for OpenSSL)
5391
AC_CACHE_VAL(ac_cv_have_ssl,
5392
[#try to guess OpenSSL locations
5394
ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5395
ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5396
AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5397
ac_ssl_includes="$ssl_incdir"
5399
ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5400
if test ! "$ac_ssl_libraries" = "NO"; then
5401
ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5406
for dir in $ssl_libdirs; do
5407
try="ls -1 $dir/libssl*"
5408
if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5411
ac_ssl_libraries="$ssl_libdir"
5413
ac_ldflags_safe="$LDFLAGS"
5414
ac_libs_safe="$LIBS"
5416
LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5417
LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5419
AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5425
LDFLAGS="$ac_ldflags_safe"
5426
LIBS="$ac_libs_safe"
5428
if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5436
eval "$ac_cv_have_ssl"
5438
AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5440
AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5441
AC_MSG_RESULT($ac_ssl_rsaref)
5443
AC_MSG_CHECKING([for easter eggs])
5444
AC_MSG_RESULT([none found])
5450
if test "$have_ssl" = yes; then
5451
AC_MSG_CHECKING(for OpenSSL version)
5452
dnl Check for SSL version
5453
AC_CACHE_VAL(ac_cv_ssl_version,
5456
cat >conftest.$ac_ext <<EOF
5457
#include <openssl/opensslv.h>
5461
#ifndef OPENSSL_VERSION_NUMBER
5462
printf("ssl_version=\\"error\\"\n");
5464
if (OPENSSL_VERSION_NUMBER < 0x00906000)
5465
printf("ssl_version=\\"old\\"\n");
5467
printf("ssl_version=\\"ok\\"\n");
5473
ac_save_CPPFLAGS=$CPPFLAGS
5474
if test "$ac_ssl_includes" != "/usr/include"; then
5475
CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5478
if AC_TRY_EVAL(ac_link); then
5480
if eval `./conftest 2>&5`; then
5481
if test $ssl_version = error; then
5482
AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5484
if test $ssl_version = old; then
5485
AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5489
ac_cv_ssl_version="ssl_version=$ssl_version"
5491
AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5492
Check config.log, and if you can't figure it out, send a mail to
5493
David Faure <faure@kde.org>, attaching your config.log])
5497
AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5498
Check config.log, and if you can't figure it out, send a mail to
5499
David Faure <faure@kde.org>, attaching your config.log])
5501
CPPFLAGS=$ac_save_CPPFLAGS
5505
eval "$ac_cv_ssl_version"
5506
AC_MSG_RESULT($ssl_version)
5509
if test "$have_ssl" != yes; then
5512
AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5513
ac_cv_have_ssl="have_ssl=yes \
5514
ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5517
ssl_libraries="$ac_ssl_libraries"
5518
ssl_includes="$ac_ssl_includes"
5520
if test "$ac_ssl_rsaref" = yes; then
5521
LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5524
if test $ssl_version = "old"; then
5525
AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5531
if test "$ssl_includes" = "/usr/include"; then
5532
if test -f /usr/kerberos/include/krb5.h; then
5533
SSL_INCLUDES="-I/usr/kerberos/include"
5535
elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5536
SSL_INCLUDES="-I$ssl_includes"
5539
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5542
SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5545
AC_SUBST(SSL_INCLUDES)
5546
AC_SUBST(SSL_LDFLAGS)
5550
AC_DEFUN([KDE_CHECK_STRLCPY],
5552
AC_REQUIRE([AC_CHECK_STRLCAT])
5553
AC_REQUIRE([AC_CHECK_STRLCPY])
5554
AC_CHECK_SIZEOF(size_t)
5555
AC_CHECK_SIZEOF(unsigned long)
5557
AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5559
#if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5562
],AC_MSG_RESULT([yes]),[
5565
Apparently on your system our assumption sizeof size_t == sizeof unsigned long
5566
does not apply. Please mail kde-devel@kde.org with a description of your system!
5571
AC_DEFUN([KDE_CHECK_BINUTILS],
5573
AC_MSG_CHECKING([if ld supports unversioned version maps])
5575
kde_save_LDFLAGS="$LDFLAGS"
5576
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5577
echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5578
AC_TRY_LINK([int foo;],
5580
#ifdef __INTEL_COMPILER
5581
icc apparently does not support libtools version-info and version-script
5582
at the same time. Dunno where the bug is, but until somebody figured out,
5583
better disable the optional version scripts.
5587
], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5588
LDFLAGS="$kde_save_LDFLAGS"
5590
AM_CONDITIONAL(include_VERSION_SCRIPT,
5591
[test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5593
AC_MSG_RESULT($kde_supports_versionmaps)
5596
AC_DEFUN([AM_PROG_OBJC],[
5597
AC_CHECK_PROGS(OBJC, gcc, gcc)
5598
test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5599
if test "x${OBJCFLAGS-unset}" = xunset; then
5603
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5606
AC_DEFUN([KDE_CHECK_PERL],
5608
KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5609
AC_MSG_ERROR([No Perl found in your $PATH.
5610
We need perl to generate some code.])
5615
AC_DEFUN([KDE_CHECK_LARGEFILE],
5618
if test "$ac_cv_sys_file_offset_bits" != no; then
5619
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5622
if test "x$ac_cv_sys_large_files" != "xno"; then
5623
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"