~ubuntu-branches/ubuntu/maverick/kaptain/maverick

« back to all changes in this revision

Viewing changes to admin/acinclude.m4.in

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Toedter
  • Date: 2008-03-10 22:47:58 UTC
  • mto: (3.1.4 intrepid)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20080310224758-x9mj2gmjhopp0zu1
Tags: upstream-0.72
ImportĀ upstreamĀ versionĀ 0.72

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
dnl IMPORTANT NOTE:
23
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.
 
24
dnl carried into every other module in the repository. 
27
25
dnl
28
26
dnl Single-module modifications are best placed in configure.in for kdelibs
29
27
dnl and kdebase or configure.in.in if present.
33
31
dnl thanks to Raja R Harinath.
34
32
dnl ------------------------------------------------------------------------
35
33
dnl
36
 
ifdef([_AC_PATH_X_DIRECT],[],
37
 
   [AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
38
34
ifdef([_AC_PATH_X_XMKMF],[],
39
35
   [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
 
36
ifdef([AC_OUTPUT_SUBDIRS],[],
 
37
   [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
 
38
 
 
39
# KDE_PATH_X_DIRECT
 
40
dnl Internal subroutine of AC_PATH_X.
 
41
dnl Set ac_x_includes and/or ac_x_libraries.
 
42
AC_DEFUN(KDE_PATH_X_DIRECT,
 
43
[
 
44
AC_REQUIRE([KDE_CHECK_LIB64])
 
45
 
 
46
if test "$ac_x_includes" = NO; then
 
47
  # Guess where to find include files, by looking for this one X11 .h file.
 
48
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 
49
 
 
50
  # First, try using that file with no special directory specified.
 
51
AC_TRY_CPP([#include <$x_direct_test_include>],
 
52
[# We can compile using X headers with no special include directory.
 
53
ac_x_includes=],
 
54
[# Look for the header file in a standard set of common directories.
 
55
# Check X11 before X11Rn because it is often a symlink to the current release.
 
56
  for ac_dir in               \
 
57
    /usr/X11/include          \
 
58
    /usr/X11R6/include        \
 
59
    /usr/X11R5/include        \
 
60
    /usr/X11R4/include        \
 
61
                              \
 
62
    /usr/include/X11          \
 
63
    /usr/include/X11R6        \
 
64
    /usr/include/X11R5        \
 
65
    /usr/include/X11R4        \
 
66
                              \
 
67
    /usr/local/X11/include    \
 
68
    /usr/local/X11R6/include  \
 
69
    /usr/local/X11R5/include  \
 
70
    /usr/local/X11R4/include  \
 
71
                              \
 
72
    /usr/local/include/X11    \
 
73
    /usr/local/include/X11R6  \
 
74
    /usr/local/include/X11R5  \
 
75
    /usr/local/include/X11R4  \
 
76
                              \
 
77
    /usr/X386/include         \
 
78
    /usr/x386/include         \
 
79
    /usr/XFree86/include/X11  \
 
80
                              \
 
81
    /usr/include              \
 
82
    /usr/local/include        \
 
83
    /usr/unsupported/include  \
 
84
    /usr/athena/include       \
 
85
    /usr/local/x11r5/include  \
 
86
    /usr/lpp/Xamples/include  \
 
87
                              \
 
88
    /usr/openwin/include      \
 
89
    /usr/openwin/share/include \
 
90
    ; \
 
91
  do
 
92
    if test -r "$ac_dir/$x_direct_test_include"; then
 
93
      ac_x_includes=$ac_dir
 
94
      break
 
95
    fi
 
96
  done])
 
97
fi # $ac_x_includes = NO
 
98
 
 
99
if test "$ac_x_libraries" = NO; then
 
100
  # Check for the libraries.
 
101
 
 
102
  test -z "$x_direct_test_library" && x_direct_test_library=Xt
 
103
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
 
104
 
 
105
  # See if we find them without any special options.
 
106
  # Don't add to $LIBS permanently.
 
107
  ac_save_LIBS="$LIBS"
 
108
  LIBS="-l$x_direct_test_library $LIBS"
 
109
AC_TRY_LINK(, [${x_direct_test_function}()],
 
110
[LIBS="$ac_save_LIBS"
 
111
# We can link X programs with no special library path.
 
112
ac_x_libraries=],
 
113
[LIBS="$ac_save_LIBS"
 
114
# First see if replacing the include by lib works.
 
115
# Check X11 before X11Rn because it is often a symlink to the current release.
 
116
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
 
117
    /usr/X11/lib${kdelibsuff}           \
 
118
    /usr/X11R6/lib${kdelibsuff}         \
 
119
    /usr/X11R5/lib${kdelibsuff}         \
 
120
    /usr/X11R4/lib${kdelibsuff}         \
 
121
                                        \
 
122
    /usr/lib${kdelibsuff}/X11           \
 
123
    /usr/lib${kdelibsuff}/X11R6         \
 
124
    /usr/lib${kdelibsuff}/X11R5         \
 
125
    /usr/lib${kdelibsuff}/X11R4         \
 
126
                                        \
 
127
    /usr/local/X11/lib${kdelibsuff}     \
 
128
    /usr/local/X11R6/lib${kdelibsuff}   \
 
129
    /usr/local/X11R5/lib${kdelibsuff}   \
 
130
    /usr/local/X11R4/lib${kdelibsuff}   \
 
131
                                        \
 
132
    /usr/local/lib${kdelibsuff}/X11     \
 
133
    /usr/local/lib${kdelibsuff}/X11R6   \
 
134
    /usr/local/lib${kdelibsuff}/X11R5   \
 
135
    /usr/local/lib${kdelibsuff}/X11R4   \
 
136
                                        \
 
137
    /usr/X386/lib${kdelibsuff}          \
 
138
    /usr/x386/lib${kdelibsuff}          \
 
139
    /usr/XFree86/lib${kdelibsuff}/X11   \
 
140
                                        \
 
141
    /usr/lib${kdelibsuff}               \
 
142
    /usr/local/lib${kdelibsuff}         \
 
143
    /usr/unsupported/lib${kdelibsuff}   \
 
144
    /usr/athena/lib${kdelibsuff}        \
 
145
    /usr/local/x11r5/lib${kdelibsuff}   \
 
146
    /usr/lpp/Xamples/lib${kdelibsuff}   \
 
147
    /lib/usr/lib${kdelibsuff}/X11       \
 
148
                                        \
 
149
    /usr/openwin/lib${kdelibsuff}       \
 
150
    /usr/openwin/share/lib${kdelibsuff} \
 
151
    ; \
 
152
do
 
153
dnl Don't even attempt the hair of trying to link an X program!
 
154
  for ac_extension in a so sl; do
 
155
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
 
156
      ac_x_libraries=$ac_dir
 
157
      break 2
 
158
    fi
 
159
  done
 
160
done])
 
161
fi # $ac_x_libraries = NO
 
162
])
 
163
 
40
164
 
41
165
dnl ------------------------------------------------------------------------
42
166
dnl Find a file (or one of more files in a list of dirs)
138
262
])
139
263
])
140
264
 
 
265
 
 
266
AC_DEFUN(KDE_CHECK_UIC_FLAG,
 
267
[
 
268
    AC_MSG_CHECKING([whether uic supports -$1 ])
 
269
    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
 
270
    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
 
271
    [
 
272
        cat >conftest.ui <<EOT
 
273
        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
 
274
EOT
 
275
        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
 
276
        if AC_TRY_EVAL(ac_uic_testrun); then
 
277
            eval "kde_cv_prog_uic_$kde_cache=yes"
 
278
        else
 
279
            eval "kde_cv_prog_uic_$kde_cache=no"
 
280
        fi
 
281
        rm -f conftest*
 
282
    ])
 
283
 
 
284
    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
 
285
        AC_MSG_RESULT([yes])
 
286
        :
 
287
        $3
 
288
    else
 
289
        AC_MSG_RESULT([no])
 
290
        :
 
291
        $4
 
292
    fi
 
293
])
 
294
 
 
295
 
141
296
dnl ------------------------------------------------------------------------
142
297
dnl Find the meta object compiler and the ui compiler in the PATH,
143
298
dnl in $QTDIR/bin, and some more usual places
156
311
 
157
312
   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
158
313
   if test -z "$UIC_NOT_NEEDED"; then
159
 
     KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
160
 
     if test -z "$UIC" ; then
 
314
     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
 
315
     if test -z "$UIC_PATH" ; then
161
316
       KDE_UIC_ERROR_MESSAGE
162
317
       exit 1
 
318
     elif test $kde_qtver = 3; then
 
319
       KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
 
320
       KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
 
321
 
 
322
       UIC=$UIC_PATH
 
323
       if test x$ac_uic_supports_libpath = xyes; then
 
324
           UIC="$UIC -L \$(kde_widgetdir)"
 
325
       fi
 
326
       if test x$ac_uic_supports_nounload = xyes; then
 
327
           UIC="$UIC -nounload"
 
328
       fi
163
329
     fi
164
330
   else
165
331
     UIC="echo uic not available: "
170
336
 
171
337
   UIC_TR="i18n"
172
338
   if test $kde_qtver = 3; then
173
 
     UIC_TR="QT_KDE_I18N"
 
339
     UIC_TR="tr2i18n"
174
340
   fi
175
341
 
176
342
   AC_SUBST(UIC_TR)
298
464
    kde_servicetypesdir='\${prefix}/share/servicetypes'
299
465
  fi
300
466
  if test -z "$kde_moduledir"; then
301
 
    if test $kde_qtver = 2; then
302
 
      kde_moduledir='\${exec_prefix}/lib/kde2'
 
467
    if test "$kde_qtver" = "2"; then
 
468
      kde_moduledir='\${libdir}/kde2'
303
469
    else
304
 
      kde_moduledir='\${exec_prefix}/lib/kde3'
 
470
      kde_moduledir='\${libdir}/kde3'
305
471
    fi
306
472
  fi
307
473
  if test -z "$kde_styledir"; then
308
 
    kde_styledir='\${exec_prefix}/lib/kde3/plugins/styles'
 
474
    kde_styledir='\${libdir}/kde3/plugins/styles'
309
475
  fi
310
476
  if test -z "$kde_widgetdir"; then
311
 
    kde_widgetdir='\${exec_prefix}/lib/kde3/plugins/designer'
 
477
    kde_widgetdir='\${libdir}/kde3/plugins/designer'
312
478
  fi
313
479
 
314
480
  KDE_SET_PATHS(defaults)
335
501
   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
336
502
   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
337
503
   test -z "$kde_styledir" || test -z "kde_widgetdir" 
338
 
   test "$kde_have_all_paths" != "yes"; then
 
504
   test "x$kde_have_all_paths" != "xyes"; then
339
505
     kde_have_all_paths=no
340
506
  fi
341
507
])
347
513
])
348
514
])
349
515
 
 
516
AC_DEFUN(KDE_MISSING_ARTS_ERROR,
 
517
[
 
518
    AC_MSG_ERROR([The important program $1 was not found!
 
519
Please check whether you installed aRts correctly.
 
520
])
 
521
])
 
522
 
350
523
AC_DEFUN(KDE_SUBST_PROGRAMS,
351
524
[
352
525
 
353
 
        kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
 
526
        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"
 
527
        test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
354
528
        if test -n "$KDEDIRS"; then
355
529
           kde_save_IFS=$IFS
356
530
           IFS=:
362
536
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
363
537
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
364
538
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
365
 
        KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
366
 
        KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
 
539
        KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
 
540
        KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
367
541
        KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
368
542
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
369
543
      
370
544
        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
371
 
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
 
545
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
372
546
            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
373
547
            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
374
548
            if test "$KDE_XSL_STYLESHEET" = "NO"; then
529
703
   AC_CHECK_FUNC(shmat, ,
530
704
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
531
705
   
532
 
   # Solaris 2.6 and others need -lresolv for res_init
533
 
   AC_CHECK_FUNCS(res_init, , [
534
 
     kde_libs_safe="$LIBS"
535
 
     LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
536
 
     AC_TRY_LINK(
537
 
[
538
 
#include <resolv.h>
539
 
],
540
 
541
 
res_init(); 
542
 
],
543
 
        LIBRESOLV="-lresolv"
544
 
        X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
545
 
        AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
546
 
     )
547
 
     LIBS=$kde_libs_safe
 
706
   # darwin needs this to initialize the environment
 
707
   AC_CHECK_HEADERS(crt_externs.h)
 
708
   AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
 
709
 
 
710
   # more headers that need to be explicitly included on darwin
 
711
   AC_CHECK_HEADERS(sys/types.h stdint.h)
 
712
 
 
713
   # darwin requires a poll emulation library
 
714
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
 
715
 
 
716
   # CoreAudio framework
 
717
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
 
718
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
 
719
     FRAMEWORK_COREAUDIO="-framework CoreAudio"
548
720
   ])
549
721
 
 
722
   AC_CHECK_RES_INIT
 
723
   AC_SUBST(LIB_POLL)
 
724
   AC_SUBST(FRAMEWORK_COREAUDIO)
550
725
   LIBSOCKET="$X_EXTRA_LIBS"
551
726
   AC_SUBST(LIBSOCKET)
552
 
   AC_SUBST(LIBRESOLV)
553
727
   AC_SUBST(X_EXTRA_LIBS)
554
728
   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
555
729
   AC_SUBST(LIBUCB)
565
739
 
566
740
   KDE_CHECK_TYPES
567
741
   KDE_CHECK_LIBDL
 
742
 
 
743
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
 
744
[
 
745
/*
 
746
 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
 
747
 * that defines bzero.
 
748
 */
 
749
 
 
750
#if defined(_AIX)
 
751
#include <strings.h>
 
752
#endif
 
753
])
 
754
 
 
755
AC_CHECK_FUNCS([vsnprintf snprintf])
 
756
 
 
757
AH_VERBATIM(_TRU64,[
 
758
/*
 
759
 * On HP-UX, the declaration of vsnprintf() is needed every time !
 
760
 */
 
761
 
 
762
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
 
763
#if __STDC__
 
764
#include <stdarg.h>
 
765
#include <stdlib.h>
 
766
#else
 
767
#include <varargs.h>
 
768
#endif
 
769
#ifdef __cplusplus
 
770
extern "C"
 
771
#endif
 
772
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
 
773
#ifdef __cplusplus
 
774
extern "C"
 
775
#endif
 
776
int snprintf(char *str, size_t n, char const *fmt, ...);
 
777
#endif
 
778
])
 
779
 
568
780
])
569
781
 
