3
dnl This file is part of the KDE libraries/packages
4
dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5
dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
7
dnl This file is free software; you can redistribute it and/or
8
dnl modify it under the terms of the GNU Library General Public
9
dnl License as published by the Free Software Foundation; either
10
dnl version 2 of the License, or (at your option) any later version.
12
dnl This library is distributed in the hope that it will be useful,
13
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
dnl Library General Public License for more details.
17
dnl You should have received a copy of the GNU Library General Public License
18
dnl along with this library; see the file COPYING.LIB. If not, write to
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
dnl Boston, MA 02111-1307, USA.
23
dnl Please do not modify this file unless you expect your modifications to be
24
dnl carried into every other module in the repository. If you decide that you
25
dnl really want to modify it, contact coolo@kde.org mentioning that you have
26
dnl and that the modified file should be committed to every module.
28
dnl Single-module modifications are best placed in configure.in for kdelibs
29
dnl and kdebase or configure.in.in if present.
31
dnl ------------------------------------------------------------------------
32
dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
33
dnl thanks to Raja R Harinath.
34
dnl ------------------------------------------------------------------------
36
ifdef([_AC_PATH_X_XMKMF],[],
37
[AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
38
ifdef([AC_OUTPUT_SUBDIRS],[],
39
[AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
42
dnl Internal subroutine of AC_PATH_X.
43
dnl Set ac_x_includes and/or ac_x_libraries.
44
AC_DEFUN(KDE_PATH_X_DIRECT,
45
[if test "$ac_x_includes" = NO; then
46
# Guess where to find include files, by looking for this one X11 .h file.
47
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
49
# First, try using that file with no special directory specified.
50
AC_TRY_CPP([#include <$x_direct_test_include>],
51
[# We can compile using X headers with no special include directory.
53
[# Look for the header file in a standard set of common directories.
54
# Check X11 before X11Rn because it is often a symlink to the current release.
66
/usr/local/X11/include \
67
/usr/local/X11R6/include \
68
/usr/local/X11R5/include \
69
/usr/local/X11R4/include \
71
/usr/local/include/X11 \
72
/usr/local/include/X11R6 \
73
/usr/local/include/X11R5 \
74
/usr/local/include/X11R4 \
78
/usr/XFree86/include/X11 \
82
/usr/unsupported/include \
84
/usr/local/x11r5/include \
85
/usr/lpp/Xamples/include \
87
/usr/openwin/include \
88
/usr/openwin/share/include \
91
if test -r "$ac_dir/$x_direct_test_include"; then
96
fi # $ac_x_includes = NO
98
if test "$ac_x_libraries" = NO; then
99
# Check for the libraries.
101
test -z "$x_direct_test_library" && x_direct_test_library=Xt
102
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
104
# See if we find them without any special options.
105
# Don't add to $LIBS permanently.
107
LIBS="-l$x_direct_test_library $LIBS"
108
AC_TRY_LINK(, [${x_direct_test_function}()],
109
[LIBS="$ac_save_LIBS"
110
# We can link X programs with no special library path.
112
[LIBS="$ac_save_LIBS"
113
# First see if replacing the include by lib works.
114
# Check X11 before X11Rn because it is often a symlink to the current release.
115
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
127
/usr/local/X11R6/lib \
128
/usr/local/X11R5/lib \
129
/usr/local/X11R4/lib \
132
/usr/local/lib/X11R6 \
133
/usr/local/lib/X11R5 \
134
/usr/local/lib/X11R4 \
138
/usr/XFree86/lib/X11 \
142
/usr/unsupported/lib \
144
/usr/local/x11r5/lib \
145
/usr/lpp/Xamples/lib \
149
/usr/openwin/share/lib \
152
dnl Don't even attempt the hair of trying to link an X program!
153
for ac_extension in a so sl; do
154
if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
155
ac_x_libraries=$ac_dir
160
fi # $ac_x_libraries = NO
164
dnl ------------------------------------------------------------------------
165
dnl Find a file (or one of more files in a list of dirs)
166
dnl ------------------------------------------------------------------------
168
AC_DEFUN(AC_FIND_FILE,
175
echo "configure: __oline__: $i/$j" >&AC_FD_CC
176
if test -r "$i/$j"; then
177
echo "taking that" >&AC_FD_CC
185
dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
186
dnl if-not-found, test-parameter)
187
AC_DEFUN(KDE_FIND_PATH,
189
AC_MSG_CHECKING([for $1])
190
if test -n "$$2"; then
193
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
195
AC_CACHE_VAL(kde_cv_path_$kde_cache,
207
if test -x "$dir/$1"; then
210
evalstr="$dir/$1 $5 2>&1 "
211
if eval $evalstr; then
212
kde_cv_path="$dir/$1"
216
kde_cv_path="$dir/$1"
222
eval "kde_cv_path_$kde_cache=$kde_cv_path"
226
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
230
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
231
AC_MSG_RESULT(not found)
234
AC_MSG_RESULT($kde_cv_path)
240
AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
242
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
243
Please check whether you installed Qt correctly.
244
You need to have a running moc binary.
245
configure tried to run $ac_cv_path_moc and the test didn't
246
succeed. If configure shouldn't have tried this one, set
247
the environment variable MOC to the right one before running
252
AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
254
AC_MSG_WARN([No Qt ui compiler (uic) found!
255
Please check whether you installed Qt correctly.
256
You need to have a running uic binary.
257
configure tried to run $ac_cv_path_uic and the test didn't
258
succeed. If configure shouldn't have tried this one, set
259
the environment variable UIC to the right one before running
265
AC_DEFUN(KDE_CHECK_UIC_FLAG,
267
AC_MSG_CHECKING([whether uic supports -$1 ])
268
kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
269
AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
271
cat >conftest.ui <<EOT
272
<!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
274
ac_uic_testrun="$UIC -$1 $2 conftest.ui >/dev/null"
275
if AC_TRY_EVAL(ac_uic_testrun); then
276
eval "kde_cv_prog_uic_$kde_cache=yes"
278
eval "kde_cv_prog_uic_$kde_cache=no"
283
if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
295
dnl ------------------------------------------------------------------------
296
dnl Find the meta object compiler and the ui compiler in the PATH,
297
dnl in $QTDIR/bin, and some more usual places
298
dnl ------------------------------------------------------------------------
300
AC_DEFUN(AC_PATH_QT_MOC_UIC,
303
for dir in $kde_qt_dirs; do
304
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
306
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
307
if test ! "$ac_qt_bindir" = "NO"; then
308
qt_bindirs="$ac_qt_bindir $qt_bindirs"
311
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
312
if test -z "$UIC_NOT_NEEDED"; then
313
KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
314
if test -z "$UIC" ; then
315
KDE_UIC_ERROR_MESSAGE
317
elif test $kde_qtver = 3; then
318
KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
319
KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
321
if test x$ac_uic_supports_libpath = xyes; then
322
UIC="$UIC -L \$(kde_widgetdir)"
324
if test x$ac_uic_supports_nounload = xyes; then
329
UIC="echo uic not available: "
336
if test $kde_qtver = 3; then
343
AC_DEFUN(KDE_1_CHECK_PATHS,
345
KDE_1_CHECK_PATH_HEADERS
349
if test -n "$USE_RPATH"; then
351
if test -n "$kde_libraries"; then
352
KDE_TEST_RPATH="-R $kde_libraries"
355
if test -n "$qt_libraries"; then
356
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
359
if test -n "$x_libraries"; then
360
KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
363
KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
366
AC_MSG_CHECKING([for KDE libraries installed])
367
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'
369
if AC_TRY_EVAL(ac_link) && test -s conftest; then
372
AC_MSG_ERROR([your system fails at linking a small KDE application!
373
Check, if your compiler is installed correctly and if you have used the
374
same compiler to compile Qt and kdelibs as you did use now.
375
For more details about this problem, look at the end of config.log.])
378
if eval `KDEDIR= ./conftest 2>&5`; then
384
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
385
kde_have_all_paths=yes
387
KDE_SET_PATHS($kde_result)
391
AC_DEFUN(KDE_SET_PATHS,
393
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
394
kde_htmldir=\"$kde_htmldir\" \
395
kde_appsdir=\"$kde_appsdir\" \
396
kde_icondir=\"$kde_icondir\" \
397
kde_sounddir=\"$kde_sounddir\" \
398
kde_datadir=\"$kde_datadir\" \
399
kde_locale=\"$kde_locale\" \
400
kde_cgidir=\"$kde_cgidir\" \
401
kde_confdir=\"$kde_confdir\" \
402
kde_mimedir=\"$kde_mimedir\" \
403
kde_toolbardir=\"$kde_toolbardir\" \
404
kde_wallpaperdir=\"$kde_wallpaperdir\" \
405
kde_templatesdir=\"$kde_templatesdir\" \
406
kde_bindir=\"$kde_bindir\" \
407
kde_servicesdir=\"$kde_servicesdir\" \
408
kde_servicetypesdir=\"$kde_servicetypesdir\" \
409
kde_moduledir=\"$kde_moduledir\" \
410
kde_styledir=\"$kde_styledir\" \
411
kde_widgetdir=\"$kde_widgetdir\" \
415
AC_DEFUN(KDE_SET_DEFAULT_PATHS,
417
if test "$1" = "default"; then
419
if test -z "$kde_htmldir"; then
420
kde_htmldir='\${prefix}/share/doc/HTML'
422
if test -z "$kde_appsdir"; then
423
kde_appsdir='\${prefix}/share/applnk'
425
if test -z "$kde_icondir"; then
426
kde_icondir='\${prefix}/share/icons'
428
if test -z "$kde_sounddir"; then
429
kde_sounddir='\${prefix}/share/sounds'
431
if test -z "$kde_datadir"; then
432
kde_datadir='\${prefix}/share/apps'
434
if test -z "$kde_locale"; then
435
kde_locale='\${prefix}/share/locale'
437
if test -z "$kde_cgidir"; then
438
kde_cgidir='\${exec_prefix}/cgi-bin'
440
if test -z "$kde_confdir"; then
441
kde_confdir='\${prefix}/share/config'
443
if test -z "$kde_mimedir"; then
444
kde_mimedir='\${prefix}/share/mimelnk'
446
if test -z "$kde_toolbardir"; then
447
kde_toolbardir='\${prefix}/share/toolbar'
449
if test -z "$kde_wallpaperdir"; then
450
kde_wallpaperdir='\${prefix}/share/wallpapers'
452
if test -z "$kde_templatesdir"; then
453
kde_templatesdir='\${prefix}/share/templates'
455
if test -z "$kde_bindir"; then
456
kde_bindir='\${exec_prefix}/bin'
458
if test -z "$kde_servicesdir"; then
459
kde_servicesdir='\${prefix}/share/services'
461
if test -z "$kde_servicetypesdir"; then
462
kde_servicetypesdir='\${prefix}/share/servicetypes'
464
if test -z "$kde_moduledir"; then
465
if test "$kde_qtver" = "2"; then
466
kde_moduledir='\${libdir}/kde2'
468
kde_moduledir='\${libdir}/kde3'
471
if test -z "$kde_styledir"; then
472
kde_styledir='\${libdir}/kde3/plugins/styles'
474
if test -z "$kde_widgetdir"; then
475
kde_widgetdir='\${libdir}/kde3/plugins/designer'
478
KDE_SET_PATHS(defaults)
482
if test $kde_qtver = 1; then
483
AC_MSG_RESULT([compiling])
486
AC_MSG_ERROR([path checking not yet supported for KDE 2])
492
AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
493
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
494
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
495
test -z "$kde_datadir" || test -z "$kde_locale" ||
496
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
497
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
498
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
499
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
500
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
501
test -z "$kde_styledir" || test -z "kde_widgetdir"
502
test "x$kde_have_all_paths" != "xyes"; then
503
kde_have_all_paths=no
507
AC_DEFUN(KDE_MISSING_PROG_ERROR,
509
AC_MSG_ERROR([The important program $1 was not found!
510
Please check whether you installed KDE correctly.
514
AC_DEFUN(KDE_SUBST_PROGRAMS,
517
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"
518
if test -n "$KDEDIRS"; then
521
for dir in $KDEDIRS; do
522
kde_default_bindirs="$dir/bin $kde_default_bindirs "
526
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
527
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
528
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
529
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
530
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
531
KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
532
KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
534
if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
535
kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
536
test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
537
AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
538
if test "$KDE_XSL_STYLESHEET" = "NO"; then
539
KDE_XSL_STYLESHEET=""
541
KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
545
DCOP_DEPENDENCIES='$(DCOPIDL)'
547
AC_SUBST(DCOPIDL2CPP)
548
AC_SUBST(DCOP_DEPENDENCIES)
550
AC_SUBST(ARTSCCONFIG)
553
AC_SUBST(KDE_XSL_STYLESHEET)
555
if test -x "$KDECONFIG"; then # it can be "compiled"
556
kde_libs_prefix=`$KDECONFIG --prefix`
557
if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
558
AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
559
This means it has been moved since you installed it.
560
This won't work. Please recompile kdelibs for the new prefix.
563
kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
565
kde_libs_prefix='$(prefix)'
566
kde_libs_htmldir='$(kde_htmldir)'
568
AC_SUBST(kde_libs_prefix)
569
AC_SUBST(kde_libs_htmldir)
572
AC_DEFUN(AC_CREATE_KFSSTND,
574
AC_REQUIRE([AC_CHECK_RPATH])
576
AC_MSG_CHECKING([for KDE paths])
579
AC_CACHE_VAL(kde_cv_all_paths,
581
KDE_SET_DEFAULT_PATHS($1)
584
eval "$kde_cv_all_paths"
585
KDE_CHECK_PATHS_FOR_COMPLETENESS
586
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
587
# wrong values were cached, may be, we can set better ones
589
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
590
kde_datadir= kde_locale= kde_cgidir= kde_confdir=
591
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
592
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
596
KDE_SET_DEFAULT_PATHS($1)
597
eval "$kde_cv_all_paths"
598
KDE_CHECK_PATHS_FOR_COMPLETENESS
599
kde_result="$kde_result (cache overridden)"
601
if test "$kde_have_all_paths" = "no"; then
602
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
603
Since it had compiled and linked before, it must be a strange problem on your system.
604
Look at config.log for details. If you are not able to fix this, look at
605
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
606
(If you're using an egcs version on Linux, you may update binutils!)
610
AC_MSG_RESULT($kde_result)
619
AC_DEFUN(AC_SUBST_KFSSTND,
621
AC_SUBST(kde_htmldir)
622
AC_SUBST(kde_appsdir)
623
AC_SUBST(kde_icondir)
624
AC_SUBST(kde_sounddir)
625
AC_SUBST(kde_datadir)
627
AC_SUBST(kde_confdir)
628
AC_SUBST(kde_mimedir)
629
AC_SUBST(kde_wallpaperdir)
632
AC_SUBST(kde_templatesdir)
633
AC_SUBST(kde_servicesdir)
634
AC_SUBST(kde_servicetypesdir)
635
AC_SUBST(kde_moduledir)
636
AC_SUBST(kde_styledir)
637
AC_SUBST(kde_widgetdir)
638
if test "$kde_qtver" = 1; then
639
kde_minidir="$kde_icondir/mini"
641
# for KDE 1 - this breaks KDE2 apps using minidir, but
642
# that's the plan ;-/
643
kde_minidir="/dev/null"
645
dnl AC_SUBST(kde_minidir)
646
dnl AC_SUBST(kde_cgidir)
647
dnl AC_SUBST(kde_toolbardir)
650
AC_DEFUN(KDE_MISC_TESTS,
653
dnl Checks for libraries.
654
AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
656
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
659
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
660
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
661
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
662
You should install libcrypt from another source or configure with PAM
667
if test $kde_have_crypt = yes; then
668
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
672
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
673
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
674
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
675
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
677
AC_CHECK_FUNC(inet_ntoa)
678
if test $ac_cv_func_inet_ntoa = no; then
679
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
681
AC_CHECK_FUNC(connect)
682
if test $ac_cv_func_connect = no; then
683
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
687
AC_CHECK_FUNC(remove)
688
if test $ac_cv_func_remove = no; then
689
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
692
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
693
AC_CHECK_FUNC(shmat, ,
694
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
696
# Solaris 2.6 and others need -lresolv for res_init
697
AC_CHECK_FUNCS(res_init, , [
698
kde_libs_safe="$LIBS"
699
LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
708
X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
709
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
714
LIBSOCKET="$X_EXTRA_LIBS"
717
AC_SUBST(X_EXTRA_LIBS)
718
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
721
case $host in dnl this *is* LynxOS specific
723
AC_MSG_CHECKING([LynxOS header file wrappers])
724
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
725
AC_MSG_RESULT(disabled)
726
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
734
dnl ------------------------------------------------------------------------
735
dnl Find the header files and libraries for X-Windows. Extended the
737
dnl ------------------------------------------------------------------------
741
AC_REQUIRE([KDE_MISC_TESTS])dnl
745
[ --enable-embedded link to Qt-embedded, don't use X],
746
kde_use_qt_emb=$enableval,
752
[ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment],
753
kde_use_qt_emb_palm=$enableval,
754
kde_use_qt_emb_palm=no
757
if test "$kde_use_qt_emb" = "no"; then
759
AC_MSG_CHECKING(for X)
762
AC_CACHE_VAL(kde_cv_have_x,
763
[# One or both of the vars are not set, and there is no cached value.
764
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
767
kde_x_includes=$x_includes
769
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
772
kde_x_libraries=$x_libraries
775
# below we use the standard autoconf calls
776
ac_x_libraries=$kde_x_libraries
777
ac_x_includes=$kde_x_includes
780
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
781
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
782
dnl location. The correct location is /usr/lib32 or an undefined value
783
dnl (the linker is smart enough to pick the correct default library).
784
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
785
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
786
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
787
dnl x_includes should be left alone.
795
if test -z "$ac_x_includes"; then
798
if test -z "$ac_x_libraries"; then
799
ac_x_libraries="/usr/lib"
802
#from now on we use our own again
804
# when the user already gave --x-includes, we ignore
805
# what the standard autoconf macros told us.
806
if test "$kde_x_includes" = NO; then
807
kde_x_includes=$ac_x_includes
810
# for --x-libraries too
811
if test "$kde_x_libraries" = NO; then
812
kde_x_libraries=$ac_x_libraries
815
if test "$kde_x_includes" = NO; then
816
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
819
if test "$kde_x_libraries" = NO; then
820
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
823
# Record where we found X for the cache.
824
kde_cv_have_x="have_x=yes \
825
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
828
eval "$kde_cv_have_x"
830
if test "$have_x" != yes; then
831
AC_MSG_RESULT($have_x)
834
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
837
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
839
x_includes="."; dnl better than nothing :-
841
x_includes=$kde_x_includes
842
X_INCLUDES="-I$x_includes"
845
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
847
x_libraries="/usr/lib"; dnl better than nothing :-
849
x_libraries=$kde_x_libraries
850
X_LDFLAGS="-L$x_libraries"
852
all_includes="$X_INCLUDES"
853
all_libraries="$X_LDFLAGS"
857
AC_SUBST(x_libraries)
860
# Check for libraries that X11R6 Xt/Xaw programs need.
861
ac_save_LDFLAGS="$LDFLAGS"
862
LDFLAGS="$LDFLAGS $X_LDFLAGS"
863
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
864
# check for ICE first), but we must link in the order -lSM -lICE or
865
# we get undefined symbols. So assume we have SM if we have ICE.
866
# These have to be linked with before -lX11, unlike the other
867
# libraries we check for below, so use a different variable.
868
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
869
AC_CHECK_LIB(ICE, IceConnectionNumber,
870
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
872
LDFLAGS="$ac_save_LDFLAGS"
876
LIB_X11='-lX11 $(LIBSOCKET)'
879
AC_MSG_CHECKING(for libXext)
880
AC_CACHE_VAL(kde_cv_have_libXext,
882
kde_ldflags_safe="$LDFLAGS"
883
kde_libs_safe="$LIBS"
885
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
886
LIBS="-lXext -lX11 $LIBSOCKET"
895
printf("hello Xext\n");
897
kde_cv_have_libXext=yes,
898
kde_cv_have_libXext=no
901
LDFLAGS=$kde_ldflags_safe
905
AC_MSG_RESULT($kde_cv_have_libXext)
907
if test "$kde_cv_have_libXext" = "no"; then
908
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
909
can't find it itself, we stop here assuming that make wouldn't find
913
AC_MSG_CHECKING(for Xinerama)
915
AC_ARG_WITH(xinerama,
916
[ --with-xinerama enable support for Xinerama ],
924
kde_save_LDFLAGS="$LDFLAGS"
925
kde_save_CFLAGS="$CFLAGS"
926
kde_save_LIBS="$LIBS"
927
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
928
CFLAGS="$CFLAGS -I$x_includes"
929
LIBS="-lXinerama -lXext"
931
if test "x$no_xinerama" = "xno"; then
933
AC_CACHE_VAL(ac_cv_have_xinerama,
935
AC_TRY_LINK([#include <X11/Xlib.h>
936
#include <X11/extensions/Xinerama.h>],
937
[XineramaIsActive(NULL);],
938
[ac_cv_have_xinerama="yes"],
939
[ac_cv_have_xinerama="no"])
942
ac_cv_have_xinerama=no;
945
AC_MSG_RESULT($ac_cv_have_xinerama)
949
if test "$ac_cv_have_xinerama" = "yes"; then
950
AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
951
LIBXINERAMA="-lXinerama"
954
AC_SUBST(LIBXINERAMA)
956
LDFLAGS="$kde_save_LDFLAGS"
957
CFLAGS="$kde_save_CFLAGS"
958
LIBS="$kde_save_LIBS"
964
dnl We're using QT Embedded
965
CXXFLAGS="$CXXFLAGS -fno-rtti -DQWS"
966
CFLAGS="$CFLAGS -DQWS"
967
LDFLAGS="$LDFLAGS -DQWS"
968
QTE_NORTTI="-fno-rtti -DQWS"
983
AC_SUBST(x_libraries)
993
AC_DEFUN(KDE_PRINT_QT_PROGRAM,
995
AC_REQUIRE([KDE_USE_QT])
996
cat > conftest.$ac_ext <<EOF
997
#include "confdefs.h"
999
#include <qapplication.h>
1001
if test "$kde_qtver" = "2"; then
1002
cat >> conftest.$ac_ext <<EOF
1004
#include <qstring.h>
1008
if test $kde_qtsubver -gt 0; then
1009
cat >> conftest.$ac_ext <<EOF
1010
#include <qiconview.h>
1015
if test "$kde_qtver" = "3"; then
1016
cat >> conftest.$ac_ext <<EOF
1017
#include <qcursor.h>
1018
#include <qstylefactory.h>
1019
#include <private/qucomextra_p.h>
1023
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1024
cat >> conftest.$ac_ext <<EOF
1030
if test "$kde_qtver" = "2"; then
1031
cat >> conftest.$ac_ext <<EOF
1032
QStringList *t = new QStringList();
1035
if test $kde_qtsubver -gt 0; then
1036
cat >> conftest.$ac_ext <<EOF
1038
iv.setWordWrapIconText(false);
1040
s.setLatin1("Elvis is alive", 14);
1044
if test "$kde_qtver" = "3"; then
1045
cat >> conftest.$ac_ext <<EOF
1046
(void)QStyleFactory::create(QString::null);
1047
QCursor c(Qt::WhatsThisCursor);
1050
cat >> conftest.$ac_ext <<EOF
1056
AC_DEFUN(KDE_USE_QT,
1058
if test -z "$1"; then
1062
kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1063
# following is the check if subversion isnļæ½t found in passed argument
1064
if test "$kde_qtsubver" = "$1"; then
1067
kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1068
if test "$kde_qtver" = "1"; then
1073
if test -z "$2"; then
1074
if test "$kde_qtver" = "2"; then
1075
if test $kde_qtsubver -gt 0; then
1076
kde_qt_minversion=">= Qt 2.2.2"
1078
kde_qt_minversion=">= Qt 2.0.2"
1081
if test "$kde_qtver" = "3"; then
1082
kde_qt_minversion=">= Qt 3.0.3"
1084
if test "$kde_qtver" = "1"; then
1085
kde_qt_minversion=">= 1.42 and < 2.0"
1088
kde_qt_minversion=$2
1091
if test -z "$3"; then
1092
if test $kde_qtver = 3; then
1093
kde_qt_verstring="QT_VERSION >= 303"
1095
if test $kde_qtver = 2; then
1096
if test $kde_qtsubver -gt 0; then
1097
kde_qt_verstring="QT_VERSION >= 222"
1099
kde_qt_verstring="QT_VERSION >= 200"
1102
if test $kde_qtver = 1; then
1103
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1109
if test $kde_qtver = 3; then
1110
kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
1112
if test $kde_qtver = 2; then
1113
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1115
if test $kde_qtver = 1; then
1116
kde_qt_dirs="$QTDIR /usr/lib/qt"
1120
AC_DEFUN(KDE_CHECK_QT_DIRECT,
1122
AC_REQUIRE([KDE_USE_QT])
1123
AC_MSG_CHECKING([if Qt compiles without flags])
1124
AC_CACHE_VAL(kde_cv_qt_direct,
1128
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1129
ac_LIBRARY_PATH="$LIBRARY_PATH"
1130
ac_cxxflags_safe="$CXXFLAGS"
1131
ac_ldflags_safe="$LDFLAGS"
1132
ac_libs_safe="$LIBS"
1134
CXXFLAGS="$CXXFLAGS -I$qt_includes"
1135
LDFLAGS="$LDFLAGS $X_LDFLAGS"
1136
if test "x$kde_use_qt_emb" != "xyes"; then
1137
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1139
LIBS="$LIBQT $LIBSOCKET"
1142
export LD_LIBRARY_PATH
1146
KDE_PRINT_QT_PROGRAM
1148
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1149
kde_cv_qt_direct="yes"
1151
kde_cv_qt_direct="no"
1152
echo "configure: failed program was:" >&AC_FD_CC
1153
cat conftest.$ac_ext >&AC_FD_CC
1157
CXXFLAGS="$ac_cxxflags_safe"
1158
LDFLAGS="$ac_ldflags_safe"
1159
LIBS="$ac_libs_safe"
1161
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1162
export LD_LIBRARY_PATH
1163
LIBRARY_PATH="$ac_LIBRARY_PATH"
1168
if test "$kde_cv_qt_direct" = "yes"; then
1177
dnl ------------------------------------------------------------------------
1178
dnl Try to find the Qt headers and libraries.
1179
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1180
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1181
dnl ------------------------------------------------------------------------
1183
AC_DEFUN(AC_PATH_QT_1_3,
1185
AC_REQUIRE([K_PATH_X])
1186
AC_REQUIRE([KDE_USE_QT])
1188
dnl ------------------------------------------------------------------------
1189
dnl Add configure flag to enable linking to MT version of Qt library.
1190
dnl ------------------------------------------------------------------------
1194
[ --disable-mt link to non-threaded Qt (deprecated)],
1195
kde_use_qt_mt=$enableval,
1197
if test $kde_qtver = 3; then
1207
dnl ------------------------------------------------------------------------
1208
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1209
dnl ------------------------------------------------------------------------
1213
if test "x$kde_use_qt_mt" = "xyes"; then
1215
if test "x$kde_use_threading" = "xyes"; then
1216
CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1217
KDE_MT_LDFLAGS="$USE_THREADS"
1218
KDE_MT_LIBS="$LIBPTHREAD"
1223
AC_SUBST(KDE_MT_LDFLAGS)
1224
AC_SUBST(KDE_MT_LIBS)
1226
kde_qt_was_given=yes
1228
dnl ------------------------------------------------------------------------
1229
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1230
dnl ------------------------------------------------------------------------
1231
if test -z "$LIBQT_GLOB"; then
1232
if test "x$kde_use_qt_emb" = "xyes"; then
1233
LIBQT_GLOB="libqte.*"
1235
LIBQT_GLOB="libqt.*"
1239
if test -z "$LIBQT"; then
1240
dnl ------------------------------------------------------------
1241
dnl If we got --enable-embedded then adjust the Qt library name.
1242
dnl ------------------------------------------------------------
1243
if test "x$kde_use_qt_emb" = "xyes"; then
1249
kde_int_qt="-l$qtlib"
1255
if test -z "$LIBQPE"; then
1256
dnl ------------------------------------------------------------
1257
dnl If we got --enable-palmtop then add -lqpe to the link line
1258
dnl ------------------------------------------------------------
1259
if test "x$kde_use_qt_emb" = "xyes"; then
1260
if test "x$kde_use_qt_emb_palm" = "xyes"; then
1270
dnl ------------------------------------------------------------------------
1271
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1272
dnl ------------------------------------------------------------------------
1274
if test "x$kde_use_qt_mt" = "xyes"; then
1275
if test -z "$LIBQT"; then
1277
kde_int_qt="-l$qtlib-mt"
1280
kde_int_qt="$qtlib-mt"
1282
LIBQT_GLOB="lib$qtlib-mt.*"
1283
USING_QT_MT="using -mt"
1288
if test $kde_qtver != 1; then
1290
AC_REQUIRE([AC_FIND_PNG])
1291
AC_REQUIRE([AC_FIND_JPEG])
1292
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1295
if test $kde_qtver = 3; then
1296
AC_REQUIRE([KDE_CHECK_LIBDL])
1297
LIBQT="$LIBQT $LIBDL"
1300
AC_MSG_CHECKING([for Qt])
1302
if test "x$kde_use_qt_emb" != "xyes"; then
1303
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1305
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1309
[ --with-qt-dir=DIR where the root of Qt is installed ],
1310
[ ac_qt_includes="$withval"/include
1311
ac_qt_libraries="$withval"/lib
1312
ac_qt_bindir="$withval"/bin
1315
AC_ARG_WITH(qt-includes,
1316
[ --with-qt-includes=DIR where the Qt includes are. ],
1318
ac_qt_includes="$withval"
1321
kde_qt_libs_given=no
1323
AC_ARG_WITH(qt-libraries,
1324
[ --with-qt-libraries=DIR where the Qt library is installed.],
1325
[ ac_qt_libraries="$withval"
1326
kde_qt_libs_given=yes
1329
AC_CACHE_VAL(ac_cv_have_qt,
1330
[#try to guess Qt locations
1333
for dir in $kde_qt_dirs; do
1334
qt_incdirs="$qt_incdirs $dir/include $dir"
1336
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes"
1337
if test ! "$ac_qt_includes" = "NO"; then
1338
qt_incdirs="$ac_qt_includes $qt_incdirs"
1341
if test "$kde_qtver" != "1"; then
1342
kde_qt_header=qstyle.h
1344
kde_qt_header=qglobal.h
1347
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1348
ac_qt_includes="$qt_incdir"
1351
for dir in $kde_qt_dirs; do
1352
qt_libdirs="$qt_libdirs $dir/lib $dir"
1354
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1355
if test ! "$ac_qt_libraries" = "NO"; then
1356
qt_libdir=$ac_qt_libraries
1358
qt_libdirs="$ac_qt_libraries $qt_libdirs"
1359
# if the Qt was given, the chance is too big that libqt.* doesn't exist
1361
for dir in $qt_libdirs; do
1362
try="ls -1 $dir/${LIBQT_GLOB}"
1363
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1367
ac_qt_libraries="$qt_libdir"
1372
ac_cxxflags_safe="$CXXFLAGS"
1373
ac_ldflags_safe="$LDFLAGS"
1374
ac_libs_safe="$LIBS"
1376
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1377
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1378
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1380
KDE_PRINT_QT_PROGRAM
1382
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1385
echo "configure: failed program was:" >&AC_FD_CC
1386
cat conftest.$ac_ext >&AC_FD_CC
1387
ac_qt_libraries="NO"
1390
CXXFLAGS="$ac_cxxflags_safe"
1391
LDFLAGS="$ac_ldflags_safe"
1392
LIBS="$ac_libs_safe"
1395
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1396
ac_cv_have_qt="have_qt=no"
1399
if test "$ac_qt_includes" = NO; then
1400
if test "$ac_qt_libraries" = NO; then
1401
ac_qt_notfound="(headers and libraries)";
1403
ac_qt_notfound="(headers)";
1406
if test "x$kde_use_qt_mt" = "xyes"; then
1408
Make sure that you have compiled Qt with thread support!"
1409
ac_qt_notfound="(library $qtlib-mt)";
1411
ac_qt_notfound="(library $qtlib)";
1415
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1416
For more details about this problem, look at the end of config.log.$missing_qt_mt])
1422
eval "$ac_cv_have_qt"
1424
if test "$have_qt" != yes; then
1425
AC_MSG_RESULT([$have_qt]);
1427
ac_cv_have_qt="have_qt=yes \
1428
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1429
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1431
qt_libraries="$ac_qt_libraries"
1432
qt_includes="$ac_qt_includes"
1435
if test ! "$kde_qt_libs_given" = "yes"; then
1436
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1439
AC_SUBST(qt_libraries)
1440
AC_SUBST(qt_includes)
1442
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1445
QT_INCLUDES="-I$qt_includes"
1446
all_includes="$QT_INCLUDES $all_includes"
1449
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1452
QT_LDFLAGS="-L$qt_libraries"
1453
all_libraries="$all_libraries $QT_LDFLAGS"
1455
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1457
AC_SUBST(QT_INCLUDES)
1458
AC_SUBST(QT_LDFLAGS)
1463
if test "x$kde_use_qt_emb" != "xyes"; then
1464
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1466
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
1468
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1476
AC_DEFUN(AC_PATH_QT,
1481
AC_DEFUN(KDE_CHECK_FINAL,
1483
AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1484
kde_use_final=$enableval, kde_use_final=no)
1487
if test "x$kde_use_final" = "xyes"; then
1488
KDE_USE_FINAL_TRUE=""
1489
KDE_USE_FINAL_FALSE="#"
1491
KDE_USE_FINAL_TRUE="#"
1492
KDE_USE_FINAL_FALSE=""
1494
AC_SUBST(KDE_USE_FINAL_TRUE)
1495
AC_SUBST(KDE_USE_FINAL_FALSE)
1497
AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
1498
kde_use_closure=$enableval, kde_use_closure=yes)
1500
if test "x$kde_use_closure" = "xyes"; then
1501
KDE_USE_CLOSURE_TRUE=""
1502
KDE_USE_CLOSURE_FALSE="#"
1503
# CXXFLAGS="$CXXFLAGS $REPO"
1505
KDE_USE_CLOSURE_TRUE="#"
1506
KDE_USE_CLOSURE_FALSE=""
1508
AC_SUBST(KDE_USE_CLOSURE_TRUE)
1509
AC_SUBST(KDE_USE_CLOSURE_FALSE)
1512
dnl ------------------------------------------------------------------------
1513
dnl Now, the same with KDE
1514
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1515
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1516
dnl ------------------------------------------------------------------------
1518
AC_DEFUN(AC_BASE_PATH_KDE,
1521
AC_REQUIRE([AC_PATH_QT])dnl
1523
AC_MSG_CHECKING([for KDE])
1525
if test "${prefix}" != NONE; then
1526
kde_includes=${prefix}/include
1527
ac_kde_includes=$prefix/include
1529
if test "${exec_prefix}" != NONE; then
1530
kde_libraries=${libdir}
1531
ac_kde_libraries=$libdir
1533
kde_libraries=${prefix}/lib
1534
ac_kde_libraries=$prefix/lib
1543
AC_CACHE_VAL(ac_cv_have_kde,
1544
[#try to guess kde locations
1546
if test "$kde_qtver" = 1; then
1547
kde_check_header="ksock.h"
1548
kde_check_lib="libkdecore.la"
1550
kde_check_header="ksharedptr.h"
1551
kde_check_lib="libkio.la"
1554
if test -z "$1"; then
1556
kde_incdirs="/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 $includedir"
1557
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1558
kde_incdirs="$ac_kde_includes $kde_incdirs"
1559
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1560
ac_kde_includes="$kde_incdir"
1562
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1564
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1565
So, check this please and use another prefix!])
1568
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib"
1569
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
1570
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1571
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1572
ac_kde_libraries="$kde_libdir"
1574
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1576
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1577
So, check this please and use another prefix!])
1579
ac_kde_libraries="$kde_libdir"
1581
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
1582
ac_cv_have_kde="have_kde=no"
1584
ac_cv_have_kde="have_kde=yes \
1585
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1590
ac_cv_have_kde="have_kde=no"
1595
eval "$ac_cv_have_kde"
1597
if test "$have_kde" != "yes"; then
1598
if test "${prefix}" = NONE; then
1599
ac_kde_prefix="$ac_default_prefix"
1601
ac_kde_prefix="$prefix"
1603
if test "$exec_prefix" = NONE; then
1604
ac_kde_exec_prefix="$ac_kde_prefix"
1605
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1607
ac_kde_exec_prefix="$exec_prefix"
1608
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1611
kde_libraries="${libdir}"
1612
kde_includes=${ac_kde_prefix}/include
1615
ac_cv_have_kde="have_kde=yes \
1616
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1617
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1619
kde_libraries="$ac_kde_libraries"
1620
kde_includes="$ac_kde_includes"
1622
AC_SUBST(kde_libraries)
1623
AC_SUBST(kde_includes)
1625
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1628
KDE_INCLUDES="-I$kde_includes"
1629
all_includes="$KDE_INCLUDES $all_includes"
1632
KDE_LDFLAGS="-L$kde_libraries"
1633
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1634
all_libraries="$all_libraries $KDE_LDFLAGS"
1637
AC_SUBST(KDE_LDFLAGS)
1638
AC_SUBST(KDE_INCLUDES)
1640
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1642
all_libraries="$all_libraries $USER_LDFLAGS"
1643
all_includes="$all_includes $USER_INCLUDES"
1644
AC_SUBST(all_includes)
1645
AC_SUBST(all_libraries)
1650
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1652
AC_MSG_CHECKING(for extra includes)
1653
AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1654
adds non standard include paths],
1655
kde_use_extra_includes="$withval",
1656
kde_use_extra_includes=NONE
1659
if test -n "$kde_use_extra_includes" && \
1660
test "$kde_use_extra_includes" != "NONE"; then
1664
for dir in $kde_use_extra_includes; do
1665
kde_extra_includes="$kde_extra_includes $dir"
1666
USER_INCLUDES="$USER_INCLUDES -I$dir"
1669
kde_use_extra_includes="added"
1671
kde_use_extra_includes="no"
1673
AC_SUBST(USER_INCLUDES)
1675
AC_MSG_RESULT($kde_use_extra_includes)
1678
AC_MSG_CHECKING(for extra libs)
1679
AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1680
kde_use_extra_libs=$withval,
1681
kde_use_extra_libs=NONE
1683
if test -n "$kde_use_extra_libs" && \
1684
test "$kde_use_extra_libs" != "NONE"; then
1688
for dir in $kde_use_extra_libs; do
1689
kde_extra_libs="$kde_extra_libs $dir"
1690
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1691
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1694
kde_use_extra_libs="added"
1696
kde_use_extra_libs="no"
1699
AC_SUBST(USER_LDFLAGS)
1701
AC_MSG_RESULT($kde_use_extra_libs)
1705
AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1707
AC_MSG_CHECKING([for KDE headers installed])
1710
cat > conftest.$ac_ext <<EOF
1712
# include <stdlib.h>
1715
#include "confdefs.h"
1719
printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1720
printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1721
printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1722
printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1723
printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1724
printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1725
printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1726
printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1727
printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1728
printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1729
printf("kde_wallpaperdir=\\"%s\\"\n",
1730
KApplication::kde_wallpaperdir().data());
1731
printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1732
printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1733
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1734
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1735
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1736
printf("kde_styledir=\\"/tmp/dummy\\"\n");
1737
printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1742
ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1743
if AC_TRY_EVAL(ac_compile); then
1746
AC_MSG_ERROR([your system is not able to compile a small KDE application!
1747
Check, if you installed the KDE header files correctly.
1748
For more details about this problem, look at the end of config.log.])
1754
AC_DEFUN(KDE_CHECK_KDEQTADDON,
1756
AC_MSG_CHECKING(for kde-qt-addon)
1757
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1759
kde_ldflags_safe="$LDFLAGS"
1760
kde_libs_safe="$LIBS"
1761
kde_cxxflags_safe="$CXXFLAGS"
1763
LIBS="-lkde-qt-addon $LIBQT $LIBS"
1764
CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1765
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1773
kde_cv_have_kdeqtaddon=yes,
1774
kde_cv_have_kdeqtaddon=no
1777
LDFLAGS=$kde_ldflags_safe
1779
CXXFLAGS=$kde_cxxflags_safe
1782
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1784
if test "$kde_cv_have_kdeqtaddon" = "no"; then
1785
AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1786
It is a separate package (and CVS module) named kde-qt-addon.])
1790
AC_DEFUN(KDE_CHECK_KIMGIO,
1792
AC_REQUIRE([AC_BASE_PATH_KDE])
1793
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1794
AC_REQUIRE([AC_FIND_TIFF])
1795
AC_REQUIRE([AC_FIND_JPEG])
1796
AC_REQUIRE([AC_FIND_PNG])
1797
AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1799
if test "$1" = "existance"; then
1802
kde_save_LIBS="$LIBS"
1803
LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1804
AC_CHECK_LIB(kimgio, kimgioRegister, [
1805
LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1806
LIBS="$kde_save_LIBS"
1809
LIBKIMGIO_EXISTS=yes
1812
if test "$LIBKIMGIO_EXISTS" = "yes"; then
1813
LIB_KIMGIO='-lkimgio'
1817
AC_SUBST(LIB_KIMGIO)
1820
AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1822
AC_REQUIRE([KDE_MISC_TESTS])
1823
AC_REQUIRE([KDE_CHECK_LIBDL])
1824
AC_REQUIRE([K_PATH_X])
1826
if test $kde_qtver = 3; then
1827
LIB_KDECORE='-lkdecore'
1828
AC_SUBST(LIB_KDECORE)
1839
LIB_KSPELL='-lkspell'
1840
AC_SUBST(LIB_KSPELL)
1841
LIB_KPARTS='-lkparts'
1842
AC_SUBST(LIB_KPARTS)
1843
LIB_KDEPRINT='-lkdeprint'
1844
AC_SUBST(LIB_KDEPRINT)
1845
# these are for backward compatibility
1847
AC_SUBST(LIB_KSYCOCA)
1850
elif test $kde_qtver = 2; then
1851
LIB_KDECORE='-lkdecore'
1852
AC_SUBST(LIB_KDECORE)
1857
LIB_KSYCOCA='-lksycoca'
1858
AC_SUBST(LIB_KSYCOCA)
1867
LIB_KSPELL='-lkspell'
1868
AC_SUBST(LIB_KSPELL)
1869
LIB_KPARTS='-lkparts'
1870
AC_SUBST(LIB_KPARTS)
1871
LIB_KDEPRINT='-lkdeprint'
1872
AC_SUBST(LIB_KDEPRINT)
1874
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1875
AC_SUBST(LIB_KDECORE)
1876
LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1878
LIB_KFM='-lkfm $(LIB_KDECORE)'
1880
LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1882
LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1887
AC_DEFUN(AC_PATH_KDE,
1890
AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1892
if test "$enableval" = "no";
1893
then ac_use_path_checking="default"
1894
else ac_use_path_checking=""
1898
if test "$kde_qtver" = 1;
1899
then ac_use_path_checking=""
1900
else ac_use_path_checking="default"
1905
AC_CREATE_KFSSTND($ac_use_path_checking)
1908
KDE_CREATE_LIBS_ALIASES
1912
AC_DEFUN(AC_CHECK_SETENV,
1914
AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
1915
AC_CHECK_FUNCS([setenv unsetenv])
1918
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1920
AC_MSG_CHECKING(for getdomainname)
1921
AC_CACHE_VAL(ac_cv_func_getdomainname,
1925
save_CXXFLAGS="$CXXFLAGS"
1926
kde_safe_LIBS="$LIBS"
1927
LIBS="$LIBS $X_EXTRA_LIBS"
1928
if test "$GCC" = "yes"; then
1929
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1937
getdomainname(buffer, 200);
1939
ac_cv_func_getdomainname=yes,
1940
ac_cv_func_getdomainname=no)
1941
CXXFLAGS="$save_CXXFLAGS"
1945
AC_MSG_RESULT($ac_cv_func_getdomainname)
1947
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1948
AC_CACHE_VAL(ac_cv_proto_getdomainname,
1952
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1953
ac_cv_proto_getdomainname=no
1956
LIBS="$LIBS $X_EXTRA_LIBS"
1961
extern "C" int getdomainname (char *, int);
1965
getdomainname(buffer, 200);
1967
ac_cv_func_getdomainname=yes
1968
ac_cv_proto_getdomainname=yes,
1969
AC_MSG_RESULT([fatal error])
1970
AC_MSG_ERROR([getdomainname unavailable]))
1975
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1977
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1978
AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1980
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1981
AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1982
[Define if you have getdomainname prototype])
1987
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1990
AC_MSG_CHECKING([for gethostname])
1991
AC_CACHE_VAL(ac_cv_func_gethostname,
1995
save_CXXFLAGS="$CXXFLAGS"
1996
if test "$GCC" = "yes"; then
1997
CXXFLAGS="$CXXFLAGS -pedantic-errors"
2005
gethostname(buffer, 200);
2007
ac_cv_func_gethostname=yes,
2008
ac_cv_func_gethostname=no)
2009
CXXFLAGS="$save_CXXFLAGS"
2012
AC_MSG_RESULT($ac_cv_func_gethostname)
2014
AC_MSG_CHECKING([if gethostname needs custom prototype])
2015
AC_CACHE_VAL(ac_cv_proto_gethostname,
2019
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
2020
ac_cv_proto_gethostname=no
2026
extern "C" int gethostname (char *, int);
2030
gethostname(buffer, 200);
2032
ac_cv_func_gethostname=yes
2033
ac_cv_proto_gethostname=yes,
2034
AC_MSG_RESULT([fatal error])
2035
AC_MSG_ERROR(gethostname unavailable))
2039
AC_MSG_RESULT($ac_cv_proto_gethostname)
2041
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
2042
AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
2043
[Define if you have gethostname prototype])
2045
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
2046
AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
2050
AC_DEFUN(AC_CHECK_USLEEP,
2052
AC_MSG_CHECKING([for usleep])
2053
AC_CACHE_VAL(ac_cv_func_usleep,
2057
ac_libs_safe="$LIBS"
2058
LIBS="$LIBS $LIBUCB"
2066
ac_cv_func_usleep=yes,
2067
ac_cv_func_usleep=no)
2068
LIBS="$ac_libs_safe"
2071
AC_MSG_RESULT($ac_cv_func_usleep)
2072
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
2073
AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
2077
AC_DEFUN(AC_CHECK_RANDOM,
2079
AC_MSG_CHECKING([for random])
2080
AC_CACHE_VAL(ac_cv_func_random,
2084
ac_libs_safe="$LIBS"
2085
LIBS="$LIBS $LIBUCB"
2092
ac_cv_func_random=yes,
2093
ac_cv_func_random=no)
2094
LIBS="$ac_libs_safe"
2097
AC_MSG_RESULT($ac_cv_func_random)
2098
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
2099
AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
2103
AC_DEFUN(AC_FIND_GIF,
2104
[AC_MSG_CHECKING([for giflib])
2105
AC_CACHE_VAL(ac_cv_lib_gif,
2106
[ac_save_LIBS="$LIBS"
2107
if test "x$kde_use_qt_emb" != "xyes"; then
2108
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2110
LIBS="$all_libraries -lgif"
2117
int GifLastError(void);
2121
/* We use char because int might match the return type of a gcc2
2122
builtin and then its argument prototype would still apply. */
2124
[return GifLastError();],
2125
eval "ac_cv_lib_gif=yes",
2126
eval "ac_cv_lib_gif=no")
2127
LIBS="$ac_save_LIBS"
2129
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2131
AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2133
AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2137
AC_DEFUN(KDE_FIND_JPEG_HELPER,
2139
AC_MSG_CHECKING([for libjpeg$2])
2140
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2143
ac_save_LIBS="$LIBS"
2144
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2145
ac_save_CFLAGS="$CFLAGS"
2146
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2148
[/* Override any gcc2 internal prototype to avoid an error. */
2149
struct jpeg_decompress_struct;
2150
typedef struct jpeg_decompress_struct * j_decompress_ptr;
2155
void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2156
int version, size_t structsize);
2160
/* We use char because int might match the return type of a gcc2
2161
builtin and then its argument prototype would still apply. */
2163
[jpeg_CreateDecompress(0L, 0, 0);],
2164
eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2165
eval "ac_cv_lib_jpeg_$1=no")
2166
LIBS="$ac_save_LIBS"
2167
CFLAGS="$ac_save_CFLAGS"
2170
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2171
LIBJPEG="$ac_cv_lib_jpeg_$1"
2172
AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2180
AC_DEFUN(AC_FIND_JPEG,
2182
dnl first look for libraries
2183
KDE_FIND_JPEG_HELPER(6b, 6b,
2184
KDE_FIND_JPEG_HELPER(normal, [],
2191
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2192
dnl requires system dependent includes loaded before it)
2193
jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
2194
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2195
test "x$jpeg_incdir" = xNO && jpeg_incdir=
2197
dnl if headers _and_ libraries are missing, this is no error, and we
2198
dnl continue with a warning (the user will get no jpeg support in khtml)
2199
dnl if only one is missing, it means a configuration error, but we still
2201
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2202
AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2204
if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2206
There is an installation error in jpeg support. You seem to have only one
2207
of either the headers _or_ the libraries installed. You may need to either
2208
provide correct --with-extra-... options, or the development package of
2209
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2210
Disabling JPEG support.
2213
AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2222
AC_DEFUN(KDE_CHECK_QT_JPEG,
2224
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2225
AC_CACHE_VAL(kde_cv_qt_jpeg,
2229
ac_save_LIBS="$LIBS"
2230
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2231
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2232
ac_save_CXXFLAGS="$CXXFLAGS"
2233
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2235
[#include <qapplication.h>],
2239
QApplication app(argc, argv);],
2240
eval "kde_cv_qt_jpeg=no",
2241
eval "kde_cv_qt_jpeg=yes")
2242
LIBS="$ac_save_LIBS"
2243
CXXFLAGS="$ac_save_CXXFLAGS"
2247
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2249
LIBJPEG_QT='$(LIBJPEG)'
2257
AC_DEFUN(AC_FIND_ZLIB,
2259
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2260
AC_MSG_CHECKING([for libz])
2261
AC_CACHE_VAL(ac_cv_lib_z,
2264
kde_save_LIBS="$LIBS"
2265
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2266
kde_save_CFLAGS="$CFLAGS"
2267
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2272
[return (zlibVersion() == ZLIB_VERSION); ],
2273
eval "ac_cv_lib_z='-lz'",
2274
eval "ac_cv_lib_z=no")
2275
LIBS="$kde_save_LIBS"
2276
CFLAGS="$kde_save_CFLAGS"
2278
if test ! "$ac_cv_lib_z" = no; then
2279
AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2282
AC_MSG_RESULT($ac_cv_lib_z)
2284
AC_MSG_ERROR(not found. Check your installation and look into config.log)
2290
AC_DEFUN(KDE_TRY_TIFFLIB,
2292
AC_MSG_CHECKING([for libtiff $1])
2294
AC_CACHE_VAL(kde_cv_libtiff_$1,
2298
kde_save_LIBS="$LIBS"
2299
if test "x$kde_use_qt_emb" != "xyes"; then
2300
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2302
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2304
kde_save_CXXFLAGS="$CXXFLAGS"
2305
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2311
[return (TIFFOpen( "", "r") == 0); ],
2313
kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2315
kde_cv_libtiff_$1=no
2318
LIBS="$kde_save_LIBS"
2319
CXXFLAGS="$kde_save_CXXFLAGS"
2323
if test "$kde_cv_libtiff_$1" = "no"; then
2328
LIBTIFF="$kde_cv_libtiff_$1"
2330
AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2336
AC_DEFUN(AC_FIND_TIFF,
2338
AC_REQUIRE([K_PATH_X])
2339
AC_REQUIRE([AC_FIND_ZLIB])
2340
AC_REQUIRE([AC_FIND_JPEG])
2341
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2343
KDE_TRY_TIFFLIB(tiff, [],
2344
KDE_TRY_TIFFLIB(tiff34))
2350
AC_DEFUN(AC_FIND_PNG,
2352
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2353
AC_REQUIRE([AC_FIND_ZLIB])
2354
AC_MSG_CHECKING([for libpng])
2355
AC_CACHE_VAL(ac_cv_lib_png,
2357
kde_save_LIBS="$LIBS"
2358
if test "x$kde_use_qt_emb" != "xyes"; then
2359
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2361
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2363
kde_save_CFLAGS="$CFLAGS"
2364
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2371
png_structp png_ptr = png_create_read_struct( /* image ptr */
2372
PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2373
return( png_ptr != 0 );
2375
eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2376
eval "ac_cv_lib_png=no"
2378
LIBS="$kde_save_LIBS"
2379
CFLAGS="$kde_save_CFLAGS"
2381
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2382
AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2383
LIBPNG="$ac_cv_lib_png"
2385
AC_MSG_RESULT($ac_cv_lib_png)
2393
AC_DEFUN(AC_CHECK_BOOL,
2395
AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2398
AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2400
AC_MSG_CHECKING(if you need GNU extensions)
2401
AC_CACHE_VAL(ac_cv_gnu_extensions,
2403
cat > conftest.c << EOF
2404
#include <features.h>
2406
#ifdef __GNU_LIBRARY__
2411
if (eval "$ac_cpp conftest.c") 2>&5 |
2412
egrep "yes" >/dev/null 2>&1; then
2414
ac_cv_gnu_extensions=yes
2416
ac_cv_gnu_extensions=no
2420
AC_MSG_RESULT($ac_cv_gnu_extensions)
2421
if test "$ac_cv_gnu_extensions" = "yes"; then
2422
AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2426
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2428
AC_MSG_CHECKING(whether $CXX supports -$1)
2429
kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
2430
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2434
save_CXXFLAGS="$CXXFLAGS"
2435
CXXFLAGS="$CXXFLAGS -$1"
2436
AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2437
CXXFLAGS="$save_CXXFLAGS"
2440
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2451
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2452
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2453
dnl it's all white-space separated
2454
AC_DEFUN(AC_REMOVE_FORBIDDEN,
2457
if test -n "$__val"; then
2463
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2464
*) # Careful to not add spaces, where there were none, because otherwise
2465
# libtool gets confused, if we change e.g. CXX
2466
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2474
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2475
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2477
if test "x$kde_use_qt_emb" != "xyes"; then
2478
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2479
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2481
AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2482
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2486
AC_DEFUN(AC_CHECK_COMPILERS,
2488
AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]],
2492
kde_use_debug_code="yes"
2493
kde_use_debug_define=no
2496
kde_use_debug_code="full"
2497
kde_use_debug_define=no
2500
kde_use_debug_code="no"
2501
kde_use_debug_define=yes
2505
[kde_use_debug_code="no"
2506
kde_use_debug_define=no
2509
dnl Just for configure --help
2510
AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2512
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2514
if test $enableval = "no"; then
2515
kde_use_strict_options="no"
2517
kde_use_strict_options="yes"
2519
], [kde_use_strict_options="no"])
2521
AC_ARG_ENABLE(warnings,[ --enable-warnings compiles with -Wall and similiar],
2523
if test $enableval = "no"; then
2524
kde_use_warnings="no"
2526
kde_use_warnings="yes"
2528
], [kde_use_warnings="no"])
2530
dnl enable warnings for debug build
2531
if test "$kde_use_debug_code" != "no"; then
2532
kde_use_warnings=yes
2535
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2536
[kde_use_profiling=$enableval],
2537
[kde_use_profiling="no"]
2540
dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2547
if test "$GCC" = "yes"; then
2548
if test "$kde_use_debug_code" != "no"; then
2549
if test $kde_use_debug_code = "full"; then
2550
CFLAGS="-g3 $CFLAGS"
2552
CFLAGS="-g -O2 $CFLAGS"
2555
CFLAGS="-O2 $CFLAGS"
2559
if test "$kde_use_debug_define" = "yes"; then
2560
CFLAGS="-DNDEBUG $CFLAGS"
2565
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2566
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2569
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2573
CXXFLAGS=" $CXXFLAGS"
2577
if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2578
if test "$kde_use_debug_code" != "no"; then
2579
if test "$CXX" = "KCC"; then
2580
CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2582
if test "$kde_use_debug_code" = "full"; then
2583
CXXFLAGS="-g3 $CXXFLAGS"
2585
CXXFLAGS="-g -O2 $CXXFLAGS"
2588
KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2590
dnl convenience compiler flags
2591
KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
2592
AC_SUBST(WOVERLOADED_VIRTUAL)
2594
if test "$CXX" = "KCC"; then
2595
CXXFLAGS="+K3 $CXXFLAGS"
2597
CXXFLAGS="-O2 $CXXFLAGS"
2602
if test "$kde_use_debug_define" = "yes"; then
2603
CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
2606
if test "$kde_use_profiling" = "yes"; then
2607
KDE_CHECK_COMPILER_FLAG(pg,
2609
CFLAGS="-pg $CFLAGS"
2610
CXXFLAGS="-pg $CXXFLAGS"
2614
if test "$kde_use_warnings" = "yes"; then
2615
if test "$GCC" = "yes"; then
2618
CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2619
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
2622
CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2623
KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
2624
KDE_CHECK_COMPILER_FLAG(Wbad-function-cast,[CXXFLAGS="-Wbad-function-cast $CXXFLAGS"])
2625
KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2626
KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2630
if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
2631
CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
2634
if test "$GXX" = "yes"; then
2635
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2636
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2637
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
2639
if test "$CXX" = "KCC"; then
2640
dnl unfortunately we currently cannot disable exception support in KCC
2641
dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
2642
dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
2643
dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
2645
AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]],
2647
kde_use_pch=$enableval
2650
if test "$kde_use_pch" = "yes"; then
2651
dnl TODO: support --pch-dir!
2652
KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
2653
dnl the below works (but the dir must exist), but it's
2654
dnl useless for a whole package.
2655
dnl The are precompiled headers for each source file, so when compiling
2656
dnl from scratch, it doesn't make a difference, and they take up
2657
dnl around ~5Mb _per_ sourcefile.
2658
dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
2659
dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
2661
dnl this flag controls inlining. by default KCC inlines in optimisation mode
2662
dnl all implementations that are defined inside the class {} declaration.
2663
dnl because of templates-compatibility with broken gcc compilers, this
2664
dnl can cause excessive inlining. This flag limits it to a sane level
2665
KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
2666
KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
2667
KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
2668
KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
2669
dnl Some source files are shared between multiple executables
2670
dnl (or libraries) and some of those need template instantiations.
2671
dnl In that case KCC needs to compile those sources with
2672
dnl --one_instantiation_per_object. To make it easy for us we compile
2673
dnl _all_ objects with that flag (--one_per is a shorthand).
2674
KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
2676
AC_SUBST(USE_EXCEPTIONS)
2677
dnl obsolete macro - provided to keep things going
2682
*-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
2683
*-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
2684
*-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
2686
if test "$GXX" = yes; then
2687
libstdcpp=`$CXX -print-file-name=libstdc++.so`
2688
if test ! -f $libstdcpp; then
2689
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])
2695
AC_VALIDIFY_CXXFLAGS
2699
# the following is to allow programs, that are known to
2700
# have problems when compiled with -O2
2701
if test -n "$CXXFLAGS"; then
2705
for i in $CXXFLAGS; do
2710
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
2717
if test -n "$CFLAGS"; then
2721
for i in $CFLAGS; do
2726
NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
2733
if test "x$kde_use_qt_emb" = "xyes"; then
2734
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS -fno-rtti -DQWS"
2737
AC_SUBST(NOOPT_CXXFLAGS)
2738
AC_SUBST(NOOPT_CFLAGS)
2742
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2745
AC_SUBST(KDE_CXXFLAGS)
2748
AC_DEFUN(KDE_ADD_DEPENDENCIES,
2750
[A]M_DEPENDENCIES(CC)
2751
[A]M_DEPENDENCIES(CXX)
2754
dnl just a wrapper to clean up configure.in
2755
AC_DEFUN(KDE_PROG_LIBTOOL,
2757
AC_REQUIRE([AC_CHECK_COMPILERS])
2758
AC_REQUIRE([AC_ENABLE_SHARED])
2759
AC_REQUIRE([AC_ENABLE_STATIC])
2761
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2772
LIBTOOL_SHELL="/bin/sh ./libtool"
2773
# LIBTOOL="$LIBTOOL --silent"
2774
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
2775
AC_SUBST(KDE_PLUGIN)
2777
AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps using objprelink (experimental [only tested on linux/386])],
2778
kde_use_objprelink=$enableval, kde_use_objprelink=no)
2779
if test "x$kde_use_objprelink" = "xyes"; then
2781
KDE_FIND_PATH(objprelink, OBJPRELINK, [], [kde_use_objprelink=no])
2783
if test "x$kde_use_objprelink" = "xyes"; then
2784
AC_MSG_CHECKING([Patching libtool to run objprelink.])
2785
mv libtool libtool.orig
2786
cat > libtool <<\EOF
2788
for n ; do case $n in
2789
*.o) test -r $n && echo objprelink $n && objprelink $n ;;
2790
*.lo) m=`basename $n .lo`".o" && test -r $m && echo objprelink $m && objprelink $m
2791
m=".libs/$m" && test -r $m && echo objprelink $m && objprelink $m ;;
2794
cat >> libtool libtool.orig
2802
AC_DEFUN(KDE_CHECK_TYPES,
2803
[ AC_CHECK_SIZEOF(int, 4)dnl
2804
AC_CHECK_SIZEOF(long, 4)dnl
2805
AC_CHECK_SIZEOF(char *, 4)dnl
2806
AC_CHECK_SIZEOF(char, 1)dnl
2809
AC_DEFUN(KDE_DO_IT_ALL,
2813
AM_INIT_AUTOMAKE($1, $2)
2814
AM_DISABLE_LIBRARIES
2815
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
2822
AC_DEFUN(AC_CHECK_RPATH,
2824
AC_MSG_CHECKING(for rpath)
2825
AC_ARG_ENABLE(rpath,
2826
[ --disable-rpath do not use the rpath feature of ld],
2827
USE_RPATH=$enableval, USE_RPATH=yes)
2829
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
2831
KDE_RPATH="-R \$(kde_libraries)"
2833
if test -n "$qt_libraries"; then
2834
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
2836
dnl $x_libraries is set to /usr/lib in case
2837
if test -n "$X_LDFLAGS"; then
2838
KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
2840
if test -n "$KDE_EXTRA_RPATH"; then
2841
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
2844
AC_SUBST(KDE_EXTRA_RPATH)
2846
AC_MSG_RESULT($USE_RPATH)
2849
dnl Check for the type of the third argument of getsockname
2850
AC_DEFUN(AC_CHECK_SOCKLEN_T, [
2851
AC_MSG_CHECKING(for socklen_t)
2852
AC_CACHE_VAL(ac_cv_socklen_t, [
2856
#include <sys/types.h>
2857
#include <sys/socket.h>
2860
getsockname(0,(struct sockaddr*)0, &a);
2862
ac_cv_socklen_t=socklen_t,
2864
#include <sys/types.h>
2865
#include <sys/socket.h>
2868
getsockname(0,(struct sockaddr*)0, &a);
2870
ac_cv_socklen_t=int,
2871
ac_cv_socklen_t=size_t
2877
AC_MSG_RESULT($ac_cv_socklen_t)
2878
if test "$ac_cv_socklen_t" != "socklen_t"; then
2879
AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
2880
[Define the real type of socklen_t])
2882
AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
2886
dnl This is a merge of some macros out of the gettext aclocal.m4
2887
dnl since we don't need anything, I took the things we need
2888
dnl the copyright for them is:
2890
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2891
dnl This Makefile.in is free software; the Free Software Foundation
2892
dnl gives unlimited permission to copy and/or distribute it,
2893
dnl with or without modifications, as long as this notice is preserved.
2895
dnl This program is distributed in the hope that it will be useful,
2896
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2897
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2898
dnl PARTICULAR PURPOSE.
2900
dnl for this file it is relicensed under LGPL
2902
AC_DEFUN(AM_KDE_WITH_NLS,
2904
dnl If we use NLS figure out what method
2906
AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
2907
[test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
2908
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2910
if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
2911
AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
2918
AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
2919
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2921
dnl Test whether we really found GNU xgettext.
2922
if test "$XGETTEXT" != ":"; then
2923
dnl If it is no GNU xgettext we define it as : so that the
2924
dnl Makefiles still can work.
2925
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2929
[found xgettext programs is not GNU xgettext; ignore it])
2937
# Search path for a program which passes the given test.
2938
# Ulrich Drepper <drepper@cygnus.com>, 1996.
2941
# Stephan Kulow: I appended a _KDE against name conflicts
2943
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
2944
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2945
AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
2946
[# Extract the first word of "$2", so it can be a program name with args.
2947
set dummy $2; ac_word=[$]2
2948
AC_MSG_CHECKING([for $ac_word])
2949
AC_CACHE_VAL(ac_cv_path_$1,
2952
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2955
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2956
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2957
test -z "$ac_dir" && ac_dir=.
2958
if test -f $ac_dir/$ac_word; then
2960
ac_cv_path_$1="$ac_dir/$ac_word"
2966
dnl If no 4th arg is given, leave the cache variable unset,
2967
dnl so AC_PATH_PROGS will keep looking.
2968
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2973
if test -n "[$]$1"; then
2974
AC_MSG_RESULT([$]$1)
2982
# Check whether LC_MESSAGES is available in <locale.h>.
2983
# Ulrich Drepper <drepper@cygnus.com>, 1995.
2987
AC_DEFUN(AM_LC_MESSAGES,
2988
[if test $ac_cv_header_locale_h = yes; then
2989
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2990
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2991
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2992
if test $am_cv_val_LC_MESSAGES = yes; then
2993
AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
2997
dnl From Jim Meyering.
2998
dnl FIXME: migrate into libit.
3000
AC_DEFUN([AM_FUNC_OBSTACK],
3001
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3002
[AC_TRY_LINK([#include "obstack.h"],
3003
[struct obstack *mem;obstack_free(mem,(char *) 0)],
3004
am_cv_func_obstack=yes,
3005
am_cv_func_obstack=no)])
3006
if test $am_cv_func_obstack = yes; then
3007
AC_DEFINE(HAVE_OBSTACK)
3009
LIBOBJS="$LIBOBJS obstack.o"
3013
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3014
dnl FIXME: Migrate into libit
3016
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3017
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3018
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3019
am_cv_lib_error_at_line=yes,
3020
am_cv_lib_error_at_line=no)])
3021
if test $am_cv_lib_error_at_line = no; then
3022
LIBOBJS="$LIBOBJS error.o"
3024
AC_SUBST(LIBOBJS)dnl
3027
# Macro to add for using GNU gettext.
3028
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3031
# Stephan Kulow: I put a KDE in it to avoid name conflicts
3033
AC_DEFUN(AM_KDE_GNU_GETTEXT,
3034
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3035
AC_REQUIRE([AC_PROG_RANLIB])dnl
3036
AC_REQUIRE([AC_HEADER_STDC])dnl
3037
AC_REQUIRE([AC_TYPE_OFF_T])dnl
3038
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3039
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3040
AC_REQUIRE([AC_FUNC_MMAP])dnl
3041
AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3042
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
3043
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
3044
__argz_count __argz_stringify __argz_next])
3046
AC_MSG_CHECKING(for stpcpy)
3047
AC_CACHE_VAL(kde_cv_func_stpcpy,
3049
kde_safe_cxxflags=$CXXFLAGS
3050
CXXFLAGS="-Wmissing-prototypes -Werror"
3058
stpcpy(buffer, buffer);
3060
kde_cv_func_stpcpy=yes,
3061
kde_cv_func_stpcpy=no)
3063
CXXFLAGS=$kde_safe_cxxflags
3065
AC_MSG_RESULT($kde_cv_func_stpcpy)
3066
if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3067
AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3072
if test "x$CATOBJEXT" != "x"; then
3073
if test "x$ALL_LINGUAS" = "x"; then
3076
AC_MSG_CHECKING(for catalogs to be installed)
3078
for lang in ${LINGUAS=$ALL_LINGUAS}; do
3079
case "$ALL_LINGUAS" in
3080
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3083
LINGUAS=$NEW_LINGUAS
3084
AC_MSG_RESULT($LINGUAS)
3087
dnl Construct list of names of catalog files to be constructed.
3088
if test -n "$LINGUAS"; then
3089
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3095
AC_DEFUN(AC_HAVE_XPM,
3096
[AC_REQUIRE_CPP()dnl
3097
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3099
test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3100
test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3102
AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
3103
xpm_test=$withval, xpm_test="yes")
3104
if test "x$xpm_test" = xno; then
3107
AC_MSG_CHECKING(for XPM)
3108
AC_CACHE_VAL(ac_cv_have_xpm,
3111
ac_save_ldflags="$LDFLAGS"
3112
ac_save_cflags="$CFLAGS"
3113
if test "x$kde_use_qt_emb" != "xyes"; then
3114
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3116
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3118
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3119
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3120
AC_TRY_LINK([#include <X11/xpm.h>],[],
3121
ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3122
LDFLAGS="$ac_save_ldflags"
3123
CFLAGS="$ac_save_cflags"
3126
if test "$ac_cv_have_xpm" = no; then
3132
AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3133
if test "$XPM_LDFLAGS" = ""; then
3134
XPMLIB='-lXpm $(LIB_X11)'
3136
XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3138
if test "$XPM_INCLUDE" = ""; then
3141
XPMINC="-I$XPM_INCLUDE"
3151
AC_DEFUN(AC_HAVE_DPMS,
3152
[AC_REQUIRE_CPP()dnl
3153
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3155
test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3156
test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3159
AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
3160
dpms_test=$withval, dpms_test="yes")
3161
if test "x$dpms_test" = xno; then
3164
AC_MSG_CHECKING(for DPMS)
3165
dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3166
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3167
AC_CACHE_VAL(ac_cv_have_dpms,
3169
if test "x$kde_use_qt_emb" = "xyes"; then
3171
ac_cv_have_dpms="no"
3174
ac_save_ldflags="$LDFLAGS"
3175
ac_save_cflags="$CFLAGS"
3176
ac_save_libs="$LIBS"
3177
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3178
CFLAGS="$CFLAGS $X_INCLUDES"
3179
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3181
#include <X11/Xproto.h>
3183
#include <X11/Xlib.h>
3184
#include <X11/extensions/dpms.h>
3186
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3187
ac_cv_have_dpms="yes", [
3188
LDFLAGS="$ac_save_ldflags"
3189
CFLAGS="$ac_save_cflags"
3190
LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3191
LIBS="$LIBS -lXdpms"
3192
CFLAGS="$CFLAGS $X_INCLUDES"
3193
test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3195
#include <X11/Xproto.h>
3197
#include <X11/Xlib.h>
3198
#include <X11/extensions/dpms.h>
3200
{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3202
ac_cv_have_dpms="-lXdpms"
3203
],ac_cv_have_dpms="no")
3205
LDFLAGS="$ac_save_ldflags"
3206
CFLAGS="$ac_save_cflags"
3207
LIBS="$ac_save_libs"
3211
if test "$ac_cv_have_dpms" = no; then
3217
AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3218
if test "$ac_cv_have_dpms" = "-lXdpms"; then
3221
if test "$DPMS_LDFLAGS" = ""; then
3222
DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3224
DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3226
if test "$DPMS_INCLUDE" = ""; then
3229
DPMSINC="-I$DPMS_INCLUDE"
3239
AC_DEFUN(AC_HAVE_GL,
3240
[AC_REQUIRE_CPP()dnl
3241
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3243
test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3244
test -z "$GL_INCLUDE" && GL_INCLUDE=
3246
AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
3247
gl_test=$withval, gl_test="yes")
3248
if test "x$kde_use_qt_emb" = "xyes"; then
3249
# GL and Qt Embedded is a no-go for now.
3251
elif test "x$gl_test" = xno; then
3254
AC_MSG_CHECKING(for GL)
3255
AC_CACHE_VAL(ac_cv_have_gl,
3258
ac_save_ldflags="$LDFLAGS"
3259
ac_save_cflags="$CFLAGS"
3260
LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3261
test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3262
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3263
CFLAGS="$CFLAGS $X_INCLUDES"
3264
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3265
AC_TRY_LINK([#include <GL/gl.h>
3268
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3269
if test "x$ac_cv_have_gl" = "xno"; then
3270
LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU"
3271
test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3272
LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3273
CFLAGS="$ac_save_cflags $X_INCLUDES"
3274
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3275
AC_TRY_LINK([#include <GL/gl.h>
3278
ac_cv_have_gl="yes", ac_cv_have_gl="no")
3280
LDFLAGS="$ac_save_ldflags"
3281
CFLAGS="$ac_save_cflags"
3284
if test "$ac_cv_have_gl" = "no"; then
3290
AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3291
if test "$GL_LDFLAGS" = ""; then
3292
if test "$ac_cv_have_gl" = "mesa"; then
3293
GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
3295
GLLIB='-lGL -lGLU $(LIB_X11)'
3298
if test "$ac_cv_have_gl" = "mesa"; then
3299
GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
3301
GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
3304
if test "$GL_INCLUDE" = ""; then
3307
GLINC="-I$GL_INCLUDE"
3309
AC_MSG_RESULT($ac_cv_have_gl)
3318
dnl shadow password and PAM magic - maintained by ossi@kde.org
3321
AC_REQUIRE([KDE_CHECK_LIBDL])
3324
[ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
3325
[ if test "x$withval" = "xyes"; then
3328
elif test "x$withval" = "xno"; then
3332
pam_service=$withval
3334
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3336
AC_CACHE_VAL(ac_cv_path_pam,
3338
AC_CHECK_LIB(pam, pam_start,
3339
[ AC_CHECK_HEADER(security/pam_appl.h,
3343
ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3346
eval "$ac_cv_path_pam"
3348
AC_MSG_CHECKING(for PAM)
3349
if test "x$use_pam" = xno; then
3354
AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3355
PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3357
dnl test whether struct pam_message is const (Linux) or not (Sun)
3358
AC_MSG_CHECKING(for const pam_message)
3359
AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
3360
[ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
3361
[AC_MSG_RESULT([const: Linux-type PAM])],
3362
[AC_MSG_RESULT([nonconst: Sun-type PAM])
3363
AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3365
[AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3371
dnl DEF_PAM_SERVICE(arg name, full name, define name)
3372
AC_DEFUN(DEF_PAM_SERVICE, [
3374
[ --with-$1-pam=[val] override PAM service from --with-pam for $2],
3375
[ if test "x$use_pam" = xyes; then
3376
$3_PAM_SERVICE="$withval"
3378
AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3379
You may want to enforce it by using --with-pam.])
3382
[ if test "x$use_pam" = xyes; then
3383
$3_PAM_SERVICE="$pam_service"
3386
if test -n "$$3_PAM_SERVICE"; then
3387
AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3388
AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3390
AC_SUBST($3_PAM_SERVICE)
3393
AC_DEFUN(KDE_SHADOWPASSWD, [
3394
AC_REQUIRE([KDE_PAM])
3396
AC_CHECK_LIB(shadow, getspent,
3397
[ LIBSHADOW="-lshadow"
3401
AC_CHECK_LIB(gen, getspent,
3405
[ AC_CHECK_FUNC(getspent,
3406
[ ac_use_shadow=yes ],
3407
[ ac_use_shadow=no ])
3413
AC_MSG_CHECKING([for shadow passwords])
3416
[ --with-shadow If you want shadow password support ],
3417
[ if test "x$withval" != "xno"; then
3423
use_shadow="$ac_use_shadow"
3426
if test "x$use_shadow" = xyes; then
3428
AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3435
dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3436
dnl this still applies, if we could use it indirectly through pam.
3437
if test "x$use_shadow" = xyes ||
3438
( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3440
*-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3441
SETUIDFLAGS="-m 4755 -o root";;
3443
SETUIDFLAGS="-m 4755";;
3446
AC_SUBST(SETUIDFLAGS)
3450
AC_DEFUN(KDE_PASSWDLIBS, [
3451
AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3452
AC_REQUIRE([KDE_PAM])
3453
AC_REQUIRE([KDE_SHADOWPASSWD])
3455
if test "x$use_pam" = "xyes"; then
3456
PASSWDLIBS="$PAMLIBS"
3458
PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3461
dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3462
dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
3463
dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3464
dnl may need to read /etc/master.passwd).
3467
SETUIDFLAGS="-m 4755 -o root"
3473
AC_SUBST(PASSWDLIBS)
3476
AC_DEFUN(KDE_CHECK_LIBDL,
3478
AC_CHECK_LIB(dl, dlopen, [
3480
ac_cv_have_dlfcn=yes
3483
AC_CHECK_LIB(dld, shl_unload, [
3485
ac_cv_have_shload=yes
3491
AC_DEFUN(KDE_CHECK_DLOPEN,
3494
AC_CHECK_HEADERS(dlfcn.h dl.h)
3495
if test "$ac_cv_header_dlfcn_h" = "no"; then
3499
if test "$ac_cv_header_dl_h" = "no"; then
3500
ac_cv_have_shload=no
3503
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3505
AC_ARG_ENABLE(dlopen,
3506
[ --disable-dlopen link statically [default=no]] ,
3507
enable_dlopen=$enableval,
3510
# override the user's opinion, if we know it better ;)
3511
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3515
if test "$ac_cv_have_dlfcn" = "yes"; then
3516
AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3519
if test "$ac_cv_have_shload" = "yes"; then
3520
AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3523
if test "$enable_dlopen" = no ; then
3524
test -n "$1" && eval $1
3526
test -n "$2" && eval $2
3531
AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3533
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3535
AC_MSG_CHECKING([dynamic loading])
3536
eval "`egrep '^build_libtool_libs=' libtool`"
3537
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3539
AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3543
AC_MSG_RESULT($dynamic_loading)
3544
if test "$dynamic_loading" = "yes"; then
3551
AC_DEFUN(KDE_ADD_INCLUDES,
3553
if test -z "$1"; then
3554
test_include="Pix.h"
3559
AC_MSG_CHECKING([for libg++ ($test_include)])
3561
AC_CACHE_VAL(kde_cv_libgpp_includes,
3563
kde_cv_libgpp_includes=no
3569
/usr/unsupported/include \
3574
if test -r "$ac_dir/$test_include"; then
3575
kde_cv_libgpp_includes=$ac_dir
3581
AC_MSG_RESULT($kde_cv_libgpp_includes)
3582
if test "$kde_cv_libgpp_includes" != "no"; then
3583
all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3589
AC_DEFUN(KDE_CHECK_MICO,
3591
AC_REQUIRE([KDE_CHECK_LIBDL])
3592
AC_REQUIRE([KDE_MISC_TESTS])
3593
AC_MSG_CHECKING(for MICO)
3595
if test -z "$MICODIR"; then
3596
kde_micodir=/usr/local
3598
kde_micodir="$MICODIR"
3601
AC_ARG_WITH(micodir,
3602
[ --with-micodir=micodir where mico is installed ],
3603
kde_micodir=$withval,
3604
kde_micodir=$kde_micodir
3607
AC_CACHE_VAL(kde_cv_mico_incdir,
3609
mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3610
AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3613
kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3615
if test ! -r $kde_micodir/include/CORBA.h; then
3616
AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3619
AC_MSG_RESULT($kde_micodir)
3621
MICO_INCLUDES=-I$kde_micodir/include
3622
AC_SUBST(MICO_INCLUDES)
3623
MICO_LDFLAGS=-L$kde_micodir/lib
3624
AC_SUBST(MICO_LDFLAGS)
3625
micodir=$kde_micodir
3628
AC_MSG_CHECKING([for MICO version])
3629
AC_CACHE_VAL(kde_cv_mico_version,
3632
cat >conftest.$ac_ext <<EOF
3634
#include <mico/version.h>
3637
printf("MICO_VERSION=%s\n",MICO_VERSION);
3641
ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3642
if AC_TRY_EVAL(ac_compile); then
3643
if eval `./conftest 2>&5`; then
3644
kde_cv_mico_version=$MICO_VERSION
3646
AC_MSG_ERROR([your system is not able to execute a small application to
3647
find MICO version! Check $kde_micodir/include/mico/version.h])
3650
AC_MSG_ERROR([your system is not able to compile a small application to
3651
find MICO version! Check $kde_micodir/include/mico/version.h])
3655
dnl installed MICO version
3656
mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3657
mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3658
mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3660
if test "x$1" = "x"; then
3666
dnl required MICO version
3667
req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3668
req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3669
req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3671
if test "$mico_v_maj" -lt "$req_v_maj" || \
3672
( test "$mico_v_maj" -eq "$req_v_maj" && \
3673
test "$mico_v_mid" -lt "$req_v_mid" ) || \
3674
( test "$mico_v_mid" -eq "$req_v_mid" && \
3675
test "$mico_v_min" -lt "$req_v_min" )
3678
AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3679
at least is required. You should upgrade MICO.])
3681
AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3684
LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3686
if test -z "$IDL"; then
3687
IDL='$(kde_bindir)/cuteidl'
3690
IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3691
AC_SUBST(IDL_DEPENDENCIES)
3693
idldir="\$(includedir)/idl"
3698
AC_DEFUN(KDE_CHECK_MINI_STL,
3700
AC_REQUIRE([KDE_CHECK_MICO])
3702
AC_MSG_CHECKING(if we use mico's mini-STL)
3703
AC_CACHE_VAL(kde_cv_have_mini_stl,
3707
kde_save_cxxflags="$CXXFLAGS"
3708
CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3711
#include <mico/config.h>
3714
#ifdef HAVE_MINI_STL
3718
kde_cv_have_mini_stl=no,
3719
kde_cv_have_mini_stl=yes)
3720
CXXFLAGS="$kde_save_cxxflags"
3724
if test "x$kde_cv_have_mini_stl" = "xyes"; then
3736
AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3738
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3739
AC_SUBST(LIBPTHREAD)
3742
AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3744
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3745
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3747
if test "$kde_use_kernthreads" = "yes"; then
3748
ac_save_CXXFLAGS="$CXXFLAGS"
3749
ac_save_CFLAGS="$CFLAGS"
3750
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3751
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3752
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3753
CXXFLAGS="$ac_save_CXXFLAGS"
3754
CFLAGS="$ac_save_CFLAGS"
3755
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3756
kde_use_kernthreads=no
3758
dnl Add proper -I and -l statements
3759
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3760
if test "x$LIBPTHREAD" = "x"; then
3761
kde_use_kernthreads=no
3763
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3768
if test -z "$LIBPTHREAD"; then
3769
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3775
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3776
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3779
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3782
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3783
LIBPTHREAD="$LIBPTHREAD -lc_r"
3785
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3786
if test "$CXX" = "KCC"; then
3787
CXXFLAGS="$CXXFLAGS --thread_safe"
3788
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
3794
AC_SUBST(USE_THREADS)
3795
AC_SUBST(LIBPTHREAD)
3798
AC_DEFUN(KDE_CHECK_THREADING,
3800
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3801
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
3802
dnl default is yes if libpthread is found and no if no libpthread is available
3803
if test -z "$LIBPTHREAD"; then
3804
if test -z "$USE_THREADS"; then
3805
kde_check_threading_default=no
3807
kde_check_threading_default=yes
3810
kde_check_threading_default=yes
3812
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
3813
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
3814
if test "x$kde_use_threading" = "xyes"; then
3815
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
3819
AC_DEFUN(KDE_TRY_LINK_PYTHON,
3821
if test "$kde_python_link_found" = no; then
3823
if test "$1" = normal; then
3824
AC_MSG_CHECKING(if a Python application links)
3826
AC_MSG_CHECKING(if Python depends on $2)
3829
AC_CACHE_VAL(kde_cv_try_link_python_$1,
3833
kde_save_cflags="$CFLAGS"
3834
CFLAGS="$CFLAGS $PYTHONINC"
3835
kde_save_libs="$LIBS"
3836
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
3837
kde_save_ldflags="$LDFLAGS"
3838
LDFLAGS="$LDFLAGS $PYTHONLIB"
3844
PySys_SetArgv(1, 0);
3846
[kde_cv_try_link_python_$1=yes],
3847
[kde_cv_try_link_python_$1=no]
3849
CFLAGS="$kde_save_cflags"
3850
LIBS="$kde_save_libs"
3851
LDFLAGS="$kde_save_ldflags"
3854
if test "$kde_cv_try_link_python_$1" = "yes"; then
3856
kde_python_link_found=yes
3857
if test ! "$1" = normal; then
3858
LIBPYTHON="$LIBPYTHON $2"
3871
AC_DEFUN(KDE_CHECK_PYTHON_DIR,
3873
AC_MSG_CHECKING([for Python directory])
3875
AC_CACHE_VAL(kde_cv_pythondir,
3877
if test -z "$PYTHONDIR"; then
3878
kde_cv_pythondir=/usr/local
3880
kde_cv_pythondir="$PYTHONDIR"
3884
AC_ARG_WITH(pythondir,
3885
[ --with-pythondir=pythondir use python installed in pythondir ],
3887
ac_python_dir=$withval
3888
], ac_python_dir=$kde_cv_pythondir
3891
AC_MSG_RESULT($ac_python_dir)
3894
AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
3896
AC_REQUIRE([KDE_CHECK_LIBDL])
3897
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3898
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
3900
if test -z "$1"; then
3906
AC_MSG_CHECKING([for Python$version])
3908
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
3909
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
3910
if test ! -r $python_incdir/Python.h; then
3911
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
3912
python_incdir=$python_incdir/python$version
3913
if test ! -r $python_incdir/Python.h; then
3918
PYTHONINC=-I$python_incdir
3920
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3921
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
3922
if test ! -r $python_libdir/libpython$version.a; then
3923
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
3924
python_libdir=$python_libdir/python$version/config
3925
if test ! -r $python_libdir/libpython$version.a; then
3930
PYTHONLIB=-L$python_libdir
3931
kde_orig_LIBPYTHON=$LIBPYTHON
3932
if test -z "$LIBPYTHON"; then
3933
LIBPYTHON=-lpython$version
3936
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
3937
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
3938
python_moddir=$python_moddir/python$version
3939
if test ! -r $python_moddir/copy.py; then
3943
PYTHONMODDIR=$python_moddir
3945
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
3947
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
3948
LIBPYTHON=$kde_orig_LIBPYTHON
3949
test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
3950
test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
3953
dnl Note: this test is very weak
3954
kde_python_link_found=no
3955
KDE_TRY_LINK_PYTHON(normal)
3956
KDE_TRY_LINK_PYTHON(m, -lm)
3957
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
3958
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
3959
KDE_TRY_LINK_PYTHON(db2, -ldb2)
3960
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
3961
KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
3962
KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
3963
KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
3964
KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
3965
KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
3966
KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
3967
[AC_MSG_WARN([it seems, Python depends on another library.
3968
Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
3969
and contact the authors to let them know about this problem])
3972
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
3976
AC_SUBST(PYTHONMODDIR)
3977
AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
3983
AC_DEFUN(KDE_CHECK_PYTHON,
3985
KDE_CHECK_PYTHON_INTERN("2.2",
3986
[KDE_CHECK_PYTHON_INTERN("2.1",
3987
[KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
3991
AC_DEFUN(KDE_CHECK_STL_SGI,
3993
AC_MSG_CHECKING([if STL implementation is SGI like])
3994
AC_CACHE_VAL(kde_cv_stl_type_sgi,
3998
using namespace std;
4000
string astring="Hallo Welt.";
4001
astring.erase(0, 6); // now astring is "Welt"
4003
], kde_cv_stl_type_sgi=yes,
4004
kde_cv_stl_type_sgi=no)
4007
AC_MSG_RESULT($kde_cv_stl_type_sgi)
4009
if test "$kde_cv_stl_type_sgi" = "yes"; then
4010
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4014
AC_DEFUN(KDE_CHECK_STL_HP,
4016
AC_MSG_CHECKING([if STL implementation is HP like])
4017
AC_CACHE_VAL(kde_cv_stl_type_hp,
4021
using namespace std;
4023
string astring="Hello World";
4024
astring.remove(0, 6); // now astring is "World"
4026
], kde_cv_stl_type_hp=yes,
4027
kde_cv_stl_type_hp=no)
4029
AC_MSG_RESULT($kde_cv_stl_type_hp)
4031
if test "$kde_cv_stl_type_hp" = "yes"; then
4032
AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
4036
AC_DEFUN(KDE_CHECK_STL,
4040
ac_save_CXXFLAGS="$CXXFLAGS"
4041
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4044
if test "$kde_cv_stl_type_sgi" = "no"; then
4047
if test "$kde_cv_stl_type_hp" = "no"; then
4048
AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
4052
CXXFLAGS="$ac_save_CXXFLAGS"
4056
AC_DEFUN(AC_FIND_QIMGIO,
4057
[AC_REQUIRE([AC_FIND_JPEG])
4058
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4059
AC_MSG_CHECKING([for qimgio])
4060
AC_CACHE_VAL(ac_cv_lib_qimgio,
4064
ac_save_LIBS="$LIBS"
4065
ac_save_CXXFLAGS="$CXXFLAGS"
4066
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4067
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4070
#include <qimageio.h>
4071
#include <qstring.h>
4073
QString t = "hallo";
4078
ac_cv_lib_qimgio=yes,
4079
ac_cv_lib_qimgio=no,
4080
ac_cv_lib_qimgio=no)
4081
LIBS="$ac_save_LIBS"
4082
CXXFLAGS="$ac_save_CXXFLAGS"
4085
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4086
LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4088
AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4091
AC_MSG_RESULT(not found)
4095
AC_DEFUN(KDE_CHECK_ANSI,
4099
AC_DEFUN(KDE_CHECK_INSURE,
4101
AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
4103
if test $enableval = "no"; dnl
4104
then ac_use_insure="no"
4105
else ac_use_insure="yes"
4107
], [ac_use_insure="no"])
4109
AC_MSG_CHECKING(if we will use Insure++ to debug)
4110
AC_MSG_RESULT($ac_use_insure)
4111
if test "$ac_use_insure" = "yes"; dnl
4112
then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
4116
AC_DEFUN(AM_DISABLE_LIBRARIES,
4118
AC_PROVIDE([AM_ENABLE_STATIC])
4119
AC_PROVIDE([AM_ENABLE_SHARED])
4125
AC_DEFUN(AC_CHECK_UTMP_FILE,
4127
AC_MSG_CHECKING([for utmp file])
4129
AC_CACHE_VAL(kde_cv_utmp_file,
4140
if test -r "$ac_file"; then
4141
kde_cv_utmp_file=$ac_file
4147
if test "$kde_cv_utmp_file" != "no"; then
4148
AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4150
AC_MSG_RESULT($kde_cv_utmp_file)
4153
AC_MSG_RESULT([non found])
4158
AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
4161
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4163
if test ! -s $srcdir/subdirs; then
4164
dnl Note: Makefile.common creates subdirs, so this is just a fallback
4166
files=`cd $srcdir && ls -1`
4167
dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4169
echo $i >> $srcdir/subdirs
4173
if test -s $srcdir/inst-apps; then
4174
ac_topsubdirs="`cat $srcdir/inst-apps`"
4176
ac_topsubdirs="`cat $srcdir/subdirs`"
4179
for i in $ac_topsubdirs; do
4180
AC_MSG_CHECKING([if $i should be compiled])
4181
if test -d $srcdir/$i; then
4183
for j in $DO_NOT_COMPILE; do
4184
if test $i = $j; then
4191
AC_MSG_RESULT($install_it)
4192
if test $install_it = "yes"; then
4193
TOPSUBDIRS="$TOPSUBDIRS $i"
4197
AC_SUBST(TOPSUBDIRS)
4200
AC_DEFUN(KDE_CHECK_NAMESPACES,
4202
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4216
int Foo::Bar::i = 1;
4219
AC_DEFINE(HAVE_NAMESPACES)
4226
AC_DEFUN(KDE_CHECK_NEWLIBS,
4231
dnl ------------------------------------------------------------------------
4232
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4233
dnl ------------------------------------------------------------------------
4235
AC_DEFUN(AC_CHECK_S_ISSOCK,
4237
AC_MSG_CHECKING(for S_ISSOCK)
4238
AC_CACHE_VAL(ac_cv_have_s_issock,
4244
#include <sys/stat.h>
4248
int b = S_ISSOCK( buff.st_mode );
4250
ac_cv_have_s_issock=yes,
4251
ac_cv_have_s_issock=no)
4254
AC_MSG_RESULT($ac_cv_have_s_issock)
4255
if test "$ac_cv_have_s_issock" = "yes"; then
4256
AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4260
dnl ------------------------------------------------------------------------
4261
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4262
dnl ------------------------------------------------------------------------
4264
AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
4266
AC_MSG_CHECKING(for MAXPATHLEN)
4267
AC_CACHE_VAL(ac_cv_maxpathlen,
4270
cat > conftest.$ac_ext <<EOF
4272
# include <stdlib.h>
4275
#include <sys/param.h>
4277
#define MAXPATHLEN 1024
4280
KDE_HELLO MAXPATHLEN
4284
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4286
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4287
ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4289
ac_cv_maxpathlen=1024
4295
AC_MSG_RESULT($ac_cv_maxpathlen)
4296
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4299
dnl -------------------------------------------------------------------------
4300
dnl See if the compiler supports a template repository bero@redhat.de
4301
dnl -------------------------------------------------------------------------
4302
AC_DEFUN(KDE_COMPILER_REPO,
4307
KDE_CHECK_COMPILER_FLAG(frepo,
4313
if test -z "$REPO"; then
4314
KDE_CHECK_COMPILER_FLAG(instances=explicit,
4316
REPO="-instances=explicit"
4317
NOREPO="-instances=extern"
4321
if test -n "$REPO"; then
4322
AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
4323
[C++ compiler supports template repository])
4331
AC_DEFUN(KDE_CHECK_HEADER,
4334
kde_safe_cppflags=$CPPFLAGS
4335
CPPFLAGS="$CPPFLAGS $all_includes"
4337
AC_CHECK_HEADER($1, $2, $3)
4338
CPPFLAGS=$kde_safe_cppflags
4342
AC_DEFUN(KDE_FAST_CONFIGURE,
4344
dnl makes configure fast (needs perl)
4345
AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
4346
with_fast_perl=$enableval, with_fast_perl=yes)
4349
AC_DEFUN(KDE_CONF_FILES,
4352
if test -f $srcdir/configure.files ; then
4353
val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4356
if test -n "$val" ; then
4358
CONF_FILES="$CONF_FILES $i"
4361
AC_SUBST(CONF_FILES)
4364
AC_DEFUN(KDE_SET_PREFIX,
4367
dnl make $KDEDIR the default for the installation
4368
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4370
if test "x$prefix" = "xNONE"; then
4371
prefix=$ac_default_prefix
4372
ac_configure_args="$ac_configure_args --prefix=$prefix"
4378
pushdef([AC_PROG_INSTALL],
4380
dnl our own version, testing for a -p flag
4381
popdef([AC_PROG_INSTALL])
4382
dnl as AC_PROG_INSTALL works as it works we first have
4383
dnl to save if the user didn't specify INSTALL, as the
4384
dnl autoconf one overwrites INSTALL and we have no chance to find
4386
test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4387
test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4388
test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4391
if test -z "$kde_save_INSTALL_given" ; then
4392
# OK, user hasn't given any INSTALL, autoconf found one for us
4393
# now we test, if it supports the -p flag
4394
AC_MSG_CHECKING(for -p flag to install)
4395
rm -f confinst.$$.* > /dev/null 2>&1
4396
echo "Testtest" > confinst.$$.orig
4398
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4399
if test -f confinst.$$.new ; then
4400
# OK, -p seems to do no harm to install
4401
INSTALL="${INSTALL} -p"
4406
AC_MSG_RESULT($ac_res)
4408
dnl the following tries to resolve some signs and wonders coming up
4409
dnl with different autoconf/automake versions
4411
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4412
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4413
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4414
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4415
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4416
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
4417
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4418
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
4419
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
4420
dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4421
dnl automake (due to broken Makefile.am or whatever) to install programs,
4422
dnl and so does not see the -s flag in automake > 1.4
4423
dnl to clean up that mess we:
4424
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4425
dnl which cleans KDE's program with automake > 1.4;
4426
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4427
dnl with automake<=1.4
4428
dnl note that dues to this sometimes two '-s' flags are used (if KDE
4429
dnl properly uses install-@DIR@PROGRAMS, but I don't care
4431
dnl And to all this comes, that I even can't write in comments variable
4432
dnl names used by automake, because it is so stupid to think I wanted to
4433
dnl _use_ them, therefor I have written A_M_... instead of AM_
4434
dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4436
if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4437
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4439
if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4440
INSTALL_SCRIPT='${INSTALL}'
4444
AC_DEFUN(KDE_LANG_CPLUSPLUS,
4446
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4447
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4450
pushdef([AC_LANG_CPLUSPLUS],
4451
[popdef([AC_LANG_CPLUSPLUS])
4455
AC_DEFUN(KDE_CHECK_LONG_LONG,
4457
AC_MSG_CHECKING(for long long)
4458
AC_CACHE_VAL(kde_cv_c_long_long,
4466
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4469
AC_MSG_RESULT($kde_cv_c_long_long)
4470
if test "$kde_cv_c_long_long" = yes; then
4471
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4475
AC_DEFUN(KDE_CHECK_LIB,
4477
kde_save_LDFLAGS="$LDFLAGS"
4478
dnl AC_CHECK_LIB modifies LIBS, so save it here
4479
kde_save_LIBS="$LIBS"
4480
LDFLAGS="$LDFLAGS $all_libraries"
4482
aix*) LDFLAGS="-brtl $LDFLAGS"
4483
test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4486
AC_CHECK_LIB($1, $2, $3, $4, $5)
4487
LDFLAGS="$kde_save_LDFLAGS"
4488
LIBS="$kde_save_LIBS"
4494
AC_DEFUN(KDE_CHECK_INITGROUPS,
4496
AC_REQUIRE([AC_CANONICAL_HOST])
4497
AC_CHECK_FUNCS(initgroups)
4498
if test "x$ac_cv_func_initgroups" = "xyes"; then
4502
AC_MSG_CHECKING([for initgroups prototype])
4503
AC_CACHE_VAL(kde_cv_check_initgroups_proto,
4509
int x = initgroups(buffer,id);
4511
kde_cv_check_initgroups_proto=yes,
4512
kde_cv_check_initgroups_proto=no)
4514
AC_MSG_RESULT($kde_cv_check_initgroups_proto)
4518
kde_cv_check_initgroups_proto=yes
4522
kde_cv_check_initgroups_proto=no
4524
if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
4525
kde_check_initgroups_proto=1
4527
kde_check_initgroups_proto=0
4529
AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
4530
[initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
4534
AC_DEFUN(KDE_CHECK_JAVA_DIR,
4536
AC_MSG_CHECKING([for Java directory])
4539
[ --with-java=javadir use java installed in javadir, --without-java disables ],
4540
[ ac_java_dir=$withval
4544
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4545
if test "x$ac_java_dir" = "xno"; then
4546
kde_cv_java_bindir=no
4547
kde_cv_java_includedir=no
4548
kde_java_libjvmdir=no
4549
kde_java_libhpidir=no
4551
if test "x$ac_java_dir" = "x"; then
4552
dnl No option set -> look in $PATH
4553
AC_CACHE_VAL(kde_cv_java_bindir,
4555
dnl First look for javac in $PATH. If not found we'll look at the option.
4556
KDE_FIND_PATH(javac, JAVAC, [], [])
4557
if test -n "$JAVAC"; then
4558
kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
4559
dnl this substitution might not work - well, we test for jni.h below
4560
kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
4562
kde_cv_java_bindir=no
4566
dnl config option set
4567
kde_cv_java_bindir=$ac_java_dir/bin
4568
kde_cv_java_includedir=$ac_java_dir/include
4572
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
4573
if test "x$kde_cv_java_bindir" != "xno"; then
4575
dnl Look for libjvm.so
4576
kde_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4577
dnl Look for libhpi.so and avoid green threads
4578
kde_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
4580
dnl Now check everything's fine under there
4582
if test ! -x "$kde_cv_java_bindir/javac"; then
4583
AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
4585
if test ! -x "$kde_cv_java_bindir/javah"; then
4586
AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4588
if test ! -x "$kde_cv_java_bindir/jar"; then
4589
AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4591
if test ! -r "$kde_cv_java_includedir/jni.h"; then
4592
AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
4594
if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
4595
AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
4597
if test ! -r "$kde_java_libhpidir/libhpi.so"; then
4598
AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
4601
jni_includes="-I$kde_cv_java_includedir"
4602
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4603
dnl and under linux here..
4604
test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
4605
test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
4607
dnl Check for JNI version
4610
ac_cxxflags_safe="$CXXFLAGS"
4611
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4617
#ifndef JNI_VERSION_1_2
4620
],[ kde_jni_works=yes ],
4621
[ kde_jni_works=no ])
4623
if test $kde_jni_works = no; then
4624
AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
4625
You need to have Java Development Kit (JDK) version 1.2.
4627
Use --with-java to specify another location.
4628
Use --without-java to configure without java support.
4629
Or download a newer JDK and try again.
4630
See e.g. http://java.sun.com/products/jdk/1.2 ])
4633
CXXFLAGS="$ac_cxxflags_safe"
4636
dnl All tests ok, inform and subst the variables
4637
AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
4639
JAVAC=$kde_cv_java_bindir/javac
4641
JAVAH=$kde_cv_java_bindir/javah
4643
JAR=$kde_cv_java_bindir/jar
4645
AC_SUBST(jni_includes)
4646
JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
4651
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
4652
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
4653
dnl big packages, m4_foreach is dog-slow. So use our own version of
4654
dnl it. (matz@kde.org)
4655
m4_define([mm_foreach],
4656
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
4657
m4_define([mm_car], [[$1]])
4658
m4_define([mm_car2], [[$@]])
4659
m4_define([_mm_foreach],
4660
[m4_if(m4_quote($2), [], [],
4661
[m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
4662
mm_car2(m4_shift($2)),
4664
m4_define([AC_FOREACH],
4665
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
4667
AC_DEFUN(KDE_NEED_FLEX,
4670
LIBS="$LIBS $USER_LDFLAGS"
4673
if test -z "$LEXLIB"; then
4674
AC_MSG_ERROR([You need to have flex installed.])
4679
AC_DEFUN(AC_PATH_QTOPIA,
4681
dnl TODO: use AC_CACHE_VAL
4683
if test -z "$1"; then
4688
qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
4689
qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
4690
qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
4693
qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
4694
qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
4696
AC_REQUIRE([AC_PATH_QT])
4698
AC_MSG_CHECKING([for Qtopia])
4701
AC_SUBST(LIB_QTOPIA)
4703
kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
4707
AC_ARG_WITH(qtopia-dir,
4708
[ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
4709
[ ac_qtopia_incdir="$withval"/include] )
4712
for dir in $kde_qtopia_dirs; do
4713
qtopia_incdirs="$qtopia_incdirs $dir/include"
4716
if test ! "$ac_qtopia_incdir" = "NO"; then
4717
qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
4721
AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
4722
ac_qtopia_incdir="$qtopia_incdir"
4724
if test -z "$qtopia_incdir"; then
4725
AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
4728
qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
4729
qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
4730
qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
4732
qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
4733
qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
4734
if test "$qtopia_ver" -lt "$qtopia_minver"; then
4735
AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
4742
ac_cxxflags_safe="$CXXFLAGS"
4743
ac_ldflags_safe="$LDFLAGS"
4744
ac_libs_safe="$LIBS"
4746
CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
4747
LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
4748
LIBS="$LIBS $LIB_QTOPIA $LIBQT"
4750
cat > conftest.$ac_ext <<EOF
4751
#include "confdefs.h"
4752
#include <qpe/qpeapplication.h>
4753
#include <qpe/version.h>
4755
int main( int argc, char **argv )
4757
QPEApplication app( argc, argv );
4762
if AC_TRY_EVAL(ac_link) && test -s conftest; then
4766
AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
4767
the end of config.log])
4770
CXXFLAGS="$ac_cxxflags_safe"
4771
LDFLAGS="$ac_ldflags_safe"
4772
LIBS="$ac_libs_safe"
4776
QTOPIA_INCLUDES="-I$qtopia_incdir"
4777
AC_SUBST(QTOPIA_INCLUDES)
4779
AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])