570
782
dnl ------------------------------------------------------------------------
574
786
dnl
575
787
AC_DEFUN(K_PATH_X,
576
788
[
577
 
AC_REQUIRE([AC_PROG_CPP])dnl
578
789
AC_REQUIRE([KDE_MISC_TESTS])dnl
 
790
AC_REQUIRE([KDE_CHECK_LIB64])
579
791
 
580
792
AC_ARG_ENABLE(
581
793
  embedded,
584
796
  kde_use_qt_emb=no
585
797
)
586
798
 
 
799
AC_ARG_ENABLE(
 
800
  qtopia,
 
801
  [  --enable-qtopia         link to Qt-embedded, link to the Qtopia Environment],
 
802
  kde_use_qt_emb_palm=$enableval,
 
803
  kde_use_qt_emb_palm=no
 
804
)
 
805
 
587
806
if test "$kde_use_qt_emb" = "no"; then
588
807
 
589
808
AC_MSG_CHECKING(for X)
606
825
ac_x_libraries=$kde_x_libraries
607
826
ac_x_includes=$kde_x_includes
608
827
 
609
 
_AC_PATH_X_DIRECT
 
828
KDE_PATH_X_DIRECT
610
829
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
611
830
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
612
831
dnl location. The correct location is /usr/lib32 or an undefined value
626
845
    ac_x_includes="."
627
846
  fi
628
847
  if test -z "$ac_x_libraries"; then
629
 
    ac_x_libraries="/usr/lib"
 
848
    ac_x_libraries="/usr/lib${kdelibsuff}"
630
849
  fi
631
850
esac
632
851
#from now on we use our own again
743
962
AC_MSG_CHECKING(for Xinerama)
744
963
 
745
964
 AC_ARG_WITH(xinerama,
746
 
  [  --with-xinerama        enable support for Xinerama ],
 
965
  [  --with-xinerama         enable support for Xinerama ],
747
966
  [
748
967
    no_xinerama=no
749
968
  ], [
792
1011
 
793
1012
else
794
1013
  dnl We're using QT Embedded
795
 
  CXXFLAGS="$CXXFLAGS -DQWS"
796
 
  CFLAGS="$CFLAGS -DQWS"
797
 
  LDFLAGS="$LDFLAGS -DQWS"
798
 
  QTE_NORTTI="-DQWS"
 
1014
  CPPFLAGS=-DQWS
 
1015
  CXXFLAGS="$CXXFLAGS -fno-rtti"
 
1016
  QTE_NORTTI="-fno-rtti -DQWS"
799
1017
  X_PRE_LIBS=""
800
1018
  LIB_X11=""
801
1019
  LIB_XEXT=""
837
1055
 
838
1056
if test $kde_qtsubver -gt 0; then
839
1057
cat >> conftest.$ac_ext <<EOF
840
 
#include <qiconview.h>
 
1058
#if QT_VERSION < 210
 
1059
#error 1
 
1060
#endif
841
1061
EOF
842
1062
fi
843
1063
fi
844
1064
 
845
1065
if test "$kde_qtver" = "3"; then
846
1066
cat >> conftest.$ac_ext <<EOF
 
1067
#include <qcursor.h>
847
1068
#include <qstylefactory.h>
848
1069
#include <private/qucomextra_p.h>
849
1070
EOF
859
1080
if test "$kde_qtver" = "2"; then
860
1081
cat >> conftest.$ac_ext <<EOF
861
1082
    QStringList *t = new QStringList();
 
1083
    Q_UNUSED(t);
862
1084
EOF
863
1085
if test $kde_qtsubver -gt 0; then
864
1086
cat >> conftest.$ac_ext <<EOF
865
 
    QIconView iv(0);
866
 
    iv.setWordWrapIconText(false);
867
1087
    QString s;
868
1088
    s.setLatin1("Elvis is alive", 14);
869
 
    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
870
1089
EOF
871
1090
fi
872
1091
fi
873
1092
if test "$kde_qtver" = "3"; then
874
1093
cat >> conftest.$ac_ext <<EOF
875
1094
    (void)QStyleFactory::create(QString::null);
 
1095
    QCursor c(Qt::WhatsThisCursor);
876
1096
EOF
877
1097
fi
878
1098
cat >> conftest.$ac_ext <<EOF
883
1103
 
884
1104
AC_DEFUN(KDE_USE_QT,
885
1105
[
886
 
 
887
1106
if test -z "$1"; then
888
 
  kde_qtver=2
889
 
  kde_qtsubver=2
 
1107
  # Current default Qt version: 3.1
 
1108
  kde_qtver=3
 
1109
  kde_qtsubver=1
890
1110
else
891
 
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
892
 
  # following is the check if subversion isnļæ½t found in passed argument
 
1111
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
 
1112
  # following is the check if subversion isnt found in passed argument
893
1113
  if test "$kde_qtsubver" = "$1"; then
894
1114
    kde_qtsubver=1
895
1115
  fi
896
 
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
 
1116
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
897
1117
  if test "$kde_qtver" = "1"; then
898
1118
    kde_qtsubver=42
899
1119
  fi
908
1128
    fi
909
1129
  fi
910
1130
  if test "$kde_qtver" = "3"; then
911
 
    kde_qt_minversion=">= Qt 3.0.0-beta6"
 
1131
    if test $kde_qtsubver -gt 0; then
 
1132
      kde_qt_minversion=">= Qt 3.1.0"
 
1133
    else
 
1134
      kde_qt_minversion=">= Qt 3.0"
 
1135
    fi
912
1136
  fi
913
1137
  if test "$kde_qtver" = "1"; then
914
1138
    kde_qt_minversion=">= 1.42 and < 2.0"
919
1143
 
920
1144
if test -z "$3"; then
921
1145
   if test $kde_qtver = 3; then
922
 
     kde_qt_verstring="QT_VERSION >= 300"
 
1146
     if test $kde_qtsubver -gt 0; then
 
1147
       kde_qt_verstring="QT_VERSION >= 0x030100"
 
1148
     else
 
1149
       kde_qt_verstring="QT_VERSION >= 300"
 
1150
     fi
923
1151
   fi
924
1152
   if test $kde_qtver = 2; then
925
1153
     if test $kde_qtsubver -gt 0; then
936
1164
fi
937
1165
 
938
1166
if test $kde_qtver = 3; then
939
 
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
940
 
fi 
 
1167
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
 
1168
fi
941
1169
if test $kde_qtver = 2; then
942
1170
   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
943
1171
fi
1013
1241
[
1014
1242
AC_REQUIRE([K_PATH_X])
1015
1243
AC_REQUIRE([KDE_USE_QT])
 
1244
AC_REQUIRE([KDE_CHECK_LIB64])
1016
1245
 
1017
1246
dnl ------------------------------------------------------------------------
1018
1247
dnl Add configure flag to enable linking to MT version of Qt library.
1020
1249
 
1021
1250
AC_ARG_ENABLE(
1022
1251
  mt,
1023
 
  [  --disable-mt             link to non-threaded Qt (deprecated)],
 
1252
  [  --disable-mt            link to non-threaded Qt (deprecated)],
1024
1253
  kde_use_qt_mt=$enableval,
1025
1254
  [
1026
1255
    if test $kde_qtver = 3; then
1038
1267
dnl ------------------------------------------------------------------------
1039
1268
 
1040
1269
KDE_MT_LDFLAGS=
 
1270
KDE_MT_LIBS=
1041
1271
if test "x$kde_use_qt_mt" = "xyes"; then
1042
1272
  KDE_CHECK_THREADING
1043
1273
  if test "x$kde_use_threading" = "xyes"; then
1044
1274
    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1045
 
    KDE_MT_LDFLAGS="$USE_THREADS $LIBPTHREAD"
 
1275
    KDE_MT_LDFLAGS="$USE_THREADS"
 
1276
    KDE_MT_LIBS="$LIBPTHREAD"
1046
1277
  else
1047
1278
    kde_use_qt_mt=no
1048
1279
  fi
1049
1280
fi
1050
1281
AC_SUBST(KDE_MT_LDFLAGS)
 
1282
AC_SUBST(KDE_MT_LIBS)
1051
1283
 
1052
1284
kde_qt_was_given=yes
1053
1285
 
1071
1303
  else
1072
1304
    qtlib="qt"
1073
1305
  fi
1074
 
 
1075
 
  LIBQT="-l$qtlib"
 
1306
 
1076
1307
  kde_int_qt="-l$qtlib"
 
1308
else
 
1309
  kde_int_qt="$LIBQT"
 
1310
  kde_lib_qt_set=yes
 
1311
fi
 
1312
 
 
1313
if test -z "$LIBQPE"; then
 
1314
dnl ------------------------------------------------------------
 
1315
dnl If we got --enable-palmtop then add -lqpe to the link line
 
1316
dnl ------------------------------------------------------------
 
1317
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1318
    if test "x$kde_use_qt_emb_palm" = "xyes"; then
 
1319
      LIB_QPE="-lqpe"
 
1320
    else
 
1321
      LIB_QPE=""
 
1322
    fi
 
1323
  else
 
1324
    LIB_QPE=""
 
1325
  fi
1077
1326
fi
1078
1327
 
1079
1328
dnl ------------------------------------------------------------------------
1081
1330
dnl ------------------------------------------------------------------------
1082
1331
 
1083
1332
if test "x$kde_use_qt_mt" = "xyes"; then
1084
 
  LIBQT="-l$qtlib-mt"
1085
 
  kde_int_qt="-l$qtlib-mt"
 
1333
  if test -z "$LIBQT"; then
 
1334
    LIBQT="-l$qtlib-mt"
 
1335
    kde_int_qt="-l$qtlib-mt"
 
1336
  else
 
1337
    LIBQT="$qtlib-mt"
 
1338
    kde_int_qt="$qtlib-mt"
 
1339
  fi
1086
1340
  LIBQT_GLOB="lib$qtlib-mt.*"
1087
1341
  USING_QT_MT="using -mt"
 
1342
else
 
1343
  LIBQT="-l$qtlib"
1088
1344
fi
1089
1345
 
1090
1346
if test $kde_qtver != 1; then
1094
1350
  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1095
1351
fi
1096
1352
 
 
1353
if test $kde_qtver = 3; then
 
1354
  AC_REQUIRE([KDE_CHECK_LIBDL])
 
1355
  LIBQT="$LIBQT $LIBDL"
 
1356
fi
 
1357
 
1097
1358
AC_MSG_CHECKING([for Qt])
1098
1359
 
1099
1360
if test "x$kde_use_qt_emb" != "xyes"; then
1105
1366
AC_ARG_WITH(qt-dir,
1106
1367
    [  --with-qt-dir=DIR       where the root of Qt is installed ],
1107
1368
    [  ac_qt_includes="$withval"/include
1108
 
       ac_qt_libraries="$withval"/lib
 
1369
       ac_qt_libraries="$withval"/lib${kdelibsuff}
1109
1370
       ac_qt_bindir="$withval"/bin
1110
1371
    ])
1111
1372
 
1146
1407
 
1147
1408
qt_libdirs=""
1148
1409
for dir in $kde_qt_dirs; do
1149
 
   qt_libdirs="$qt_libdirs $dir/lib $dir"
 
1410
   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1150
1411
done
1151
1412
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1152
1413
if test ! "$ac_qt_libraries" = "NO"; then
1172
1433
 
1173
1434
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1174
1435
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1175
 
LIBS="$LIBS $LIBQT"
 
1436
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1176
1437
 
1177
1438
KDE_PRINT_QT_PROGRAM
1178
1439
 
1192
1453
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1193
1454
  ac_cv_have_qt="have_qt=no"
1194
1455
  ac_qt_notfound=""
 
1456
  missing_qt_mt=""
1195
1457
  if test "$ac_qt_includes" = NO; then
1196
1458
    if test "$ac_qt_libraries" = NO; then
1197
1459
      ac_qt_notfound="(headers and libraries)";
1199
1461
      ac_qt_notfound="(headers)";
1200
1462
    fi
1201
1463
  else
1202
 
    ac_qt_notfound="(libraries)";
 
1464
    if test "x$kde_use_qt_mt" = "xyes"; then
 
1465
       missing_qt_mt="
 
1466
Make sure that you have compiled Qt with thread support!"
 
1467
       ac_qt_notfound="(library $qtlib-mt)";
 
1468
    else
 
1469
       ac_qt_notfound="(library $qtlib)";
 
1470
    fi
1203
1471
  fi
1204
1472
 
1205
1473
  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1206
 
For more details about this problem, look at the end of config.log.])
 
1474
For more details about this problem, look at the end of config.log.$missing_qt_mt])
1207
1475
else
1208
1476
  have_qt="yes"
1209
1477
fi
1248
1516
AC_SUBST(QT_LDFLAGS)
1249
1517
AC_PATH_QT_MOC_UIC
1250
1518
 
 
1519
KDE_CHECK_QT_JPEG
 
1520
 
1251
1521
if test "x$kde_use_qt_emb" != "xyes"; then
1252
 
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
 
1522
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1253
1523
else
1254
 
LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG)'
 
1524
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
1255
1525
fi
 
1526
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
 
1527
 
1256
1528
AC_SUBST(LIB_QT)
 
1529
AC_SUBST(LIB_QPE)
1257
1530
 
1258
1531
AC_SUBST(kde_qtver)
1259
1532
])
1263
1536
AC_PATH_QT_1_3
1264
1537
])
1265
1538
 
 
1539
AC_DEFUN(KDE_CHECK_UIC_PLUGINS,
 
1540
[
 
1541
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
 
1542
 
 
1543
if test x$ac_uic_supports_libpath = xyes; then
 
1544
 
 
1545
AC_MSG_CHECKING([if UIC has KDE plugins available])
 
1546
AC_CACHE_VAL(kde_cv_uic_plugins,
 
1547
[
 
1548
cat > actest.ui << EOF
 
1549
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
 
1550
<class>NewConnectionDialog</class>
 
1551
<widget class="QDialog">
 
1552
   <widget class="KLineEdit">
 
1553
        <property name="name">
 
1554
           <cstring>testInput</cstring>
 
1555
        </property>
 
1556
   </widget>
 
1557
</widget>
 
1558
</UI>
 
1559
EOF
 
1560
       
 
1561
 
 
1562
 
 
1563
kde_cv_uic_plugins=no
 
1564
kde_line="$UIC_PATH -L $kde_widgetdir"
 
1565
if test x$ac_uic_supports_nounload = xyes; then
 
1566
   kde_line="$kde_line -nounload"
 
1567
fi
 
1568
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
 
1569
if AC_TRY_EVAL(kde_line); then
 
1570
        if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
 
1571
                kde_cv_uic_plugins=yes
 
1572
        fi
 
1573
fi
 
1574
rm -f actest.ui actest.cpp
 
1575
])
 
1576
 
 
1577
if test "$kde_cv_uic_plugins" = yes; then
 
1578
        AC_MSG_RESULT([yes])
 
1579
else
 
1580
        AC_MSG_ERROR([not found - you need to install kdelibs first.])
 
1581
fi
 
1582
fi
 
1583
])
 
1584
 
1266
1585
AC_DEFUN(KDE_CHECK_FINAL,
1267
1586
[
1268
1587
  AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
1304
1623
[
1305
1624
AC_PREREQ([2.13])
1306
1625
AC_REQUIRE([AC_PATH_QT])dnl
 
1626
AC_REQUIRE([KDE_CHECK_LIB64])
 
1627
 
1307
1628
AC_CHECK_RPATH
1308
1629
AC_MSG_CHECKING([for KDE])
1309
1630
 
1312
1633
  ac_kde_includes=$prefix/include
1313
1634
 
1314
1635
  if test "${exec_prefix}" != NONE; then
1315
 
    kde_libraries=${exec_prefix}/lib
1316
 
    ac_kde_libraries=$exec_prefix/lib
 
1636
     kde_libraries=${libdir}
 
1637
     ac_kde_libraries=$libdir
 
1638
     if test "$ac_kde_libraries" = '${exec_prefix}/lib'${kdelibsuff}; then
 
1639
        ac_kde_libraries=$exec_prefix/lib${kdelibsuff}
 
1640
     fi
1317
1641
  else
1318
 
    kde_libraries=${prefix}/lib
1319
 
    ac_kde_libraries=$prefix/lib
 
1642
     kde_libraries=${prefix}/lib${kdelibsuff}
 
1643
     ac_kde_libraries=$prefix/lib${kdelibsuff}
1320
1644
  fi
1321
1645
else
1322
1646
  ac_kde_includes=
1338
1662
 
1339
1663
if test -z "$1"; then
1340
1664
 
1341
 
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
 
1665
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"
1342
1666
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1343
1667
kde_incdirs="$ac_kde_includes $kde_incdirs"
1344
1668
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1350
1674
So, check this please and use another prefix!])
1351
1675
fi
1352
1676
 
1353
 
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
1354
 
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
1355
 
kde_libdirs="$ac_kde_libraries $kde_libdirs"
 
1677
kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
 
1678
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
 
1679
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1356
1680
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1357
1681
ac_kde_libraries="$kde_libdir"
1358
1682
 
 
1683
kde_widgetdir=NO
 
1684
dnl this might be somewhere else
 
1685
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
 
1686
 
1359
1687
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1360
1688
AC_MSG_ERROR([
1361
1689
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1362
1690
So, check this please and use another prefix!])
1363
1691
fi
1364
 
ac_kde_libraries="$kde_libdir"
1365
 
 
1366
 
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
 
1692
 
 
1693
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
 
1694
AC_MSG_ERROR([
 
1695
I can't find the designer plugins. These are required and should have been installed
 
1696
by kdelibs])
 
1697
fi
 
1698
 
 
1699
if test -n "$kde_widgetdir"; then
 
1700
    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
 
1701
fi
 
1702
 
 
1703
 
 
1704
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1367
1705
  ac_cv_have_kde="have_kde=no"
1368
1706
else
1369
1707
  ac_cv_have_kde="have_kde=yes \
1393
1731
  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1394
1732
 fi
1395
1733
 
1396
 
 kde_libraries="${ac_kde_exec_prefix}/lib"
 
1734
 kde_libraries="${libdir}"
1397
1735
 kde_includes=${ac_kde_prefix}/include
1398
1736
 
1399
1737
else
1429
1767
AC_SUBST(all_includes)
1430
1768
AC_SUBST(all_libraries)
1431
1769
 
 
1770
if test -z "$1"; then
 
1771
KDE_CHECK_UIC_PLUGINS
 
1772
fi
 
1773
 
 
1774
ac_kde_libraries="$kde_libdir"
 
1775
 
1432
1776
AC_SUBST(AUTODIRS)
 
1777
 
 
1778
 
1433
1779
])
1434
1780
 
1435
1781
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1561
1907
 
1562
1908
 LDFLAGS=$kde_ldflags_safe
1563
1909
 LIBS=$kde_libs_safe
1564
 
 kde_cxxflags_safe="$CXXFLAGS"
 
1910
 CXXFLAGS=$kde_cxxflags_safe
1565
1911
])
1566
1912
 
1567
1913
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1608
1954
   AC_REQUIRE([KDE_CHECK_LIBDL])
1609
1955
   AC_REQUIRE([K_PATH_X])
1610
1956
 
1611
 
if test $kde_qtver != 1; then
1612
 
   LIB_KDECORE='-lkdecore'
1613
 
   AC_SUBST(LIB_KDECORE)
1614
 
   LIB_KDEUI='-lkdeui'
1615
 
   AC_SUBST(LIB_KDEUI)
1616
 
   LIB_KIO='-lkio'
1617
 
   AC_SUBST(LIB_KIO)
1618
 
   LIB_KSYCOCA='-lksycoca'
1619
 
   AC_SUBST(LIB_KSYCOCA)
1620
 
   LIB_SMB='-lsmb'
1621
 
   AC_SUBST(LIB_SMB)
1622
 
   LIB_KFILE='-lkfile'
1623
 
   AC_SUBST(LIB_KFILE)
1624
 
   LIB_KAB='-lkab'
1625
 
   AC_SUBST(LIB_KAB)
1626
 
   LIB_KHTML='-lkhtml'
1627
 
   AC_SUBST(LIB_KHTML)
1628
 
   LIB_KSPELL='-lkspell'
1629
 
   AC_SUBST(LIB_KSPELL)
1630
 
   LIB_KPARTS='-lkparts'
1631
 
   AC_SUBST(LIB_KPARTS)
1632
 
   LIB_KWRITE='-lkwrite'
1633
 
   AC_SUBST(LIB_KWRITE)
 
1957
if test $kde_qtver = 3; then
 
1958
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
1959
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
1960
   AC_SUBST(LIB_KIO, "-lkio")
 
1961
   AC_SUBST(LIB_SMB, "-lsmb")
 
1962
   AC_SUBST(LIB_KAB, "-lkab")
 
1963
   AC_SUBST(LIB_KABC, "-lkabc")
 
1964
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
1965
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
1966
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
1967
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
 
1968
# these are for backward compatibility
 
1969
   AC_SUBST(LIB_KSYCOCA, "-lkio")
 
1970
   AC_SUBST(LIB_KFILE, "-lkio")
 
1971
elif test $kde_qtver = 2; then
 
1972
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
1973
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
1974
   AC_SUBST(LIB_KIO, "-lkio")
 
1975
   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
 
1976
   AC_SUBST(LIB_SMB, "-lsmb")
 
1977
   AC_SUBST(LIB_KFILE, "-lkfile")
 
1978
   AC_SUBST(LIB_KAB, "-lkab")
 
1979
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
1980
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
1981
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
1982
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
1634
1983
else
1635
 
   LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
1636
 
   AC_SUBST(LIB_KDECORE)
1637
 
   LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
1638
 
   AC_SUBST(LIB_KDEUI)
1639
 
   LIB_KFM='-lkfm $(LIB_KDECORE)'
1640
 
   AC_SUBST(LIB_KFM)
1641
 
   LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
1642
 
   AC_SUBST(LIB_KFILE)
1643
 
   LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
1644
 
   AC_SUBST(LIB_KAB)
 
1984
   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
 
1985
   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
 
1986
   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
 
1987
   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
 
1988
   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
1645
1989
fi
1646
1990
])
1647
1991
 
1669
2013
  KDE_CREATE_LIBS_ALIASES
1670
2014
])
1671
2015
 
1672
 
dnl obsolete
1673
 
AC_DEFUN(AC_CHECK_SETENV,
1674
 
[
1675
 
   AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl 
1676
 
   AC_CHECK_FUNCS([setenv unsetenv])
1677
 
])
1678
 
 
1679
 
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1680
 
[
1681
 
AC_MSG_CHECKING(for getdomainname)
1682
 
AC_CACHE_VAL(ac_cv_func_getdomainname,
 
2016
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
 
2017
AC_DEFUN(KDE_CHECK_FUNC_EXT,
 
2018
[
 
2019
AC_MSG_CHECKING(for $1)
 
2020
AC_CACHE_VAL(kde_cv_func_$1,
1683
2021
[
1684
2022
AC_LANG_SAVE
1685
2023
AC_LANG_CPLUSPLUS
1686
2024
save_CXXFLAGS="$CXXFLAGS"
1687
2025
kde_safe_LIBS="$LIBS"
1688
2026
LIBS="$LIBS $X_EXTRA_LIBS"
1689
 
if test "$GCC" = "yes"; then
1690
 
CXXFLAGS="$CXXFLAGS -pedantic-errors"
 
2027
if test "$GXX" = "yes"; then
 
2028
  CXXFLAGS="$CXXFLAGS -pedantic-errors"
1691
2029
fi
1692
2030
AC_TRY_COMPILE([
1693
 
#include <stdlib.h>
1694
 
#include <unistd.h>
 
2031
$2
1695
2032
],
1696
2033
[
1697
 
char buffer[200];
1698
 
getdomainname(buffer, 200);
 
2034
$3
1699
2035
],
1700
 
ac_cv_func_getdomainname=yes,
1701
 
ac_cv_func_getdomainname=no)
 
2036
kde_cv_func_$1=yes,
 
2037
kde_cv_func_$1=no)
1702
2038
CXXFLAGS="$save_CXXFLAGS"
1703
2039
LIBS=$kde_safe_LIBS
1704
2040
AC_LANG_RESTORE
1705
2041
])
1706
 
AC_MSG_RESULT($ac_cv_func_getdomainname)
1707
 
 
1708
 
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1709
 
AC_CACHE_VAL(ac_cv_proto_getdomainname,
 
2042
 
 
2043
AC_MSG_RESULT($kde_cv_func_$1)
 
2044
 
 
2045
AC_MSG_CHECKING([if $1 needs custom prototype])
 
2046
AC_CACHE_VAL(kde_cv_proto_$1,
1710
2047
[
 
2048
if test "x$kde_cv_func_$1" = xyes; then
 
2049
  kde_cv_proto_$1=no
 
2050
else
 
2051
  case "$1" in
 
2052
        setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
 
2053
                kde_cv_proto_$1="yes - in libkdefakes"
 
2054
                ;;
 
2055
        *)
 
2056
                kde_cv_proto_$1=unknown
 
2057
                ;;
 
2058
  esac
 
2059
fi
 
2060
 
 
2061
if test "x$kde_cv_proto_$1" = xunknown; then
 
2062
 
1711
2063
AC_LANG_SAVE
1712
2064
AC_LANG_CPLUSPLUS
1713
 
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1714
 
  ac_cv_proto_getdomainname=no
1715
 
else
1716
2065
  kde_safe_libs=$LIBS
1717
2066
  LIBS="$LIBS $X_EXTRA_LIBS"
1718
2067
  AC_TRY_LINK([
1719
 
#include <stdlib.h>
1720
 
#include <unistd.h>
 
2068
$2
1721
2069
 
1722
 
extern "C" int getdomainname (char *, int);
 
2070
extern "C" $4;
1723
2071
],
1724
2072
[
1725
 
char buffer[200];
1726
 
getdomainname(buffer, 200);
 
2073
$3
1727
2074
],
1728
 
  ac_cv_func_getdomainname=yes
1729
 
  ac_cv_proto_getdomainname=yes,
1730
 
  AC_MSG_RESULT([fatal error])
1731
 
  AC_MSG_ERROR([getdomainname unavailable]))
1732
 
fi
 
2075
[ kde_cv_func_$1=yes
 
2076
  kde_cv_proto_$1=yes ],
 
2077
  [kde_cv_proto_$1="$1 unavailable"]
 
2078
)
1733
2079
LIBS=$kde_safe_libs
1734
2080
AC_LANG_RESTORE
1735
 
])
1736
 
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1737
 
 
1738
 
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1739
 
  AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1740
 
fi
1741
 
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1742
 
  AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1743
 
  [Define if you have getdomainname prototype])
1744
 
fi
1745
 
 
 
2081
fi
 
2082
])
 
2083
AC_MSG_RESULT($kde_cv_proto_$1)
 
2084
 
 
2085
if test "x$kde_cv_func_$1" = xyes; then
 
2086
  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
 
2087
  $6
 
2088
fi
 
2089
if test "x$kde_cv_proto_$1" = xno; then
 
2090
  AC_DEFINE(HAVE_$5_PROTO, 1,
 
2091
  [Define if you have the $1 prototype])
 
2092
fi
 
2093
 
 
2094
AH_VERBATIM([_HAVE_$5_PROTO],
 
2095
[
 
2096
#if !defined(HAVE_$5_PROTO)
 
2097
#ifdef __cplusplus
 
2098
extern "C"
 
2099
#endif
 
2100
$4;
 
2101
#endif
 
2102
])
 
2103
])
 
2104
 
 
2105
AC_DEFUN(AC_CHECK_SETENV,
 
2106
[
 
2107
        KDE_CHECK_FUNC_EXT(setenv, [
 
2108
#include <stdlib.h>
 
2109
], 
 
2110
                [setenv("VAR", "VALUE", 1);],
 
2111
                [int setenv (const char *, const char *, int)],
 
2112
                [SETENV])
 
2113
])
 
2114
 
 
2115
AC_DEFUN(AC_CHECK_UNSETENV,
 
2116
[
 
2117
        KDE_CHECK_FUNC_EXT(unsetenv, [
 
2118
#include <stdlib.h>
 
2119
], 
 
2120
                [unsetenv("VAR");],
 
2121
                [void unsetenv (const char *)],
 
2122
                [UNSETENV])
 
2123
])
 
2124
 
 
2125
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
 
2126
[
 
2127
        KDE_CHECK_FUNC_EXT(getdomainname, [
 
2128
#include <stdlib.h>
 
2129
#include <unistd.h>
 
2130
], 
 
2131
                [
 
2132
char buffer[200];
 
2133
getdomainname(buffer, 200);
 
2134
],      
 
2135
                [int getdomainname (char *, unsigned int)],
 
2136
                [GETDOMAINNAME])
1746
2137
])
1747
2138
 
1748
2139
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1749
2140
[
1750
 
 
1751
 
AC_MSG_CHECKING([for gethostname])
1752
 
AC_CACHE_VAL(ac_cv_func_gethostname,
1753
 
[
1754
 
AC_LANG_SAVE
1755
 
AC_LANG_CPLUSPLUS
1756
 
save_CXXFLAGS="$CXXFLAGS"
1757
 
if test "$GCC" = "yes"; then
1758
 
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1759
 
fi
1760
 
AC_TRY_LINK([
1761
 
#include <stdlib.h>
1762
 
#include <unistd.h>
1763
 
],
1764
 
[
1765
 
char buffer[200];
1766
 
gethostname(buffer, 200);
1767
 
],
1768
 
ac_cv_func_gethostname=yes,
1769
 
ac_cv_func_gethostname=no)
1770
 
CXXFLAGS="$save_CXXFLAGS"
1771
 
AC_LANG_RESTORE
1772
 
])
1773
 
AC_MSG_RESULT($ac_cv_func_gethostname)
1774
 
 
1775
 
AC_MSG_CHECKING([if gethostname needs custom prototype])
1776
 
AC_CACHE_VAL(ac_cv_proto_gethostname,
1777
 
[
1778
 
AC_LANG_SAVE
1779
 
AC_LANG_CPLUSPLUS
1780
 
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1781
 
  ac_cv_proto_gethostname=no
1782
 
else
1783
 
  AC_TRY_LINK([
1784
 
#include <stdlib.h>
1785
 
#include <unistd.h>
1786
 
 
1787
 
extern "C" int gethostname (char *, int);
1788
 
],
1789
 
[
1790
 
char buffer[200];
1791
 
gethostname(buffer, 200);
1792
 
],
1793
 
  ac_cv_func_gethostname=yes
1794
 
  ac_cv_proto_gethostname=yes,
1795
 
  AC_MSG_RESULT([fatal error])
1796
 
  AC_MSG_ERROR(gethostname unavailable))
1797
 
fi
1798
 
AC_LANG_RESTORE
1799
 
])
1800
 
AC_MSG_RESULT($ac_cv_proto_gethostname)
1801
 
 
1802
 
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
1803
 
  AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
1804
 
  [Define if you have gethostname prototype])
1805
 
fi
1806
 
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1807
 
  AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
1808
 
fi
 
2141
        KDE_CHECK_FUNC_EXT(gethostname, [
 
2142
#include <stdlib.h>
 
2143
#include <unistd.h>
 
2144
], 
 
2145
                [
 
2146
char buffer[200];
 
2147
gethostname(buffer, 200);
 
2148
],      
 
2149
                [int gethostname (char *, unsigned int)],
 
2150
                [GETHOSTNAME])
1809
2151
])
1810
2152
 
1811
2153
AC_DEFUN(AC_CHECK_USLEEP,
1812
2154
[
1813
 
AC_MSG_CHECKING([for usleep])
1814
 
AC_CACHE_VAL(ac_cv_func_usleep,
1815
 
[
1816
 
AC_LANG_SAVE
1817
 
AC_LANG_CPLUSPLUS
1818
 
ac_libs_safe="$LIBS"
1819
 
LIBS="$LIBS $LIBUCB"
1820
 
AC_TRY_LINK([
1821
 
#include <stdlib.h>
 
2155
        KDE_CHECK_FUNC_EXT(usleep, [
1822
2156
#include <unistd.h>
1823
 
],
1824
 
[
 
2157
], 
 
2158
                [
1825
2159
usleep(200);
1826
 
],
1827
 
ac_cv_func_usleep=yes,
1828
 
ac_cv_func_usleep=no)
1829
 
LIBS="$ac_libs_safe"
1830
 
AC_LANG_RESTORE
1831
 
])
1832
 
AC_MSG_RESULT($ac_cv_func_usleep)
1833
 
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1834
 
  AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
1835
 
fi
1836
 
])
 
2160
],      
 
2161
                [int usleep (unsigned int)],
 
2162
                [USLEEP])
 
2163
])
 
2164
 
1837
2165
 
1838
2166
AC_DEFUN(AC_CHECK_RANDOM,
1839
2167
[
1840
 
AC_MSG_CHECKING([for random])
1841
 
AC_CACHE_VAL(ac_cv_func_random,
1842
 
[
1843
 
AC_LANG_SAVE
1844
 
AC_LANG_CPLUSPLUS
1845
 
ac_libs_safe="$LIBS"
1846
 
LIBS="$LIBS $LIBUCB"
1847
 
AC_TRY_LINK([
 
2168
        KDE_CHECK_FUNC_EXT(random, [
1848
2169
#include <stdlib.h>
1849
 
],
1850
 
[
 
2170
], 
 
2171
                [
1851
2172
random();
1852
 
],
1853
 
ac_cv_func_random=yes,
1854
 
ac_cv_func_random=no)
1855
 
LIBS="$ac_libs_safe"
1856
 
AC_LANG_RESTORE
1857
 
])
1858
 
AC_MSG_RESULT($ac_cv_func_random)
1859
 
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1860
 
  AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
1861
 
fi
 
2173
],      
 
2174
                [long int random(void)],
 
2175
                [RANDOM])
 
2176
 
 
2177
        KDE_CHECK_FUNC_EXT(srandom, [
 
2178
#include <stdlib.h>
 
2179
], 
 
2180
                [
 
2181
srandom(27);
 
2182
],      
 
2183
                [void srandom(unsigned int)],
 
2184
                [SRANDOM])
 
2185
 
 
2186
])
 
2187
 
 
2188
AC_DEFUN(AC_CHECK_INITGROUPS,
 
2189
[
 
2190
        KDE_CHECK_FUNC_EXT(initgroups, [
 
2191
#include <sys/types.h>
 
2192
#include <unistd.h>
 
2193
#include <grp.h>
 
2194
],
 
2195
        [
 
2196
char buffer[200];
 
2197
initgroups(buffer, 27);
 
2198
],
 
2199
        [int initgroups(const char *, gid_t)],
 
2200
        [INITGROUPS])
 
2201
])
 
2202
 
 
2203
AC_DEFUN(AC_CHECK_MKSTEMP,
 
2204
[
 
2205
        KDE_CHECK_FUNC_EXT(mkstemp, [
 
2206
#include <stdlib.h>
 
2207
],
 
2208
        [
 
2209
mkstemp("/tmp/aaaXXXXXX");
 
2210
],
 
2211
        [int mkstemp(char *)],
 
2212
        [MKSTEMP])
 
2213
])
 
2214
 
 
2215
AC_DEFUN(AC_CHECK_MKSTEMPS,
 
2216
[
 
2217
        KDE_CHECK_FUNC_EXT(mkstemps, [
 
2218
#include <stdlib.h>
 
2219
#include <unistd.h>
 
2220
],
 
2221
        [
 
2222
mkstemps("/tmp/aaaXXXXXX", 6);
 
2223
],
 
2224
        [int mkstemps(char *, int)],
 
2225
        [MKSTEMPS])
 
2226
])
 
2227
 
 
2228
AC_DEFUN(AC_CHECK_RES_INIT,
 
2229
[
 
2230
  AC_MSG_CHECKING([if res_init needs -lresolv])
 
2231
  kde_libs_safe="$LIBS"
 
2232
  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
 
2233
  AC_TRY_LINK(
 
2234
    [
 
2235
#include <sys/types.h>
 
2236
#include <netinet/in.h>
 
2237
#include <arpa/nameser.h>
 
2238
#include <resolv.h>
 
2239
    ],
 
2240
    [
 
2241
      res_init(); 
 
2242
    ],
 
2243
    [
 
2244
      LIBRESOLV="-lresolv"
 
2245
      AC_MSG_RESULT(yes)
 
2246
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
 
2247
    ],
 
2248
    [ AC_MSG_RESULT(no) ]
 
2249
  )
 
2250
  LIBS="$kde_libs_safe"
 
2251
  AC_SUBST(LIBRESOLV)
 
2252
 
 
2253
  AC_MSG_CHECKING([if res_init is available])
 
2254
  AC_TRY_COMPILE(
 
2255
    [
 
2256
#include <sys/types.h>
 
2257
#include <netinet/in.h>
 
2258
#include <arpa/nameser.h>
 
2259
#include <resolv.h>
 
2260
    ],
 
2261
    [
 
2262
      res_init();
 
2263
    ],
 
2264
    [
 
2265
      AC_MSG_RESULT(yes)
 
2266
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
 
2267
    ],
 
2268
    [ AC_MSG_RESULT(no) ]
 
2269
  )
 
2270
])
 
2271
 
 
2272
AC_DEFUN(AC_CHECK_STRLCPY,
 
2273
[
 
2274
        KDE_CHECK_FUNC_EXT(strlcpy, [
 
2275
#include <string.h>
 
2276
],
 
2277
[ char buf[20];
 
2278
  strlcpy(buf, "KDE function test", sizeof(buf));
 
2279
],
 
2280
        [unsigned long strlcpy(char*, const char*, unsigned long)],
 
2281
        [STRLCPY])
 
2282
])
 
2283
 
 
2284
AC_DEFUN(AC_CHECK_STRLCAT,
 
2285
[
 
2286
        KDE_CHECK_FUNC_EXT(strlcat, [
 
2287
#include <string.h>
 
2288
],
 
2289
[ char buf[20];
 
2290
  buf[0]='\0';
 
2291
  strlcat(buf, "KDE function test", sizeof(buf));
 
2292
],
 
2293
        [unsigned long strlcat(char*, const char*, unsigned long)],
 
2294
        [STRLCAT])
1862
2295
])
1863
2296
 
1864
2297
AC_DEFUN(AC_FIND_GIF,
1951
2384
 
1952
2385
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
1953
2386
dnl requires system dependent includes loaded before it)
1954
 
jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
 
2387
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
1955
2388
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
1956
2389
test "x$jpeg_incdir" = xNO && jpeg_incdir=
1957
2390
 
1978
2411
fi
1979
2412
 
1980
2413
AC_SUBST(LIBJPEG)
 
2414
AH_VERBATIM(_AC_CHECK_JPEG,
 
2415
[/*
 
2416
 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
 
2417
 * headers and I'm too lazy to write a configure test as long as only
 
2418
 * unixware is related
 
2419
 */
 
2420
#ifdef _UNIXWARE
 
2421
#define HAVE_BOOLEAN
 
2422
#endif
 
2423
])
 
2424
])
 
2425
 
 
2426
AC_DEFUN(KDE_CHECK_QT_JPEG,
 
2427
[
 
2428
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
 
2429
AC_CACHE_VAL(kde_cv_qt_jpeg,
 
2430
[
 
2431
AC_LANG_SAVE
 
2432
AC_LANG_CPLUSPLUS
 
2433
ac_save_LIBS="$LIBS"
 
2434
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
 
2435
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
 
2436
ac_save_CXXFLAGS="$CXXFLAGS"
 
2437
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
2438
AC_TRY_LINK(
 
2439
[#include <qapplication.h>],
 
2440
            [
 
2441
            int argc;
 
2442
            char** argv;
 
2443
            QApplication app(argc, argv);],
 
2444
            eval "kde_cv_qt_jpeg=no",
 
2445
            eval "kde_cv_qt_jpeg=yes")
 
2446
LIBS="$ac_save_LIBS"
 
2447
CXXFLAGS="$ac_save_CXXFLAGS"
 
2448
AC_LANG_RESTORE
 
2449
])
 
2450
 
 
2451
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
 
2452
  AC_MSG_RESULT(yes)
 
2453
  LIBJPEG_QT='$(LIBJPEG)'
 
2454
else
 
2455
  AC_MSG_RESULT(no)
 
2456
  LIBJPEG_QT=
 
2457
fi
 
2458
 
1981
2459
])
1982
2460
 
1983
2461
AC_DEFUN(AC_FIND_ZLIB,
2151
2629
 
2152
2630
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2153
2631
[
2154
 
dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
2155
2632
AC_MSG_CHECKING(whether $CXX supports -$1)
2156
 
kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
 
2633
kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
2157
2634
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2158
2635
[
2159
 
echo 'int main() { return 0; }' >conftest.cc
2160
 
eval "kde_cv_prog_cxx_$kde_cache=no"
2161
 
if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
2162
 
  if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
2163
 
    eval "kde_cv_prog_cxx_$kde_cache=yes"
2164
 
  fi
2165
 
fi
2166
 
rm -f conftest*
 
2636
  AC_LANG_SAVE
 
2637
  AC_LANG_CPLUSPLUS
 
2638
  save_CXXFLAGS="$CXXFLAGS"
 
2639
  CXXFLAGS="$CXXFLAGS -$1"
 
2640
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
 
2641
  CXXFLAGS="$save_CXXFLAGS"
 
2642
  AC_LANG_RESTORE
2167
2643
])
2168
2644
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2169
2645
 AC_MSG_RESULT(yes)
2202
2678
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2203
2679
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2204
2680
[dnl
 
2681
if test "x$kde_use_qt_emb" != "xyes"; then
2205
2682
 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2206
2683
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
 
2684
else
 
2685
 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
 
2686
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
 
2687
fi
2207
2688
])
2208
2689
 
2209
2690
AC_DEFUN(AC_CHECK_COMPILERS,
2210
2691
[
2211
 
  AC_ARG_ENABLE(debug,[  --enable-debug          enables debug symbols [default=no]],
 
2692
  AC_ARG_ENABLE(debug,[  --enable-debug[=ARG]    enables debug symbols (yes|no|full) [default=no]],
2212
2693
  [
2213
 
   if test $enableval = "no"; dnl
2214
 
     then
2215
 
       kde_use_debug_code="no"
2216
 
       kde_use_debug_define=yes
2217
 
     else
2218
 
       kde_use_debug_code="yes"
2219
 
       kde_use_debug_define=no
2220
 
   fi
 
2694
    case $enableval in
 
2695
      yes)
 
2696
        kde_use_debug_code="yes"
 
2697
        kde_use_debug_define=no
 
2698
        ;;
 
2699
      full)
 
2700
        kde_use_debug_code="full"
 
2701
        kde_use_debug_define=no
 
2702
        ;;
 
2703
      *)
 
2704
        kde_use_debug_code="no"
 
2705
        kde_use_debug_define=yes
 
2706
        ;;
 
2707
    esac
2221
2708
  ], 
2222
2709
    [kde_use_debug_code="no"
2223
2710
      kde_use_debug_define=no
2235
2722
    fi
2236
2723
   ], [kde_use_strict_options="no"])
2237
2724
 
 
2725
  AC_ARG_ENABLE(warnings,[  --disable-warnings      disables compilation with -Wall and similiar],
 
2726
   [
 
2727
    if test $enableval = "no"; then
 
2728
         kde_use_warnings="no"
 
2729
       else
 
2730
         kde_use_warnings="yes"
 
2731
    fi
 
2732
   ], [kde_use_warnings="yes"])
 
2733
 
 
2734
  dnl enable warnings for debug build
 
2735
  if test "$kde_use_debug_code" != "no"; then
 
2736
    kde_use_warnings=yes
 
2737
  fi
 
2738
 
2238
2739
  AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
2239
2740
    [kde_use_profiling=$enableval],
2240
2741
    [kde_use_profiling="no"]
2241
2742
  )
2242
2743
 
 
2744
  AC_ARG_ENABLE(gcov,[  --enable-gcov           enables gcov test coverage support [default=no]],
 
2745
    [kde_use_gcov=$enableval],
 
2746
    [kde_use_gcov=no]
 
2747
  )
 
2748
 
2243
2749
  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2244
2750
  CFLAGS=" $CFLAGS"
2245
2751
 
2246
2752
  AC_PROG_CC 
2247
2753
 
 
2754
  AC_PROG_CPP
 
2755
 
2248
2756
  if test "$GCC" = "yes"; then
2249
 
    if test "$kde_use_debug_code" = "yes"; then
2250
 
      CFLAGS="-g -O2 $CFLAGS"
2251
 
      case $host in
2252
 
        *-*-linux-gnu)  
2253
 
          CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2254
 
        ;;
2255
 
      esac
 
2757
    if test "$kde_use_debug_code" != "no"; then
 
2758
      if test $kde_use_debug_code = "full" || test $kde_use_gcov = "yes"; then
 
2759
        CFLAGS="-g3 $CFLAGS"
 
2760
      else
 
2761
        CFLAGS="-g -O2 $CFLAGS"
 
2762
      fi
2256
2763
    else
2257
2764
      CFLAGS="-O2 $CFLAGS"
2258
2765
    fi
2262
2769
    CFLAGS="-DNDEBUG $CFLAGS"
2263
2770
  fi
2264
2771
 
 
2772
 
2265
2773
  case "$host" in
2266
2774
  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2267
2775
  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2275
2783
 
2276
2784
  AC_PROG_CXX
2277
2785
 
2278
 
  if test "$GXX" = "yes"; then
2279
 
    if test "$kde_use_debug_code" = "yes"; then
2280
 
      CXXFLAGS="-g -O2 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2281
 
 
2282
 
      KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2283
 
      KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
 
2786
  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
 
2787
    if test "$kde_use_debug_code" != "no"; then
 
2788
      if test "$CXX" = "KCC"; then
 
2789
        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
 
2790
      else
 
2791
        if test "$kde_use_debug_code" = "full"; then
 
2792
          CXXFLAGS="-g3 $CXXFLAGS"
 
2793
        else
 
2794
          CXXFLAGS="-g -O2 $CXXFLAGS"
 
2795
        fi
 
2796
      fi
2284
2797
      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2285
2798
 
2286
 
      case $host in  dnl
2287
 
      *-*-linux-gnu)
2288
 
        CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
2289
 
        ;;
2290
 
      esac
2291
 
 
2292
 
      if test "$kde_use_strict_options" = "yes"; then
2293
 
        CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
2294
 
      fi
2295
 
 
2296
 
      if test "$kde_very_strict" = "yes"; then
2297
 
        CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
2298
 
      fi
 
2799
      dnl convenience compiler flags
 
2800
      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
 
2801
      AC_SUBST(WOVERLOADED_VIRTUAL)
2299
2802
    else
2300
 
      CXXFLAGS="-O2 $CXXFLAGS"
 
2803
      if test "$CXX" = "KCC"; then
 
2804
        CXXFLAGS="+K3 $CXXFLAGS"
 
2805
      else
 
2806
        CXXFLAGS="-O2 $CXXFLAGS"
 
2807
      fi  
2301
2808
    fi
2302
2809
  fi
2303
2810
 
2304
2811
  if test "$kde_use_debug_define" = "yes"; then
2305
 
    CXXFLAGS="-DNDEBUG $CXXFLAGS"
 
2812
    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
2306
2813
  fi  
2307
2814
 
2308
2815
  if test "$kde_use_profiling" = "yes"; then
2312
2819
      CXXFLAGS="-pg $CXXFLAGS"
2313
2820
    ])
2314
2821
  fi
 
2822
 
 
2823
  if test "$kde_use_gcov" = "yes"; then
 
2824
    KDE_CHECK_COMPILER_FLAG(fprofile-arcs,
 
2825
    [
 
2826
      CFLAGS="-fprofile-arcs -ftest-coverage $CFLAGS"
 
2827
      CXXFLAGS="-fprofile-arcs -ftest-coverage $CXXFLAGS"
 
2828
    ])
 
2829
  fi
 
2830
 
 
2831
  if test "$kde_use_warnings" = "yes"; then
 
2832
      if test "$GCC" = "yes"; then
 
2833
        case $host in
 
2834
          *-*-linux-gnu)        
 
2835
            CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
 
2836
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
 
2837
          ;;
 
2838
        esac
 
2839
        CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
 
2840
        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
 
2841
        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
 
2842
        KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
 
2843
     fi
 
2844
  fi
 
2845
 
 
2846
  if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
 
2847
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
 
2848
  fi
2315
2849
    
2316
 
  KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2317
 
  KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2318
 
  KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
 
2850
  if test "$GXX" = "yes"; then
 
2851
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
 
2852
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
 
2853
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
 
2854
  fi
 
2855
  if test "$CXX" = "KCC"; then
 
2856
    dnl unfortunately we currently cannot disable exception support in KCC
 
2857
    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
 
2858
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
 
2859
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
 
2860
 
 
2861
    AC_ARG_ENABLE(pch,[  --enable-pch            enables precompiled header support (currently only KCC) [default=no]],
 
2862
    [
 
2863
      kde_use_pch=$enableval
 
2864
    ],[kde_use_pch=no])
 
2865
 
 
2866
    if test "$kde_use_pch" = "yes"; then
 
2867
      dnl TODO: support --pch-dir!
 
2868
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
 
2869
      dnl the below works (but the dir must exist), but it's
 
2870
      dnl useless for a whole package.
 
2871
      dnl The are precompiled headers for each source file, so when compiling
 
2872
      dnl from scratch, it doesn't make a difference, and they take up
 
2873
      dnl around ~5Mb _per_ sourcefile.
 
2874
      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
 
2875
      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
 
2876
    fi
 
2877
    dnl this flag controls inlining. by default KCC inlines in optimisation mode
 
2878
    dnl all implementations that are defined inside the class {} declaration. 
 
2879
    dnl because of templates-compatibility with broken gcc compilers, this
 
2880
    dnl can cause excessive inlining. This flag limits it to a sane level
 
2881
    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
 
2882
    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
 
2883
    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
 
2884
    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
 
2885
    dnl Some source files are shared between multiple executables
 
2886
    dnl (or libraries) and some of those need template instantiations.
 
2887
    dnl In that case KCC needs to compile those sources with
 
2888
    dnl --one_instantiation_per_object.  To make it easy for us we compile
 
2889
    dnl _all_ objects with that flag (--one_per is a shorthand).
 
2890
    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
 
2891
  fi
2319
2892
  AC_SUBST(USE_EXCEPTIONS)
2320
2893
  dnl obsolete macro - provided to keep things going
2321
2894
  USE_RTTI=
2339
2912
 
2340
2913
  AC_PROG_CXXCPP
2341
2914
 
2342
 
  # the following is to allow programs, that are known to
2343
 
  # have problems when compiled with -O2
2344
 
  if test -n "$CXXFLAGS"; then
2345
 
      kde_safe_IFS=$IFS
2346
 
      IFS=" "
2347
 
      NOOPT_CXXFLAGS=""
2348
 
      for i in $CXXFLAGS; do
2349
 
        case $i in
2350
 
          -O*)
2351
 
                ;;
2352
 
          *)
2353
 
                NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
2354
 
                ;;
2355
 
        esac
2356
 
      done
2357
 
      IFS=$kde_safe_IFS
2358
 
  fi
2359
 
 
2360
 
  if test "x$kde_use_qt_emb" = "xyes"; then
2361
 
    NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS -DQWS"
 
2915
  if test "$GCC" = yes; then
 
2916
     NOOPT_CXXFLAGS=-O0
 
2917
     NOOPT_CFLAGS=-O0
2362
2918
  fi
2363
2919
 
2364
2920
  AC_SUBST(NOOPT_CXXFLAGS)
 
2921
  AC_SUBST(NOOPT_CFLAGS)
2365
2922
 
2366
2923
  KDE_CHECK_FINAL
2367
2924
 
2368
2925
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2369
 
 
2370
 
  KDE_CXXFLAGS=
2371
 
  AC_SUBST(KDE_CXXFLAGS)
2372
2926
])
2373
2927
 
2374
2928
AC_DEFUN(KDE_ADD_DEPENDENCIES,
2385
2939
AC_REQUIRE([AC_ENABLE_STATIC])
2386
2940
 
2387
2941
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
 
2942
AC_REQUIRE([KDE_CHECK_LIB64])
2388
2943
 
2389
2944
AC_LANG_SAVE
2390
2945
AC_LANG_C
2399
2954
#  LIBTOOL="$LIBTOOL --silent"
2400
2955
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
2401
2956
AC_SUBST(KDE_PLUGIN)
 
2957
 
 
2958
AC_ARG_ENABLE(objprelink, [  --enable-objprelink     prelink apps using objprelink (obsolete)],
 
2959
       kde_use_objprelink=$enableval, kde_use_objprelink=no)
 
2960
  if test "x$kde_use_objprelink" = "xyes"; then 
 
2961
        AC_MSG_WARN([
 
2962
------------------------------------------------------------
 
2963
Configuration option --enable-objprelink is no longer useful.
 
2964
See http:://objprelink.sourceforge.net for details:
 
2965
1- Recent binutils are fast enough to do without objprelink.
 
2966
2- Newer versions of objprelink do not need this option.
 
2967
------------------------------------------------------------
 
2968
])
 
2969
  fi
 
2970
])
 
2971
 
 
2972
AC_DEFUN(KDE_CHECK_LIB64,
 
2973
[
 
2974
    kdelibsuff=none
 
2975
    AC_ARG_ENABLE(libsuffix,
 
2976
        AC_HELP_STRING([--enable-libsuffix],
 
2977
            [/lib directory suffix (64,32,none[=default])]),
 
2978
            kdelibsuff=$enableval)
 
2979
    # TODO: add an auto case that compiles a little C app to check
 
2980
    # where the glibc is
 
2981
    if test "$kdelibsuff" = "none"; then
 
2982
       kdelibsuff=
 
2983
    fi
 
2984
    if test -z "$kdelibsuff"; then
 
2985
        AC_MSG_RESULT([not using lib directory suffix])
 
2986
        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
 
2987
    else
 
2988
        if test "$libdir" = '${exec_prefix}/lib'; then
 
2989
            libdir="$libdir${kdelibsuff}"
 
2990
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
 
2991
        fi
 
2992
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
 
2993
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
 
2994
    fi
2402
2995
])
2403
2996
 
2404
2997
AC_DEFUN(KDE_CHECK_TYPES,
2437
3030
  fi
2438
3031
  dnl $x_libraries is set to /usr/lib in case
2439
3032
  if test -n "$X_LDFLAGS"; then
2440
 
    KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
 
3033
    X_RPATH="-R \$(x_libraries)" 
 
3034
    KDE_RPATH="$KDE_RPATH $X_RPATH"
2441
3035
  fi
2442
3036
  if test -n "$KDE_EXTRA_RPATH"; then
2443
3037
    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
2445
3039
fi
2446
3040
AC_SUBST(KDE_EXTRA_RPATH)
2447
3041
AC_SUBST(KDE_RPATH)
 
3042
AC_SUBST(X_RPATH)
2448
3043
AC_MSG_RESULT($USE_RPATH)
2449
3044
])
2450
3045
 
2641
3236
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2642
3237
   AC_REQUIRE([AC_FUNC_MMAP])dnl
2643
3238
   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
2644
 
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
2645
 
   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
 
3239
   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
 
3240
   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
2646
3241
__argz_count __argz_stringify __argz_next])
2647
3242
 
2648
3243
   AC_MSG_CHECKING(for stpcpy)
2649
3244
   AC_CACHE_VAL(kde_cv_func_stpcpy,
2650
3245
   [
2651
3246
   kde_safe_cxxflags=$CXXFLAGS
2652
 
   CXXFLAGS="-Wmissing-prototypes -Werror"
 
3247
   CXXFLAGS="-Werror"
2653
3248
   AC_LANG_SAVE
2654
3249
   AC_LANG_CPLUSPLUS
2655
3250
   AC_TRY_COMPILE([
2856
3451
   AC_MSG_CHECKING(for GL)
2857
3452
   AC_CACHE_VAL(ac_cv_have_gl,
2858
3453
   [
2859
 
    AC_LANG_C
 
3454
    AC_LANG_SAVE
 
3455
    AC_LANG_CPLUSPLUS
2860
3456
    ac_save_ldflags="$LDFLAGS"
2861
 
    ac_save_cflags="$CFLAGS"
 
3457
    ac_save_cxxflags="$CXXFLAGS"
2862
3458
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
2863
3459
    test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
2864
3460
    LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
2865
 
    CFLAGS="$CFLAGS $X_INCLUDES"
 
3461
    CXXFLAGS="$CFLAGS $X_INCLUDES"
2866
3462
    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2867
3463
    AC_TRY_LINK([#include <GL/gl.h>
2868
 
#include <GL/glu.h>           
 
3464
#include <GL/glu.h>
2869
3465
], [],
2870
3466
        ac_cv_have_gl="mesa", ac_cv_have_gl="no")
2871
3467
    if test "x$ac_cv_have_gl" = "xno"; then
2872
 
      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU"
 
3468
      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
2873
3469
      test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
2874
3470
      LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
2875
 
      CFLAGS="$ac_save_cflags $X_INCLUDES"
 
3471
      CXXFLAGS="$ac_save_cflags $X_INCLUDES"
2876
3472
      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
2877
3473
      AC_TRY_LINK([#include <GL/gl.h>
2878
3474
#include <GL/glu.h>
2879
3475
], [],
2880
3476
          ac_cv_have_gl="yes", ac_cv_have_gl="no")
2881
3477
    fi
 
3478
    AC_LANG_RESTORE
2882
3479
    LDFLAGS="$ac_save_ldflags"
2883
 
    CFLAGS="$ac_save_cflags"
 
3480
    CXXFLAGS="$ac_save_cxxflags"
2884
3481
   ])dnl
2885
3482
 
2886
3483
  if test "$ac_cv_have_gl" = "no"; then
2892
3489
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
2893
3490
    if test "$GL_LDFLAGS" = ""; then
2894
3491
       if test "$ac_cv_have_gl" = "mesa"; then
2895
 
          GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
 
3492
          GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
2896
3493
       else
2897
 
          GLLIB='-lGL -lGLU $(LIB_X11)'
 
3494
          GLLIB='-lGLU -lGL $(LIB_X11)'
2898
3495
       fi
2899
3496
    else
2900
3497
       if test "$ac_cv_have_gl" = "mesa"; then
2901
 
          GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
 
3498
          GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
2902
3499
       else
2903
 
          GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
 
3500
          GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
2904
3501
       fi
2905
3502
    fi
2906
3503
    if test "$GL_INCLUDE" = ""; then
2938
3535
      AC_CACHE_VAL(ac_cv_path_pam,
2939
3536
        [ use_pam=no
2940
3537
          AC_CHECK_LIB(pam, pam_start,
2941
 
            [ AC_CHECK_HEADER(security/pam_appl.h, 
 
3538
            [ AC_CHECK_HEADER(security/pam_appl.h,
2942
3539
                [ use_pam=yes
2943
3540
                  pam_service=kde ]) 
2944
3541
            ], , $LIBDL)
3060
3657
    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3061
3658
  fi
3062
3659
 
 
3660
  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
 
3661
  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
 
3662
  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
 
3663
  dnl may need to read /etc/master.passwd).
 
3664
  case $host in
 
3665
  *-*-freebsd*)
 
3666
    SETUIDFLAGS="-m 4755 -o root"
 
3667
    ;;
 
3668
  *)
 
3669
    ;;
 
3670
  esac
 
3671
 
3063
3672
  AC_SUBST(PASSWDLIBS)
3064
3673
])
3065
3674
 
3336
3945
 
3337
3946
    if test "$kde_use_kernthreads" = "yes"; then
3338
3947
      ac_save_CXXFLAGS="$CXXFLAGS"
3339
 
      ac_save_CFLAGS="$CXXFLAGS"
 
3948
      ac_save_CFLAGS="$CFLAGS"
3340
3949
      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3341
3950
      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3342
3951
      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3360
3969
      fi
3361
3970
    fi
3362
3971
 
 
3972
    AH_VERBATIM(__svr_define, [
 
3973
#if defined(__SVR4) && !defined(__svr4__)
 
3974
#define __svr4__ 1
 
3975
#endif
 
3976
])
3363
3977
    case $host_os in
3364
3978
        solaris*)
3365
3979
                KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3366
3980
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3367
 
                echo "Setting Solaris pthread compilation options"
3368
3981
                ;;
3369
3982
        freebsd*)
3370
3983
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3371
 
                echo "Setting FreeBSD pthread compilation options"
3372
3984
                ;;
3373
3985
        aix*)
3374
3986
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3375
3987
                LIBPTHREAD="$LIBPTHREAD -lc_r"
3376
 
                echo "Setting AIX pthread compilation options"
3377
3988
                ;;
3378
3989
        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3379
 
                USE_THREADS="$USE_THREADS -DPIC -fPIC"
3380
 
                echo "Setting Linux pthread compilation options"
 
3990
                if test "$CXX" = "KCC"; then
 
3991
                  CXXFLAGS="$CXXFLAGS --thread_safe"
 
3992
                  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
 
3993
                fi
3381
3994
                ;;
3382
3995
        *)
3383
3996
                ;;
3553
4166
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
3554
4167
  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
3555
4168
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
 
4169
  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
3556
4170
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
3557
4171
        [AC_MSG_WARN([it seems, Python depends on another library.
3558
 
    Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
 
4172
    Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
3559
4173
    and contact the authors to let them know about this problem])
3560
 
 
3561
4174
        ])
3562
4175
 
3563
4176
  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
3573
4186
 
3574
4187
AC_DEFUN(KDE_CHECK_PYTHON,
3575
4188
[
3576
 
  KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
3577
 
        [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
3578
 
  ])
 
4189
  KDE_CHECK_PYTHON_INTERN("2.3", 
 
4190
    [KDE_CHECK_PYTHON_INTERN("2.2", 
 
4191
      [KDE_CHECK_PYTHON_INTERN("2.1", 
 
4192
        [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
 
4193
  ])])])
3579
4194
])
3580
4195
 
3581
4196
AC_DEFUN(KDE_CHECK_STL_SGI,
3635
4250
       KDE_CHECK_STL_HP
3636
4251
 
3637
4252
       if test "$kde_cv_stl_type_hp" = "no"; then
3638
 
         AC_MSG_ERROR("no known STL type found")
 
4253
         AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
3639
4254
       fi
3640
4255
    fi
3641
4256
 
3779
4394
    install_it="no"
3780
4395
  fi
3781
4396
  AC_MSG_RESULT($install_it)
 
4397
  vari=`echo $i | sed -e 's,[[-+.]],_,g'`
3782
4398
  if test $install_it = "yes"; then
3783
4399
    TOPSUBDIRS="$TOPSUBDIRS $i"
 
4400
    eval "$vari""_SUBDIR_included=yes"
 
4401
  else
 
4402
    eval "$vari""_SUBDIR_included=no"
3784
4403
  fi
3785
4404
done
3786
4405
 
3845
4464
if test "$ac_cv_have_s_issock" = "yes"; then
3846
4465
  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
3847
4466
fi
 
4467
 
 
4468
AH_VERBATIM(_ISSOCK,
 
4469
[
 
4470
#ifndef HAVE_S_ISSOCK
 
4471
#define HAVE_S_ISSOCK
 
4472
#define S_ISSOCK(mode) (1==0)
 
4473
#endif
 
4474
])
 
4475
 
3848
4476
])
3849
4477
 
3850
4478
dnl ------------------------------------------------------------------------
3924
4552
   kde_safe_cppflags=$CPPFLAGS
3925
4553
   CPPFLAGS="$CPPFLAGS $all_includes"
3926
4554
   AC_LANG_CPLUSPLUS
3927
 
   AC_CHECK_HEADER($1, $2, $3)
 
4555
   AC_CHECK_HEADER($1, $2, $3, $4)
3928
4556
   CPPFLAGS=$kde_safe_cppflags
3929
4557
   AC_LANG_RESTORE
3930
4558
])
3931
4559
 
3932
 
AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
 
4560
AC_DEFUN(KDE_CHECK_HEADERS,
3933
4561
[
3934
 
  KDE_CHECK_HEADER(QwSpriteField.h, ,
3935
 
  [
3936
 
    AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
3937
 
       QwSpriteField out of kdesupport.])
3938
 
      $1
3939
 
  ])
 
4562
   AH_CHECK_HEADERS([$1])
 
4563
   AC_LANG_SAVE
 
4564
   kde_safe_cppflags=$CPPFLAGS
 
4565
   CPPFLAGS="$CPPFLAGS $all_includes"
 
4566
   AC_LANG_CPLUSPLUS
 
4567
   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
 
4568
   CPPFLAGS=$kde_safe_cppflags
 
4569
   AC_LANG_RESTORE
3940
4570
])
3941
4571
 
3942
4572
AC_DEFUN(KDE_FAST_CONFIGURE,
3969
4599
 
3970
4600
  if test "x$prefix" = "xNONE"; then
3971
4601
    prefix=$ac_default_prefix
3972
 
    ac_configure_args="$ac_configure_args --prefix $prefix"
 
4602
    ac_configure_args="$ac_configure_args --prefix=$prefix"
3973
4603
  fi
 
4604
  # And delete superflous '/' to make compares easier
 
4605
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4606
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
3974
4607
  KDE_FAST_CONFIGURE
3975
4608
  KDE_CONF_FILES
3976
4609
])
4074
4707
 
4075
4708
AC_DEFUN(KDE_CHECK_LIB,
4076
4709
[
 
4710
     kde_save_LDFLAGS="$LDFLAGS"
 
4711
     dnl AC_CHECK_LIB modifies LIBS, so save it here
4077
4712
     kde_save_LIBS="$LIBS"
4078
 
     LIBS="$LIBS $all_libraries"
 
4713
     LDFLAGS="$LDFLAGS $all_libraries"
4079
4714
     case $host_os in
4080
 
      aix*) LIBS="-brtl $LIBS"
4081
 
        test "$GCC" = yes && LIBS="-Wl,$LIBS"
 
4715
      aix*) LDFLAGS="-brtl $LDFLAGS"
 
4716
        test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4082
4717
        ;;
4083
4718
     esac
4084
4719
     AC_CHECK_LIB($1, $2, $3, $4, $5)
 
4720
     LDFLAGS="$kde_save_LDFLAGS"
4085
4721
     LIBS="$kde_save_LIBS"
4086
4722
])
4087
4723
 
4088
 
 
4089
 
 
4090
 
 
4091
 
AC_DEFUN(KDE_CHECK_INITGROUPS,
4092
 
4093
 
  AC_REQUIRE([AC_CANONICAL_HOST])
4094
 
  AC_CHECK_FUNCS(initgroups)
4095
 
  if test "x$ac_cv_func_initgroups" = "xyes"; then
4096
 
    case $host_os in
4097
 
      aix*) AC_LANG_SAVE
4098
 
            AC_LANG_CPLUSPLUS
4099
 
            AC_MSG_CHECKING([for initgroups prototype])
4100
 
            AC_CACHE_VAL(kde_cv_check_initgroups_proto,
4101
 
            [ AC_TRY_COMPILE(
4102
 
              [ #include <grp.h>
4103
 
              ],
4104
 
              [ char buffer[10];
4105
 
                gid_t id;
4106
 
                int x = initgroups(buffer,id);
4107
 
              ],
4108
 
              kde_cv_check_initgroups_proto=yes,
4109
 
              kde_cv_check_initgroups_proto=no)
4110
 
            ])
4111
 
            AC_MSG_RESULT($kde_cv_check_initgroups_proto)
4112
 
            AC_LANG_RESTORE
4113
 
            ;;
4114
 
      *)
4115
 
            kde_cv_check_initgroups_proto=yes
4116
 
            ;;
4117
 
    esac
4118
 
  else
4119
 
    kde_cv_check_initgroups_proto=no
4120
 
  fi
4121
 
  if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
4122
 
    kde_check_initgroups_proto=1
4123
 
  else
4124
 
    kde_check_initgroups_proto=0
4125
 
  fi
4126
 
  AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
4127
 
           [initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
 
4724
AC_DEFUN(KDE_JAVA_PREFIX,
 
4725
[
 
4726
        dir=`dirname "$1"`
 
4727
        base=`basename "$1"`
 
4728
        list=`ls -1 $dir 2> /dev/null`
 
4729
        for entry in $list; do 
 
4730
                if test -d $dir/$entry/bin; then
 
4731
                        case $entry in
 
4732
                           $base)
 
4733
                                javadirs="$javadirs $dir/$entry/bin"
 
4734
                                ;;
 
4735
                        esac
 
4736
                elif test -d $dir/$entry/jre/bin; then
 
4737
                        case $entry in
 
4738
                           $base)
 
4739
                                javadirs="$javadirs $dir/$entry/jre/bin"
 
4740
                                ;;
 
4741
                        esac
 
4742
                fi
 
4743
        done
4128
4744
])
4129
4745
 
4130
 
 
 
4746
dnl KDE_CHEC_JAVA_DIR(onlyjre)
4131
4747
AC_DEFUN(KDE_CHECK_JAVA_DIR,
4132
4748
[
4133
 
AC_MSG_CHECKING([for Java directory])
4134
4749
 
4135
4750
AC_ARG_WITH(java,
4136
4751
[  --with-java=javadir     use java installed in javadir, --without-java disables ],
4138
4753
], ac_java_dir=""
4139
4754
)
4140
4755
 
 
4756
AC_MSG_CHECKING([for Java])
 
4757
 
4141
4758
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4142
 
if test "x$ac_java_dir" = xno; then
4143
 
   kde_cv_java_bindir=no
4144
 
   kde_cv_java_includedir=no
4145
 
   kde_cv_java_libjvmdir=no
4146
 
   kde_cv_java_libhpidir=no
 
4759
if test "x$ac_java_dir" = "xno"; then
 
4760
   kde_java_bindir=no
 
4761
   kde_java_includedir=no
 
4762
   kde_java_libjvmdir=no
 
4763
   kde_java_libhpidir=no
4147
4764
else
4148
 
  if test "x$ac_java_dir" = x; then
4149
 
    dnl No option set -> look in $PATH
4150
 
    AC_CACHE_VAL(kde_cv_java_bindir,
4151
 
    [
4152
 
      dnl First look for javac in $PATH. If not found we'll look at the option.
4153
 
      KDE_FIND_PATH(javac, JAVAC, [], [])
 
4765
  if test "x$ac_java_dir" = "x"; then
 
4766
     
 
4767
     
 
4768
      dnl No option set -> look in $PATH
 
4769
      KDE_JAVA_PREFIX(/usr/j2se)
 
4770
      KDE_JAVA_PREFIX(/usr/j*dk*)
 
4771
      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
 
4772
      KDE_JAVA_PREFIX(/opt/j*sdk*)
 
4773
      KDE_JAVA_PREFIX(/usr/lib/java*)
 
4774
      KDE_JAVA_PREFIX(/usr/java*)
 
4775
      KDE_JAVA_PREFIX(/usr/java/j*dk*)
 
4776
      KDE_JAVA_PREFIX(/usr/java/j*re*)
 
4777
      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
 
4778
      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
 
4779
      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
 
4780
      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
 
4781
      KDE_JAVA_PREFIX(/opt/java*)
 
4782
    
 
4783
      kde_cv_path="NONE"
 
4784
      kde_save_IFS=$IFS
 
4785
      IFS=':'
 
4786
      for dir in $PATH; do
 
4787
          javadirs="$javadirs $dir"
 
4788
      done
 
4789
      IFS=$kde_save_IFS
 
4790
      jredirs=
 
4791
 
 
4792
      for dir in $javadirs; do
 
4793
          if test ! -d $dir; then break; fi
 
4794
          if test -x "$dir/java"; then
 
4795
                libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
4796
                if test ! -f $libjvmdir/libjvm.so; then continue; fi
 
4797
                jredirs="$jredirs $dir"
 
4798
          fi
 
4799
      done
 
4800
 
 
4801
      JAVAC=
 
4802
      JAVA=
 
4803
      kde_java_bindir=no
 
4804
      for dir in $jredirs; do
 
4805
          JAVA="$dir/java"
 
4806
          kde_java_bindir=$dir
 
4807
          if test -x "$dir/javac"; then
 
4808
                JAVAC="$dir/javac"
 
4809
                break
 
4810
          fi
 
4811
      done
 
4812
 
4154
4813
      if test -n "$JAVAC"; then
4155
 
          kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
4156
4814
          dnl this substitution might not work - well, we test for jni.h below
4157
 
          kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
 
4815
          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4158
4816
      else
4159
 
          kde_cv_java_bindir=no
 
4817
          kde_java_includedir=no
4160
4818
      fi
4161
 
    ])
4162
4819
  else
4163
4820
    dnl config option set
4164
 
    kde_cv_java_bindir=$ac_java_dir/bin
4165
 
    kde_cv_java_includedir=$ac_java_dir/include
 
4821
    kde_java_bindir=$ac_java_dir/bin
 
4822
    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
 
4823
        kde_java_includedir=no
 
4824
    else
 
4825
        kde_java_includedir=$ac_java_dir/include
 
4826
    fi
4166
4827
  fi
4167
4828
fi
4168
4829
 
4169
 
dnl Look for libjvm.so
4170
 
kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4171
 
dnl Look for libhpi.so and avoid green threads
4172
 
kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
 
4830
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
 
4831
if test "x$kde_java_bindir" != "xno"; then
4173
4832
 
4174
 
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
4175
 
if test ! "x$kde_cv_java_bindir" = xno; then
 
4833
  dnl Look for libjvm.so
 
4834
  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
4835
  dnl Look for libhpi.so and avoid green threads
 
4836
  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4176
4837
 
4177
4838
  dnl Now check everything's fine under there
4178
 
 
4179
 
  if test ! -x "$kde_cv_java_bindir/javac"; then
4180
 
    AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
4181
 
  fi
4182
 
  if test ! -x "$kde_cv_java_bindir/javah"; then
4183
 
    AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4184
 
  fi
4185
 
  if test ! -x "$kde_cv_java_bindir/jar"; then
4186
 
    AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4187
 
  fi
4188
 
  if test ! -r "$kde_cv_java_includedir/jni.h"; then
4189
 
    AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
4190
 
  fi
4191
 
  if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
4192
 
    AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
4193
 
  fi
4194
 
  if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
4195
 
    AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
4196
 
  fi
4197
 
 
4198
 
  jni_includes="-I$kde_cv_java_includedir"
4199
 
  dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4200
 
  dnl and under linux here..
4201
 
  test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
4202
 
  test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
4203
 
 
4204
 
  dnl Check for JNI version
 
4839
  dnl the include dir is our flag for having the JDK
 
4840
  if test -d "$kde_java_includedir"; then
 
4841
    if test ! -x "$kde_java_bindir/javac"; then
 
4842
      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
 
4843
    fi
 
4844
    if test ! -x "$kde_java_bindir/javah"; then
 
4845
      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4846
    fi
 
4847
    if test ! -x "$kde_java_bindir/jar"; then
 
4848
      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4849
    fi
 
4850
    if test ! -r "$kde_java_includedir/jni.h"; then
 
4851
      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
 
4852
    fi
 
4853
 
 
4854
    jni_includes="-I$kde_java_includedir"
 
4855
    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
 
4856
    dnl and under linux here..
 
4857
    test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
 
4858
    test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
 
4859
    test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
 
4860
 
 
4861
  else
 
4862
    JAVAC=
 
4863
    jni_includes=
 
4864
  fi
 
4865
 
 
4866
  if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
 
4867
     AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
 
4868
  fi 
 
4869
 
 
4870
  if test ! -x "$kde_java_bindir/java"; then
 
4871
      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4872
  fi
 
4873
 
 
4874
  if test ! -r "$kde_java_libhpidir/libhpi.so"; then
 
4875
    AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
 
4876
  fi
 
4877
 
 
4878
  if test -n "$jni_includes"; then
 
4879
    dnl Check for JNI version
 
4880
    AC_LANG_SAVE
 
4881
    AC_LANG_CPLUSPLUS
 
4882
    ac_cxxflags_safe="$CXXFLAGS"
 
4883
    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
 
4884
 
 
4885
    AC_TRY_COMPILE([
 
4886
  #include <jni.h>
 
4887
              ],
 
4888
              [
 
4889
  #ifndef JNI_VERSION_1_2
 
4890
  Syntax Error
 
4891
  #endif
 
4892
              ],[ kde_jni_works=yes ],
 
4893
              [ kde_jni_works=no ])
 
4894
 
 
4895
    if test $kde_jni_works = no; then
 
4896
      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
 
4897
                    You need to have Java Development Kit (JDK) version 1.2. 
 
4898
 
 
4899
                    Use --with-java to specify another location.
 
4900
                    Use --without-java to configure without java support.
 
4901
                    Or download a newer JDK and try again. 
 
4902
                    See e.g. http://java.sun.com/products/jdk/1.2 ])
 
4903
    fi
 
4904
 
 
4905
    CXXFLAGS="$ac_cxxflags_safe"    
 
4906
    AC_LANG_RESTORE
 
4907
 
 
4908
    dnl All tests ok, inform and subst the variables
 
4909
 
 
4910
    JAVAC=$kde_java_bindir/javac
 
4911
    JAVAH=$kde_java_bindir/javah
 
4912
    JAR=$kde_java_bindir/jar
 
4913
    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
4914
    JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
 
4915
    AC_MSG_RESULT([java JDK in $kde_java_bindir])
 
4916
 
 
4917
  else
 
4918
      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
4919
      AC_MSG_RESULT([java JRE in $kde_java_bindir])
 
4920
  fi
 
4921
else # no
 
4922
  AC_MSG_RESULT([none found])
 
4923
fi
 
4924
 
 
4925
AC_SUBST(JAVAC)
 
4926
AC_SUBST(JAVAH)
 
4927
AC_SUBST(JAR)
 
4928
AC_SUBST(JVMLIBS)
 
4929
AC_SUBST(jni_includes)
 
4930
 
 
4931
# for backward compat
 
4932
kde_cv_java_includedir=$kde_java_includedir
 
4933
kde_cv_java_bindir=$kde_java_bindir
 
4934
])
 
4935
 
 
4936
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
 
4937
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
 
4938
dnl big packages, m4_foreach is dog-slow.  So use our own version of
 
4939
dnl it.  (matz@kde.org)
 
4940
m4_define([mm_foreach],
 
4941
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
 
4942
m4_define([mm_car], [[$1]])
 
4943
m4_define([mm_car2], [[$@]])
 
4944
m4_define([_mm_foreach],
 
4945
[m4_if(m4_quote($2), [], [],
 
4946
       [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
 
4947
                                                     mm_car2(m4_shift($2)),
 
4948
                                                     [$3])])])
 
4949
m4_define([AC_FOREACH],
 
4950
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
 
4951
 
 
4952
AC_DEFUN(KDE_NEED_FLEX,
 
4953
[
 
4954
kde_libs_safe=$LIBS
 
4955
LIBS="$LIBS $USER_LDFLAGS"
 
4956
AM_PROG_LEX
 
4957
LIBS=$kde_libs_safe
 
4958
if test -z "$LEXLIB"; then
 
4959
    AC_MSG_ERROR([You need to have flex installed.])
 
4960
fi
 
4961
AC_SUBST(LEXLIB)
 
4962
])
 
4963
 
 
4964
AC_DEFUN(AC_PATH_QTOPIA,
 
4965
[
 
4966
  dnl TODO: use AC_CACHE_VAL
 
4967
 
 
4968
  if test -z "$1"; then
 
4969
    qtopia_minver_maj=1
 
4970
    qtopia_minver_min=5
 
4971
    qtopia_minver_pat=0
 
4972
  else
 
4973
    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
 
4974
    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
 
4975
    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
 
4976
  fi
 
4977
 
 
4978
  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
 
4979
  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
 
4980
 
 
4981
  AC_REQUIRE([AC_PATH_QT])
 
4982
 
 
4983
  AC_MSG_CHECKING([for Qtopia])
 
4984
 
 
4985
  LIB_QTOPIA="-lqpe"
 
4986
  AC_SUBST(LIB_QTOPIA)
 
4987
 
 
4988
  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
 
4989
 
 
4990
  ac_qtopia_incdir=NO
 
4991
 
 
4992
  AC_ARG_WITH(qtopia-dir,
 
4993
              [  --with-qtopia-dir=DIR   where the root of Qtopia is installed ],
 
4994
              [  ac_qtopia_incdir="$withval"/include] ) 
 
4995
  
 
4996
  qtopia_incdirs=""
 
4997
  for dir in $kde_qtopia_dirs; do
 
4998
    qtopia_incdirs="$qtopia_incdirs $dir/include"
 
4999
  done
 
5000
 
 
5001
  if test ! "$ac_qtopia_incdir" = "NO"; then
 
5002
    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
 
5003
  fi
 
5004
 
 
5005
  qtopia_incdir=""
 
5006
  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
 
5007
  ac_qtopia_incdir="$qtopia_incdir"
 
5008
 
 
5009
  if test -z "$qtopia_incdir"; then
 
5010
    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
 
5011
  fi
 
5012
 
 
5013
  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
 
5014
  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
 
5015
  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
 
5016
 
 
5017
  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
 
5018
  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
 
5019
  if test "$qtopia_ver" -lt "$qtopia_minver"; then
 
5020
    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
 
5021
is required.])
 
5022
  fi
 
5023
 
4205
5024
  AC_LANG_SAVE
4206
5025
  AC_LANG_CPLUSPLUS
 
5026
 
4207
5027
  ac_cxxflags_safe="$CXXFLAGS"
4208
 
  CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4209
 
 
4210
 
  AC_TRY_COMPILE([
4211
 
#include <jni.h>
4212
 
            ],
4213
 
            [
4214
 
#ifndef JNI_VERSION_1_2
4215
 
Syntax Error
 
5028
  ac_ldflags_safe="$LDFLAGS"
 
5029
  ac_libs_safe="$LIBS"
 
5030
 
 
5031
  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
 
5032
  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
 
5033
  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
 
5034
 
 
5035
  cat > conftest.$ac_ext <<EOF
 
5036
#include "confdefs.h"
 
5037
#include <qpe/qpeapplication.h>
 
5038
#include <qpe/version.h>
 
5039
 
 
5040
int main( int argc, char **argv )
 
5041
{
 
5042
    QPEApplication app( argc, argv );
 
5043
    return 0;
 
5044
}
 
5045
EOF
 
5046
 
 
5047
  if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
5048
    rm -f conftest*
 
5049
  else
 
5050
    rm -f conftest*
 
5051
    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
 
5052
the end of config.log])
 
5053
  fi
 
5054
 
 
5055
  CXXFLAGS="$ac_cxxflags_safe"
 
5056
  LDFLAGS="$ac_ldflags_safe"
 
5057
  LIBS="$ac_libs_safe"
 
5058
 
 
5059
  AC_LANG_RESTORE
 
5060
 
 
5061
  QTOPIA_INCLUDES="-I$qtopia_incdir"
 
5062
  AC_SUBST(QTOPIA_INCLUDES)
 
5063
 
 
5064
  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
 
5065
])
 
5066
 
 
5067
 
 
5068
AC_DEFUN(KDE_INIT_DOXYGEN,
 
5069
[
 
5070
AC_MSG_CHECKING([for Qt docs])
 
5071
kde_qtdir=
 
5072
if test "${with_qt_dir+set}" = set; then
 
5073
  kde_qtdir="$with_qt_dir"
 
5074
fi
 
5075
 
 
5076
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html ], QTDOCDIR)
 
5077
AC_MSG_RESULT($QTDOCDIR)
 
5078
 
 
5079
AC_SUBST(QTDOCDIR)
 
5080
 
 
5081
KDE_FIND_PATH(dot, DOT, [], [])
 
5082
if test -n "$DOT"; then
 
5083
  KDE_HAVE_DOT="YES"
 
5084
else
 
5085
  KDE_HAVE_DOT="NO"
 
5086
fi
 
5087
AC_SUBST(KDE_HAVE_DOT)
 
5088
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
 
5089
AC_SUBST(DOXYGEN)
 
5090
 
 
5091
DOXYGEN_PROJECT_NAME="$1"
 
5092
DOXYGEN_PROJECT_NUMBER="$2"
 
5093
AC_SUBST(DOXYGEN_PROJECT_NAME)
 
5094
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
 
5095
 
 
5096
KDE_HAS_DOXYGEN=no
 
5097
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
 
5098
  KDE_HAS_DOXYGEN=yes
 
5099
fi
 
5100
AC_SUBST(KDE_HAS_DOXYGEN)
 
5101
 
 
5102
])
 
5103
 
 
5104
 
 
5105
AC_DEFUN(AC_FIND_BZIP2,
 
5106
[
 
5107
AC_MSG_CHECKING([for bzDecompress in libbz2])
 
5108
AC_CACHE_VAL(ac_cv_lib_bzip2,
 
5109
[
 
5110
AC_LANG_C
 
5111
kde_save_LIBS="$LIBS"
 
5112
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
 
5113
kde_save_CFLAGS="$CFLAGS"
 
5114
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
5115
AC_TRY_LINK(dnl
 
5116
[
 
5117
#define BZ_NO_STDIO
 
5118
#include<bzlib.h>
 
5119
],
 
5120
            [ bz_stream s; (void) bzDecompress(&s); ],
 
5121
            eval "ac_cv_lib_bzip2='-lbz2'",
 
5122
            eval "ac_cv_lib_bzip2=no")
 
5123
LIBS="$kde_save_LIBS"
 
5124
CFLAGS="$kde_save_CFLAGS"
 
5125
])dnl
 
5126
AC_MSG_RESULT($ac_cv_lib_bzip2)
 
5127
 
 
5128
if test ! "$ac_cv_lib_bzip2" = no; then
 
5129
  BZIP2DIR=bzip2
 
5130
 
 
5131
  LIBBZ2="$ac_cv_lib_bzip2"
 
5132
  AC_SUBST(LIBBZ2)
 
5133
 
 
5134
else
 
5135
 
 
5136
   cxx_shared_flag=
 
5137
   ld_shared_flag=
 
5138
   KDE_CHECK_COMPILER_FLAG(shared, [
 
5139
        ld_shared_flag="-shared"
 
5140
   ])
 
5141
   KDE_CHECK_COMPILER_FLAG(fPIC, [
 
5142
        cxx_shared_flag="-fPIC"
 
5143
   ])
 
5144
 
 
5145
   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
 
5146
   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
 
5147
   [
 
5148
   AC_LANG_CPLUSPLUS
 
5149
   kde_save_LIBS="$LIBS"
 
5150
   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
 
5151
   kde_save_CXXFLAGS="$CXXFLAGS"
 
5152
   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
 
5153
 
 
5154
   AC_TRY_LINK(dnl
 
5155
   [
 
5156
   #define BZ_NO_STDIO
 
5157
   #include<bzlib.h>
 
5158
   ],
 
5159
               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
 
5160
               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
 
5161
               eval "ac_cv_lib_bzip2_prefix=no")
 
5162
   LIBS="$kde_save_LIBS"
 
5163
   CXXFLAGS="$kde_save_CXXFLAGS"
 
5164
   ])dnl
 
5165
 
 
5166
   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
 
5167
   
 
5168
 
 
5169
 
 
5170
   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
 
5171
     BZIP2DIR=bzip2
 
5172
    
 
5173
     LIBBZ2="$ac_cv_lib_bzip2_prefix"
 
5174
     AC_SUBST(LIBBZ2)
 
5175
 
 
5176
     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
 
5177
   dnl else, we just ignore this
 
5178
   fi
 
5179
 
 
5180
fi
 
5181
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
 
5182
])
 
5183
 
 
5184
dnl ------------------------------------------------------------------------
 
5185
dnl Try to find the SSL headers and libraries.
 
5186
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
 
5187
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
 
5188
dnl ------------------------------------------------------------------------
 
5189
dnl
 
5190
AC_DEFUN(KDE_CHECK_SSL,
 
5191
[
 
5192
LIBSSL="-lssl -lcrypto"
 
5193
AC_REQUIRE([KDE_CHECK_LIB64])
 
5194
 
 
5195
ac_ssl_includes=NO ac_ssl_libraries=NO
 
5196
ssl_libraries=""
 
5197
ssl_includes=""
 
5198
AC_ARG_WITH(ssl-dir,
 
5199
    [  --with-ssl-dir=DIR      where the root of OpenSSL is installed],
 
5200
    [  ac_ssl_includes="$withval"/include
 
5201
       ac_ssl_libraries="$withval"/lib$kdelibsuff
 
5202
    ])
 
5203
 
 
5204
want_ssl=yes
 
5205
AC_ARG_WITH(ssl,
 
5206
    [  --without-ssl           disable SSL checks],
 
5207
    [want_ssl=$withval])
 
5208
 
 
5209
if test $want_ssl = yes; then
 
5210
 
 
5211
AC_MSG_CHECKING(for OpenSSL)
 
5212
 
 
5213
AC_CACHE_VAL(ac_cv_have_ssl,
 
5214
[#try to guess OpenSSL locations
 
5215
  
 
5216
  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
 
5217
  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
 
5218
  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
 
5219
  ac_ssl_includes="$ssl_incdir"
 
5220
 
 
5221
  ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
 
5222
  if test ! "$ac_ssl_libraries" = "NO"; then
 
5223
    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
 
5224
  fi
 
5225
 
 
5226
  test=NONE
 
5227
  ssl_libdir=NONE
 
5228
  for dir in $ssl_libdirs; do
 
5229
    try="ls -1 $dir/libssl*"
 
5230
    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
5231
  done
 
5232
 
 
5233
  ac_ssl_libraries="$ssl_libdir"
 
5234
 
 
5235
  AC_LANG_SAVE
 
5236
  AC_LANG_C
 
5237
 
 
5238
  ac_cflags_safe="$CFLAGS"
 
5239
  ac_ldflags_safe="$LDFLAGS"
 
5240
  ac_libs_safe="$LIBS"
 
5241
 
 
5242
  CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
 
5243
  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
 
5244
  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
 
5245
 
 
5246
  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
 
5247
  ac_ssl_rsaref="yes"
 
5248
  ,
 
5249
  ac_ssl_rsaref="no"
 
5250
  )
 
5251
 
 
5252
  CFLAGS="$ac_cflags_safe"
 
5253
  LDFLAGS="$ac_ldflags_safe"
 
5254
  LIBS="$ac_libs_safe"
 
5255
 
 
5256
  AC_LANG_RESTORE
 
5257
 
 
5258
  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
 
5259
    have_ssl=no
 
5260
  else
 
5261
    have_ssl=yes;
 
5262
  fi
 
5263
 
 
5264
  ])
 
5265
 
 
5266
  eval "$ac_cv_have_ssl"
 
5267
 
 
5268
  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
 
5269
 
 
5270
  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
 
5271
  AC_MSG_RESULT($ac_ssl_rsaref)
 
5272
 
 
5273
  AC_MSG_CHECKING([for easter eggs])
 
5274
  AC_MSG_RESULT([none found])
 
5275
 
 
5276
else
 
5277
  have_ssl=no
 
5278
fi
 
5279
 
 
5280
if test "$have_ssl" = yes; then
 
5281
  AC_MSG_CHECKING(for OpenSSL version)
 
5282
  dnl Check for SSL version
 
5283
  AC_CACHE_VAL(ac_cv_ssl_version,
 
5284
  [
 
5285
    AC_LANG_SAVE
 
5286
    AC_LANG_C 
 
5287
 
 
5288
    cat >conftest.$ac_ext <<EOF
 
5289
#include <openssl/opensslv.h>
 
5290
#include <stdio.h>
 
5291
    int main() {
 
5292
 
 
5293
#ifndef OPENSSL_VERSION_NUMBER
 
5294
      printf("ssl_version=\\"error\\"\n");
 
5295
#else
 
5296
      if (OPENSSL_VERSION_NUMBER < 0x00906000)
 
5297
        printf("ssl_version=\\"old\\"\n");
 
5298
      else
 
5299
        printf("ssl_version=\\"ok\\"\n");
4216
5300
#endif
4217
 
            ],[ 
4218
 
            ],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
4219
 
                  You need to have Java Development Kit (JDK) version 1.2. 
4220
 
        
4221
 
                  Use --with-java to specify another location.
4222
 
                  Use --without-java to configure without java support.
4223
 
                  Or download a newer JDK and try again. 
4224
 
                  See e.g. http://java.sun.com/products/jdk/1.2 ])
4225
 
            ])
4226
 
 
4227
 
  CXXFLAGS="$ac_cxxflags_safe"    
4228
 
  AC_LANG_RESTORE
4229
 
 
4230
 
  dnl All tests ok, inform and subst the variables
4231
 
  AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
4232
 
 
4233
 
  JAVAC=$kde_cv_java_bindir/javac
4234
 
  AC_SUBST(JAVAC)
4235
 
  JAVAH=$kde_cv_java_bindir/javah
4236
 
  AC_SUBST(JAVAH)
4237
 
  JAR=$kde_cv_java_bindir/jar
4238
 
  AC_SUBST(JAR)
4239
 
  AC_SUBST(jni_includes)
4240
 
  JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"
4241
 
  AC_SUBST(JVMLIBS)
4242
 
fi
4243
 
])
 
5301
     return (0);
 
5302
    }
 
5303
EOF
 
5304
 
 
5305
    ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
 
5306
    if AC_TRY_EVAL(ac_compile); then 
 
5307
 
 
5308
      if eval `./conftest 2>&5`; then
 
5309
        if test $ssl_version = error; then
 
5310
          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
 
5311
        else
 
5312
          if test $ssl_version = old; then
 
5313
            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
 
5314
            have_ssl=no
 
5315
          fi
 
5316
        fi
 
5317
        ac_cv_ssl_version="ssl_version=$ssl_version"
 
5318
      else
 
5319
        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
 
5320
        Check config.log, and if you can't figure it out, send a mail to 
 
5321
        David Faure <faure@kde.org>, attaching your config.log])
 
5322
      fi
 
5323
 
 
5324
    else
 
5325
      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
 
5326
      Check config.log, and if you can't figure it out, send a mail to 
 
5327
      David Faure <faure@kde.org>, attaching your config.log])
 
5328
    fi 
 
5329
 
 
5330
    AC_LANG_RESTORE
 
5331
 
 
5332
  ])
 
5333
 
 
5334
  eval "$ac_cv_ssl_version"
 
5335
  AC_MSG_RESULT($ssl_version)
 
5336
fi
 
5337
 
 
5338
if test "$have_ssl" != yes; then
 
5339
  LIBSSL="";
 
5340
else
 
5341
  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
 
5342
  ac_cv_have_ssl="have_ssl=yes \
 
5343
    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
 
5344
  
 
5345
  
 
5346
  ssl_libraries="$ac_ssl_libraries"
 
5347
  ssl_includes="$ac_ssl_includes"
 
5348
 
 
5349
  if test "$ac_ssl_rsaref" = yes; then
 
5350
    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
 
5351
  fi
 
5352
 
 
5353
  if test $ssl_version = "old"; then
 
5354
    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
 
5355
  fi
 
5356
fi
 
5357
 
 
5358
if test "$ssl_includes" = "/usr/include" || test  "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
 
5359
 SSL_INCLUDES="";
 
5360
else
 
5361
 SSL_INCLUDES="-I$ssl_includes"
 
5362
fi
 
5363
 
 
5364
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
 
5365
 SSL_LDFLAGS=""
 
5366
else
 
5367
 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
 
5368
fi
 
5369
 
 
5370
AC_SUBST(SSL_INCLUDES)
 
5371
AC_SUBST(SSL_LDFLAGS)
 
5372
AC_SUBST(LIBSSL)
 
5373
])
 
5374
 
 
5375
AC_DEFUN(KDE_CHECK_STRLCPY,
 
5376
[
 
5377
  AC_CHECK_STRLCPY
 
5378
  AC_CHECK_STRLCAT
 
5379
  AC_CHECK_SIZEOF(size_t)
 
5380
  AC_CHECK_SIZEOF(unsigned long)
 
5381
 
 
5382
  AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
 
5383
  AC_TRY_COMPILE(,[
 
5384
    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
 
5385
       choke me
 
5386
    #endif
 
5387
    ],[AC_MSG_RESULT([yes])],[
 
5388
      AC_MSG_RESULT([no])
 
5389
      AC_MSG_ERROR([
 
5390
       Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
 
5391
       does not apply. Please mail kde-devel@kde.org with a description of your system!
 
5392
      ])
 
5393
  ])
 
5394
])
 
5395