~ubuntu-branches/ubuntu/karmic/kxstitch/karmic

« back to all changes in this revision

Viewing changes to admin/.#acinclude.m4.in.2.483

  • Committer: Bazaar Package Importer
  • Author(s): Ilya Barygin
  • Date: 2009-06-20 10:58:28 UTC
  • mfrom: (1.1.3 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090620105828-kb6fd4ex7ba60hf6
Tags: 0.8.3.1-1ubuntu1
* Merge from Debian unstable (LP: #389803), remaining changes:
  - Add --without-arts to ./configure params
  - Add dh_icons
* Dropped Ubuntu changes:
  - debian/control: Replace build-depends on libmagick++9-dev with
    graphicsmagick-libmagick-dev-compat
    (upstream code now compiles with libmagick++-dev)
  - Add --with-extra-includes=/usr/include/GraphicsMagick to ./configure
    (Debian package adds /usr/include/ImageMagick)
  - debian/patches/gcc_minmax.patch: Fix FTBFS when building with gcc 4.2
    (fixed upstream)
  - Add quilt support, build-depend on quilt
    (added in Debian package)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##   -*- autoconf -*-
2
 
 
3
 
dnl    This file is part of the KDE libraries/packages
4
 
dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5
 
dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
6
 
 
7
 
dnl    This file is free software; you can redistribute it and/or
8
 
dnl    modify it under the terms of the GNU Library General Public
9
 
dnl    License as published by the Free Software Foundation; either
10
 
dnl    version 2 of the License, or (at your option) any later version.
11
 
 
12
 
dnl    This library is distributed in the hope that it will be useful,
13
 
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
dnl    Library General Public License for more details.
16
 
 
17
 
dnl    You should have received a copy of the GNU Library General Public License
18
 
dnl    along with this library; see the file COPYING.LIB.  If not, write to
19
 
dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
dnl    Boston, MA 02111-1307, USA.
21
 
 
22
 
dnl IMPORTANT NOTE:
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. 
25
 
dnl
26
 
dnl Single-module modifications are best placed in configure.in for kdelibs
27
 
dnl and kdebase or configure.in.in if present.
28
 
 
29
 
# KDE_PATH_X_DIRECT
30
 
dnl Internal subroutine of AC_PATH_X.
31
 
dnl Set ac_x_includes and/or ac_x_libraries.
32
 
AC_DEFUN([KDE_PATH_X_DIRECT],
33
 
[
34
 
AC_REQUIRE([KDE_CHECK_LIB64])
35
 
 
36
 
if test "$ac_x_includes" = NO; then
37
 
  # Guess where to find include files, by looking for this one X11 .h file.
38
 
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
39
 
 
40
 
  # First, try using that file with no special directory specified.
41
 
AC_TRY_CPP([#include <$x_direct_test_include>],
42
 
[# We can compile using X headers with no special include directory.
43
 
ac_x_includes=],
44
 
[# Look for the header file in a standard set of common directories.
45
 
# Check X11 before X11Rn because it is often a symlink to the current release.
46
 
  for ac_dir in               \
47
 
    /usr/X11/include          \
48
 
    /usr/X11R6/include        \
49
 
    /usr/X11R5/include        \
50
 
    /usr/X11R4/include        \
51
 
                              \
52
 
    /usr/include/X11          \
53
 
    /usr/include/X11R6        \
54
 
    /usr/include/X11R5        \
55
 
    /usr/include/X11R4        \
56
 
                              \
57
 
    /usr/local/X11/include    \
58
 
    /usr/local/X11R6/include  \
59
 
    /usr/local/X11R5/include  \
60
 
    /usr/local/X11R4/include  \
61
 
                              \
62
 
    /usr/local/include/X11    \
63
 
    /usr/local/include/X11R6  \
64
 
    /usr/local/include/X11R5  \
65
 
    /usr/local/include/X11R4  \
66
 
                              \
67
 
    /usr/X386/include         \
68
 
    /usr/x386/include         \
69
 
    /usr/XFree86/include/X11  \
70
 
                              \
71
 
    /usr/include              \
72
 
    /usr/local/include        \
73
 
    /usr/unsupported/include  \
74
 
    /usr/athena/include       \
75
 
    /usr/local/x11r5/include  \
76
 
    /usr/lpp/Xamples/include  \
77
 
                              \
78
 
    /usr/openwin/include      \
79
 
    /usr/openwin/share/include \
80
 
    ; \
81
 
  do
82
 
    if test -r "$ac_dir/$x_direct_test_include"; then
83
 
      ac_x_includes=$ac_dir
84
 
      break
85
 
    fi
86
 
  done])
87
 
fi # $ac_x_includes = NO
88
 
 
89
 
if test "$ac_x_libraries" = NO; then
90
 
  # Check for the libraries.
91
 
 
92
 
  test -z "$x_direct_test_library" && x_direct_test_library=Xt
93
 
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
94
 
 
95
 
  # See if we find them without any special options.
96
 
  # Don't add to $LIBS permanently.
97
 
  ac_save_LIBS="$LIBS"
98
 
  LIBS="-l$x_direct_test_library $LIBS"
99
 
AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100
 
[LIBS="$ac_save_LIBS"
101
 
# We can link X programs with no special library path.
102
 
ac_x_libraries=],
103
 
[LIBS="$ac_save_LIBS"
104
 
# First see if replacing the include by lib works.
105
 
# Check X11 before X11Rn because it is often a symlink to the current release.
106
 
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
107
 
    /usr/X11/lib${kdelibsuff}           \
108
 
    /usr/X11R6/lib${kdelibsuff}         \
109
 
    /usr/X11R5/lib${kdelibsuff}         \
110
 
    /usr/X11R4/lib${kdelibsuff}         \
111
 
                                        \
112
 
    /usr/lib${kdelibsuff}/X11           \
113
 
    /usr/lib${kdelibsuff}/X11R6         \
114
 
    /usr/lib${kdelibsuff}/X11R5         \
115
 
    /usr/lib${kdelibsuff}/X11R4         \
116
 
                                        \
117
 
    /usr/local/X11/lib${kdelibsuff}     \
118
 
    /usr/local/X11R6/lib${kdelibsuff}   \
119
 
    /usr/local/X11R5/lib${kdelibsuff}   \
120
 
    /usr/local/X11R4/lib${kdelibsuff}   \
121
 
                                        \
122
 
    /usr/local/lib${kdelibsuff}/X11     \
123
 
    /usr/local/lib${kdelibsuff}/X11R6   \
124
 
    /usr/local/lib${kdelibsuff}/X11R5   \
125
 
    /usr/local/lib${kdelibsuff}/X11R4   \
126
 
                                        \
127
 
    /usr/X386/lib${kdelibsuff}          \
128
 
    /usr/x386/lib${kdelibsuff}          \
129
 
    /usr/XFree86/lib${kdelibsuff}/X11   \
130
 
                                        \
131
 
    /usr/lib${kdelibsuff}               \
132
 
    /usr/local/lib${kdelibsuff}         \
133
 
    /usr/unsupported/lib${kdelibsuff}   \
134
 
    /usr/athena/lib${kdelibsuff}        \
135
 
    /usr/local/x11r5/lib${kdelibsuff}   \
136
 
    /usr/lpp/Xamples/lib${kdelibsuff}   \
137
 
    /lib/usr/lib${kdelibsuff}/X11       \
138
 
                                        \
139
 
    /usr/openwin/lib${kdelibsuff}       \
140
 
    /usr/openwin/share/lib${kdelibsuff} \
141
 
    ; \
142
 
do
143
 
dnl Don't even attempt the hair of trying to link an X program!
144
 
  for ac_extension in a so sl; do
145
 
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
146
 
      ac_x_libraries=$ac_dir
147
 
      break 2
148
 
    fi
149
 
  done
150
 
done])
151
 
fi # $ac_x_libraries = NO
152
 
])
153
 
 
154
 
 
155
 
dnl ------------------------------------------------------------------------
156
 
dnl Find a file (or one of more files in a list of dirs)
157
 
dnl ------------------------------------------------------------------------
158
 
dnl
159
 
AC_DEFUN([AC_FIND_FILE],
160
 
[
161
 
$3=NO
162
 
for i in $2;
163
 
do
164
 
  for j in $1;
165
 
  do
166
 
    echo "configure: __oline__: $i/$j" >&AC_FD_CC
167
 
    if test -r "$i/$j"; then
168
 
      echo "taking that" >&AC_FD_CC
169
 
      $3=$i
170
 
      break 2
171
 
    fi
172
 
  done
173
 
done
174
 
])
175
 
 
176
 
dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177
 
dnl     if-not-found, test-parameter, prepend-path)
178
 
dnl
179
 
dnl Look for program-name in list-of-dirs+$PATH.
180
 
dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
181
 
dnl If found, $variable-name is set. If not, if-not-found is evaluated.
182
 
dnl test-parameter: if set, the program is executed with this arg,
183
 
dnl                 and only a successful exit code is required.
184
 
AC_DEFUN([KDE_FIND_PATH],
185
 
[
186
 
   AC_MSG_CHECKING([for $1])
187
 
   if test -n "$$2"; then
188
 
        kde_cv_path="$$2";
189
 
   else
190
 
        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
191
 
 
192
 
        AC_CACHE_VAL(kde_cv_path_$kde_cache,
193
 
        [
194
 
        kde_cv_path="NONE"
195
 
        kde_save_IFS=$IFS
196
 
        IFS=':'
197
 
        dirs=""
198
 
        for dir in $PATH; do
199
 
          dirs="$dirs $dir"
200
 
        done
201
 
        if test -z "$6"; then  dnl Append dirs in PATH (default)
202
 
          dirs="$3 $dirs"
203
 
        else  dnl Prepend dirs in PATH (if 6th arg is set)
204
 
          dirs="$dirs $3"
205
 
        fi
206
 
        IFS=$kde_save_IFS
207
 
 
208
 
        for dir in $dirs; do
209
 
          if test -x "$dir/$1"; then
210
 
            if test -n "$5"
211
 
            then
212
 
              evalstr="$dir/$1 $5 2>&1 "
213
 
              if eval $evalstr; then
214
 
                kde_cv_path="$dir/$1"
215
 
                break
216
 
              fi
217
 
            else
218
 
                kde_cv_path="$dir/$1"
219
 
                break
220
 
            fi
221
 
          fi
222
 
        done
223
 
 
224
 
        eval "kde_cv_path_$kde_cache=$kde_cv_path"
225
 
 
226
 
        ])
227
 
 
228
 
      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
229
 
 
230
 
   fi
231
 
 
232
 
   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
233
 
      AC_MSG_RESULT(not found)
234
 
      $4
235
 
   else
236
 
      AC_MSG_RESULT($kde_cv_path)
237
 
      $2=$kde_cv_path
238
 
 
239
 
   fi
240
 
])
241
 
 
242
 
AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
243
 
[
244
 
    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
245
 
Please check whether you installed Qt correctly.
246
 
You need to have a running moc binary.
247
 
configure tried to run $ac_cv_path_moc and the test didn't
248
 
succeed. If configure shouldn't have tried this one, set
249
 
the environment variable MOC to the right one before running
250
 
configure.
251
 
])
252
 
])
253
 
 
254
 
AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
255
 
[
256
 
    AC_MSG_WARN([No Qt ui compiler (uic) found!
257
 
Please check whether you installed Qt correctly.
258
 
You need to have a running uic binary.
259
 
configure tried to run $ac_cv_path_uic and the test didn't
260
 
succeed. If configure shouldn't have tried this one, set
261
 
the environment variable UIC to the right one before running
262
 
configure.
263
 
])
264
 
])
265
 
 
266
 
 
267
 
AC_DEFUN([KDE_CHECK_UIC_FLAG],
268
 
[
269
 
    AC_MSG_CHECKING([whether uic supports -$1 ])
270
 
    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
271
 
    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
272
 
    [
273
 
        cat >conftest.ui <<EOT
274
 
        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
275
 
EOT
276
 
        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
277
 
        if AC_TRY_EVAL(ac_uic_testrun); then
278
 
            eval "kde_cv_prog_uic_$kde_cache=yes"
279
 
        else
280
 
            eval "kde_cv_prog_uic_$kde_cache=no"
281
 
        fi
282
 
        rm -f conftest*
283
 
    ])
284
 
 
285
 
    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
286
 
        AC_MSG_RESULT([yes])
287
 
        :
288
 
        $3
289
 
    else
290
 
        AC_MSG_RESULT([no])
291
 
        :
292
 
        $4
293
 
    fi
294
 
])
295
 
 
296
 
 
297
 
dnl ------------------------------------------------------------------------
298
 
dnl Find the meta object compiler and the ui compiler in the PATH,
299
 
dnl in $QTDIR/bin, and some more usual places
300
 
dnl ------------------------------------------------------------------------
301
 
dnl
302
 
AC_DEFUN([AC_PATH_QT_MOC_UIC],
303
 
[
304
 
   AC_REQUIRE([KDE_CHECK_PERL])
305
 
   qt_bindirs=""
306
 
   for dir in $kde_qt_dirs; do
307
 
      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
308
 
   done
309
 
   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
310
 
   if test ! "$ac_qt_bindir" = "NO"; then
311
 
      qt_bindirs="$ac_qt_bindir $qt_bindirs"
312
 
   fi
313
 
 
314
 
   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
315
 
   if test -z "$UIC_NOT_NEEDED"; then
316
 
     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
317
 
     if test -z "$UIC_PATH" ; then
318
 
       KDE_UIC_ERROR_MESSAGE
319
 
       exit 1
320
 
     else
321
 
       UIC=$UIC_PATH
322
 
 
323
 
       if test $kde_qtver = 3; then
324
 
         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
325
 
         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
326
 
 
327
 
         if test x$ac_uic_supports_libpath = xyes; then
328
 
             UIC="$UIC -L \$(kde_widgetdir)"
329
 
         fi
330
 
         if test x$ac_uic_supports_nounload = xyes; then
331
 
             UIC="$UIC -nounload"
332
 
         fi
333
 
       fi
334
 
     fi
335
 
   else
336
 
     UIC="echo uic not available: "
337
 
   fi
338
 
 
339
 
   AC_SUBST(MOC)
340
 
   AC_SUBST(UIC)
341
 
 
342
 
   UIC_TR="i18n"
343
 
   if test $kde_qtver = 3; then
344
 
     UIC_TR="tr2i18n"
345
 
   fi
346
 
 
347
 
   AC_SUBST(UIC_TR)
348
 
])
349
 
 
350
 
AC_DEFUN([KDE_1_CHECK_PATHS],
351
 
[
352
 
  KDE_1_CHECK_PATH_HEADERS
353
 
 
354
 
  KDE_TEST_RPATH=
355
 
 
356
 
  if test -n "$USE_RPATH"; then
357
 
 
358
 
     if test -n "$kde_libraries"; then
359
 
       KDE_TEST_RPATH="-R $kde_libraries"
360
 
     fi
361
 
 
362
 
     if test -n "$qt_libraries"; then
363
 
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
364
 
     fi
365
 
 
366
 
     if test -n "$x_libraries"; then
367
 
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
368
 
     fi
369
 
 
370
 
     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
371
 
  fi
372
 
 
373
 
AC_MSG_CHECKING([for KDE libraries installed])
374
 
ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
375
 
 
376
 
if AC_TRY_EVAL(ac_link) && test -s conftest; then
377
 
  AC_MSG_RESULT(yes)
378
 
else
379
 
  AC_MSG_ERROR([your system fails at linking a small KDE application!
380
 
Check, if your compiler is installed correctly and if you have used the
381
 
same compiler to compile Qt and kdelibs as you did use now.
382
 
For more details about this problem, look at the end of config.log.])
383
 
fi
384
 
 
385
 
if eval `KDEDIR= ./conftest 2>&5`; then
386
 
  kde_result=done
387
 
else
388
 
  kde_result=problems
389
 
fi
390
 
 
391
 
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392
 
kde_have_all_paths=yes
393
 
 
394
 
KDE_SET_PATHS($kde_result)
395
 
 
396
 
])
397
 
 
398
 
AC_DEFUN([KDE_SET_PATHS],
399
 
[
400
 
  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
401
 
        kde_htmldir=\"$kde_htmldir\" \
402
 
        kde_appsdir=\"$kde_appsdir\" \
403
 
        kde_icondir=\"$kde_icondir\" \
404
 
        kde_sounddir=\"$kde_sounddir\" \
405
 
        kde_datadir=\"$kde_datadir\" \
406
 
        kde_locale=\"$kde_locale\" \
407
 
        kde_cgidir=\"$kde_cgidir\" \
408
 
        kde_confdir=\"$kde_confdir\" \
409
 
        kde_kcfgdir=\"$kde_kcfgdir\" \
410
 
        kde_mimedir=\"$kde_mimedir\" \
411
 
        kde_toolbardir=\"$kde_toolbardir\" \
412
 
        kde_wallpaperdir=\"$kde_wallpaperdir\" \
413
 
        kde_templatesdir=\"$kde_templatesdir\" \
414
 
        kde_bindir=\"$kde_bindir\" \
415
 
        kde_servicesdir=\"$kde_servicesdir\" \
416
 
        kde_servicetypesdir=\"$kde_servicetypesdir\" \
417
 
        kde_moduledir=\"$kde_moduledir\" \
418
 
        kde_styledir=\"$kde_styledir\" \
419
 
        kde_widgetdir=\"$kde_widgetdir\" \
420
 
        xdg_appsdir=\"$xdg_appsdir\" \
421
 
        xdg_menudir=\"$xdg_menudir\" \
422
 
        xdg_directorydir=\"$xdg_directorydir\" \
423
 
        kde_result=$1"
424
 
])
425
 
 
426
 
AC_DEFUN([KDE_SET_DEFAULT_PATHS],
427
 
[
428
 
if test "$1" = "default"; then
429
 
 
430
 
  if test -z "$kde_htmldir"; then
431
 
    kde_htmldir='\${datadir}/doc/HTML'
432
 
  fi
433
 
  if test -z "$kde_appsdir"; then
434
 
    kde_appsdir='\${datadir}/applnk'
435
 
  fi
436
 
  if test -z "$kde_icondir"; then
437
 
    kde_icondir='\${datadir}/icons'
438
 
  fi
439
 
  if test -z "$kde_sounddir"; then
440
 
    kde_sounddir='\${datadir}/sounds'
441
 
  fi
442
 
  if test -z "$kde_datadir"; then
443
 
    kde_datadir='\${datadir}/apps'
444
 
  fi
445
 
  if test -z "$kde_locale"; then
446
 
    kde_locale='\${datadir}/locale'
447
 
  fi
448
 
  if test -z "$kde_cgidir"; then
449
 
    kde_cgidir='\${exec_prefix}/cgi-bin'
450
 
  fi
451
 
  if test -z "$kde_confdir"; then
452
 
    kde_confdir='\${datadir}/config'
453
 
  fi
454
 
  if test -z "$kde_kcfgdir"; then
455
 
    kde_kcfgdir='\${datadir}/config.kcfg'
456
 
  fi
457
 
  if test -z "$kde_mimedir"; then
458
 
    kde_mimedir='\${datadir}/mimelnk'
459
 
  fi
460
 
  if test -z "$kde_toolbardir"; then
461
 
    kde_toolbardir='\${datadir}/toolbar'
462
 
  fi
463
 
  if test -z "$kde_wallpaperdir"; then
464
 
    kde_wallpaperdir='\${datadir}/wallpapers'
465
 
  fi
466
 
  if test -z "$kde_templatesdir"; then
467
 
    kde_templatesdir='\${datadir}/templates'
468
 
  fi
469
 
  if test -z "$kde_bindir"; then
470
 
    kde_bindir='\${exec_prefix}/bin'
471
 
  fi
472
 
  if test -z "$kde_servicesdir"; then
473
 
    kde_servicesdir='\${datadir}/services'
474
 
  fi
475
 
  if test -z "$kde_servicetypesdir"; then
476
 
    kde_servicetypesdir='\${datadir}/servicetypes'
477
 
  fi
478
 
  if test -z "$kde_moduledir"; then
479
 
    if test "$kde_qtver" = "2"; then
480
 
      kde_moduledir='\${libdir}/kde2'
481
 
    else
482
 
      kde_moduledir='\${libdir}/kde3'
483
 
    fi
484
 
  fi
485
 
  if test -z "$kde_styledir"; then
486
 
    kde_styledir='\${libdir}/kde3/plugins/styles'
487
 
  fi
488
 
  if test -z "$kde_widgetdir"; then
489
 
    kde_widgetdir='\${libdir}/kde3/plugins/designer'
490
 
  fi
491
 
  if test -z "$xdg_appsdir"; then
492
 
    xdg_appsdir='\${datadir}/applications/kde'
493
 
  fi
494
 
  if test -z "$xdg_menudir"; then
495
 
    xdg_menudir='\${sysconfdir}/xdg/menus'
496
 
  fi
497
 
  if test -z "$xdg_directorydir"; then
498
 
    xdg_directorydir='\${datadir}/desktop-directories'
499
 
  fi
500
 
 
501
 
  KDE_SET_PATHS(defaults)
502
 
 
503
 
else
504
 
 
505
 
  if test $kde_qtver = 1; then
506
 
     AC_MSG_RESULT([compiling])
507
 
     KDE_1_CHECK_PATHS
508
 
  else
509
 
     AC_MSG_ERROR([path checking not yet supported for KDE 2])
510
 
  fi
511
 
 
512
 
fi
513
 
])
514
 
 
515
 
AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
516
 
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
517
 
   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
518
 
   test -z "$kde_datadir" || test -z "$kde_locale"  ||
519
 
   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
520
 
   test -z "$kde_kcfgdir" ||
521
 
   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
522
 
   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
523
 
   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
524
 
   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
525
 
   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
526
 
   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
527
 
   test "x$kde_have_all_paths" != "xyes"; then
528
 
     kde_have_all_paths=no
529
 
  fi
530
 
])
531
 
 
532
 
AC_DEFUN([KDE_MISSING_PROG_ERROR],
533
 
[
534
 
    AC_MSG_ERROR([The important program $1 was not found!
535
 
Please check whether you installed KDE correctly.
536
 
])
537
 
])
538
 
 
539
 
AC_DEFUN([KDE_MISSING_ARTS_ERROR],
540
 
[
541
 
    AC_MSG_ERROR([The important program $1 was not found!
542
 
Please check whether you installed aRts correctly or use
543
 
--without-arts to compile without aRts support (this will remove functionality).
544
 
])
545
 
])
546
 
 
547
 
AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
548
 
[
549
 
    kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
550
 
    test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
551
 
    if test -n "$KDEDIRS"; then
552
 
       kde_save_IFS=$IFS
553
 
       IFS=:
554
 
       for dir in $KDEDIRS; do
555
 
            kde_default_bindirs="$dir/bin $kde_default_bindirs "
556
 
       done
557
 
       IFS=$kde_save_IFS
558
 
    fi
559
 
])
560
 
 
561
 
AC_DEFUN([KDE_SUBST_PROGRAMS],
562
 
[
563
 
    AC_ARG_WITH(arts,
564
 
        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565
 
        [build_arts=$withval],
566
 
        [build_arts=yes]
567
 
    )
568
 
    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
569
 
    if test "$build_arts" = "no"; then
570
 
        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
571
 
    fi
572
 
 
573
 
        KDE_SET_DEFAULT_BINDIRS
574
 
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575
 
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576
 
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577
 
        if test "$build_arts" '!=' "no"; then
578
 
          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579
 
          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
580
 
        fi
581
 
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
582
 
 
583
 
        kde32ornewer=1
584
 
        kde33ornewer=1
585
 
        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
586
 
            kde32ornewer=
587
 
            kde33ornewer=
588
 
        else
589
 
            if test "$kde_qtver" = "3"; then
590
 
              if test "$kde_qtsubver" -le 1; then
591
 
                kde32ornewer=
592
 
              fi
593
 
              if test "$kde_qtsubver" -le 2; then
594
 
                kde33ornewer=
595
 
              fi
596
 
            fi
597
 
        fi
598
 
 
599
 
        if test -n "$kde32ornewer"; then
600
 
            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
601
 
            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
602
 
        fi
603
 
        if test -n "$kde33ornewer"; then
604
 
            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
605
 
            AC_SUBST(MAKEKDEWIDGETS)
606
 
        fi
607
 
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
608
 
 
609
 
        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
610
 
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
611
 
            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
612
 
            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
613
 
            if test "$KDE_XSL_STYLESHEET" = "NO"; then
614
 
                KDE_XSL_STYLESHEET=""
615
 
            else
616
 
                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
617
 
            fi
618
 
        fi
619
 
 
620
 
        DCOP_DEPENDENCIES='$(DCOPIDL)'
621
 
        if test -n "$kde32ornewer"; then
622
 
            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
623
 
            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
624
 
            AC_SUBST(KCONFIG_COMPILER)
625
 
            AC_SUBST(KCFG_DEPENDENCIES)
626
 
            AC_SUBST(DCOPIDLNG)
627
 
        fi
628
 
        AC_SUBST(DCOPIDL)
629
 
        AC_SUBST(DCOPIDL2CPP)
630
 
        AC_SUBST(DCOP_DEPENDENCIES)
631
 
        AC_SUBST(MCOPIDL)
632
 
        AC_SUBST(ARTSCCONFIG)
633
 
        AC_SUBST(MEINPROC)
634
 
        AC_SUBST(KDE_XSL_STYLESHEET)
635
 
        AC_SUBST(XMLLINT)
636
 
])dnl
637
 
 
638
 
AC_DEFUN([AC_CREATE_KFSSTND],
639
 
[
640
 
AC_REQUIRE([AC_CHECK_RPATH])
641
 
 
642
 
AC_MSG_CHECKING([for KDE paths])
643
 
kde_result=""
644
 
kde_cached_paths=yes
645
 
AC_CACHE_VAL(kde_cv_all_paths,
646
 
[
647
 
  KDE_SET_DEFAULT_PATHS($1)
648
 
  kde_cached_paths=no
649
 
])
650
 
eval "$kde_cv_all_paths"
651
 
KDE_CHECK_PATHS_FOR_COMPLETENESS
652
 
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
653
 
  # wrong values were cached, may be, we can set better ones
654
 
  kde_result=
655
 
  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
656
 
  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
657
 
  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
658
 
  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
659
 
  kde_have_all_paths=
660
 
  kde_styledir=
661
 
  kde_widgetdir=
662
 
  xdg_appsdir = xdg_menudir= xdg_directorydir= 
663
 
  KDE_SET_DEFAULT_PATHS($1)
664
 
  eval "$kde_cv_all_paths"
665
 
  KDE_CHECK_PATHS_FOR_COMPLETENESS
666
 
  kde_result="$kde_result (cache overridden)"
667
 
fi
668
 
if test "$kde_have_all_paths" = "no"; then
669
 
  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
670
 
Since it had compiled and linked before, it must be a strange problem on your system.
671
 
Look at config.log for details. If you are not able to fix this, look at
672
 
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
673
 
(If you're using an egcs version on Linux, you may update binutils!)
674
 
])
675
 
else
676
 
  rm -f conftest*
677
 
  AC_MSG_RESULT($kde_result)
678
 
fi
679
 
 
680
 
bindir=$kde_bindir
681
 
 
682
 
KDE_SUBST_PROGRAMS
683
 
 
684
 
])
685
 
 
686
 
AC_DEFUN([AC_SUBST_KFSSTND],
687
 
[
688
 
AC_SUBST(kde_htmldir)
689
 
AC_SUBST(kde_appsdir)
690
 
AC_SUBST(kde_icondir)
691
 
AC_SUBST(kde_sounddir)
692
 
AC_SUBST(kde_datadir)
693
 
AC_SUBST(kde_locale)
694
 
AC_SUBST(kde_confdir)
695
 
AC_SUBST(kde_kcfgdir)
696
 
AC_SUBST(kde_mimedir)
697
 
AC_SUBST(kde_wallpaperdir)
698
 
AC_SUBST(kde_bindir)
699
 
dnl X Desktop Group standards
700
 
AC_SUBST(xdg_appsdir)
701
 
AC_SUBST(xdg_menudir)
702
 
AC_SUBST(xdg_directorydir)
703
 
dnl for KDE 2
704
 
AC_SUBST(kde_templatesdir)
705
 
AC_SUBST(kde_servicesdir)
706
 
AC_SUBST(kde_servicetypesdir)
707
 
AC_SUBST(kde_moduledir)
708
 
AC_SUBST(kdeinitdir, '$(kde_moduledir)')
709
 
AC_SUBST(kde_styledir)
710
 
AC_SUBST(kde_widgetdir)
711
 
if test "$kde_qtver" = 1; then
712
 
  kde_minidir="$kde_icondir/mini"
713
 
else
714
 
# for KDE 1 - this breaks KDE2 apps using minidir, but
715
 
# that's the plan ;-/
716
 
  kde_minidir="/dev/null"
717
 
fi
718
 
dnl AC_SUBST(kde_minidir)
719
 
dnl AC_SUBST(kde_cgidir)
720
 
dnl AC_SUBST(kde_toolbardir)
721
 
])
722
 
 
723
 
AC_DEFUN([KDE_MISC_TESTS],
724
 
[
725
 
   dnl Checks for libraries.
726
 
   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
727
 
   AC_SUBST(LIBUTIL)
728
 
   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
729
 
   AC_SUBST(LIBCOMPAT)
730
 
   kde_have_crypt=
731
 
   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
732
 
      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
733
 
        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
734
 
You should install libcrypt from another source or configure with PAM
735
 
support])
736
 
        kde_have_crypt=no
737
 
      ]))
738
 
   AC_SUBST(LIBCRYPT)
739
 
   if test $kde_have_crypt = yes; then
740
 
      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
741
 
   fi
742
 
   AC_CHECK_SOCKLEN_T
743
 
   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
744
 
   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
745
 
      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
746
 
        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
747
 
   fi
748
 
   AC_CHECK_FUNC(inet_ntoa)
749
 
   if test $ac_cv_func_inet_ntoa = no; then
750
 
     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
751
 
   fi
752
 
   AC_CHECK_FUNC(connect)
753
 
   if test $ac_cv_func_connect = no; then
754
 
      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
755
 
        $X_EXTRA_LIBS)
756
 
   fi
757
 
 
758
 
   AC_CHECK_FUNC(remove)
759
 
   if test $ac_cv_func_remove = no; then
760
 
      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
761
 
   fi
762
 
 
763
 
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
764
 
   AC_CHECK_FUNC(shmat, ,
765
 
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
766
 
   
767
 
   # more headers that need to be explicitly included on darwin
768
 
   AC_CHECK_HEADERS(sys/types.h stdint.h)
769
 
 
770
 
   # sys/bitypes.h is needed for uint32_t and friends on Tru64
771
 
   AC_CHECK_HEADERS(sys/bitypes.h)
772
 
 
773
 
   # darwin requires a poll emulation library
774
 
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
775
 
 
776
 
   # CoreAudio framework
777
 
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
778
 
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
779
 
     FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
780
 
   ])
781
 
 
782
 
   AC_CHECK_RES_INIT
783
 
   AC_SUBST(LIB_POLL)
784
 
   AC_SUBST(FRAMEWORK_COREAUDIO)
785
 
   LIBSOCKET="$X_EXTRA_LIBS"
786
 
   AC_SUBST(LIBSOCKET)
787
 
   AC_SUBST(X_EXTRA_LIBS)
788
 
   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
789
 
   AC_SUBST(LIBUCB)
790
 
 
791
 
   case $host in  dnl this *is* LynxOS specific
792
 
   *-*-lynxos* )
793
 
        AC_MSG_CHECKING([LynxOS header file wrappers])
794
 
        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
795
 
        AC_MSG_RESULT(disabled)
796
 
        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
797
 
         ;;
798
 
    esac
799
 
 
800
 
   KDE_CHECK_TYPES
801
 
   KDE_CHECK_LIBDL
802
 
   KDE_CHECK_STRLCPY
803
 
 
804
 
# darwin needs this to initialize the environment
805
 
AC_CHECK_HEADERS(crt_externs.h)
806
 
AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
807
 
 
808
 
AH_VERBATIM(_DARWIN_ENVIRON,
809
 
[
810
 
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
811
 
# include <sys/time.h>
812
 
# include <crt_externs.h>
813
 
# define environ (*_NSGetEnviron())
814
 
#endif
815
 
])
816
 
 
817
 
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
818
 
[
819
 
/*
820
 
 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
821
 
 * that defines bzero.
822
 
 */
823
 
 
824
 
#if defined(_AIX)
825
 
#include <strings.h>
826
 
#endif
827
 
])
828
 
 
829
 
AC_CHECK_FUNCS([vsnprintf snprintf])
830
 
 
831
 
AH_VERBATIM(_TRU64,[
832
 
/*
833
 
 * On HP-UX, the declaration of vsnprintf() is needed every time !
834
 
 */
835
 
 
836
 
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
837
 
#if __STDC__
838
 
#include <stdarg.h>
839
 
#include <stdlib.h>
840
 
#else
841
 
#include <varargs.h>
842
 
#endif
843
 
#ifdef __cplusplus
844
 
extern "C"
845
 
#endif
846
 
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
847
 
#ifdef __cplusplus
848
 
extern "C"
849
 
#endif
850
 
int snprintf(char *str, size_t n, char const *fmt, ...);
851
 
#endif
852
 
])
853
 
 
854
 
])
855
 
 
856
 
dnl ------------------------------------------------------------------------
857
 
dnl Find the header files and libraries for X-Windows. Extended the
858
 
dnl macro AC_PATH_X
859
 
dnl ------------------------------------------------------------------------
860
 
dnl
861
 
AC_DEFUN([K_PATH_X],
862
 
[
863
 
AC_REQUIRE([KDE_MISC_TESTS])dnl
864
 
AC_REQUIRE([KDE_CHECK_LIB64])
865
 
 
866
 
AC_ARG_ENABLE(
867
 
  embedded,
868
 
  AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
869
 
  kde_use_qt_emb=$enableval,
870
 
  kde_use_qt_emb=no
871
 
)
872
 
 
873
 
AC_ARG_ENABLE(
874
 
  qtopia,
875
 
  AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
876
 
  kde_use_qt_emb_palm=$enableval,
877
 
  kde_use_qt_emb_palm=no
878
 
)
879
 
 
880
 
AC_ARG_ENABLE(
881
 
  mac,
882
 
  AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
883
 
  kde_use_qt_mac=$enableval,
884
 
  kde_use_qt_mac=no
885
 
)
886
 
 
887
 
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
888
 
 
889
 
AC_MSG_CHECKING(for X)
890
 
 
891
 
AC_CACHE_VAL(kde_cv_have_x,
892
 
[# One or both of the vars are not set, and there is no cached value.
893
 
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
894
 
   kde_x_includes=NO
895
 
else
896
 
   kde_x_includes=$x_includes
897
 
fi
898
 
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
899
 
   kde_x_libraries=NO
900
 
else
901
 
   kde_x_libraries=$x_libraries
902
 
fi
903
 
 
904
 
# below we use the standard autoconf calls
905
 
ac_x_libraries=$kde_x_libraries
906
 
ac_x_includes=$kde_x_includes
907
 
 
908
 
KDE_PATH_X_DIRECT
909
 
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
910
 
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
911
 
dnl location. The correct location is /usr/lib32 or an undefined value
912
 
dnl (the linker is smart enough to pick the correct default library).
913
 
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
914
 
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
915
 
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
916
 
dnl x_includes should be left alone.
917
 
case "$host" in
918
 
mips-sgi-irix6*)
919
 
  ;;
920
 
*-*-solaris*)
921
 
  ;;
922
 
*)
923
 
  _AC_PATH_X_XMKMF
924
 
  if test -z "$ac_x_includes"; then
925
 
    ac_x_includes="."
926
 
  fi
927
 
  if test -z "$ac_x_libraries"; then
928
 
    ac_x_libraries="/usr/lib${kdelibsuff}"
929
 
  fi
930
 
esac
931
 
#from now on we use our own again
932
 
 
933
 
# when the user already gave --x-includes, we ignore
934
 
# what the standard autoconf macros told us.
935
 
if test "$kde_x_includes" = NO; then
936
 
  kde_x_includes=$ac_x_includes
937
 
fi
938
 
 
939
 
# for --x-libraries too
940
 
if test "$kde_x_libraries" = NO; then
941
 
  kde_x_libraries=$ac_x_libraries
942
 
fi
943
 
 
944
 
if test "$kde_x_includes" = NO; then
945
 
  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
946
 
fi
947
 
 
948
 
if test "$kde_x_libraries" = NO; then
949
 
  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
950
 
fi
951
 
 
952
 
# Record where we found X for the cache.
953
 
kde_cv_have_x="have_x=yes \
954
 
         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
955
 
])dnl
956
 
 
957
 
eval "$kde_cv_have_x"
958
 
 
959
 
if test "$have_x" != yes; then
960
 
  AC_MSG_RESULT($have_x)
961
 
  no_x=yes
962
 
else
963
 
  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
964
 
fi
965
 
 
966
 
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
967
 
  X_INCLUDES=""
968
 
  x_includes="."; dnl better than nothing :-
969
 
 else
970
 
  x_includes=$kde_x_includes
971
 
  X_INCLUDES="-I$x_includes"
972
 
fi
973
 
 
974
 
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
975
 
  X_LDFLAGS=""
976
 
  x_libraries="/usr/lib"; dnl better than nothing :-
977
 
 else
978
 
  x_libraries=$kde_x_libraries
979
 
  X_LDFLAGS="-L$x_libraries"
980
 
fi
981
 
all_includes="$X_INCLUDES"
982
 
all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED"
983
 
 
984
 
# Check for libraries that X11R6 Xt/Xaw programs need.
985
 
ac_save_LDFLAGS="$LDFLAGS"
986
 
LDFLAGS="$LDFLAGS $X_LDFLAGS"
987
 
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
988
 
# check for ICE first), but we must link in the order -lSM -lICE or
989
 
# we get undefined symbols.  So assume we have SM if we have ICE.
990
 
# These have to be linked with before -lX11, unlike the other
991
 
# libraries we check for below, so use a different variable.
992
 
#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
993
 
AC_CHECK_LIB(ICE, IceConnectionNumber,
994
 
  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
995
 
LDFLAGS="$ac_save_LDFLAGS"
996
 
 
997
 
LIB_X11='-lX11 $(LIBSOCKET)'
998
 
 
999
 
AC_MSG_CHECKING(for libXext)
1000
 
AC_CACHE_VAL(kde_cv_have_libXext,
1001
 
[
1002
 
kde_ldflags_safe="$LDFLAGS"
1003
 
kde_libs_safe="$LIBS"
1004
 
 
1005
 
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1006
 
LIBS="-lXext -lX11 $LIBSOCKET"
1007
 
 
1008
 
AC_TRY_LINK([
1009
 
#include <stdio.h>
1010
 
#ifdef STDC_HEADERS
1011
 
# include <stdlib.h>
1012
 
#endif
1013
 
],
1014
 
[
1015
 
printf("hello Xext\n");
1016
 
],
1017
 
kde_cv_have_libXext=yes,
1018
 
kde_cv_have_libXext=no
1019
 
)
1020
 
 
1021
 
LDFLAGS=$kde_ldflags_safe
1022
 
LIBS=$kde_libs_safe
1023
 
])
1024
 
 
1025
 
AC_MSG_RESULT($kde_cv_have_libXext)
1026
 
 
1027
 
if test "$kde_cv_have_libXext" = "no"; then
1028
 
  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1029
 
can't find it itself, we stop here assuming that make wouldn't find
1030
 
them either.])
1031
 
fi
1032
 
 
1033
 
LIB_XEXT="-lXext"
1034
 
QTE_NORTTI=""
1035
 
 
1036
 
elif test "$kde_use_qt_emb" = "yes"; then
1037
 
  dnl We're using QT Embedded
1038
 
  CPPFLAGS=-DQWS
1039
 
  CXXFLAGS="$CXXFLAGS -fno-rtti"
1040
 
  QTE_NORTTI="-fno-rtti -DQWS"
1041
 
  X_PRE_LIBS=""
1042
 
  LIB_X11=""
1043
 
  LIB_XEXT=""
1044
 
  LIB_XRENDER=""
1045
 
  LIBSM=""
1046
 
  X_INCLUDES=""
1047
 
  X_LDFLAGS=""
1048
 
  x_includes=""
1049
 
  x_libraries=""
1050
 
elif test "$kde_use_qt_mac" = "yes"; then
1051
 
  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1052
 
  dnl be included to get the information) --Sam
1053
 
  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1054
 
  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1055
 
  X_PRE_LIBS=""
1056
 
  LIB_X11=""
1057
 
  LIB_XEXT=""
1058
 
  LIB_XRENDER=""
1059
 
  LIBSM=""
1060
 
  X_INCLUDES=""
1061
 
  X_LDFLAGS=""
1062
 
  x_includes=""
1063
 
  x_libraries=""
1064
 
fi
1065
 
AC_SUBST(X_PRE_LIBS)
1066
 
AC_SUBST(LIB_X11)
1067
 
AC_SUBST(LIB_XRENDER)
1068
 
AC_SUBST(LIBSM)
1069
 
AC_SUBST(X_INCLUDES)
1070
 
AC_SUBST(X_LDFLAGS)
1071
 
AC_SUBST(x_includes)
1072
 
AC_SUBST(x_libraries)
1073
 
AC_SUBST(QTE_NORTTI)
1074
 
AC_SUBST(LIB_XEXT)
1075
 
 
1076
 
])
1077
 
 
1078
 
AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1079
 
[
1080
 
AC_REQUIRE([KDE_USE_QT])
1081
 
cat > conftest.$ac_ext <<EOF
1082
 
#include "confdefs.h"
1083
 
#include <qglobal.h>
1084
 
#include <qapplication.h>
1085
 
EOF
1086
 
if test "$kde_qtver" = "2"; then
1087
 
cat >> conftest.$ac_ext <<EOF
1088
 
#include <qevent.h>
1089
 
#include <qstring.h>
1090
 
#include <qstyle.h>
1091
 
EOF
1092
 
 
1093
 
if test $kde_qtsubver -gt 0; then
1094
 
cat >> conftest.$ac_ext <<EOF
1095
 
#if QT_VERSION < 210
1096
 
#error 1
1097
 
#endif
1098
 
EOF
1099
 
fi
1100
 
fi
1101
 
 
1102
 
if test "$kde_qtver" = "3"; then
1103
 
cat >> conftest.$ac_ext <<EOF
1104
 
#include <qcursor.h>
1105
 
#include <qstylefactory.h>
1106
 
#include <private/qucomextra_p.h>
1107
 
EOF
1108
 
fi
1109
 
 
1110
 
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1111
 
cat >> conftest.$ac_ext <<EOF
1112
 
#error 1
1113
 
#endif
1114
 
 
1115
 
int main() {
1116
 
EOF
1117
 
if test "$kde_qtver" = "2"; then
1118
 
cat >> conftest.$ac_ext <<EOF
1119
 
    QStringList *t = new QStringList();
1120
 
    Q_UNUSED(t);
1121
 
EOF
1122
 
if test $kde_qtsubver -gt 0; then
1123
 
cat >> conftest.$ac_ext <<EOF
1124
 
    QString s;
1125
 
    s.setLatin1("Elvis is alive", 14);
1126
 
EOF
1127
 
fi
1128
 
fi
1129
 
if test "$kde_qtver" = "3"; then
1130
 
cat >> conftest.$ac_ext <<EOF
1131
 
    (void)QStyleFactory::create(QString::null);
1132
 
    QCursor c(Qt::WhatsThisCursor);
1133
 
EOF
1134
 
fi
1135
 
cat >> conftest.$ac_ext <<EOF
1136
 
    return 0;
1137
 
}
1138
 
EOF
1139
 
])
1140
 
 
1141
 
AC_DEFUN([KDE_USE_QT],
1142
 
[
1143
 
if test -z "$1"; then
1144
 
  # Current default Qt version: 3.3
1145
 
  kde_qtver=3
1146
 
  kde_qtsubver=3
1147
 
else
1148
 
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1149
 
  # following is the check if subversion isnt found in passed argument
1150
 
  if test "$kde_qtsubver" = "$1"; then
1151
 
    kde_qtsubver=1
1152
 
  fi
1153
 
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1154
 
  if test "$kde_qtver" = "1"; then
1155
 
    kde_qtsubver=42
1156
 
  fi
1157
 
fi
1158
 
 
1159
 
if test -z "$2"; then
1160
 
  if test "$kde_qtver" = "2"; then
1161
 
    if test $kde_qtsubver -gt 0; then
1162
 
      kde_qt_minversion=">= Qt 2.2.2"
1163
 
    else
1164
 
      kde_qt_minversion=">= Qt 2.0.2"
1165
 
    fi
1166
 
  fi
1167
 
  if test "$kde_qtver" = "3"; then
1168
 
    if test $kde_qtsubver -gt 0; then
1169
 
         if test $kde_qtsubver -gt 1; then
1170
 
            if test $kde_qtsubver -gt 2; then
1171
 
                kde_qt_minversion=">= Qt 3.3"
1172
 
            else
1173
 
                kde_qt_minversion=">= Qt 3.2"
1174
 
            fi
1175
 
         else
1176
 
            kde_qt_minversion=">= Qt 3.1 (20021021)"
1177
 
         fi
1178
 
    else
1179
 
      kde_qt_minversion=">= Qt 3.0"
1180
 
    fi
1181
 
  fi
1182
 
  if test "$kde_qtver" = "1"; then
1183
 
    kde_qt_minversion=">= 1.42 and < 2.0"
1184
 
  fi
1185
 
else
1186
 
   kde_qt_minversion="$2"
1187
 
fi
1188
 
 
1189
 
if test -z "$3"; then
1190
 
   if test $kde_qtver = 3; then
1191
 
     if test $kde_qtsubver -gt 0; then
1192
 
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
1193
 
       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1194
 
       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1195
 
     else
1196
 
       kde_qt_verstring="QT_VERSION >= 300"
1197
 
     fi
1198
 
   fi
1199
 
   if test $kde_qtver = 2; then
1200
 
     if test $kde_qtsubver -gt 0; then
1201
 
       kde_qt_verstring="QT_VERSION >= 222"
1202
 
     else
1203
 
       kde_qt_verstring="QT_VERSION >= 200"
1204
 
     fi
1205
 
   fi
1206
 
   if test $kde_qtver = 1; then
1207
 
    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1208
 
   fi
1209
 
else
1210
 
   kde_qt_verstring="$3"
1211
 
fi
1212
 
 
1213
 
if test $kde_qtver = 3; then
1214
 
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1215
 
fi
1216
 
if test $kde_qtver = 2; then
1217
 
   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1218
 
fi
1219
 
if test $kde_qtver = 1; then
1220
 
   kde_qt_dirs="$QTDIR /usr/lib/qt"
1221
 
fi
1222
 
])
1223
 
 
1224
 
AC_DEFUN([KDE_CHECK_QT_DIRECT],
1225
 
[
1226
 
AC_REQUIRE([KDE_USE_QT])
1227
 
AC_MSG_CHECKING([if Qt compiles without flags])
1228
 
AC_CACHE_VAL(kde_cv_qt_direct,
1229
 
[
1230
 
AC_LANG_SAVE
1231
 
AC_LANG_CPLUSPLUS
1232
 
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1233
 
ac_LIBRARY_PATH="$LIBRARY_PATH"
1234
 
ac_cxxflags_safe="$CXXFLAGS"
1235
 
ac_ldflags_safe="$LDFLAGS"
1236
 
ac_libs_safe="$LIBS"
1237
 
 
1238
 
CXXFLAGS="$CXXFLAGS -I$qt_includes"
1239
 
LDFLAGS="$LDFLAGS $X_LDFLAGS"
1240
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1241
 
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1242
 
else
1243
 
LIBS="$LIBQT $LIBSOCKET"
1244
 
fi
1245
 
LD_LIBRARY_PATH=
1246
 
export LD_LIBRARY_PATH
1247
 
LIBRARY_PATH=
1248
 
export LIBRARY_PATH
1249
 
 
1250
 
KDE_PRINT_QT_PROGRAM
1251
 
 
1252
 
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1253
 
  kde_cv_qt_direct="yes"
1254
 
else
1255
 
  kde_cv_qt_direct="no"
1256
 
  echo "configure: failed program was:" >&AC_FD_CC
1257
 
  cat conftest.$ac_ext >&AC_FD_CC
1258
 
fi
1259
 
 
1260
 
rm -f conftest*
1261
 
CXXFLAGS="$ac_cxxflags_safe"
1262
 
LDFLAGS="$ac_ldflags_safe"
1263
 
LIBS="$ac_libs_safe"
1264
 
 
1265
 
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1266
 
export LD_LIBRARY_PATH
1267
 
LIBRARY_PATH="$ac_LIBRARY_PATH"
1268
 
export LIBRARY_PATH
1269
 
AC_LANG_RESTORE
1270
 
])
1271
 
 
1272
 
if test "$kde_cv_qt_direct" = "yes"; then
1273
 
  AC_MSG_RESULT(yes)
1274
 
  $1
1275
 
else
1276
 
  AC_MSG_RESULT(no)
1277
 
  $2
1278
 
fi
1279
 
])
1280
 
 
1281
 
dnl ------------------------------------------------------------------------
1282
 
dnl Try to find the Qt headers and libraries.
1283
 
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1284
 
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1285
 
dnl ------------------------------------------------------------------------
1286
 
dnl
1287
 
AC_DEFUN([AC_PATH_QT_1_3],
1288
 
[
1289
 
AC_REQUIRE([K_PATH_X])
1290
 
AC_REQUIRE([KDE_USE_QT])
1291
 
AC_REQUIRE([KDE_CHECK_LIB64])
1292
 
 
1293
 
dnl ------------------------------------------------------------------------
1294
 
dnl Add configure flag to enable linking to MT version of Qt library.
1295
 
dnl ------------------------------------------------------------------------
1296
 
 
1297
 
AC_ARG_ENABLE(
1298
 
  mt,
1299
 
  AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1300
 
  kde_use_qt_mt=$enableval,
1301
 
  [
1302
 
    if test $kde_qtver = 3; then
1303
 
      kde_use_qt_mt=yes
1304
 
    else
1305
 
      kde_use_qt_mt=no
1306
 
    fi
1307
 
  ]
1308
 
)
1309
 
 
1310
 
USING_QT_MT=""
1311
 
 
1312
 
dnl ------------------------------------------------------------------------
1313
 
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1314
 
dnl ------------------------------------------------------------------------
1315
 
 
1316
 
KDE_MT_LDFLAGS=
1317
 
KDE_MT_LIBS=
1318
 
if test "x$kde_use_qt_mt" = "xyes"; then
1319
 
  KDE_CHECK_THREADING
1320
 
  if test "x$kde_use_threading" = "xyes"; then
1321
 
    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1322
 
    KDE_MT_LDFLAGS="$USE_THREADS"
1323
 
    KDE_MT_LIBS="$LIBPTHREAD"
1324
 
  else
1325
 
    kde_use_qt_mt=no
1326
 
  fi
1327
 
fi
1328
 
AC_SUBST(KDE_MT_LDFLAGS)
1329
 
AC_SUBST(KDE_MT_LIBS)
1330
 
 
1331
 
kde_qt_was_given=yes
1332
 
 
1333
 
dnl ------------------------------------------------------------------------
1334
 
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1335
 
dnl ------------------------------------------------------------------------
1336
 
if test -z "$LIBQT_GLOB"; then
1337
 
  if test "x$kde_use_qt_emb" = "xyes"; then
1338
 
    LIBQT_GLOB="libqte.*"
1339
 
  else
1340
 
    LIBQT_GLOB="libqt.*"
1341
 
  fi
1342
 
fi
1343
 
 
1344
 
if test -z "$LIBQT"; then
1345
 
dnl ------------------------------------------------------------
1346
 
dnl If we got --enable-embedded then adjust the Qt library name.
1347
 
dnl ------------------------------------------------------------
1348
 
  if test "x$kde_use_qt_emb" = "xyes"; then
1349
 
    qtlib="qte"
1350
 
  else
1351
 
    qtlib="qt"
1352
 
  fi
1353
 
 
1354
 
  kde_int_qt="-l$qtlib"
1355
 
else
1356
 
  kde_int_qt="$LIBQT"
1357
 
  kde_lib_qt_set=yes
1358
 
fi
1359
 
 
1360
 
if test -z "$LIBQPE"; then
1361
 
dnl ------------------------------------------------------------
1362
 
dnl If we got --enable-palmtop then add -lqpe to the link line
1363
 
dnl ------------------------------------------------------------
1364
 
  if test "x$kde_use_qt_emb" = "xyes"; then
1365
 
    if test "x$kde_use_qt_emb_palm" = "xyes"; then
1366
 
      LIB_QPE="-lqpe"
1367
 
    else
1368
 
      LIB_QPE=""
1369
 
    fi
1370
 
  else
1371
 
    LIB_QPE=""
1372
 
  fi
1373
 
fi
1374
 
 
1375
 
dnl ------------------------------------------------------------------------
1376
 
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1377
 
dnl ------------------------------------------------------------------------
1378
 
 
1379
 
if test "x$kde_use_qt_mt" = "xyes"; then
1380
 
  if test -z "$LIBQT"; then
1381
 
    LIBQT="-l$qtlib-mt"
1382
 
    kde_int_qt="-l$qtlib-mt"
1383
 
  else
1384
 
    LIBQT="$qtlib-mt"
1385
 
    kde_int_qt="$qtlib-mt"
1386
 
  fi
1387
 
  LIBQT_GLOB="lib$qtlib-mt.*"
1388
 
  USING_QT_MT="using -mt"
1389
 
else
1390
 
  LIBQT="-l$qtlib"
1391
 
fi
1392
 
 
1393
 
if test $kde_qtver != 1; then
1394
 
 
1395
 
  AC_REQUIRE([AC_FIND_PNG])
1396
 
  AC_REQUIRE([AC_FIND_JPEG])
1397
 
  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1398
 
fi
1399
 
 
1400
 
if test $kde_qtver = 3; then
1401
 
  AC_REQUIRE([KDE_CHECK_LIBDL])
1402
 
  LIBQT="$LIBQT $LIBDL"
1403
 
fi
1404
 
 
1405
 
AC_MSG_CHECKING([for Qt])
1406
 
 
1407
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1408
 
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1409
 
fi
1410
 
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1411
 
qt_libraries=""
1412
 
qt_includes=""
1413
 
AC_ARG_WITH(qt-dir,
1414
 
    AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1415
 
    [  ac_qt_includes="$withval"/include
1416
 
       ac_qt_libraries="$withval"/lib${kdelibsuff}
1417
 
       ac_qt_bindir="$withval"/bin
1418
 
    ])
1419
 
 
1420
 
AC_ARG_WITH(qt-includes,
1421
 
    AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1422
 
    [
1423
 
       ac_qt_includes="$withval"
1424
 
    ])
1425
 
 
1426
 
kde_qt_libs_given=no
1427
 
 
1428
 
AC_ARG_WITH(qt-libraries,
1429
 
    AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1430
 
    [  ac_qt_libraries="$withval"
1431
 
       kde_qt_libs_given=yes
1432
 
    ])
1433
 
 
1434
 
AC_CACHE_VAL(ac_cv_have_qt,
1435
 
[#try to guess Qt locations
1436
 
 
1437
 
qt_incdirs=""
1438
 
for dir in $kde_qt_dirs; do
1439
 
   qt_incdirs="$qt_incdirs $dir/include $dir"
1440
 
done
1441
 
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
1442
 
if test ! "$ac_qt_includes" = "NO"; then
1443
 
   qt_incdirs="$ac_qt_includes $qt_incdirs"
1444
 
fi
1445
 
 
1446
 
if test "$kde_qtver" != "1"; then
1447
 
  kde_qt_header=qstyle.h
1448
 
else
1449
 
  kde_qt_header=qglobal.h
1450
 
fi
1451
 
 
1452
 
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1453
 
ac_qt_includes="$qt_incdir"
1454
 
 
1455
 
qt_libdirs=""
1456
 
for dir in $kde_qt_dirs; do
1457
 
   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1458
 
done
1459
 
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1460
 
if test ! "$ac_qt_libraries" = "NO"; then
1461
 
  qt_libdir=$ac_qt_libraries
1462
 
else
1463
 
  qt_libdirs="$ac_qt_libraries $qt_libdirs"
1464
 
  # if the Qt was given, the chance is too big that libqt.* doesn't exist
1465
 
  qt_libdir=NONE
1466
 
  for dir in $qt_libdirs; do
1467
 
    try="ls -1 $dir/${LIBQT_GLOB}"
1468
 
    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1469
 
  done
1470
 
fi
1471
 
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1472
 
  if test -e "$a"; then
1473
 
    LIBQT="$LIBQT ${kde_int_qt}_incremental"
1474
 
    break
1475
 
  fi
1476
 
done
1477
 
 
1478
 
ac_qt_libraries="$qt_libdir"
1479
 
 
1480
 
AC_LANG_SAVE
1481
 
AC_LANG_CPLUSPLUS
1482
 
 
1483
 
ac_cxxflags_safe="$CXXFLAGS"
1484
 
ac_ldflags_safe="$LDFLAGS"
1485
 
ac_libs_safe="$LIBS"
1486
 
 
1487
 
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1488
 
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1489
 
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1490
 
 
1491
 
KDE_PRINT_QT_PROGRAM
1492
 
 
1493
 
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1494
 
  rm -f conftest*
1495
 
else
1496
 
  echo "configure: failed program was:" >&AC_FD_CC
1497
 
  cat conftest.$ac_ext >&AC_FD_CC
1498
 
  ac_qt_libraries="NO"
1499
 
fi
1500
 
rm -f conftest*
1501
 
CXXFLAGS="$ac_cxxflags_safe"
1502
 
LDFLAGS="$ac_ldflags_safe"
1503
 
LIBS="$ac_libs_safe"
1504
 
 
1505
 
AC_LANG_RESTORE
1506
 
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1507
 
  ac_cv_have_qt="have_qt=no"
1508
 
  ac_qt_notfound=""
1509
 
  missing_qt_mt=""
1510
 
  if test "$ac_qt_includes" = NO; then
1511
 
    if test "$ac_qt_libraries" = NO; then
1512
 
      ac_qt_notfound="(headers and libraries)";
1513
 
    else
1514
 
      ac_qt_notfound="(headers)";
1515
 
    fi
1516
 
  else
1517
 
    if test "x$kde_use_qt_mt" = "xyes"; then
1518
 
       missing_qt_mt="
1519
 
Make sure that you have compiled Qt with thread support!"
1520
 
       ac_qt_notfound="(library $qtlib-mt)";
1521
 
    else
1522
 
       ac_qt_notfound="(library $qtlib)";
1523
 
    fi
1524
 
  fi
1525
 
 
1526
 
  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1527
 
For more details about this problem, look at the end of config.log.$missing_qt_mt])
1528
 
else
1529
 
  have_qt="yes"
1530
 
fi
1531
 
])
1532
 
 
1533
 
eval "$ac_cv_have_qt"
1534
 
 
1535
 
if test "$have_qt" != yes; then
1536
 
  AC_MSG_RESULT([$have_qt]);
1537
 
else
1538
 
  ac_cv_have_qt="have_qt=yes \
1539
 
    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1540
 
  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1541
 
 
1542
 
  qt_libraries="$ac_qt_libraries"
1543
 
  qt_includes="$ac_qt_includes"
1544
 
fi
1545
 
 
1546
 
if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1547
 
     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1548
 
fi
1549
 
 
1550
 
AC_SUBST(qt_libraries)
1551
 
AC_SUBST(qt_includes)
1552
 
 
1553
 
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1554
 
 QT_INCLUDES=""
1555
 
else
1556
 
 QT_INCLUDES="-I$qt_includes"
1557
 
 all_includes="$QT_INCLUDES $all_includes"
1558
 
fi
1559
 
 
1560
 
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1561
 
 QT_LDFLAGS=""
1562
 
else
1563
 
 QT_LDFLAGS="-L$qt_libraries"
1564
 
 all_libraries="$QT_LDFLAGS $all_libraries"
1565
 
fi
1566
 
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1567
 
 
1568
 
AC_SUBST(QT_INCLUDES)
1569
 
AC_SUBST(QT_LDFLAGS)
1570
 
AC_PATH_QT_MOC_UIC
1571
 
 
1572
 
KDE_CHECK_QT_JPEG
1573
 
 
1574
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1575
 
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1576
 
else
1577
 
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1578
 
fi
1579
 
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1580
 
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1581
 
  if test -e "$a"; then
1582
 
     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1583
 
     break
1584
 
  fi
1585
 
done
1586
 
 
1587
 
AC_SUBST(LIB_QT)
1588
 
AC_SUBST(LIB_QPE)
1589
 
 
1590
 
AC_SUBST(kde_qtver)
1591
 
])
1592
 
 
1593
 
AC_DEFUN([AC_PATH_QT],
1594
 
[
1595
 
AC_PATH_QT_1_3
1596
 
])
1597
 
 
1598
 
AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1599
 
[
1600
 
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1601
 
 
1602
 
if test x$ac_uic_supports_libpath = xyes; then
1603
 
 
1604
 
AC_MSG_CHECKING([if UIC has KDE plugins available])
1605
 
AC_CACHE_VAL(kde_cv_uic_plugins,
1606
 
[
1607
 
cat > actest.ui << EOF
1608
 
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1609
 
<class>NewConnectionDialog</class>
1610
 
<widget class="QDialog">
1611
 
   <widget class="KLineEdit">
1612
 
        <property name="name">
1613
 
           <cstring>testInput</cstring>
1614
 
        </property>
1615
 
   </widget>
1616
 
</widget>
1617
 
</UI>
1618
 
EOF
1619
 
       
1620
 
 
1621
 
 
1622
 
kde_cv_uic_plugins=no
1623
 
kde_line="$UIC_PATH -L $kde_widgetdir"
1624
 
if test x$ac_uic_supports_nounload = xyes; then
1625
 
   kde_line="$kde_line -nounload"
1626
 
fi
1627
 
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1628
 
if AC_TRY_EVAL(kde_line); then
1629
 
        # if you're trying to debug this check and think it's incorrect,
1630
 
        # better check your installation. The check _is_ correct - your
1631
 
        # installation is not.
1632
 
        if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1633
 
                kde_cv_uic_plugins=yes
1634
 
        fi
1635
 
fi
1636
 
rm -f actest.ui actest.cpp
1637
 
])
1638
 
 
1639
 
AC_MSG_RESULT([$kde_cv_uic_plugins])
1640
 
if test "$kde_cv_uic_plugins" != yes; then
1641
 
        AC_MSG_ERROR([you need to install kdelibs first.])
1642
 
fi
1643
 
fi
1644
 
])
1645
 
 
1646
 
AC_DEFUN([KDE_CHECK_FINAL],
1647
 
[
1648
 
  AC_ARG_ENABLE(final,
1649
 
        AC_HELP_STRING([--enable-final],
1650
 
                       [build size optimized apps (experimental - needs lots of memory)]),
1651
 
        kde_use_final=$enableval, kde_use_final=no)
1652
 
 
1653
 
  if test "x$kde_use_final" = "xyes"; then
1654
 
      KDE_USE_FINAL_TRUE=""
1655
 
      KDE_USE_FINAL_FALSE="#"
1656
 
   else
1657
 
      KDE_USE_FINAL_TRUE="#"
1658
 
      KDE_USE_FINAL_FALSE=""
1659
 
  fi
1660
 
  AC_SUBST(KDE_USE_FINAL_TRUE)
1661
 
  AC_SUBST(KDE_USE_FINAL_FALSE)
1662
 
])
1663
 
 
1664
 
AC_DEFUN([KDE_CHECK_CLOSURE],
1665
 
[
1666
 
  AC_ARG_ENABLE(closure,
1667
 
                AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1668
 
        kde_use_closure=$enableval, kde_use_closure=no)
1669
 
 
1670
 
  KDE_NO_UNDEFINED=""
1671
 
  if test "x$kde_use_closure" = "xyes"; then
1672
 
       KDE_USE_CLOSURE_TRUE=""
1673
 
       KDE_USE_CLOSURE_FALSE="#"
1674
 
#       CXXFLAGS="$CXXFLAGS $REPO"
1675
 
  else
1676
 
       KDE_USE_CLOSURE_TRUE="#"
1677
 
       KDE_USE_CLOSURE_FALSE=""
1678
 
       KDE_NO_UNDEFINED=""
1679
 
       case $host in 
1680
 
         *-*-linux-gnu)
1681
 
           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1682
 
                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1683
 
                [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1684
 
                [KDE_NO_UNDEFINED=""])],
1685
 
            [KDE_NO_UNDEFINED=""])
1686
 
           ;;
1687
 
       esac
1688
 
  fi
1689
 
  AC_SUBST(KDE_USE_CLOSURE_TRUE)
1690
 
  AC_SUBST(KDE_USE_CLOSURE_FALSE)
1691
 
  AC_SUBST(KDE_NO_UNDEFINED)
1692
 
])
1693
 
 
1694
 
dnl Check for the linker if it supports --as-needed
1695
 
AC_DEFUN([KDE_CHECK_AS_NEEDED],
1696
 
[
1697
 
  AC_ARG_ENABLE(as_needed,
1698
 
                AC_HELP_STRING([--disable-as-needed],[disable the --as-needed flag for the linker]),
1699
 
        kde_use_as_needed=$enableval, kde_use_as_needed=yes)
1700
 
 
1701
 
  LDFLAGS_AS_NEEDED=""
1702
 
  if test "x$kde_use_as_needed" = "xyes"; then
1703
 
       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1704
 
       [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1705
 
  fi
1706
 
  AC_SUBST(LDFLAGS_AS_NEEDED)
1707
 
  
1708
 
])
1709
 
 
1710
 
AC_DEFUN([KDE_CHECK_NMCHECK],
1711
 
[
1712
 
  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1713
 
        kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1714
 
 
1715
 
  if test "$kde_use_nmcheck" = "yes"; then
1716
 
      KDE_USE_NMCHECK_TRUE=""
1717
 
      KDE_USE_NMCHECK_FALSE="#"
1718
 
   else
1719
 
      KDE_USE_NMCHECK_TRUE="#"
1720
 
      KDE_USE_NMCHECK_FALSE=""
1721
 
  fi
1722
 
  AC_SUBST(KDE_USE_NMCHECK_TRUE)
1723
 
  AC_SUBST(KDE_USE_NMCHECK_FALSE)
1724
 
])
1725
 
 
1726
 
AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1727
 
savex=$exec_prefix
1728
 
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1729
 
tmp=$$2
1730
 
while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1731
 
exec_prefix=$savex
1732
 
])
1733
 
 
1734
 
dnl ------------------------------------------------------------------------
1735
 
dnl Now, the same with KDE
1736
 
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1737
 
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1738
 
dnl ------------------------------------------------------------------------
1739
 
dnl
1740
 
AC_DEFUN([AC_BASE_PATH_KDE],
1741
 
[
1742
 
AC_REQUIRE([KDE_CHECK_STL])
1743
 
AC_REQUIRE([AC_PATH_QT])dnl
1744
 
AC_REQUIRE([KDE_CHECK_LIB64])
1745
 
 
1746
 
AC_CHECK_RPATH
1747
 
AC_MSG_CHECKING([for KDE])
1748
 
 
1749
 
if test "${prefix}" != NONE; then
1750
 
  kde_includes=${includedir}
1751
 
  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1752
 
 
1753
 
  kde_libraries=${libdir}
1754
 
  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1755
 
 
1756
 
else
1757
 
  ac_kde_includes=
1758
 
  ac_kde_libraries=
1759
 
  kde_libraries=""
1760
 
  kde_includes=""
1761
 
fi
1762
 
 
1763
 
AC_CACHE_VAL(ac_cv_have_kde,
1764
 
[#try to guess kde locations
1765
 
 
1766
 
if test "$kde_qtver" = 1; then
1767
 
  kde_check_header="ksock.h"
1768
 
  kde_check_lib="libkdecore.la"
1769
 
else
1770
 
  kde_check_header="ksharedptr.h"
1771
 
  kde_check_lib="libkio.la"
1772
 
fi
1773
 
 
1774
 
if test -z "$1"; then
1775
 
 
1776
 
kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1777
 
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1778
 
kde_incdirs="$ac_kde_includes $kde_incdirs"
1779
 
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1780
 
ac_kde_includes="$kde_incdir"
1781
 
 
1782
 
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1783
 
  AC_MSG_ERROR([
1784
 
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1785
 
So, check this please and use another prefix!])
1786
 
fi
1787
 
 
1788
 
kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1789
 
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1790
 
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1791
 
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1792
 
ac_kde_libraries="$kde_libdir"
1793
 
 
1794
 
kde_widgetdir=NO
1795
 
dnl this might be somewhere else
1796
 
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1797
 
 
1798
 
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1799
 
AC_MSG_ERROR([
1800
 
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1801
 
So, check this please and use another prefix!])
1802
 
fi
1803
 
 
1804
 
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1805
 
AC_MSG_ERROR([
1806
 
I can't find the designer plugins. These are required and should have been installed
1807
 
by kdelibs])
1808
 
fi
1809
 
 
1810
 
if test -n "$kde_widgetdir"; then
1811
 
    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1812
 
fi
1813
 
 
1814
 
 
1815
 
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1816
 
  ac_cv_have_kde="have_kde=no"
1817
 
else
1818
 
  ac_cv_have_kde="have_kde=yes \
1819
 
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1820
 
fi
1821
 
 
1822
 
else dnl test -z $1, e.g. from kdelibs
1823
 
 
1824
 
  ac_cv_have_kde="have_kde=no"
1825
 
 
1826
 
fi
1827
 
])dnl
1828
 
 
1829
 
eval "$ac_cv_have_kde"
1830
 
 
1831
 
if test "$have_kde" != "yes"; then
1832
 
 if test "${prefix}" = NONE; then
1833
 
  ac_kde_prefix="$ac_default_prefix"
1834
 
 else
1835
 
  ac_kde_prefix="$prefix"
1836
 
 fi
1837
 
 if test "$exec_prefix" = NONE; then
1838
 
  ac_kde_exec_prefix="$ac_kde_prefix"
1839
 
  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1840
 
 else
1841
 
  ac_kde_exec_prefix="$exec_prefix"
1842
 
  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1843
 
 fi
1844
 
 
1845
 
 kde_libraries="${libdir}"
1846
 
 kde_includes="${includedir}"
1847
 
 
1848
 
else
1849
 
  ac_cv_have_kde="have_kde=yes \
1850
 
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1851
 
  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1852
 
 
1853
 
  kde_libraries="$ac_kde_libraries"
1854
 
  kde_includes="$ac_kde_includes"
1855
 
fi
1856
 
AC_SUBST(kde_libraries)
1857
 
AC_SUBST(kde_includes)
1858
 
 
1859
 
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1860
 
 KDE_INCLUDES=""
1861
 
else
1862
 
 KDE_INCLUDES="-I$kde_includes"
1863
 
 all_includes="$KDE_INCLUDES $all_includes"
1864
 
fi
1865
 
 
1866
 
KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1867
 
 
1868
 
KDE_LDFLAGS="-L$kde_libraries"
1869
 
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1870
 
 all_libraries="$KDE_LDFLAGS $all_libraries"
1871
 
fi
1872
 
 
1873
 
AC_SUBST(KDE_LDFLAGS)
1874
 
AC_SUBST(KDE_INCLUDES)
1875
 
 
1876
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1877
 
 
1878
 
all_libraries="$USER_LDFLAGS $all_libraries"
1879
 
all_includes="$all_includes $USER_INCLUDES"
1880
 
AC_SUBST(all_includes)
1881
 
AC_SUBST(all_libraries)
1882
 
 
1883
 
if test -z "$1"; then
1884
 
KDE_CHECK_UIC_PLUGINS
1885
 
fi
1886
 
 
1887
 
ac_kde_libraries="$kde_libdir"
1888
 
 
1889
 
AC_SUBST(AUTODIRS)
1890
 
 
1891
 
 
1892
 
])
1893
 
 
1894
 
AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1895
 
[
1896
 
AC_MSG_CHECKING(for extra includes)
1897
 
AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1898
 
  kde_use_extra_includes="$withval",
1899
 
  kde_use_extra_includes=NONE
1900
 
)
1901
 
kde_extra_includes=
1902
 
if test -n "$kde_use_extra_includes" && \
1903
 
   test "$kde_use_extra_includes" != "NONE"; then
1904
 
 
1905
 
   ac_save_ifs=$IFS
1906
 
   IFS=':'
1907
 
   for dir in $kde_use_extra_includes; do
1908
 
     kde_extra_includes="$kde_extra_includes $dir"
1909
 
     USER_INCLUDES="$USER_INCLUDES -I$dir"
1910
 
   done
1911
 
   IFS=$ac_save_ifs
1912
 
   kde_use_extra_includes="added"
1913
 
else
1914
 
   kde_use_extra_includes="no"
1915
 
fi
1916
 
AC_SUBST(USER_INCLUDES)
1917
 
 
1918
 
AC_MSG_RESULT($kde_use_extra_includes)
1919
 
 
1920
 
kde_extra_libs=
1921
 
AC_MSG_CHECKING(for extra libs)
1922
 
AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1923
 
  kde_use_extra_libs=$withval,
1924
 
  kde_use_extra_libs=NONE
1925
 
)
1926
 
if test -n "$kde_use_extra_libs" && \
1927
 
   test "$kde_use_extra_libs" != "NONE"; then
1928
 
 
1929
 
   ac_save_ifs=$IFS
1930
 
   IFS=':'
1931
 
   for dir in $kde_use_extra_libs; do
1932
 
     kde_extra_libs="$kde_extra_libs $dir"
1933
 
     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1934
 
     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1935
 
   done
1936
 
   IFS=$ac_save_ifs
1937
 
   kde_use_extra_libs="added"
1938
 
else
1939
 
   kde_use_extra_libs="no"
1940
 
fi
1941
 
 
1942
 
AC_SUBST(USER_LDFLAGS)
1943
 
 
1944
 
AC_MSG_RESULT($kde_use_extra_libs)
1945
 
 
1946
 
])
1947
 
 
1948
 
AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1949
 
[
1950
 
    AC_MSG_CHECKING([for KDE headers installed])
1951
 
    AC_LANG_SAVE
1952
 
    AC_LANG_CPLUSPLUS
1953
 
cat > conftest.$ac_ext <<EOF
1954
 
#ifdef STDC_HEADERS
1955
 
# include <stdlib.h>
1956
 
#endif
1957
 
#include <stdio.h>
1958
 
#include "confdefs.h"
1959
 
#include <kapp.h>
1960
 
 
1961
 
int main() {
1962
 
    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1963
 
    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1964
 
    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1965
 
    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1966
 
    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1967
 
    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1968
 
    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1969
 
    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1970
 
    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1971
 
    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1972
 
    printf("kde_wallpaperdir=\\"%s\\"\n",
1973
 
        KApplication::kde_wallpaperdir().data());
1974
 
    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1975
 
    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1976
 
    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1977
 
    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1978
 
    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1979
 
    printf("kde_styledir=\\"/tmp/dummy\\"\n");
1980
 
    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1981
 
    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
1982
 
    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
1983
 
    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
1984
 
    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
1985
 
    return 0;
1986
 
    }
1987
 
EOF
1988
 
 
1989
 
 ac_save_CPPFLAGS=$CPPFLAGS
1990
 
 CPPFLAGS="$all_includes $CPPFLAGS"
1991
 
 if AC_TRY_EVAL(ac_compile); then
1992
 
   AC_MSG_RESULT(yes)
1993
 
 else
1994
 
   AC_MSG_ERROR([your system is not able to compile a small KDE application!
1995
 
Check, if you installed the KDE header files correctly.
1996
 
For more details about this problem, look at the end of config.log.])
1997
 
  fi
1998
 
  CPPFLAGS=$ac_save_CPPFLAGS
1999
 
 
2000
 
  AC_LANG_RESTORE
2001
 
])
2002
 
 
2003
 
AC_DEFUN([KDE_CHECK_KDEQTADDON],
2004
 
[
2005
 
AC_MSG_CHECKING(for kde-qt-addon)
2006
 
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2007
 
[
2008
 
 kde_ldflags_safe="$LDFLAGS"
2009
 
 kde_libs_safe="$LIBS"
2010
 
 kde_cxxflags_safe="$CXXFLAGS"
2011
 
 
2012
 
 LIBS="-lkde-qt-addon $LIBQT $LIBS"
2013
 
 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2014
 
 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2015
 
 
2016
 
 AC_TRY_LINK([
2017
 
   #include <qdom.h>
2018
 
 ],
2019
 
 [
2020
 
   QDomDocument doc;
2021
 
 ],
2022
 
  kde_cv_have_kdeqtaddon=yes,
2023
 
  kde_cv_have_kdeqtaddon=no
2024
 
 )
2025
 
 
2026
 
 LDFLAGS=$kde_ldflags_safe
2027
 
 LIBS=$kde_libs_safe
2028
 
 CXXFLAGS=$kde_cxxflags_safe
2029
 
])
2030
 
 
2031
 
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2032
 
 
2033
 
if test "$kde_cv_have_kdeqtaddon" = "no"; then
2034
 
  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2035
 
It is a separate package (and CVS module) named kde-qt-addon.])
2036
 
fi
2037
 
])
2038
 
 
2039
 
AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2040
 
[
2041
 
   AC_REQUIRE([KDE_MISC_TESTS])
2042
 
   AC_REQUIRE([KDE_CHECK_LIBDL])
2043
 
   AC_REQUIRE([K_PATH_X])
2044
 
 
2045
 
if test $kde_qtver = 3; then
2046
 
   AC_SUBST(LIB_KDECORE, "-lkdecore")
2047
 
   AC_SUBST(LIB_KDEUI, "-lkdeui")
2048
 
   AC_SUBST(LIB_KIO, "-lkio")
2049
 
   AC_SUBST(LIB_SMB, "-lsmb")
2050
 
   AC_SUBST(LIB_KAB, "-lkab")
2051
 
   AC_SUBST(LIB_KABC, "-lkabc")
2052
 
   AC_SUBST(LIB_KHTML, "-lkhtml")
2053
 
   AC_SUBST(LIB_KSPELL, "-lkspell")
2054
 
   AC_SUBST(LIB_KPARTS, "-lkparts")
2055
 
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2056
 
   AC_SUBST(LIB_KUTILS, "-lkutils")
2057
 
   AC_SUBST(LIB_KDEPIM, "-lkdepim")
2058
 
   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2059
 
   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2060
 
# these are for backward compatibility
2061
 
   AC_SUBST(LIB_KSYCOCA, "-lkio")
2062
 
   AC_SUBST(LIB_KFILE, "-lkio")
2063
 
elif test $kde_qtver = 2; then
2064
 
   AC_SUBST(LIB_KDECORE, "-lkdecore")
2065
 
   AC_SUBST(LIB_KDEUI, "-lkdeui")
2066
 
   AC_SUBST(LIB_KIO, "-lkio")
2067
 
   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2068
 
   AC_SUBST(LIB_SMB, "-lsmb")
2069
 
   AC_SUBST(LIB_KFILE, "-lkfile")
2070
 
   AC_SUBST(LIB_KAB, "-lkab")
2071
 
   AC_SUBST(LIB_KHTML, "-lkhtml")
2072
 
   AC_SUBST(LIB_KSPELL, "-lkspell")
2073
 
   AC_SUBST(LIB_KPARTS, "-lkparts")
2074
 
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2075
 
else
2076
 
   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2077
 
   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2078
 
   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2079
 
   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2080
 
   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2081
 
fi
2082
 
])
2083
 
 
2084
 
AC_DEFUN([AC_PATH_KDE],
2085
 
[
2086
 
  AC_BASE_PATH_KDE
2087
 
  AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2088
 
  [
2089
 
  if test "$enableval" = "no";
2090
 
    then ac_use_path_checking="default"
2091
 
    else ac_use_path_checking=""
2092
 
  fi
2093
 
  ],
2094
 
  [
2095
 
  if test "$kde_qtver" = 1;
2096
 
    then ac_use_path_checking=""
2097
 
    else ac_use_path_checking="default"
2098
 
  fi
2099
 
  ]
2100
 
  )
2101
 
 
2102
 
  AC_CREATE_KFSSTND($ac_use_path_checking)
2103
 
 
2104
 
  AC_SUBST_KFSSTND
2105
 
  KDE_CREATE_LIBS_ALIASES
2106
 
])
2107
 
 
2108
 
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2109
 
AC_DEFUN([KDE_CHECK_FUNC_EXT],
2110
 
[
2111
 
AC_MSG_CHECKING(for $1)
2112
 
AC_CACHE_VAL(kde_cv_func_$1,
2113
 
[
2114
 
AC_LANG_SAVE
2115
 
AC_LANG_CPLUSPLUS
2116
 
save_CXXFLAGS="$CXXFLAGS"
2117
 
kde_safe_LIBS="$LIBS"
2118
 
LIBS="$LIBS $X_EXTRA_LIBS"
2119
 
if test "$GXX" = "yes"; then
2120
 
CXXFLAGS="$CXXFLAGS -pedantic-errors"
2121
 
fi
2122
 
AC_TRY_COMPILE([
2123
 
$2
2124
 
],
2125
 
[
2126
 
$3
2127
 
],
2128
 
kde_cv_func_$1=yes,
2129
 
kde_cv_func_$1=no)
2130
 
CXXFLAGS="$save_CXXFLAGS"
2131
 
LIBS="$kde_safe_LIBS"
2132
 
AC_LANG_RESTORE
2133
 
])
2134
 
 
2135
 
AC_MSG_RESULT($kde_cv_func_$1)
2136
 
 
2137
 
AC_MSG_CHECKING([if $1 needs custom prototype])
2138
 
AC_CACHE_VAL(kde_cv_proto_$1,
2139
 
[
2140
 
if test "x$kde_cv_func_$1" = xyes; then
2141
 
  kde_cv_proto_$1=no
2142
 
else
2143
 
  case "$1" in
2144
 
        setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2145
 
                kde_cv_proto_$1="yes - in libkdefakes"
2146
 
                ;;
2147
 
        *)
2148
 
                kde_cv_proto_$1=unknown
2149
 
                ;;
2150
 
  esac
2151
 
fi
2152
 
 
2153
 
if test "x$kde_cv_proto_$1" = xunknown; then
2154
 
 
2155
 
AC_LANG_SAVE
2156
 
AC_LANG_CPLUSPLUS
2157
 
  kde_safe_libs=$LIBS
2158
 
  LIBS="$LIBS $X_EXTRA_LIBS"
2159
 
  AC_TRY_LINK([
2160
 
$2
2161
 
 
2162
 
extern "C" $4;
2163
 
],
2164
 
[
2165
 
$3
2166
 
],
2167
 
[ kde_cv_func_$1=yes
2168
 
  kde_cv_proto_$1=yes ],
2169
 
  [kde_cv_proto_$1="$1 unavailable"]
2170
 
)
2171
 
LIBS=$kde_safe_libs
2172
 
AC_LANG_RESTORE
2173
 
fi
2174
 
])
2175
 
AC_MSG_RESULT($kde_cv_proto_$1)
2176
 
 
2177
 
if test "x$kde_cv_func_$1" = xyes; then
2178
 
  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2179
 
  $6
2180
 
fi
2181
 
if test "x$kde_cv_proto_$1" = xno; then
2182
 
  AC_DEFINE(HAVE_$5_PROTO, 1,
2183
 
  [Define if you have the $1 prototype])
2184
 
fi
2185
 
 
2186
 
AH_VERBATIM([_HAVE_$5_PROTO],
2187
 
[
2188
 
#if !defined(HAVE_$5_PROTO)
2189
 
#ifdef __cplusplus
2190
 
extern "C" {
2191
 
#endif
2192
 
$4;
2193
 
#ifdef __cplusplus
2194
 
}
2195
 
#endif
2196
 
#endif
2197
 
])
2198
 
])
2199
 
 
2200
 
AC_DEFUN([AC_CHECK_SETENV],
2201
 
[
2202
 
        KDE_CHECK_FUNC_EXT(setenv, [
2203
 
#include <stdlib.h>
2204
 
], 
2205
 
                [setenv("VAR", "VALUE", 1);],
2206
 
                [int setenv (const char *, const char *, int)],
2207
 
                [SETENV])
2208
 
])
2209
 
 
2210
 
AC_DEFUN([AC_CHECK_UNSETENV],
2211
 
[
2212
 
        KDE_CHECK_FUNC_EXT(unsetenv, [
2213
 
#include <stdlib.h>
2214
 
], 
2215
 
                [unsetenv("VAR");],
2216
 
                [void unsetenv (const char *)],
2217
 
                [UNSETENV])
2218
 
])
2219
 
 
2220
 
AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2221
 
[
2222
 
        KDE_CHECK_FUNC_EXT(getdomainname, [
2223
 
#include <stdlib.h>
2224
 
#include <unistd.h>
2225
 
#include <netdb.h>
2226
 
], 
2227
 
                [
2228
 
char buffer[200];
2229
 
getdomainname(buffer, 200);
2230
 
],      
2231
 
                [#include <sys/types.h>
2232
 
                int getdomainname (char *, size_t)],
2233
 
                [GETDOMAINNAME])
2234
 
])
2235
 
 
2236
 
AC_DEFUN([AC_CHECK_GETHOSTNAME],
2237
 
[
2238
 
        KDE_CHECK_FUNC_EXT(gethostname, [
2239
 
#include <stdlib.h>
2240
 
#include <unistd.h>
2241
 
], 
2242
 
                [
2243
 
char buffer[200];
2244
 
gethostname(buffer, 200);
2245
 
],      
2246
 
                [int gethostname (char *, unsigned int)],
2247
 
                [GETHOSTNAME])
2248
 
])
2249
 
 
2250
 
AC_DEFUN([AC_CHECK_USLEEP],
2251
 
[
2252
 
        KDE_CHECK_FUNC_EXT(usleep, [
2253
 
#include <unistd.h>
2254
 
], 
2255
 
                [
2256
 
usleep(200);
2257
 
],      
2258
 
                [int usleep (unsigned int)],
2259
 
                [USLEEP])
2260
 
])
2261
 
 
2262
 
 
2263
 
AC_DEFUN([AC_CHECK_RANDOM],
2264
 
[
2265
 
        KDE_CHECK_FUNC_EXT(random, [
2266
 
#include <stdlib.h>
2267
 
], 
2268
 
                [
2269
 
random();
2270
 
],      
2271
 
                [long int random(void)],
2272
 
                [RANDOM])
2273
 
 
2274
 
        KDE_CHECK_FUNC_EXT(srandom, [
2275
 
#include <stdlib.h>
2276
 
], 
2277
 
                [
2278
 
srandom(27);
2279
 
],      
2280
 
                [void srandom(unsigned int)],
2281
 
                [SRANDOM])
2282
 
 
2283
 
])
2284
 
 
2285
 
AC_DEFUN([AC_CHECK_INITGROUPS],
2286
 
[
2287
 
        KDE_CHECK_FUNC_EXT(initgroups, [
2288
 
#include <sys/types.h>
2289
 
#include <unistd.h>
2290
 
#include <grp.h>
2291
 
],
2292
 
        [
2293
 
char buffer[200];
2294
 
initgroups(buffer, 27);
2295
 
],
2296
 
        [int initgroups(const char *, gid_t)],
2297
 
        [INITGROUPS])
2298
 
])
2299
 
 
2300
 
AC_DEFUN([AC_CHECK_MKSTEMPS],
2301
 
[
2302
 
        KDE_CHECK_FUNC_EXT(mkstemps, [
2303
 
#include <stdlib.h>
2304
 
#include <unistd.h>
2305
 
],
2306
 
        [
2307
 
mkstemps("/tmp/aaaXXXXXX", 6);
2308
 
],
2309
 
        [int mkstemps(char *, int)],
2310
 
        [MKSTEMPS])
2311
 
])
2312
 
 
2313
 
AC_DEFUN([AC_CHECK_MKSTEMP],
2314
 
[
2315
 
        KDE_CHECK_FUNC_EXT(mkstemp, [
2316
 
#include <stdlib.h>
2317
 
#include <unistd.h>
2318
 
],
2319
 
        [
2320
 
mkstemp("/tmp/aaaXXXXXX");
2321
 
],
2322
 
        [int mkstemp(char *)],
2323
 
        [MKSTEMP])
2324
 
])
2325
 
 
2326
 
AC_DEFUN([AC_CHECK_MKDTEMP],
2327
 
[
2328
 
        KDE_CHECK_FUNC_EXT(mkdtemp, [
2329
 
#include <stdlib.h>
2330
 
#include <unistd.h>
2331
 
],
2332
 
        [
2333
 
mkdtemp("/tmp/aaaXXXXXX");
2334
 
],
2335
 
        [char *mkdtemp(char *)],
2336
 
        [MKDTEMP])
2337
 
])
2338
 
 
2339
 
 
2340
 
AC_DEFUN([AC_CHECK_RES_INIT],
2341
 
[
2342
 
  AC_MSG_CHECKING([if res_init needs -lresolv])
2343
 
  kde_libs_safe="$LIBS"
2344
 
  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2345
 
  AC_TRY_LINK(
2346
 
    [
2347
 
#include <sys/types.h>
2348
 
#include <netinet/in.h>
2349
 
#include <arpa/nameser.h>
2350
 
#include <resolv.h>
2351
 
    ],
2352
 
    [
2353
 
      res_init(); 
2354
 
    ],
2355
 
    [
2356
 
      LIBRESOLV="-lresolv"
2357
 
      AC_MSG_RESULT(yes)
2358
 
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2359
 
    ],
2360
 
    [ AC_MSG_RESULT(no) ]
2361
 
  )
2362
 
  LIBS=$kde_libs_safe
2363
 
  AC_SUBST(LIBRESOLV)
2364
 
 
2365
 
  KDE_CHECK_FUNC_EXT(res_init,
2366
 
    [
2367
 
#include <sys/types.h>
2368
 
#include <netinet/in.h>
2369
 
#include <arpa/nameser.h>
2370
 
#include <resolv.h>
2371
 
    ],
2372
 
    [res_init()],
2373
 
    [int res_init(void)],
2374
 
    [RES_INIT])
2375
 
])
2376
 
 
2377
 
AC_DEFUN([AC_CHECK_STRLCPY],
2378
 
[
2379
 
        KDE_CHECK_FUNC_EXT(strlcpy, [
2380
 
#include <string.h>
2381
 
],
2382
 
[ char buf[20];
2383
 
  strlcpy(buf, "KDE function test", sizeof(buf));
2384
 
],
2385
 
        [unsigned long strlcpy(char*, const char*, unsigned long)],
2386
 
        [STRLCPY])
2387
 
])
2388
 
 
2389
 
AC_DEFUN([AC_CHECK_STRLCAT],
2390
 
[
2391
 
        KDE_CHECK_FUNC_EXT(strlcat, [
2392
 
#include <string.h>
2393
 
],
2394
 
[ char buf[20];
2395
 
  buf[0]='\0';
2396
 
  strlcat(buf, "KDE function test", sizeof(buf));
2397
 
],
2398
 
        [unsigned long strlcat(char*, const char*, unsigned long)],
2399
 
        [STRLCAT])
2400
 
])
2401
 
 
2402
 
AC_DEFUN([AC_CHECK_RES_QUERY],
2403
 
[
2404
 
        KDE_CHECK_FUNC_EXT(res_query, [
2405
 
#include <sys/types.h>
2406
 
#include <netinet/in.h>
2407
 
#include <arpa/nameser.h>
2408
 
#include <resolv.h>
2409
 
#include <netdb.h>
2410
 
],
2411
 
[
2412
 
res_query(NULL, 0, 0, NULL, 0);
2413
 
],
2414
 
        [int res_query(const char *, int, int, unsigned char *, int)],
2415
 
        [RES_QUERY])
2416
 
])
2417
 
 
2418
 
AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2419
 
[
2420
 
        KDE_CHECK_FUNC_EXT(dn_skipname, [
2421
 
#include <sys/types.h>
2422
 
#include <netinet/in.h>
2423
 
#include <arpa/nameser.h>
2424
 
#include <resolv.h>
2425
 
],
2426
 
[
2427
 
dn_skipname (NULL, NULL);
2428
 
],
2429
 
        [int dn_skipname (unsigned char *, unsigned char *)],
2430
 
        [DN_SKIPNAME])
2431
 
])
2432
 
 
2433
 
 
2434
 
AC_DEFUN([AC_FIND_GIF],
2435
 
   [AC_MSG_CHECKING([for giflib])
2436
 
AC_CACHE_VAL(ac_cv_lib_gif,
2437
 
[ac_save_LIBS="$LIBS"
2438
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2439
 
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2440
 
else
2441
 
LIBS="$all_libraries -lgif"
2442
 
fi
2443
 
AC_TRY_LINK(dnl
2444
 
[
2445
 
#ifdef __cplusplus
2446
 
extern "C" {
2447
 
#endif
2448
 
int GifLastError(void);
2449
 
#ifdef __cplusplus
2450
 
}
2451
 
#endif
2452
 
/* We use char because int might match the return type of a gcc2
2453
 
    builtin and then its argument prototype would still apply.  */
2454
 
],
2455
 
            [return GifLastError();],
2456
 
            eval "ac_cv_lib_gif=yes",
2457
 
            eval "ac_cv_lib_gif=no")
2458
 
LIBS="$ac_save_LIBS"
2459
 
])dnl
2460
 
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2461
 
  AC_MSG_RESULT(yes)
2462
 
  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2463
 
else
2464
 
  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2465
 
fi
2466
 
])
2467
 
 
2468
 
AC_DEFUN([KDE_FIND_JPEG_HELPER],
2469
 
[
2470
 
AC_MSG_CHECKING([for libjpeg$2])
2471
 
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2472
 
[
2473
 
ac_save_LIBS="$LIBS"
2474
 
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2475
 
ac_save_CFLAGS="$CFLAGS"
2476
 
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2477
 
AC_TRY_LINK(
2478
 
[/* Override any gcc2 internal prototype to avoid an error.  */
2479
 
struct jpeg_decompress_struct;
2480
 
typedef struct jpeg_decompress_struct * j_decompress_ptr;
2481
 
typedef int size_t;
2482
 
#ifdef __cplusplus
2483
 
extern "C" {
2484
 
#endif
2485
 
    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2486
 
                                    int version, size_t structsize);
2487
 
#ifdef __cplusplus
2488
 
}
2489
 
#endif
2490
 
/* We use char because int might match the return type of a gcc2
2491
 
    builtin and then its argument prototype would still apply.  */
2492
 
],
2493
 
            [jpeg_CreateDecompress(0L, 0, 0);],
2494
 
            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2495
 
            eval "ac_cv_lib_jpeg_$1=no")
2496
 
LIBS="$ac_save_LIBS"
2497
 
CFLAGS="$ac_save_CFLAGS"
2498
 
])
2499
 
 
2500
 
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2501
 
  LIBJPEG="$ac_cv_lib_jpeg_$1"
2502
 
  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2503
 
else
2504
 
  AC_MSG_RESULT(no)
2505
 
  $3
2506
 
fi
2507
 
 
2508
 
])
2509
 
 
2510
 
AC_DEFUN([AC_FIND_JPEG],
2511
 
[
2512
 
dnl first look for libraries
2513
 
KDE_FIND_JPEG_HELPER(6b, 6b,
2514
 
   KDE_FIND_JPEG_HELPER(normal, [],
2515
 
    [
2516
 
       LIBJPEG=
2517
 
    ]
2518
 
   )
2519
 
)
2520
 
 
2521
 
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2522
 
dnl requires system dependent includes loaded before it)
2523
 
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2524
 
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2525
 
test "x$jpeg_incdir" = xNO && jpeg_incdir=
2526
 
 
2527
 
dnl if headers _and_ libraries are missing, this is no error, and we
2528
 
dnl continue with a warning (the user will get no jpeg support in khtml)
2529
 
dnl if only one is missing, it means a configuration error, but we still
2530
 
dnl only warn
2531
 
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2532
 
  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2533
 
else
2534
 
  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2535
 
    AC_MSG_WARN([
2536
 
There is an installation error in jpeg support. You seem to have only one
2537
 
of either the headers _or_ the libraries installed. You may need to either
2538
 
provide correct --with-extra-... options, or the development package of
2539
 
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2540
 
Disabling JPEG support.
2541
 
])
2542
 
  else
2543
 
    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2544
 
  fi
2545
 
  jpeg_incdir=
2546
 
  LIBJPEG=
2547
 
fi
2548
 
 
2549
 
AC_SUBST(LIBJPEG)
2550
 
AH_VERBATIM(_AC_CHECK_JPEG,
2551
 
[/*
2552
 
 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2553
 
 * headers and I'm too lazy to write a configure test as long as only
2554
 
 * unixware is related
2555
 
 */
2556
 
#ifdef _UNIXWARE
2557
 
#define HAVE_BOOLEAN
2558
 
#endif
2559
 
])
2560
 
])
2561
 
 
2562
 
AC_DEFUN([KDE_CHECK_QT_JPEG],
2563
 
[
2564
 
if test -n "$LIBJPEG"; then
2565
 
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2566
 
AC_CACHE_VAL(kde_cv_qt_jpeg,
2567
 
[
2568
 
AC_LANG_SAVE
2569
 
AC_LANG_CPLUSPLUS
2570
 
ac_save_LIBS="$LIBS"
2571
 
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2572
 
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2573
 
ac_save_CXXFLAGS="$CXXFLAGS"
2574
 
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2575
 
AC_TRY_LINK(
2576
 
[#include <qapplication.h>],
2577
 
            [
2578
 
            int argc;
2579
 
            char** argv;
2580
 
            QApplication app(argc, argv);],
2581
 
            eval "kde_cv_qt_jpeg=no",
2582
 
            eval "kde_cv_qt_jpeg=yes")
2583
 
LIBS="$ac_save_LIBS"
2584
 
CXXFLAGS="$ac_save_CXXFLAGS"
2585
 
AC_LANG_RESTORE
2586
 
fi
2587
 
])
2588
 
 
2589
 
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2590
 
  AC_MSG_RESULT(yes)
2591
 
  LIBJPEG_QT='$(LIBJPEG)'
2592
 
else
2593
 
  AC_MSG_RESULT(no)
2594
 
  LIBJPEG_QT=
2595
 
fi
2596
 
 
2597
 
])
2598
 
 
2599
 
AC_DEFUN([AC_FIND_ZLIB],
2600
 
[
2601
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2602
 
AC_MSG_CHECKING([for libz])
2603
 
AC_CACHE_VAL(ac_cv_lib_z,
2604
 
[
2605
 
kde_save_LIBS="$LIBS"
2606
 
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2607
 
kde_save_CFLAGS="$CFLAGS"
2608
 
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2609
 
AC_TRY_LINK(dnl
2610
 
[
2611
 
#include<zlib.h>
2612
 
],
2613
 
[
2614
 
  char buf[42];
2615
 
  gzFile f = (gzFile) 0;
2616
 
  /* this would segfault.. but we only link, don't run */
2617
 
  (void) gzgets(f, buf, sizeof(buf));
2618
 
 
2619
 
  return (zlibVersion() == ZLIB_VERSION); 
2620
 
],
2621
 
            eval "ac_cv_lib_z='-lz'",
2622
 
            eval "ac_cv_lib_z=no")
2623
 
LIBS="$kde_save_LIBS"
2624
 
CFLAGS="$kde_save_CFLAGS"
2625
 
])dnl
2626
 
if test ! "$ac_cv_lib_z" = no; then
2627
 
  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2628
 
  LIBZ="$ac_cv_lib_z"
2629
 
  AC_MSG_RESULT($ac_cv_lib_z)
2630
 
else
2631
 
  AC_MSG_ERROR(not found. 
2632
 
          Possibly configure picks up an outdated version
2633
 
          installed by XFree86. Remove it from your system.
2634
 
 
2635
 
          Check your installation and look into config.log)
2636
 
  LIBZ=""
2637
 
fi
2638
 
AC_SUBST(LIBZ)
2639
 
])
2640
 
 
2641
 
AC_DEFUN([KDE_TRY_TIFFLIB],
2642
 
[
2643
 
AC_MSG_CHECKING([for libtiff $1])
2644
 
 
2645
 
AC_CACHE_VAL(kde_cv_libtiff_$1,
2646
 
[
2647
 
AC_LANG_SAVE
2648
 
AC_LANG_CPLUSPLUS
2649
 
kde_save_LIBS="$LIBS"
2650
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2651
 
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2652
 
else
2653
 
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2654
 
fi
2655
 
kde_save_CXXFLAGS="$CXXFLAGS"
2656
 
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2657
 
 
2658
 
AC_TRY_LINK(dnl
2659
 
[
2660
 
#include<tiffio.h>
2661
 
],
2662
 
    [return (TIFFOpen( "", "r") == 0); ],
2663
 
[
2664
 
    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2665
 
], [
2666
 
    kde_cv_libtiff_$1=no
2667
 
])
2668
 
 
2669
 
LIBS="$kde_save_LIBS"
2670
 
CXXFLAGS="$kde_save_CXXFLAGS"
2671
 
AC_LANG_RESTORE
2672
 
])
2673
 
 
2674
 
if test "$kde_cv_libtiff_$1" = "no"; then
2675
 
    AC_MSG_RESULT(no)
2676
 
    LIBTIFF=""
2677
 
    $3
2678
 
else
2679
 
    LIBTIFF="$kde_cv_libtiff_$1"
2680
 
    AC_MSG_RESULT(yes)
2681
 
    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2682
 
    $2
2683
 
fi
2684
 
 
2685
 
])
2686
 
 
2687
 
AC_DEFUN([AC_FIND_TIFF],
2688
 
[
2689
 
AC_REQUIRE([K_PATH_X])
2690
 
AC_REQUIRE([AC_FIND_ZLIB])
2691
 
AC_REQUIRE([AC_FIND_JPEG])
2692
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2693
 
 
2694
 
KDE_TRY_TIFFLIB(tiff, [],
2695
 
   KDE_TRY_TIFFLIB(tiff34))
2696
 
 
2697
 
AC_SUBST(LIBTIFF)
2698
 
])
2699
 
 
2700
 
 
2701
 
AC_DEFUN([AC_FIND_PNG],
2702
 
[
2703
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2704
 
AC_REQUIRE([AC_FIND_ZLIB])
2705
 
AC_MSG_CHECKING([for libpng])
2706
 
AC_CACHE_VAL(ac_cv_lib_png,
2707
 
[
2708
 
kde_save_LIBS="$LIBS"
2709
 
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2710
 
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2711
 
else
2712
 
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2713
 
fi
2714
 
kde_save_CFLAGS="$CFLAGS"
2715
 
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2716
 
 
2717
 
AC_TRY_LINK(dnl
2718
 
    [
2719
 
    #include<png.h>
2720
 
    ],
2721
 
    [
2722
 
    png_structp png_ptr = png_create_read_struct(  /* image ptr */
2723
 
                PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2724
 
    return( png_ptr != 0 );
2725
 
    ],
2726
 
    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2727
 
    eval "ac_cv_lib_png=no"
2728
 
)
2729
 
LIBS="$kde_save_LIBS"
2730
 
CFLAGS="$kde_save_CFLAGS"
2731
 
])dnl
2732
 
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2733
 
  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2734
 
  LIBPNG="$ac_cv_lib_png"
2735
 
  AC_SUBST(LIBPNG)
2736
 
  AC_MSG_RESULT($ac_cv_lib_png)
2737
 
else
2738
 
  AC_MSG_RESULT(no)
2739
 
  LIBPNG=""
2740
 
  AC_SUBST(LIBPNG)
2741
 
fi
2742
 
])
2743
 
 
2744
 
 
2745
 
AC_DEFUN([AC_FIND_JASPER],
2746
 
[
2747
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2748
 
AC_REQUIRE([AC_FIND_JPEG])
2749
 
AC_MSG_CHECKING([for jasper])
2750
 
AC_CACHE_VAL(ac_cv_jasper,
2751
 
[
2752
 
kde_save_LIBS="$LIBS"
2753
 
LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2754
 
kde_save_CFLAGS="$CFLAGS"
2755
 
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2756
 
 
2757
 
AC_TRY_LINK(dnl
2758
 
    [
2759
 
    #include<jasper/jasper.h>
2760
 
    ],
2761
 
    [
2762
 
    return( jas_init() );
2763
 
    ],
2764
 
    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2765
 
    eval "ac_cv_jasper=no"
2766
 
)
2767
 
LIBS="$kde_save_LIBS"
2768
 
CFLAGS="$kde_save_CFLAGS"
2769
 
])dnl
2770
 
if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2771
 
  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2772
 
  LIB_JASPER="$ac_cv_jasper"
2773
 
  AC_MSG_RESULT($ac_cv_jasper)
2774
 
else
2775
 
  AC_MSG_RESULT(no)
2776
 
  LIB_JASPER=""
2777
 
fi
2778
 
AC_SUBST(LIB_JASPER)
2779
 
])
2780
 
 
2781
 
AC_DEFUN([AC_CHECK_BOOL],
2782
 
[
2783
 
  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2784
 
])
2785
 
 
2786
 
AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2787
 
[
2788
 
AC_MSG_CHECKING(if you need GNU extensions)
2789
 
AC_CACHE_VAL(ac_cv_gnu_extensions,
2790
 
[
2791
 
cat > conftest.c << EOF
2792
 
#include <features.h>
2793
 
 
2794
 
#ifdef __GNU_LIBRARY__
2795
 
yes
2796
 
#endif
2797
 
EOF
2798
 
 
2799
 
if (eval "$ac_cpp conftest.c") 2>&5 |
2800
 
  egrep "yes" >/dev/null 2>&1; then
2801
 
  rm -rf conftest*
2802
 
  ac_cv_gnu_extensions=yes
2803
 
else
2804
 
  ac_cv_gnu_extensions=no
2805
 
fi
2806
 
])
2807
 
 
2808
 
AC_MSG_RESULT($ac_cv_gnu_extensions)
2809
 
if test "$ac_cv_gnu_extensions" = "yes"; then
2810
 
  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2811
 
fi
2812
 
])
2813
 
 
2814
 
AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2815
 
[
2816
 
AC_MSG_CHECKING([whether $CXX supports -$1])
2817
 
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2818
 
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2819
 
[
2820
 
  AC_LANG_SAVE
2821
 
  AC_LANG_CPLUSPLUS
2822
 
  save_CXXFLAGS="$CXXFLAGS"
2823
 
  CXXFLAGS="$CXXFLAGS -$1"
2824
 
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2825
 
  CXXFLAGS="$save_CXXFLAGS"
2826
 
  AC_LANG_RESTORE
2827
 
])
2828
 
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2829
 
 AC_MSG_RESULT(yes)
2830
 
 :
2831
 
 $2
2832
 
else
2833
 
 AC_MSG_RESULT(no)
2834
 
 :
2835
 
 $3
2836
 
fi
2837
 
])
2838
 
 
2839
 
AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2840
 
[
2841
 
AC_MSG_CHECKING([whether $CC supports -$1])
2842
 
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2843
 
AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2844
 
[
2845
 
  AC_LANG_SAVE
2846
 
  AC_LANG_C
2847
 
  save_CFLAGS="$CFLAGS"
2848
 
  CFLAGS="$CFLAGS -$1"
2849
 
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2850
 
  CFLAGS="$save_CFLAGS"
2851
 
  AC_LANG_RESTORE
2852
 
])
2853
 
if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2854
 
 AC_MSG_RESULT(yes)
2855
 
 :
2856
 
 $2
2857
 
else
2858
 
 AC_MSG_RESULT(no)
2859
 
 :
2860
 
 $3
2861
 
fi
2862
 
])
2863
 
 
2864
 
 
2865
 
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2866
 
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2867
 
dnl it's all white-space separated
2868
 
AC_DEFUN([AC_REMOVE_FORBIDDEN],
2869
 
[ __val=$$1
2870
 
  __forbid=" $2 "
2871
 
  if test -n "$__val"; then
2872
 
    __new=""
2873
 
    ac_save_IFS=$IFS
2874
 
    IFS="       "
2875
 
    for i in $__val; do
2876
 
      case "$__forbid" in
2877
 
        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2878
 
        *) # Careful to not add spaces, where there were none, because otherwise
2879
 
           # libtool gets confused, if we change e.g. CXX
2880
 
           if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2881
 
      esac
2882
 
    done
2883
 
    IFS=$ac_save_IFS
2884
 
    $1=$__new
2885
 
  fi
2886
 
])
2887
 
 
2888
 
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2889
 
AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
2890
 
[dnl
2891
 
if test "x$kde_use_qt_emb" != "xyes"; then
2892
 
 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2893
 
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2894
 
else
2895
 
 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2896
 
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2897
 
fi
2898
 
])
2899
 
 
2900
 
AC_DEFUN([AC_CHECK_COMPILERS],
2901
 
[
2902
 
  AC_ARG_ENABLE(debug,
2903
 
                AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
2904
 
  [
2905
 
    case $enableval in
2906
 
      yes)
2907
 
        kde_use_debug_code="yes"
2908
 
        kde_use_debug_define=no
2909
 
        ;;
2910
 
      full)
2911
 
        kde_use_debug_code="full"
2912
 
        kde_use_debug_define=no
2913
 
        ;;
2914
 
      *)
2915
 
        kde_use_debug_code="no"
2916
 
        kde_use_debug_define=yes
2917
 
        ;;
2918
 
    esac
2919
 
  ], 
2920
 
    [kde_use_debug_code="no"
2921
 
      kde_use_debug_define=no
2922
 
  ])
2923
 
 
2924
 
  dnl Just for configure --help
2925
 
  AC_ARG_ENABLE(dummyoption,
2926
 
                AC_HELP_STRING([--disable-debug],
2927
 
                               [disables debug output and debug symbols [default=no]]),
2928
 
                [],[])
2929
 
 
2930
 
  AC_ARG_ENABLE(strict,
2931
 
                AC_HELP_STRING([--enable-strict],
2932
 
                              [compiles with strict compiler options (may not work!)]),
2933
 
   [
2934
 
    if test $enableval = "no"; then
2935
 
         kde_use_strict_options="no"
2936
 
       else
2937
 
         kde_use_strict_options="yes"
2938
 
    fi
2939
 
   ], [kde_use_strict_options="no"])
2940
 
 
2941
 
  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similiar]),
2942
 
   [
2943
 
    if test $enableval = "no"; then
2944
 
         kde_use_warnings="no"
2945
 
       else
2946
 
         kde_use_warnings="yes"
2947
 
    fi
2948
 
   ], [kde_use_warnings="yes"])
2949
 
 
2950
 
  dnl enable warnings for debug build
2951
 
  if test "$kde_use_debug_code" != "no"; then
2952
 
    kde_use_warnings=yes
2953
 
  fi
2954
 
 
2955
 
  AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
2956
 
    [kde_use_profiling=$enableval],
2957
 
    [kde_use_profiling="no"]
2958
 
  )
2959
 
 
2960
 
  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2961
 
  CFLAGS=" $CFLAGS"
2962
 
 
2963
 
  AC_PROG_CC 
2964
 
 
2965
 
  AC_PROG_CPP
2966
 
 
2967
 
  if test "$GCC" = "yes"; then
2968
 
    if test "$kde_use_debug_code" != "no"; then
2969
 
      if test $kde_use_debug_code = "full"; then
2970
 
        CFLAGS="-g3 -fno-inline $CFLAGS"
2971
 
      else
2972
 
        CFLAGS="-g -O2 $CFLAGS"
2973
 
      fi
2974
 
    else
2975
 
      CFLAGS="-O2 $CFLAGS"
2976
 
    fi
2977
 
  fi
2978
 
 
2979
 
  if test "$kde_use_debug_define" = "yes"; then
2980
 
    CFLAGS="-DNDEBUG $CFLAGS"
2981
 
  fi
2982
 
 
2983
 
 
2984
 
  case "$host" in
2985
 
  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2986
 
  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2987
 
  esac
2988
 
 
2989
 
  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2990
 
     LDFLAGS=""
2991
 
  fi
2992
 
 
2993
 
  CXXFLAGS=" $CXXFLAGS"
2994
 
 
2995
 
  AC_PROG_CXX
2996
 
 
2997
 
  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2998
 
    if test "$kde_use_debug_code" != "no"; then
2999
 
      if test "$CXX" = "KCC"; then
3000
 
        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3001
 
      else
3002
 
        if test "$kde_use_debug_code" = "full"; then
3003
 
          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3004
 
        else
3005
 
          CXXFLAGS="-g -O2 $CXXFLAGS"
3006
 
        fi
3007
 
      fi
3008
 
      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3009
 
 
3010
 
      dnl convenience compiler flags
3011
 
      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3012
 
      AC_SUBST(WOVERLOADED_VIRTUAL)
3013
 
    else
3014
 
      if test "$CXX" = "KCC"; then
3015
 
        CXXFLAGS="+K3 $CXXFLAGS"
3016
 
      else
3017
 
        CXXFLAGS="-O2 $CXXFLAGS"
3018
 
      fi  
3019
 
    fi
3020
 
  fi
3021
 
 
3022
 
  if test "$kde_use_debug_define" = "yes"; then
3023
 
    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3024
 
  fi  
3025
 
 
3026
 
  if test "$kde_use_profiling" = "yes"; then
3027
 
    KDE_CHECK_COMPILER_FLAG(pg,
3028
 
    [
3029
 
      CFLAGS="-pg $CFLAGS"
3030
 
      CXXFLAGS="-pg $CXXFLAGS"
3031
 
    ])
3032
 
  fi
3033
 
 
3034
 
  if test "$kde_use_warnings" = "yes"; then
3035
 
      if test "$GCC" = "yes"; then
3036
 
        CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3037
 
        case $host in
3038
 
          *-*-linux-gnu)        
3039
 
            CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3040
 
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
3041
 
            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3042
 
            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3043
 
          ;;
3044
 
        esac
3045
 
        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3046
 
        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3047
 
        KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
3048
 
     fi
3049
 
  fi
3050
 
 
3051
 
  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3052
 
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3053
 
  fi
3054
 
 
3055
 
  AC_ARG_ENABLE(pch,
3056
 
     AC_HELP_STRING([--enable-pch],
3057
 
                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3058
 
    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3059
 
 
3060
 
  HAVE_GCC_VISIBILITY=0
3061
 
  AC_SUBST([HAVE_GCC_VISIBILITY])
3062
 
 
3063
 
  if test "$GXX" = "yes"; then
3064
 
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3065
 
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3066
 
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3067
 
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
3068
 
    ENABLE_PERMISSIVE_FLAG="-fpermissive"
3069
 
 
3070
 
    if test "$kde_use_pch" = "yes"; then
3071
 
        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3072
 
        echo >conftest.h
3073
 
        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3074
 
            kde_gcc_supports_pch=yes
3075
 
            AC_MSG_RESULT(yes)
3076
 
        else
3077
 
            kde_gcc_supports_pch=no
3078
 
            AC_MSG_RESULT(no)
3079
 
        fi
3080
 
        if test "$kde_gcc_supports_pch" = "yes"; then
3081
 
            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3082
 
            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3083
 
                kde_gcc_supports_pch=yes
3084
 
                AC_MSG_RESULT(yes)
3085
 
            else
3086
 
                kde_gcc_supports_pch=no
3087
 
                AC_MSG_RESULT(no)
3088
 
            fi
3089
 
        fi
3090
 
        rm -f conftest.h conftest.h.gch
3091
 
    fi
3092
 
    AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3093
 
  fi
3094
 
  if test "$CXX" = "KCC"; then
3095
 
    dnl unfortunately we currently cannot disable exception support in KCC
3096
 
    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3097
 
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3098
 
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
3099
 
 
3100
 
    if test "$kde_use_pch" = "yes"; then
3101
 
      dnl TODO: support --pch-dir!
3102
 
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3103
 
      dnl the below works (but the dir must exist), but it's
3104
 
      dnl useless for a whole package.
3105
 
      dnl The are precompiled headers for each source file, so when compiling
3106
 
      dnl from scratch, it doesn't make a difference, and they take up
3107
 
      dnl around ~5Mb _per_ sourcefile.
3108
 
      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3109
 
      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3110
 
    fi
3111
 
    dnl this flag controls inlining. by default KCC inlines in optimisation mode
3112
 
    dnl all implementations that are defined inside the class {} declaration. 
3113
 
    dnl because of templates-compatibility with broken gcc compilers, this
3114
 
    dnl can cause excessive inlining. This flag limits it to a sane level
3115
 
    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3116
 
    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3117
 
    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3118
 
    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3119
 
    dnl Some source files are shared between multiple executables
3120
 
    dnl (or libraries) and some of those need template instantiations.
3121
 
    dnl In that case KCC needs to compile those sources with
3122
 
    dnl --one_instantiation_per_object.  To make it easy for us we compile
3123
 
    dnl _all_ objects with that flag (--one_per is a shorthand).
3124
 
    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3125
 
  fi
3126
 
  AC_SUBST(USE_EXCEPTIONS)
3127
 
  dnl obsolete macro - provided to keep things going
3128
 
  USE_RTTI=
3129
 
  AC_SUBST(USE_RTTI)
3130
 
 
3131
 
  case "$host" in
3132
 
      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3133
 
      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3134
 
      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3135
 
      *-*-solaris*) 
3136
 
        if test "$GXX" = yes; then
3137
 
          libstdcpp=`$CXX -print-file-name=libstdc++.so`
3138
 
          if test ! -f $libstdcpp; then
3139
 
             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
3140
 
          fi
3141
 
        fi
3142
 
        ;;
3143
 
  esac
3144
 
 
3145
 
  AC_VALIDIFY_CXXFLAGS
3146
 
 
3147
 
  AC_PROG_CXXCPP
3148
 
 
3149
 
  if test "$GCC" = yes; then
3150
 
     NOOPT_CFLAGS=-O0
3151
 
  fi
3152
 
  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3153
 
 
3154
 
  AC_SUBST(NOOPT_CXXFLAGS)
3155
 
  AC_SUBST(NOOPT_CFLAGS)
3156
 
  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3157
 
 
3158
 
  KDE_CHECK_AS_NEEDED
3159
 
  KDE_CHECK_FINAL
3160
 
  KDE_CHECK_CLOSURE
3161
 
  KDE_CHECK_NMCHECK
3162
 
 
3163
 
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3164
 
])
3165
 
 
3166
 
AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
3167
 
[
3168
 
  if test "$GXX" = "yes"; then
3169
 
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3170
 
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3171
 
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3172
 
    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
3173
 
    [
3174
 
        CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
3175
 
        HAVE_GCC_VISIBILITY=1
3176
 
        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3177
 
    ])
3178
 
  fi
3179
 
])
3180
 
 
3181
 
AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3182
 
[
3183
 
  AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
3184
 
])
3185
 
 
3186
 
AC_DEFUN([KDE_ADD_DEPENDENCIES],
3187
 
[
3188
 
   [A]M_DEPENDENCIES(CC)
3189
 
   [A]M_DEPENDENCIES(CXX)
3190
 
])
3191
 
 
3192
 
dnl just a wrapper to clean up configure.in
3193
 
AC_DEFUN([KDE_PROG_LIBTOOL],
3194
 
[
3195
 
AC_REQUIRE([AC_CHECK_COMPILERS])
3196
 
AC_REQUIRE([AC_ENABLE_SHARED])
3197
 
AC_REQUIRE([AC_ENABLE_STATIC])
3198
 
 
3199
 
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3200
 
AC_REQUIRE([KDE_CHECK_LIB64])
3201
 
 
3202
 
AC_OBJEXT
3203
 
AC_EXEEXT
3204
 
 
3205
 
AM_PROG_LIBTOOL
3206
 
AC_LIBTOOL_CXX
3207
 
 
3208
 
LIBTOOL_SHELL="/bin/sh ./libtool"
3209
 
#  LIBTOOL="$LIBTOOL --silent"
3210
 
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3211
 
AC_SUBST(KDE_PLUGIN)
3212
 
 
3213
 
# we patch configure quite some so we better keep that consistent for incremental runs 
3214
 
AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3215
 
])
3216
 
 
3217
 
AC_DEFUN([KDE_CHECK_LIB64],
3218
 
[
3219
 
    kdelibsuff=no
3220
 
    AC_ARG_ENABLE(libsuffix,
3221
 
        AC_HELP_STRING([--enable-libsuffix],
3222
 
            [/lib directory suffix (64,32,none[=default])]),
3223
 
            kdelibsuff=$enableval)
3224
 
    # TODO: add an auto case that compiles a little C app to check
3225
 
    # where the glibc is
3226
 
    if test "$kdelibsuff" = "no"; then
3227
 
       kdelibsuff=
3228
 
    fi
3229
 
    if test -z "$kdelibsuff"; then
3230
 
        AC_MSG_RESULT([not using lib directory suffix])
3231
 
        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3232
 
    else
3233
 
        if test "$libdir" = '${exec_prefix}/lib'; then
3234
 
            libdir="$libdir${kdelibsuff}"
3235
 
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3236
 
        fi
3237
 
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3238
 
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3239
 
    fi
3240
 
])
3241
 
 
3242
 
AC_DEFUN([KDE_CHECK_TYPES],
3243
 
[  AC_CHECK_SIZEOF(int, 4)dnl
3244
 
   AC_CHECK_SIZEOF(short)dnl
3245
 
  AC_CHECK_SIZEOF(long, 4)dnl
3246
 
  AC_CHECK_SIZEOF(char *, 4)dnl
3247
 
])dnl
3248
 
 
3249
 
dnl Not used - kept for compat only?
3250
 
AC_DEFUN([KDE_DO_IT_ALL],
3251
 
[
3252
 
AC_CANONICAL_SYSTEM
3253
 
AC_ARG_PROGRAM
3254
 
AM_INIT_AUTOMAKE($1, $2)
3255
 
AM_DISABLE_LIBRARIES
3256
 
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3257
 
AC_CHECK_COMPILERS
3258
 
KDE_PROG_LIBTOOL
3259
 
AM_KDE_WITH_NLS
3260
 
AC_PATH_KDE
3261
 
])
3262
 
 
3263
 
AC_DEFUN([AC_CHECK_RPATH],
3264
 
[
3265
 
AC_MSG_CHECKING(for rpath)
3266
 
AC_ARG_ENABLE(rpath,
3267
 
      AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3268
 
      USE_RPATH=$enableval, USE_RPATH=yes)
3269
 
 
3270
 
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3271
 
 
3272
 
  KDE_RPATH="-R \$(kde_libraries)"
3273
 
 
3274
 
  if test -n "$qt_libraries"; then
3275
 
    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3276
 
  fi
3277
 
  dnl $x_libraries is set to /usr/lib in case
3278
 
  if test -n "$X_LDFLAGS"; then
3279
 
    X_RPATH="-R \$(x_libraries)"
3280
 
    KDE_RPATH="$KDE_RPATH $X_RPATH"
3281
 
  fi
3282
 
  if test -n "$KDE_EXTRA_RPATH"; then
3283
 
    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3284
 
  fi
3285
 
fi
3286
 
AC_SUBST(KDE_EXTRA_RPATH)
3287
 
AC_SUBST(KDE_RPATH)
3288
 
AC_SUBST(X_RPATH)
3289
 
AC_MSG_RESULT($USE_RPATH)
3290
 
])
3291
 
 
3292
 
dnl Check for the type of the third argument of getsockname
3293
 
AC_DEFUN([AC_CHECK_SOCKLEN_T],
3294
 
[
3295
 
   AC_MSG_CHECKING(for socklen_t)
3296
 
   AC_CACHE_VAL(kde_cv_socklen_t,
3297
 
   [
3298
 
      AC_LANG_PUSH(C++)
3299
 
      kde_cv_socklen_t=no
3300
 
      AC_TRY_COMPILE([
3301
 
         #include <sys/types.h>
3302
 
         #include <sys/socket.h>
3303
 
      ],
3304
 
      [
3305
 
         socklen_t len;
3306
 
         getpeername(0,0,&len);
3307
 
      ],
3308
 
      [
3309
 
         kde_cv_socklen_t=yes
3310
 
         kde_cv_socklen_t_equiv=socklen_t
3311
 
      ])
3312
 
      AC_LANG_POP(C++)
3313
 
   ])
3314
 
   AC_MSG_RESULT($kde_cv_socklen_t)
3315
 
   if test $kde_cv_socklen_t = no; then
3316
 
      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3317
 
      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3318
 
      [
3319
 
         kde_cv_socklen_t_equiv=int
3320
 
         AC_LANG_PUSH(C++)
3321
 
         for t in int size_t unsigned long "unsigned long"; do
3322
 
            AC_TRY_COMPILE([
3323
 
               #include <sys/types.h>
3324
 
               #include <sys/socket.h>
3325
 
            ],
3326
 
            [
3327
 
               $t len;
3328
 
               getpeername(0,0,&len);
3329
 
            ],
3330
 
            [
3331
 
               kde_cv_socklen_t_equiv="$t"
3332
 
               break
3333
 
            ])
3334
 
         done
3335
 
         AC_LANG_POP(C++)
3336
 
      ])
3337
 
      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3338
 
   fi
3339
 
   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3340
 
                     [type to use in place of socklen_t if not defined])
3341
 
   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3342
 
                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3343
 
])
3344
 
 
3345
 
dnl This is a merge of some macros out of the gettext aclocal.m4
3346
 
dnl since we don't need anything, I took the things we need
3347
 
dnl the copyright for them is:
3348
 
dnl >
3349
 
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3350
 
dnl This Makefile.in is free software; the Free Software Foundation
3351
 
dnl gives unlimited permission to copy and/or distribute it,
3352
 
dnl with or without modifications, as long as this notice is preserved.
3353
 
 
3354
 
dnl This program is distributed in the hope that it will be useful,
3355
 
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3356
 
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3357
 
dnl PARTICULAR PURPOSE.
3358
 
dnl >
3359
 
dnl for this file it is relicensed under LGPL
3360
 
 
3361
 
AC_DEFUN([AM_KDE_WITH_NLS],
3362
 
  [
3363
 
    dnl If we use NLS figure out what method
3364
 
 
3365
 
    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3366
 
        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3367
 
    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3368
 
 
3369
 
     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3370
 
        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3371
 
        GMSGFMT=":"
3372
 
      fi
3373
 
      MSGFMT=$GMSGFMT
3374
 
      AC_SUBST(GMSGFMT)
3375
 
      AC_SUBST(MSGFMT)
3376
 
 
3377
 
      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3378
 
        [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3379
 
 
3380
 
      dnl Test whether we really found GNU xgettext.
3381
 
      if test "$XGETTEXT" != ":"; then
3382
 
        dnl If it is no GNU xgettext we define it as : so that the
3383
 
        dnl Makefiles still can work.
3384
 
        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3385
 
          : ;
3386
 
        else
3387
 
          AC_MSG_RESULT(
3388
 
            [found xgettext programs is not GNU xgettext; ignore it])
3389
 
          XGETTEXT=":"
3390
 
        fi
3391
 
      fi
3392
 
     AC_SUBST(XGETTEXT)
3393
 
 
3394
 
  ])
3395
 
 
3396
 
# Search path for a program which passes the given test.
3397
 
# Ulrich Drepper <drepper@cygnus.com>, 1996.
3398
 
 
3399
 
# serial 1
3400
 
# Stephan Kulow: I appended a _KDE against name conflicts
3401
 
 
3402
 
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3403
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3404
 
AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3405
 
[# Extract the first word of "$2", so it can be a program name with args.
3406
 
set dummy $2; ac_word=[$]2
3407
 
AC_MSG_CHECKING([for $ac_word])
3408
 
AC_CACHE_VAL(ac_cv_path_$1,
3409
 
[case "[$]$1" in
3410
 
  /*)
3411
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3412
 
  ;;
3413
 
  *)
3414
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3415
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
3416
 
    test -z "$ac_dir" && ac_dir=.
3417
 
    if test -f $ac_dir/$ac_word; then
3418
 
      if [$3]; then
3419
 
        ac_cv_path_$1="$ac_dir/$ac_word"
3420
 
        break
3421
 
      fi
3422
 
    fi
3423
 
  done
3424
 
  IFS="$ac_save_ifs"
3425
 
dnl If no 4th arg is given, leave the cache variable unset,
3426
 
dnl so AC_PATH_PROGS will keep looking.
3427
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3428
 
])dnl
3429
 
  ;;
3430
 
esac])dnl
3431
 
$1="$ac_cv_path_$1"
3432
 
if test -n "[$]$1"; then
3433
 
  AC_MSG_RESULT([$]$1)
3434
 
else
3435
 
  AC_MSG_RESULT(no)
3436
 
fi
3437
 
AC_SUBST($1)dnl
3438
 
])
3439
 
 
3440
 
 
3441
 
# Check whether LC_MESSAGES is available in <locale.h>.
3442
 
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3443
 
 
3444
 
# serial 1
3445
 
 
3446
 
AC_DEFUN([AM_LC_MESSAGES],
3447
 
  [if test $ac_cv_header_locale_h = yes; then
3448
 
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3449
 
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3450
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3451
 
    if test $am_cv_val_LC_MESSAGES = yes; then
3452
 
      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3453
 
    fi
3454
 
  fi])
3455
 
 
3456
 
dnl From Jim Meyering.
3457
 
dnl FIXME: migrate into libit.
3458
 
 
3459
 
AC_DEFUN([AM_FUNC_OBSTACK],
3460
 
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3461
 
 [AC_TRY_LINK([#include "obstack.h"],
3462
 
              [struct obstack *mem;obstack_free(mem,(char *) 0)],
3463
 
              am_cv_func_obstack=yes,
3464
 
              am_cv_func_obstack=no)])
3465
 
 if test $am_cv_func_obstack = yes; then
3466
 
   AC_DEFINE(HAVE_OBSTACK)
3467
 
 else
3468
 
   LIBOBJS="$LIBOBJS obstack.o"
3469
 
 fi
3470
 
])
3471
 
 
3472
 
dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3473
 
dnl FIXME: Migrate into libit
3474
 
 
3475
 
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3476
 
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3477
 
 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3478
 
              am_cv_lib_error_at_line=yes,
3479
 
              am_cv_lib_error_at_line=no)])
3480
 
 if test $am_cv_lib_error_at_line = no; then
3481
 
   LIBOBJS="$LIBOBJS error.o"
3482
 
 fi
3483
 
 AC_SUBST(LIBOBJS)dnl
3484
 
])
3485
 
 
3486
 
# Macro to add for using GNU gettext.
3487
 
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3488
 
 
3489
 
# serial 1
3490
 
# Stephan Kulow: I put a KDE in it to avoid name conflicts
3491
 
 
3492
 
AC_DEFUN([AM_KDE_GNU_GETTEXT],
3493
 
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3494
 
   AC_REQUIRE([AC_PROG_RANLIB])dnl
3495
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
3496
 
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
3497
 
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3498
 
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3499
 
   AC_REQUIRE([AC_FUNC_MMAP])dnl
3500
 
   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3501
 
   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3502
 
   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3503
 
__argz_count __argz_stringify __argz_next])
3504
 
 
3505
 
   AC_MSG_CHECKING(for stpcpy)
3506
 
   AC_CACHE_VAL(kde_cv_func_stpcpy,
3507
 
   [
3508
 
   kde_safe_cxxflags=$CXXFLAGS
3509
 
   CXXFLAGS="-Werror"
3510
 
   AC_LANG_SAVE
3511
 
   AC_LANG_CPLUSPLUS
3512
 
   AC_TRY_COMPILE([
3513
 
   #include <string.h>
3514
 
   ],
3515
 
   [
3516
 
   char buffer[200];
3517
 
   stpcpy(buffer, buffer);
3518
 
   ],
3519
 
   kde_cv_func_stpcpy=yes,
3520
 
   kde_cv_func_stpcpy=no)
3521
 
   AC_LANG_RESTORE
3522
 
   CXXFLAGS=$kde_safe_cxxflags
3523
 
   ])
3524
 
   AC_MSG_RESULT($kde_cv_func_stpcpy)
3525
 
   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3526
 
     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3527
 
   fi
3528
 
 
3529
 
   AM_LC_MESSAGES
3530
 
 
3531
 
   if test "x$CATOBJEXT" != "x"; then
3532
 
     if test "x$ALL_LINGUAS" = "x"; then
3533
 
       LINGUAS=
3534
 
     else
3535
 
       AC_MSG_CHECKING(for catalogs to be installed)
3536
 
       NEW_LINGUAS=
3537
 
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
3538
 
         case "$ALL_LINGUAS" in
3539
 
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3540
 
         esac
3541
 
       done
3542
 
       LINGUAS=$NEW_LINGUAS
3543
 
       AC_MSG_RESULT($LINGUAS)
3544
 
     fi
3545
 
 
3546
 
     dnl Construct list of names of catalog files to be constructed.
3547
 
     if test -n "$LINGUAS"; then
3548
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3549
 
     fi
3550
 
   fi
3551
 
 
3552
 
  ])
3553
 
 
3554
 
AC_DEFUN([AC_HAVE_XPM],
3555
 
 [AC_REQUIRE_CPP()dnl
3556
 
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3557
 
 
3558
 
 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3559
 
 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3560
 
 
3561
 
 AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3562
 
        xpm_test=$withval, xpm_test="yes")
3563
 
 if test "x$xpm_test" = xno; then
3564
 
   ac_cv_have_xpm=no
3565
 
 else
3566
 
   AC_MSG_CHECKING(for XPM)
3567
 
   AC_CACHE_VAL(ac_cv_have_xpm,
3568
 
   [
3569
 
    ac_save_ldflags="$LDFLAGS"
3570
 
    ac_save_cflags="$CFLAGS"
3571
 
    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3572
 
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3573
 
    else
3574
 
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3575
 
    fi
3576
 
    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3577
 
    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3578
 
    AC_TRY_LINK([#include <X11/xpm.h>],[],
3579
 
        ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3580
 
    LDFLAGS="$ac_save_ldflags"
3581
 
    CFLAGS="$ac_save_cflags"
3582
 
   ])dnl
3583
 
 
3584
 
  if test "$ac_cv_have_xpm" = no; then
3585
 
    AC_MSG_RESULT(no)
3586
 
    XPM_LDFLAGS=""
3587
 
    XPMINC=""
3588
 
    $2
3589
 
  else
3590
 
    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3591
 
    if test "$XPM_LDFLAGS" = ""; then
3592
 
       XPMLIB='-lXpm $(LIB_X11)'
3593
 
    else
3594
 
       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3595
 
    fi
3596
 
    if test "$XPM_INCLUDE" = ""; then
3597
 
       XPMINC=""
3598
 
    else
3599
 
       XPMINC="-I$XPM_INCLUDE"
3600
 
    fi
3601
 
    AC_MSG_RESULT(yes)
3602
 
    $1
3603
 
  fi
3604
 
 fi
3605
 
 AC_SUBST(XPMINC)
3606
 
 AC_SUBST(XPMLIB)
3607
 
])
3608
 
 
3609
 
AC_DEFUN([AC_HAVE_DPMS],
3610
 
 [AC_REQUIRE_CPP()dnl
3611
 
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3612
 
 
3613
 
 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3614
 
 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3615
 
 DPMS_LIB=
3616
 
 
3617
 
 AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3618
 
        dpms_test=$withval, dpms_test="yes")
3619
 
 if test "x$dpms_test" = xno; then
3620
 
   ac_cv_have_dpms=no
3621
 
 else
3622
 
   AC_MSG_CHECKING(for DPMS)
3623
 
   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3624
 
   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3625
 
   AC_CACHE_VAL(ac_cv_have_dpms,
3626
 
   [
3627
 
    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3628
 
      AC_MSG_RESULT(no)
3629
 
      ac_cv_have_dpms="no"
3630
 
    else
3631
 
      ac_save_ldflags="$LDFLAGS"
3632
 
      ac_save_cflags="$CFLAGS"
3633
 
      ac_save_libs="$LIBS"
3634
 
      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3635
 
      CFLAGS="$CFLAGS $X_INCLUDES"
3636
 
      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3637
 
      AC_TRY_LINK([
3638
 
          #include <X11/Xproto.h>
3639
 
          #include <X11/X.h>
3640
 
          #include <X11/Xlib.h>
3641
 
          #include <X11/extensions/dpms.h>
3642
 
          int foo_test_dpms()
3643
 
          { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3644
 
          ac_cv_have_dpms="yes", [
3645
 
              LDFLAGS="$ac_save_ldflags"
3646
 
              CFLAGS="$ac_save_cflags"
3647
 
              LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3648
 
              LIBS="$LIBS -lXdpms"
3649
 
              CFLAGS="$CFLAGS $X_INCLUDES"
3650
 
              test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3651
 
              AC_TRY_LINK([
3652
 
                  #include <X11/Xproto.h>
3653
 
                  #include <X11/X.h>
3654
 
                  #include <X11/Xlib.h>
3655
 
                  #include <X11/extensions/dpms.h>
3656
 
                  int foo_test_dpms()
3657
 
                  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3658
 
                  [
3659
 
                  ac_cv_have_dpms="-lXdpms"
3660
 
                  ],ac_cv_have_dpms="no")
3661
 
              ])
3662
 
      LDFLAGS="$ac_save_ldflags"
3663
 
      CFLAGS="$ac_save_cflags"
3664
 
      LIBS="$ac_save_libs"
3665
 
    fi
3666
 
   ])dnl
3667
 
 
3668
 
  if test "$ac_cv_have_dpms" = no; then
3669
 
    AC_MSG_RESULT(no)
3670
 
    DPMS_LDFLAGS=""
3671
 
    DPMSINC=""
3672
 
    $2
3673
 
  else
3674
 
    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3675
 
    if test "$ac_cv_have_dpms" = "-lXdpms"; then
3676
 
       DPMS_LIB="-lXdpms"
3677
 
    fi
3678
 
    if test "$DPMS_LDFLAGS" = ""; then
3679
 
       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3680
 
    else
3681
 
       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3682
 
    fi
3683
 
    if test "$DPMS_INCLUDE" = ""; then
3684
 
       DPMSINC=""
3685
 
    else
3686
 
       DPMSINC="-I$DPMS_INCLUDE"
3687
 
    fi
3688
 
    AC_MSG_RESULT(yes)
3689
 
    $1
3690
 
  fi
3691
 
 fi
3692
 
 ac_save_cflags="$CFLAGS"
3693
 
 CFLAGS="$CFLAGS $X_INCLUDES"
3694
 
 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3695
 
 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
3696
 
   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
3697
 
 AC_CHECK_DECL(DPMSCapable,
3698
 
   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
3699
 
   [#include <X11/extensions/dpms.h>])
3700
 
 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
3701
 
   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
3702
 
 AC_CHECK_DECL(DPMSInfo,
3703
 
   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
3704
 
   [#include <X11/extensions/dpms.h>])
3705
 
 CFLAGS="$ac_save_cflags"
3706
 
 AC_SUBST(DPMSINC)
3707
 
 AC_SUBST(DPMSLIB)
3708
 
])
3709
 
 
3710
 
AC_DEFUN([AC_HAVE_GL],
3711
 
 [AC_REQUIRE_CPP()dnl
3712
 
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3713
 
 
3714
 
 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3715
 
 test -z "$GL_INCLUDE" && GL_INCLUDE=
3716
 
 
3717
 
 AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
3718
 
        gl_test=$withval, gl_test="yes")
3719
 
 if test "x$kde_use_qt_emb" = "xyes"; then
3720
 
   # GL and Qt Embedded is a no-go for now.
3721
 
   ac_cv_have_gl=no
3722
 
 elif test "x$gl_test" = xno; then
3723
 
   ac_cv_have_gl=no
3724
 
 else
3725
 
   AC_MSG_CHECKING(for GL)
3726
 
   AC_CACHE_VAL(ac_cv_have_gl,
3727
 
   [
3728
 
    AC_LANG_SAVE
3729
 
    AC_LANG_CPLUSPLUS
3730
 
    ac_save_ldflags="$LDFLAGS"
3731
 
    ac_save_cxxflags="$CXXFLAGS"
3732
 
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3733
 
    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3734
 
    LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3735
 
    CXXFLAGS="$CFLAGS $X_INCLUDES"
3736
 
    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3737
 
    AC_TRY_LINK([#include <GL/gl.h>
3738
 
#include <GL/glu.h>
3739
 
], [],
3740
 
        ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3741
 
    if test "x$ac_cv_have_gl" = "xno"; then
3742
 
      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3743
 
      test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3744
 
      LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3745
 
      CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3746
 
      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3747
 
      AC_TRY_LINK([#include <GL/gl.h>
3748
 
#include <GL/glu.h>
3749
 
], [],
3750
 
          ac_cv_have_gl="yes", ac_cv_have_gl="no")
3751
 
    fi
3752
 
    AC_LANG_RESTORE
3753
 
    LDFLAGS="$ac_save_ldflags"
3754
 
    CXXFLAGS="$ac_save_cxxflags"
3755
 
   ])dnl
3756
 
 
3757
 
  if test "$ac_cv_have_gl" = "no"; then
3758
 
    AC_MSG_RESULT(no)
3759
 
    GL_LDFLAGS=""
3760
 
    GLINC=""
3761
 
    $2
3762
 
  else
3763
 
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3764
 
    if test "$GL_LDFLAGS" = ""; then
3765
 
       if test "$ac_cv_have_gl" = "mesa"; then
3766
 
          GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3767
 
       else
3768
 
          GLLIB='-lGLU -lGL $(LIB_X11)'
3769
 
       fi
3770
 
    else
3771
 
       if test "$ac_cv_have_gl" = "mesa"; then
3772
 
          GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3773
 
       else
3774
 
          GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3775
 
       fi
3776
 
    fi
3777
 
    if test "$GL_INCLUDE" = ""; then
3778
 
       GLINC=""
3779
 
    else
3780
 
       GLINC="-I$GL_INCLUDE"
3781
 
    fi
3782
 
    AC_MSG_RESULT($ac_cv_have_gl)
3783
 
    $1
3784
 
  fi
3785
 
 fi
3786
 
 AC_SUBST(GLINC)
3787
 
 AC_SUBST(GLLIB)
3788
 
])
3789
 
 
3790
 
 
3791
 
 dnl shadow password and PAM magic - maintained by ossi@kde.org
3792
 
 
3793
 
AC_DEFUN([KDE_PAM], [
3794
 
  AC_REQUIRE([KDE_CHECK_LIBDL])
3795
 
 
3796
 
  want_pam=
3797
 
  AC_ARG_WITH(pam,
3798
 
    AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
3799
 
    [ if test "x$withval" = "xyes"; then
3800
 
        want_pam=yes
3801
 
        pam_service=kde
3802
 
      elif test "x$withval" = "xno"; then
3803
 
        want_pam=no
3804
 
      else
3805
 
        want_pam=yes
3806
 
        pam_service=$withval
3807
 
      fi
3808
 
    ], [ pam_service=kde ])
3809
 
 
3810
 
  use_pam=
3811
 
  PAMLIBS=
3812
 
  if test "x$want_pam" != xno; then
3813
 
    AC_CHECK_LIB(pam, pam_start, [
3814
 
      AC_CHECK_HEADER(security/pam_appl.h,
3815
 
        [ pam_header=security/pam_appl.h ],
3816
 
        [ AC_CHECK_HEADER(pam/pam_appl.h,
3817
 
            [ pam_header=pam/pam_appl.h ],
3818
 
            [
3819
 
    AC_MSG_WARN([PAM detected, but no headers found!
3820
 
Make sure you have the necessary development packages installed.])
3821
 
            ]
3822
 
          )
3823
 
        ]
3824
 
      )
3825
 
    ], , $LIBDL)
3826
 
    if test -z "$pam_header"; then
3827
 
      if test "x$want_pam" = xyes; then
3828
 
        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
3829
 
      fi
3830
 
    else
3831
 
      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3832
 
      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3833
 
      use_pam=yes
3834
 
 
3835
 
      dnl darwin claims to be something special
3836
 
      if test "$pam_header" = "pam/pam_appl.h"; then
3837
 
        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
3838
 
      fi
3839
 
 
3840
 
      dnl test whether struct pam_message is const (Linux) or not (Sun)
3841
 
      AC_MSG_CHECKING(for const pam_message)
3842
 
      AC_EGREP_HEADER([struct pam_message], $pam_header,
3843
 
        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
3844
 
                          [AC_MSG_RESULT([const: Linux-type PAM])],
3845
 
                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
3846
 
                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3847
 
                          )],
3848
 
        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3849
 
    fi
3850
 
  fi
3851
 
 
3852
 
  AC_SUBST(PAMLIBS)
3853
 
])
3854
 
 
3855
 
dnl DEF_PAM_SERVICE(arg name, full name, define name)
3856
 
AC_DEFUN([DEF_PAM_SERVICE], [
3857
 
  AC_ARG_WITH($1-pam,
3858
 
    AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
3859
 
    [ if test "x$use_pam" = xyes; then
3860
 
        $3_PAM_SERVICE=$withval
3861
 
      else
3862
 
        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3863
 
You may want to enforce it by using --with-pam.])
3864
 
      fi
3865
 
    ], 
3866
 
    [ if test "x$use_pam" = xyes; then
3867
 
        $3_PAM_SERVICE="$pam_service"
3868
 
      fi
3869
 
    ])
3870
 
    if test -n "$$3_PAM_SERVICE"; then
3871
 
      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3872
 
      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3873
 
    fi
3874
 
    AC_SUBST($3_PAM_SERVICE)
3875
 
])
3876
 
 
3877
 
AC_DEFUN([KDE_SHADOWPASSWD], [
3878
 
  AC_REQUIRE([KDE_PAM])
3879
 
 
3880
 
  AC_CHECK_LIB(shadow, getspent,
3881
 
    [ LIBSHADOW="-lshadow"
3882
 
      ac_use_shadow=yes
3883
 
    ],
3884
 
    [ dnl for UnixWare
3885
 
      AC_CHECK_LIB(gen, getspent, 
3886
 
        [ LIBGEN="-lgen"
3887
 
          ac_use_shadow=yes
3888
 
        ], 
3889
 
        [ AC_CHECK_FUNC(getspent, 
3890
 
            [ ac_use_shadow=yes ],
3891
 
            [ ac_use_shadow=no ])
3892
 
        ])
3893
 
    ])
3894
 
  AC_SUBST(LIBSHADOW)
3895
 
  AC_SUBST(LIBGEN)
3896
 
  
3897
 
  AC_MSG_CHECKING([for shadow passwords])
3898
 
 
3899
 
  AC_ARG_WITH(shadow,
3900
 
    AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
3901
 
    [ if test "x$withval" != "xno"; then
3902
 
        use_shadow=yes
3903
 
      else
3904
 
        use_shadow=no
3905
 
      fi
3906
 
    ], [
3907
 
      use_shadow="$ac_use_shadow"
3908
 
    ])
3909
 
 
3910
 
  if test "x$use_shadow" = xyes; then
3911
 
    AC_MSG_RESULT(yes)
3912
 
    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3913
 
  else
3914
 
    AC_MSG_RESULT(no)
3915
 
    LIBSHADOW=
3916
 
    LIBGEN=
3917
 
  fi
3918
 
 
3919
 
  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3920
 
  dnl this still applies, if we could use it indirectly through pam.
3921
 
  if test "x$use_shadow" = xyes || 
3922
 
     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3923
 
      case $host in
3924
 
      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3925
 
        SETUIDFLAGS="-m 4755 -o root";;
3926
 
      *)
3927
 
        SETUIDFLAGS="-m 4755";;
3928
 
      esac
3929
 
  fi
3930
 
  AC_SUBST(SETUIDFLAGS)
3931
 
 
3932
 
])
3933
 
 
3934
 
AC_DEFUN([KDE_PASSWDLIBS], [
3935
 
  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3936
 
  AC_REQUIRE([KDE_PAM])
3937
 
  AC_REQUIRE([KDE_SHADOWPASSWD])
3938
 
 
3939
 
  if test "x$use_pam" = "xyes"; then 
3940
 
    PASSWDLIBS="$PAMLIBS"
3941
 
  else
3942
 
    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3943
 
  fi
3944
 
 
3945
 
  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3946
 
  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
3947
 
  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3948
 
  dnl may need to read /etc/master.passwd).
3949
 
  case $host in
3950
 
  *-*-freebsd*)
3951
 
    SETUIDFLAGS="-m 4755 -o root"
3952
 
    ;;
3953
 
  *)
3954
 
    ;;
3955
 
  esac
3956
 
 
3957
 
  AC_SUBST(PASSWDLIBS)
3958
 
])
3959
 
 
3960
 
AC_DEFUN([KDE_CHECK_LIBDL],
3961
 
[
3962
 
AC_CHECK_LIB(dl, dlopen, [
3963
 
LIBDL="-ldl"
3964
 
ac_cv_have_dlfcn=yes
3965
 
])
3966
 
 
3967
 
AC_CHECK_LIB(dld, shl_unload, [
3968
 
LIBDL="-ldld"
3969
 
ac_cv_have_shload=yes
3970
 
])
3971
 
 
3972
 
AC_SUBST(LIBDL)
3973
 
])
3974
 
 
3975
 
AC_DEFUN([KDE_CHECK_DLOPEN],
3976
 
[
3977
 
KDE_CHECK_LIBDL
3978
 
AC_CHECK_HEADERS(dlfcn.h dl.h)
3979
 
if test "$ac_cv_header_dlfcn_h" = "no"; then
3980
 
  ac_cv_have_dlfcn=no
3981
 
fi
3982
 
 
3983
 
if test "$ac_cv_header_dl_h" = "no"; then
3984
 
  ac_cv_have_shload=no
3985
 
fi
3986
 
 
3987
 
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3988
 
dnl (MM)
3989
 
AC_ARG_ENABLE(dlopen,
3990
 
AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
3991
 
enable_dlopen=$enableval,
3992
 
enable_dlopen=yes)
3993
 
 
3994
 
# override the user's opinion, if we know it better ;)
3995
 
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3996
 
  enable_dlopen=no
3997
 
fi
3998
 
 
3999
 
if test "$ac_cv_have_dlfcn" = "yes"; then
4000
 
  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4001
 
fi
4002
 
 
4003
 
if test "$ac_cv_have_shload" = "yes"; then
4004
 
  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4005
 
fi
4006
 
 
4007
 
if test "$enable_dlopen" = no ; then
4008
 
  test -n "$1" && eval $1
4009
 
else
4010
 
  test -n "$2" && eval $2
4011
 
fi
4012
 
 
4013
 
])
4014
 
 
4015
 
AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4016
 
[
4017
 
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4018
 
KDE_PROG_LIBTOOL
4019
 
AC_MSG_CHECKING([dynamic loading])
4020
 
eval "`egrep '^build_libtool_libs=' libtool`"
4021
 
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4022
 
  dynamic_loading=yes
4023
 
  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4024
 
else
4025
 
  dynamic_loading=no
4026
 
fi
4027
 
AC_MSG_RESULT($dynamic_loading)
4028
 
if test "$dynamic_loading" = "yes"; then
4029
 
  $1
4030
 
else
4031
 
  $2
4032
 
fi
4033
 
])
4034
 
 
4035
 
AC_DEFUN([KDE_ADD_INCLUDES],
4036
 
[
4037
 
if test -z "$1"; then
4038
 
  test_include="Pix.h"
4039
 
else
4040
 
  test_include="$1"
4041
 
fi
4042
 
 
4043
 
AC_MSG_CHECKING([for libg++ ($test_include)])
4044
 
 
4045
 
AC_CACHE_VAL(kde_cv_libgpp_includes,
4046
 
[
4047
 
kde_cv_libgpp_includes=no
4048
 
 
4049
 
   for ac_dir in               \
4050
 
                               \
4051
 
     /usr/include/g++          \
4052
 
     /usr/include              \
4053
 
     /usr/unsupported/include  \
4054
 
     /opt/include              \
4055
 
     $extra_include            \
4056
 
     ; \
4057
 
   do
4058
 
     if test -r "$ac_dir/$test_include"; then
4059
 
       kde_cv_libgpp_includes=$ac_dir
4060
 
       break
4061
 
     fi
4062
 
   done
4063
 
])
4064
 
 
4065
 
AC_MSG_RESULT($kde_cv_libgpp_includes)
4066
 
if test "$kde_cv_libgpp_includes" != "no"; then
4067
 
  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4068
 
fi
4069
 
])
4070
 
])
4071
 
 
4072
 
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4073
 
[
4074
 
  dnl This code is here specifically to handle the
4075
 
  dnl various flavors of threading library on FreeBSD
4076
 
  dnl 4-, 5-, and 6-, and the (weird) rules around it.
4077
 
  dnl There may be an environment PTHREAD_LIBS that 
4078
 
  dnl specifies what to use; otherwise, search for it.
4079
 
  dnl -pthread is special cased and unsets LIBPTHREAD
4080
 
  dnl below if found.
4081
 
  LIBPTHREAD=""
4082
 
 
4083
 
  if test -n "$PTHREAD_LIBS"; then
4084
 
    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4085
 
      LIBPTHREAD="PTHREAD"
4086
 
    else
4087
 
      PTHREAD_LIBS_save="$PTHREAD_LIBS"
4088
 
      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4089
 
      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4090
 
      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4091
 
          LIBPTHREAD="$PTHREAD_LIBS_save"])
4092
 
      PTHREAD_LIBS="$PTHREAD_LIBS_save"
4093
 
    fi
4094
 
  fi
4095
 
 
4096
 
  dnl Is this test really needed, in the face of the Tru64 test below?
4097
 
  if test -z "$LIBPTHREAD"; then
4098
 
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4099
 
  fi
4100
 
 
4101
 
  dnl This is a special Tru64 check, see BR 76171 issue #18.
4102
 
  if test -z "$LIBPTHREAD" ; then
4103
 
    AC_MSG_CHECKING([for pthread_create in -lpthread])
4104
 
    kde_safe_libs=$LIBS
4105
 
    LIBS="$LIBS -lpthread"
4106
 
    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4107
 
        AC_MSG_RESULT(yes)
4108
 
        LIBPTHREAD="-lpthread"],[
4109
 
        AC_MSG_RESULT(no)])
4110
 
    LIBS=$kde_safe_libs
4111
 
  fi
4112
 
 
4113
 
  dnl Un-special-case for FreeBSD.
4114
 
  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4115
 
    LIBPTHREAD=""
4116
 
  fi
4117
 
 
4118
 
  AC_SUBST(LIBPTHREAD)
4119
 
])
4120
 
 
4121
 
AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4122
 
[
4123
 
      USE_THREADS=""
4124
 
      if test -z "$LIBPTHREAD"; then
4125
 
        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4126
 
      fi
4127
 
 
4128
 
    AH_VERBATIM(__svr_define, [
4129
 
#if defined(__SVR4) && !defined(__svr4__)
4130
 
#define __svr4__ 1
4131
 
#endif
4132
 
])
4133
 
    case $host_os in
4134
 
        solaris*)
4135
 
                KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4136
 
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4137
 
                ;;
4138
 
        freebsd*)
4139
 
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4140
 
                ;;
4141
 
        aix*)
4142
 
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4143
 
                LIBPTHREAD="$LIBPTHREAD -lc_r"
4144
 
                ;;
4145
 
        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4146
 
                if test "$CXX" = "KCC"; then
4147
 
                  CXXFLAGS="$CXXFLAGS --thread_safe"
4148
 
                  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4149
 
                fi
4150
 
                ;;
4151
 
        *)
4152
 
                ;;
4153
 
    esac
4154
 
    AC_SUBST(USE_THREADS)
4155
 
    AC_SUBST(LIBPTHREAD)
4156
 
])
4157
 
 
4158
 
AC_DEFUN([KDE_CHECK_THREADING],
4159
 
[
4160
 
  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4161
 
  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4162
 
  dnl default is yes if libpthread is found and no if no libpthread is available
4163
 
  if test -z "$LIBPTHREAD"; then
4164
 
    if test -z "$USE_THREADS"; then
4165
 
      kde_check_threading_default=no
4166
 
    else
4167
 
      kde_check_threading_default=yes
4168
 
    fi
4169
 
  else
4170
 
    kde_check_threading_default=yes
4171
 
  fi
4172
 
  AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4173
 
   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4174
 
  if test "x$kde_use_threading" = "xyes"; then
4175
 
    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4176
 
  fi
4177
 
])
4178
 
 
4179
 
AC_DEFUN([KDE_TRY_LINK_PYTHON],
4180
 
[
4181
 
if test "$kde_python_link_found" = no; then
4182
 
 
4183
 
if test "$1" = normal; then
4184
 
  AC_MSG_CHECKING(if a Python application links)
4185
 
else
4186
 
  AC_MSG_CHECKING(if Python depends on $2)
4187
 
fi
4188
 
 
4189
 
AC_CACHE_VAL(kde_cv_try_link_python_$1,
4190
 
[
4191
 
kde_save_cflags="$CFLAGS"
4192
 
CFLAGS="$CFLAGS $PYTHONINC"
4193
 
kde_save_libs="$LIBS"
4194
 
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4195
 
kde_save_ldflags="$LDFLAGS"
4196
 
LDFLAGS="$LDFLAGS $PYTHONLIB"
4197
 
 
4198
 
AC_TRY_LINK(
4199
 
[
4200
 
#include <Python.h>
4201
 
],[
4202
 
        PySys_SetArgv(1, 0);
4203
 
],
4204
 
        [kde_cv_try_link_python_$1=yes],
4205
 
        [kde_cv_try_link_python_$1=no]
4206
 
)
4207
 
CFLAGS="$kde_save_cflags"
4208
 
LIBS="$kde_save_libs"
4209
 
LDFLAGS="$kde_save_ldflags"
4210
 
])
4211
 
 
4212
 
if test "$kde_cv_try_link_python_$1" = "yes"; then
4213
 
  AC_MSG_RESULT(yes)
4214
 
  kde_python_link_found=yes
4215
 
  if test ! "$1" = normal; then
4216
 
    LIBPYTHON="$LIBPYTHON $2"
4217
 
  fi
4218
 
  $3
4219
 
else
4220
 
  AC_MSG_RESULT(no)
4221
 
  $4
4222
 
fi
4223
 
 
4224
 
fi
4225
 
 
4226
 
])
4227
 
 
4228
 
AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4229
 
[
4230
 
AC_MSG_CHECKING([for Python directory])
4231
 
 
4232
 
AC_CACHE_VAL(kde_cv_pythondir,
4233
 
[
4234
 
  if test -z "$PYTHONDIR"; then
4235
 
    kde_cv_pythondir=/usr/local
4236
 
  else
4237
 
    kde_cv_pythondir="$PYTHONDIR"
4238
 
  fi
4239
 
])
4240
 
 
4241
 
AC_ARG_WITH(pythondir,
4242
 
AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4243
 
[
4244
 
  ac_python_dir=$withval
4245
 
], ac_python_dir=$kde_cv_pythondir
4246
 
)
4247
 
 
4248
 
AC_MSG_RESULT($ac_python_dir)
4249
 
])
4250
 
 
4251
 
AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4252
 
[
4253
 
AC_REQUIRE([KDE_CHECK_LIBDL])
4254
 
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4255
 
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4256
 
 
4257
 
if test -z "$1"; then
4258
 
  version="1.5"
4259
 
else
4260
 
  version="$1"
4261
 
fi
4262
 
 
4263
 
AC_MSG_CHECKING([for Python$version])
4264
 
 
4265
 
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4266
 
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4267
 
if test ! -r $python_incdir/Python.h; then
4268
 
  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4269
 
  python_incdir=$python_incdir/python$version
4270
 
  if test ! -r $python_incdir/Python.h; then
4271
 
    python_incdir=no
4272
 
  fi
4273
 
fi
4274
 
 
4275
 
PYTHONINC=-I$python_incdir
4276
 
 
4277
 
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4278
 
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4279
 
if test ! -r $python_libdir/libpython$version.so; then
4280
 
  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4281
 
  if test ! -r $python_libdir/libpython$version.a; then
4282
 
    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4283
 
    python_libdir=$python_libdir/python$version/config
4284
 
    if test ! -r $python_libdir/libpython$version.a; then
4285
 
      python_libdir=no
4286
 
    fi
4287
 
  fi
4288
 
fi
4289
 
 
4290
 
PYTHONLIB=-L$python_libdir
4291
 
kde_orig_LIBPYTHON=$LIBPYTHON
4292
 
if test -z "$LIBPYTHON"; then
4293
 
  LIBPYTHON=-lpython$version
4294
 
fi
4295
 
 
4296
 
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4297
 
python_moddir=$python_moddir/python$version
4298
 
if test ! -r $python_moddir/copy.py; then
4299
 
  python_moddir=no
4300
 
fi
4301
 
 
4302
 
PYTHONMODDIR=$python_moddir
4303
 
 
4304
 
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4305
 
 
4306
 
if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4307
 
   LIBPYTHON=$kde_orig_LIBPYTHON
4308
 
   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4309
 
   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4310
 
   $2
4311
 
else 
4312
 
  dnl Note: this test is very weak
4313
 
  kde_python_link_found=no
4314
 
  KDE_TRY_LINK_PYTHON(normal)
4315
 
  KDE_TRY_LINK_PYTHON(m, -lm)
4316
 
  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4317
 
  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4318
 
  KDE_TRY_LINK_PYTHON(db2, -ldb2)
4319
 
  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4320
 
  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4321
 
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4322
 
  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4323
 
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4324
 
  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4325
 
  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4326
 
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4327
 
        [AC_MSG_WARN([it seems, Python depends on another library.
4328
 
    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4329
 
    and contact the authors to let them know about this problem])
4330
 
        ])
4331
 
 
4332
 
  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4333
 
  AC_SUBST(PYTHONINC)
4334
 
  AC_SUBST(PYTHONLIB)
4335
 
  AC_SUBST(LIBPYTHON)
4336
 
  AC_SUBST(PYTHONMODDIR)
4337
 
  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4338
 
fi
4339
 
 
4340
 
])
4341
 
 
4342
 
 
4343
 
AC_DEFUN([KDE_CHECK_PYTHON],
4344
 
[
4345
 
  KDE_CHECK_PYTHON_INTERN("2.4", 
4346
 
    KDE_CHECK_PYTHON_INTERN("2.3", 
4347
 
     [KDE_CHECK_PYTHON_INTERN("2.2", 
4348
 
       [KDE_CHECK_PYTHON_INTERN("2.1", 
4349
 
         [KDE_CHECK_PYTHON_INTERN("2.0", 
4350
 
           [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4351
 
         ])
4352
 
       ])
4353
 
     ])
4354
 
   ])
4355
 
])
4356
 
 
4357
 
AC_DEFUN([KDE_CHECK_STL],
4358
 
[
4359
 
    AC_LANG_SAVE
4360
 
    AC_LANG_CPLUSPLUS
4361
 
    ac_save_CXXFLAGS="$CXXFLAGS"
4362
 
    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4363
 
 
4364
 
    AC_MSG_CHECKING([if C++ programs can be compiled])
4365
 
    AC_CACHE_VAL(kde_cv_stl_works,
4366
 
    [
4367
 
      AC_TRY_COMPILE([
4368
 
#include <string>
4369
 
using namespace std;
4370
 
],[
4371
 
  string astring="Hallo Welt.";
4372
 
  astring.erase(0, 6); // now astring is "Welt"
4373
 
  return 0;
4374
 
], kde_cv_stl_works=yes,
4375
 
   kde_cv_stl_works=no)
4376
 
])
4377
 
 
4378
 
   AC_MSG_RESULT($kde_cv_stl_works)
4379
 
 
4380
 
   if test "$kde_cv_stl_works" = "yes"; then
4381
 
     # back compatible
4382
 
         AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4383
 
   else
4384
 
         AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4385
 
Check config.log for details - if you're using a Linux distribution you might miss
4386
 
a package named similiar to libstd++-dev.])
4387
 
   fi
4388
 
 
4389
 
   CXXFLAGS="$ac_save_CXXFLAGS"
4390
 
   AC_LANG_RESTORE
4391
 
])
4392
 
 
4393
 
AC_DEFUN([AC_FIND_QIMGIO],
4394
 
   [AC_REQUIRE([AC_FIND_JPEG])
4395
 
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4396
 
AC_MSG_CHECKING([for qimgio])
4397
 
AC_CACHE_VAL(ac_cv_lib_qimgio,
4398
 
[
4399
 
AC_LANG_SAVE
4400
 
AC_LANG_CPLUSPLUS
4401
 
ac_save_LIBS="$LIBS"
4402
 
ac_save_CXXFLAGS="$CXXFLAGS"
4403
 
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4404
 
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4405
 
AC_TRY_RUN(dnl
4406
 
[
4407
 
#include <qimageio.h>
4408
 
#include <qstring.h>
4409
 
int main() {
4410
 
                QString t = "hallo";
4411
 
                t.fill('t');
4412
 
                qInitImageIO();
4413
 
}
4414
 
],
4415
 
            ac_cv_lib_qimgio=yes,
4416
 
            ac_cv_lib_qimgio=no,
4417
 
            ac_cv_lib_qimgio=no)
4418
 
LIBS="$ac_save_LIBS"
4419
 
CXXFLAGS="$ac_save_CXXFLAGS"
4420
 
AC_LANG_RESTORE
4421
 
])dnl
4422
 
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4423
 
  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4424
 
  AC_MSG_RESULT(yes)
4425
 
  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4426
 
  AC_SUBST(LIBQIMGIO)
4427
 
else
4428
 
  AC_MSG_RESULT(not found)
4429
 
fi
4430
 
])
4431
 
 
4432
 
AC_DEFUN([AM_DISABLE_LIBRARIES],
4433
 
[
4434
 
    AC_PROVIDE([AM_ENABLE_STATIC])
4435
 
    AC_PROVIDE([AM_ENABLE_SHARED])
4436
 
    enable_static=no
4437
 
    enable_shared=yes
4438
 
])
4439
 
 
4440
 
 
4441
 
AC_DEFUN([AC_CHECK_UTMP_FILE],
4442
 
[
4443
 
    AC_MSG_CHECKING([for utmp file])
4444
 
 
4445
 
    AC_CACHE_VAL(kde_cv_utmp_file,
4446
 
    [
4447
 
    kde_cv_utmp_file=no
4448
 
 
4449
 
    for ac_file in    \
4450
 
                      \
4451
 
        /var/run/utmp \
4452
 
        /var/adm/utmp \
4453
 
        /etc/utmp     \
4454
 
     ; \
4455
 
    do
4456
 
     if test -r "$ac_file"; then
4457
 
       kde_cv_utmp_file=$ac_file
4458
 
       break
4459
 
     fi
4460
 
    done
4461
 
    ])
4462
 
 
4463
 
    if test "$kde_cv_utmp_file" != "no"; then
4464
 
        AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4465
 
        $1
4466
 
        AC_MSG_RESULT($kde_cv_utmp_file)
4467
 
    else
4468
 
        $2
4469
 
        AC_MSG_RESULT([non found])
4470
 
    fi
4471
 
])
4472
 
 
4473
 
 
4474
 
AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4475
 
[
4476
 
 
4477
 
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4478
 
TOPSUBDIRS=""
4479
 
 
4480
 
if test ! -s $srcdir/subdirs; then
4481
 
  dnl Note: Makefile.common creates subdirs, so this is just a fallback
4482
 
  files=`cd $srcdir && ls -1`
4483
 
  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4484
 
  for i in $dirs; do
4485
 
    echo $i >> $srcdir/subdirs
4486
 
  done
4487
 
fi
4488
 
 
4489
 
ac_topsubdirs=
4490
 
if test -s $srcdir/inst-apps; then
4491
 
  ac_topsubdirs="`cat $srcdir/inst-apps`"
4492
 
elif test -s $srcdir/subdirs; then
4493
 
  ac_topsubdirs="`cat $srcdir/subdirs`"
4494
 
fi
4495
 
 
4496
 
for i in $ac_topsubdirs; do
4497
 
  AC_MSG_CHECKING([if $i should be compiled])
4498
 
  if test -d $srcdir/$i; then
4499
 
    install_it="yes"
4500
 
    for j in $DO_NOT_COMPILE; do
4501
 
      if test $i = $j; then
4502
 
        install_it="no"
4503
 
      fi
4504
 
    done
4505
 
  else
4506
 
    install_it="no"
4507
 
  fi
4508
 
  AC_MSG_RESULT($install_it)
4509
 
  vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4510
 
  if test $install_it = "yes"; then
4511
 
    TOPSUBDIRS="$TOPSUBDIRS $i"
4512
 
    eval "$vari""_SUBDIR_included=yes"
4513
 
  else
4514
 
    eval "$vari""_SUBDIR_included=no"
4515
 
  fi
4516
 
done
4517
 
 
4518
 
AC_SUBST(TOPSUBDIRS)
4519
 
])
4520
 
 
4521
 
AC_DEFUN([KDE_CHECK_NAMESPACES],
4522
 
[
4523
 
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4524
 
AC_LANG_SAVE
4525
 
AC_LANG_CPLUSPLUS
4526
 
AC_TRY_COMPILE([
4527
 
],
4528
 
[
4529
 
namespace Foo {
4530
 
  extern int i;
4531
 
  namespace Bar {
4532
 
    extern int i;
4533
 
  }
4534
 
}
4535
 
 
4536
 
int Foo::i = 0;
4537
 
int Foo::Bar::i = 1;
4538
 
],[
4539
 
  AC_MSG_RESULT(yes)
4540
 
  AC_DEFINE(HAVE_NAMESPACES)
4541
 
], [
4542
 
AC_MSG_RESULT(no)
4543
 
])
4544
 
AC_LANG_RESTORE
4545
 
])
4546
 
 
4547
 
dnl ------------------------------------------------------------------------
4548
 
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4549
 
dnl ------------------------------------------------------------------------
4550
 
dnl
4551
 
AC_DEFUN([AC_CHECK_S_ISSOCK],
4552
 
[
4553
 
AC_MSG_CHECKING(for S_ISSOCK)
4554
 
AC_CACHE_VAL(ac_cv_have_s_issock,
4555
 
[
4556
 
AC_TRY_LINK(
4557
 
[
4558
 
#include <sys/stat.h>
4559
 
],
4560
 
[
4561
 
struct stat buff;
4562
 
int b = S_ISSOCK( buff.st_mode );
4563
 
],
4564
 
ac_cv_have_s_issock=yes,
4565
 
ac_cv_have_s_issock=no)
4566
 
])
4567
 
AC_MSG_RESULT($ac_cv_have_s_issock)
4568
 
if test "$ac_cv_have_s_issock" = "yes"; then
4569
 
  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4570
 
fi
4571
 
 
4572
 
AH_VERBATIM(_ISSOCK,
4573
 
[
4574
 
#ifndef HAVE_S_ISSOCK
4575
 
#define HAVE_S_ISSOCK
4576
 
#define S_ISSOCK(mode) (1==0)
4577
 
#endif
4578
 
])
4579
 
 
4580
 
])
4581
 
 
4582
 
dnl ------------------------------------------------------------------------
4583
 
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4584
 
dnl ------------------------------------------------------------------------
4585
 
dnl
4586
 
AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4587
 
[
4588
 
AC_MSG_CHECKING(for MAXPATHLEN)
4589
 
AC_CACHE_VAL(ac_cv_maxpathlen,
4590
 
[
4591
 
cat > conftest.$ac_ext <<EOF
4592
 
#ifdef STDC_HEADERS
4593
 
# include <stdlib.h>
4594
 
#endif
4595
 
#include <stdio.h>
4596
 
#include <sys/param.h>
4597
 
#ifndef MAXPATHLEN
4598
 
#define MAXPATHLEN 1024
4599
 
#endif
4600
 
 
4601
 
KDE_HELLO MAXPATHLEN
4602
 
 
4603
 
EOF
4604
 
 
4605
 
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4606
 
 
4607
 
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4608
 
    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4609
 
else
4610
 
    ac_cv_maxpathlen=1024
4611
 
fi
4612
 
 
4613
 
rm conftest.*
4614
 
 
4615
 
])
4616
 
AC_MSG_RESULT($ac_cv_maxpathlen)
4617
 
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4618
 
])
4619
 
 
4620
 
AC_DEFUN([KDE_CHECK_HEADER],
4621
 
[
4622
 
   AC_LANG_SAVE
4623
 
   kde_safe_cppflags=$CPPFLAGS
4624
 
   CPPFLAGS="$CPPFLAGS $all_includes"
4625
 
   AC_LANG_CPLUSPLUS
4626
 
   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4627
 
   CPPFLAGS=$kde_safe_cppflags
4628
 
   AC_LANG_RESTORE
4629
 
])
4630
 
 
4631
 
AC_DEFUN([KDE_CHECK_HEADERS],
4632
 
[
4633
 
   AH_CHECK_HEADERS([$1])
4634
 
   AC_LANG_SAVE
4635
 
   kde_safe_cppflags=$CPPFLAGS
4636
 
   CPPFLAGS="$CPPFLAGS $all_includes"
4637
 
   AC_LANG_CPLUSPLUS
4638
 
   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4639
 
   CPPFLAGS=$kde_safe_cppflags
4640
 
   AC_LANG_RESTORE
4641
 
])
4642
 
 
4643
 
AC_DEFUN([KDE_FAST_CONFIGURE],
4644
 
[
4645
 
  dnl makes configure fast (needs perl)
4646
 
  AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4647
 
      with_fast_perl=$enableval, with_fast_perl=yes)
4648
 
])
4649
 
 
4650
 
AC_DEFUN([KDE_CONF_FILES],
4651
 
[
4652
 
  val=
4653
 
  if test -f $srcdir/configure.files ; then
4654
 
    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4655
 
  fi
4656
 
  CONF_FILES=
4657
 
  if test -n "$val" ; then
4658
 
    for i in $val ; do
4659
 
      CONF_FILES="$CONF_FILES $i"
4660
 
    done
4661
 
  fi
4662
 
  AC_SUBST(CONF_FILES)
4663
 
])dnl
4664
 
 
4665
 
dnl This sets the prefix, for arts and kdelibs
4666
 
dnl Do NOT use in any other module.
4667
 
dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4668
 
AC_DEFUN([KDE_SET_PREFIX_CORE],
4669
 
[
4670
 
  unset CDPATH
4671
 
  dnl make $KDEDIR the default for the installation
4672
 
  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4673
 
 
4674
 
  if test "x$prefix" = "xNONE"; then
4675
 
    prefix=$ac_default_prefix
4676
 
    ac_configure_args="$ac_configure_args --prefix=$prefix"
4677
 
  fi
4678
 
  # And delete superfluous '/' to make compares easier
4679
 
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4680
 
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4681
 
 
4682
 
  kde_libs_prefix='$(prefix)'
4683
 
  kde_libs_htmldir='$(kde_htmldir)'
4684
 
  AC_SUBST(kde_libs_prefix)
4685
 
  AC_SUBST(kde_libs_htmldir)
4686
 
  KDE_FAST_CONFIGURE
4687
 
  KDE_CONF_FILES
4688
 
])
4689
 
 
4690
 
 
4691
 
AC_DEFUN([KDE_SET_PREFIX],
4692
 
[
4693
 
  unset CDPATH
4694
 
  dnl We can't give real code to that macro, only a value.
4695
 
  dnl It only matters for --help, since we set the prefix in this function anyway.
4696
 
  AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
4697
 
 
4698
 
  KDE_SET_DEFAULT_BINDIRS
4699
 
  if test "x$prefix" = "xNONE"; then
4700
 
    dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
4701
 
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4702
 
  else
4703
 
    dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
4704
 
    kde_save_PATH="$PATH"
4705
 
    PATH="$exec_prefix/bin:$prefix/bin:$PATH"
4706
 
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4707
 
    PATH="$kde_save_PATH"
4708
 
  fi
4709
 
 
4710
 
  kde_libs_prefix=`$KDECONFIG --prefix`
4711
 
  if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
4712
 
       AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
4713
 
                    This means it has been moved since you installed it.
4714
 
                    This won't work. Please recompile kdelibs for the new prefix.
4715
 
                    ])
4716
 
  fi
4717
 
  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
4718
 
 
4719
 
  AC_MSG_CHECKING([where to install])
4720
 
  if test "x$prefix" = "xNONE"; then
4721
 
    prefix=$kde_libs_prefix
4722
 
    AC_MSG_RESULT([$prefix (as returned by kde-config)])
4723
 
  else
4724
 
    dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
4725
 
    given_prefix=$prefix
4726
 
    AC_MSG_RESULT([$prefix (as requested)])
4727
 
  fi
4728
 
 
4729
 
  # And delete superfluous '/' to make compares easier
4730
 
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4731
 
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4732
 
  given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4733
 
 
4734
 
  AC_SUBST(KDECONFIG)
4735
 
  AC_SUBST(kde_libs_prefix)
4736
 
  AC_SUBST(kde_libs_htmldir)
4737
 
 
4738
 
  KDE_FAST_CONFIGURE
4739
 
  KDE_CONF_FILES
4740
 
])
4741
 
 
4742
 
pushdef([AC_PROG_INSTALL],
4743
 
[
4744
 
  dnl our own version, testing for a -p flag
4745
 
  popdef([AC_PROG_INSTALL])
4746
 
  dnl as AC_PROG_INSTALL works as it works we first have
4747
 
  dnl to save if the user didn't specify INSTALL, as the
4748
 
  dnl autoconf one overwrites INSTALL and we have no chance to find
4749
 
  dnl out afterwards
4750
 
  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4751
 
  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4752
 
  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4753
 
  AC_PROG_INSTALL
4754
 
 
4755
 
  if test -z "$kde_save_INSTALL_given" ; then
4756
 
    # OK, user hasn't given any INSTALL, autoconf found one for us
4757
 
    # now we test, if it supports the -p flag
4758
 
    AC_MSG_CHECKING(for -p flag to install)
4759
 
    rm -f confinst.$$.* > /dev/null 2>&1
4760
 
    echo "Testtest" > confinst.$$.orig
4761
 
    ac_res=no
4762
 
    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4763
 
      if test -f confinst.$$.new ; then
4764
 
        # OK, -p seems to do no harm to install
4765
 
        INSTALL="${INSTALL} -p"
4766
 
        ac_res=yes
4767
 
      fi
4768
 
    fi
4769
 
    rm -f confinst.$$.*
4770
 
    AC_MSG_RESULT($ac_res)
4771
 
  fi
4772
 
  dnl the following tries to resolve some signs and wonders coming up
4773
 
  dnl with different autoconf/automake versions
4774
 
  dnl e.g.:
4775
 
  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4776
 
  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4777
 
  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4778
 
  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4779
 
  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4780
 
  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
4781
 
  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4782
 
  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
4783
 
  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
4784
 
  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4785
 
  dnl   automake (due to broken Makefile.am or whatever) to install programs,
4786
 
  dnl   and so does not see the -s flag in automake > 1.4
4787
 
  dnl to clean up that mess we:
4788
 
  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4789
 
  dnl   which cleans KDE's program with automake > 1.4;
4790
 
  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4791
 
  dnl   with automake<=1.4
4792
 
  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
4793
 
  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
4794
 
  dnl
4795
 
  dnl And to all this comes, that I even can't write in comments variable
4796
 
  dnl  names used by automake, because it is so stupid to think I wanted to
4797
 
  dnl  _use_ them, therefor I have written A_M_... instead of AM_
4798
 
  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4799
 
 
4800
 
  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4801
 
    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4802
 
  fi
4803
 
  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4804
 
    INSTALL_SCRIPT='${INSTALL}'
4805
 
  fi
4806
 
])dnl
4807
 
 
4808
 
AC_DEFUN([KDE_LANG_CPLUSPLUS],
4809
 
[AC_LANG_CPLUSPLUS
4810
 
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4811
 
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4812
 
])
4813
 
 
4814
 
pushdef([AC_LANG_CPLUSPLUS],
4815
 
[popdef([AC_LANG_CPLUSPLUS])
4816
 
KDE_LANG_CPLUSPLUS
4817
 
])
4818
 
 
4819
 
AC_DEFUN([KDE_CHECK_LONG_LONG],
4820
 
[
4821
 
AC_MSG_CHECKING(for long long)
4822
 
AC_CACHE_VAL(kde_cv_c_long_long,
4823
 
[
4824
 
  AC_LANG_SAVE
4825
 
  AC_LANG_CPLUSPLUS
4826
 
  AC_TRY_LINK([], [
4827
 
  long long foo = 0;
4828
 
  foo = foo+1;
4829
 
  ],
4830
 
  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4831
 
  AC_LANG_RESTORE
4832
 
])
4833
 
AC_MSG_RESULT($kde_cv_c_long_long)
4834
 
if test "$kde_cv_c_long_long" = yes; then
4835
 
   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4836
 
fi
4837
 
])
4838
 
 
4839
 
AC_DEFUN([KDE_CHECK_LIB],
4840
 
[
4841
 
     kde_save_LDFLAGS="$LDFLAGS"
4842
 
     dnl AC_CHECK_LIB modifies LIBS, so save it here
4843
 
     kde_save_LIBS="$LIBS"
4844
 
     LDFLAGS="$LDFLAGS $all_libraries"
4845
 
     case $host_os in
4846
 
      aix*) LDFLAGS="-brtl $LDFLAGS"
4847
 
        test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4848
 
        ;;
4849
 
     esac
4850
 
     AC_CHECK_LIB($1, $2, $3, $4, $5)
4851
 
     LDFLAGS="$kde_save_LDFLAGS"
4852
 
     LIBS="$kde_save_LIBS"
4853
 
])
4854
 
 
4855
 
AC_DEFUN([KDE_JAVA_PREFIX],
4856
 
[
4857
 
        dir=`dirname "$1"`
4858
 
        base=`basename "$1"`
4859
 
        list=`ls -1 $dir 2> /dev/null`
4860
 
        for entry in $list; do 
4861
 
                if test -d $dir/$entry/bin; then
4862
 
                        case $entry in
4863
 
                           $base)
4864
 
                                javadirs="$javadirs $dir/$entry/bin"
4865
 
                                ;;
4866
 
                        esac
4867
 
                elif test -d $dir/$entry/jre/bin; then
4868
 
                        case $entry in
4869
 
                           $base)
4870
 
                                javadirs="$javadirs $dir/$entry/jre/bin"
4871
 
                                ;;
4872
 
                        esac
4873
 
                fi
4874
 
        done
4875
 
])
4876
 
 
4877
 
dnl KDE_CHEC_JAVA_DIR(onlyjre)
4878
 
AC_DEFUN([KDE_CHECK_JAVA_DIR],
4879
 
[
4880
 
 
4881
 
AC_ARG_WITH(java,
4882
 
AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
4883
 
[  ac_java_dir=$withval
4884
 
], ac_java_dir=""
4885
 
)
4886
 
 
4887
 
AC_MSG_CHECKING([for Java])
4888
 
 
4889
 
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4890
 
if test "x$ac_java_dir" = "xno"; then
4891
 
   kde_java_bindir=no
4892
 
   kde_java_includedir=no
4893
 
   kde_java_libjvmdir=no
4894
 
   kde_java_libgcjdir=no
4895
 
   kde_java_libhpidir=no
4896
 
else
4897
 
  if test "x$ac_java_dir" = "x"; then
4898
 
     
4899
 
     
4900
 
      dnl No option set -> collect list of candidate paths
4901
 
      if test -n "$JAVA_HOME"; then
4902
 
        KDE_JAVA_PREFIX($JAVA_HOME)
4903
 
      fi
4904
 
      KDE_JAVA_PREFIX(/usr/j2se)
4905
 
      KDE_JAVA_PREFIX(/usr/lib/j2se)
4906
 
      KDE_JAVA_PREFIX(/usr/j*dk*)
4907
 
      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4908
 
      KDE_JAVA_PREFIX(/opt/j*sdk*)
4909
 
      KDE_JAVA_PREFIX(/usr/lib/java*)
4910
 
      KDE_JAVA_PREFIX(/usr/java*)
4911
 
      KDE_JAVA_PREFIX(/usr/java/j*dk*)
4912
 
      KDE_JAVA_PREFIX(/usr/java/j*re*)
4913
 
      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4914
 
      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4915
 
      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4916
 
      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4917
 
      KDE_JAVA_PREFIX(/opt/java*)
4918
 
 
4919
 
      kde_cv_path="NONE"
4920
 
      kde_save_IFS=$IFS
4921
 
      IFS=':'
4922
 
      for dir in $PATH; do
4923
 
          if test -d "$dir"; then
4924
 
              javadirs="$javadirs $dir"
4925
 
          fi
4926
 
      done
4927
 
      IFS=$kde_save_IFS
4928
 
      jredirs=
4929
 
 
4930
 
      dnl Now javadirs contains a list of paths that exist, all ending with bin/
4931
 
      for dir in $javadirs; do
4932
 
          dnl Check for the java executable
4933
 
          if test -x "$dir/java"; then
4934
 
              dnl And also check for a libjvm.so somewhere under there
4935
 
              dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
4936
 
              if test "$dir" != "/usr/bin"; then
4937
 
                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4938
 
                  if test ! -f $libjvmdir/libjvm.so; then continue; fi
4939
 
                  jredirs="$jredirs $dir"
4940
 
              fi
4941
 
          fi
4942
 
      done
4943
 
 
4944
 
      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
4945
 
      JAVAC=
4946
 
      JAVA=
4947
 
      kde_java_bindir=no
4948
 
      for dir in $jredirs; do
4949
 
          JAVA="$dir/java"
4950
 
          kde_java_bindir=$dir
4951
 
          if test -x "$dir/javac"; then
4952
 
                JAVAC="$dir/javac"
4953
 
                break
4954
 
          fi
4955
 
      done
4956
 
 
4957
 
      if test -n "$JAVAC"; then
4958
 
          dnl this substitution might not work - well, we test for jni.h below
4959
 
          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4960
 
      else
4961
 
          kde_java_includedir=no
4962
 
      fi
4963
 
  else
4964
 
    dnl config option set
4965
 
    kde_java_bindir=$ac_java_dir/bin
4966
 
    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4967
 
        kde_java_includedir=no
4968
 
    else
4969
 
        kde_java_includedir=$ac_java_dir/include
4970
 
    fi
4971
 
  fi
4972
 
fi
4973
 
 
4974
 
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4975
 
if test "x$kde_java_bindir" != "xno"; then
4976
 
 
4977
 
  dnl Look for libjvm.so
4978
 
  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4979
 
  dnl Look for libgcj.so
4980
 
  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
4981
 
  dnl Look for libhpi.so and avoid green threads
4982
 
  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4983
 
 
4984
 
  dnl Now check everything's fine under there
4985
 
  dnl the include dir is our flag for having the JDK
4986
 
  if test -d "$kde_java_includedir"; then
4987
 
    if test ! -x "$kde_java_bindir/javac"; then
4988
 
      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4989
 
    fi
4990
 
    if test ! -x "$kde_java_bindir/javah"; then
4991
 
      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4992
 
    fi
4993
 
    if test ! -x "$kde_java_bindir/jar"; then
4994
 
      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4995
 
    fi
4996
 
    if test ! -r "$kde_java_includedir/jni.h"; then
4997
 
      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
4998
 
    fi
4999
 
 
5000
 
    jni_includes="-I$kde_java_includedir"
5001
 
    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5002
 
    dnl and under linux here.. 
5003
 
    
5004
 
    dnl not needed for gcj
5005
 
 
5006
 
    if test "x$kde_java_libgcjdir" = "x"; then 
5007
 
      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5008
 
      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5009
 
      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5010
 
    fi
5011
 
 
5012
 
  else
5013
 
    JAVAC=
5014
 
    jni_includes=
5015
 
  fi
5016
 
 
5017
 
  if test "x$kde_java_libgcjdir" = "x"; then 
5018
 
     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5019
 
        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5020
 
     fi 
5021
 
  else
5022
 
     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5023
 
        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5024
 
     fi 
5025
 
  fi
5026
 
 
5027
 
  if test ! -x "$kde_java_bindir/java"; then
5028
 
      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5029
 
  fi
5030
 
 
5031
 
  dnl not needed for gcj compile
5032
 
 
5033
 
  if test "x$kde_java_libgcjdir" = "x"; then 
5034
 
      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5035
 
        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5036
 
      fi
5037
 
  fi
5038
 
 
5039
 
  if test -n "$jni_includes"; then
5040
 
    dnl Check for JNI version
5041
 
    AC_LANG_SAVE
5042
 
    AC_LANG_CPLUSPLUS
5043
 
    ac_cxxflags_safe="$CXXFLAGS"
5044
 
    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5045
 
 
5046
 
    AC_TRY_COMPILE([
5047
 
  #include <jni.h>
5048
 
              ],
5049
 
              [
5050
 
  #ifndef JNI_VERSION_1_2
5051
 
  Syntax Error
5052
 
  #endif
5053
 
              ],[ kde_jni_works=yes ],
5054
 
              [ kde_jni_works=no ])
5055
 
 
5056
 
    if test $kde_jni_works = no; then
5057
 
      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5058
 
                    You need to have Java Development Kit (JDK) version 1.2. 
5059
 
 
5060
 
                    Use --with-java to specify another location.
5061
 
                    Use --without-java to configure without java support.
5062
 
                    Or download a newer JDK and try again. 
5063
 
                    See e.g. http://java.sun.com/products/jdk/1.2 ])
5064
 
    fi
5065
 
 
5066
 
    CXXFLAGS="$ac_cxxflags_safe"    
5067
 
    AC_LANG_RESTORE
5068
 
 
5069
 
    dnl All tests ok, inform and subst the variables
5070
 
 
5071
 
    JAVAC=$kde_java_bindir/javac
5072
 
    JAVAH=$kde_java_bindir/javah
5073
 
    JAR=$kde_java_bindir/jar
5074
 
    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5075
 
    if test "x$kde_java_libgcjdir" = "x"; then 
5076
 
      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5077
 
    else
5078
 
      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5079
 
    fi
5080
 
    AC_MSG_RESULT([java JDK in $kde_java_bindir])
5081
 
 
5082
 
  else
5083
 
      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5084
 
      AC_MSG_RESULT([java JRE in $kde_java_bindir])
5085
 
  fi
5086
 
elif test -d "/Library/Java/Home"; then
5087
 
  kde_java_bindir="/Library/Java/Home/bin"
5088
 
  jni_includes="-I/Library/Java/Home/include"
5089
 
 
5090
 
  JAVAC=$kde_java_bindir/javac
5091
 
  JAVAH=$kde_java_bindir/javah
5092
 
  JAR=$kde_java_bindir/jar
5093
 
  JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
5094
 
 
5095
 
  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5096
 
  AC_MSG_RESULT([Apple Java Framework])
5097
 
else
5098
 
  AC_MSG_RESULT([none found])
5099
 
fi
5100
 
 
5101
 
AC_SUBST(JAVAC)
5102
 
AC_SUBST(JAVAH)
5103
 
AC_SUBST(JAR)
5104
 
AC_SUBST(JVMLIBS)
5105
 
AC_SUBST(jni_includes)
5106
 
 
5107
 
# for backward compat
5108
 
kde_cv_java_includedir=$kde_java_includedir
5109
 
kde_cv_java_bindir=$kde_java_bindir
5110
 
])
5111
 
 
5112
 
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5113
 
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5114
 
dnl big packages, m4_foreach is dog-slow.  So use our own version of
5115
 
dnl it.  (matz@kde.org)
5116
 
m4_define([mm_foreach],
5117
 
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5118
 
m4_define([mm_car], [[$1]])
5119
 
m4_define([mm_car2], [[$@]])
5120
 
m4_define([_mm_foreach],
5121
 
[m4_if(m4_quote($2), [], [],
5122
 
       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5123
 
                                                   mm_car2(m4_shift($2)),
5124
 
                                                   [$3])])])
5125
 
m4_define([AC_FOREACH],
5126
 
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5127
 
 
5128
 
AC_DEFUN([KDE_NEED_FLEX],
5129
 
[
5130
 
kde_libs_safe=$LIBS
5131
 
LIBS="$LIBS $USER_LDFLAGS"
5132
 
AM_PROG_LEX
5133
 
LIBS=$kde_libs_safe
5134
 
if test -z "$LEXLIB"; then
5135
 
    AC_MSG_ERROR([You need to have flex installed.])
5136
 
fi
5137
 
AC_SUBST(LEXLIB)
5138
 
])
5139
 
 
5140
 
AC_DEFUN([AC_PATH_QTOPIA],
5141
 
[
5142
 
  dnl TODO: use AC_CACHE_VAL
5143
 
 
5144
 
  if test -z "$1"; then
5145
 
    qtopia_minver_maj=1
5146
 
    qtopia_minver_min=5
5147
 
    qtopia_minver_pat=0
5148
 
  else
5149
 
    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5150
 
    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5151
 
    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5152
 
  fi
5153
 
 
5154
 
  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5155
 
  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5156
 
 
5157
 
  AC_REQUIRE([AC_PATH_QT])
5158
 
 
5159
 
  AC_MSG_CHECKING([for Qtopia])
5160
 
 
5161
 
  LIB_QTOPIA="-lqpe"
5162
 
  AC_SUBST(LIB_QTOPIA)
5163
 
 
5164
 
  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5165
 
 
5166
 
  ac_qtopia_incdir=NO
5167
 
 
5168
 
  AC_ARG_WITH(qtopia-dir,
5169
 
              AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5170
 
              [  ac_qtopia_incdir="$withval"/include] ) 
5171
 
  
5172
 
  qtopia_incdirs=""
5173
 
  for dir in $kde_qtopia_dirs; do
5174
 
    qtopia_incdirs="$qtopia_incdirs $dir/include"
5175
 
  done
5176
 
 
5177
 
  if test ! "$ac_qtopia_incdir" = "NO"; then
5178
 
    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5179
 
  fi
5180
 
 
5181
 
  qtopia_incdir=""
5182
 
  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5183
 
  ac_qtopia_incdir="$qtopia_incdir"
5184
 
 
5185
 
  if test -z "$qtopia_incdir"; then
5186
 
    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5187
 
  fi
5188
 
 
5189
 
  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5190
 
  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5191
 
  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5192
 
 
5193
 
  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5194
 
  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5195
 
  if test "$qtopia_ver" -lt "$qtopia_minver"; then
5196
 
    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5197
 
is required.])
5198
 
  fi
5199
 
 
5200
 
  AC_LANG_SAVE
5201
 
  AC_LANG_CPLUSPLUS
5202
 
 
5203
 
  ac_cxxflags_safe="$CXXFLAGS"
5204
 
  ac_ldflags_safe="$LDFLAGS"
5205
 
  ac_libs_safe="$LIBS"
5206
 
 
5207
 
  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5208
 
  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5209
 
  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5210
 
 
5211
 
  cat > conftest.$ac_ext <<EOF
5212
 
#include "confdefs.h"
5213
 
#include <qpe/qpeapplication.h>
5214
 
#include <qpe/version.h>
5215
 
 
5216
 
int main( int argc, char **argv )
5217
 
{
5218
 
    QPEApplication app( argc, argv );
5219
 
    return 0;
5220
 
}
5221
 
EOF
5222
 
 
5223
 
  if AC_TRY_EVAL(ac_link) && test -s conftest; then
5224
 
    rm -f conftest*
5225
 
  else
5226
 
    rm -f conftest*
5227
 
    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5228
 
the end of config.log])
5229
 
  fi
5230
 
 
5231
 
  CXXFLAGS="$ac_cxxflags_safe"
5232
 
  LDFLAGS="$ac_ldflags_safe"
5233
 
  LIBS="$ac_libs_safe"
5234
 
 
5235
 
  AC_LANG_RESTORE
5236
 
 
5237
 
  QTOPIA_INCLUDES="-I$qtopia_incdir"
5238
 
  AC_SUBST(QTOPIA_INCLUDES)
5239
 
 
5240
 
  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5241
 
])
5242
 
 
5243
 
 
5244
 
AC_DEFUN([KDE_INIT_DOXYGEN],
5245
 
[
5246
 
AC_MSG_CHECKING([for Qt docs])
5247
 
kde_qtdir=
5248
 
if test "${with_qt_dir+set}" = set; then
5249
 
  kde_qtdir="$with_qt_dir"
5250
 
fi
5251
 
 
5252
 
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
5253
 
AC_MSG_RESULT($QTDOCDIR)
5254
 
 
5255
 
AC_SUBST(QTDOCDIR)
5256
 
 
5257
 
KDE_FIND_PATH(dot, DOT, [], [])
5258
 
if test -n "$DOT"; then
5259
 
  KDE_HAVE_DOT="YES"
5260
 
else
5261
 
  KDE_HAVE_DOT="NO"
5262
 
fi
5263
 
AC_SUBST(KDE_HAVE_DOT)
5264
 
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5265
 
AC_SUBST(DOXYGEN)
5266
 
 
5267
 
DOXYGEN_PROJECT_NAME="$1"
5268
 
DOXYGEN_PROJECT_NUMBER="$2"
5269
 
AC_SUBST(DOXYGEN_PROJECT_NAME)
5270
 
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5271
 
 
5272
 
KDE_HAS_DOXYGEN=no
5273
 
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5274
 
  KDE_HAS_DOXYGEN=yes
5275
 
fi
5276
 
AC_SUBST(KDE_HAS_DOXYGEN)
5277
 
 
5278
 
])
5279
 
 
5280
 
 
5281
 
AC_DEFUN([AC_FIND_BZIP2],
5282
 
[
5283
 
AC_MSG_CHECKING([for bzDecompress in libbz2])
5284
 
AC_CACHE_VAL(ac_cv_lib_bzip2,
5285
 
[
5286
 
AC_LANG_SAVE
5287
 
AC_LANG_CPLUSPLUS
5288
 
kde_save_LIBS="$LIBS"
5289
 
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5290
 
kde_save_CXXFLAGS="$CXXFLAGS"
5291
 
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5292
 
AC_TRY_LINK(dnl
5293
 
[
5294
 
#define BZ_NO_STDIO
5295
 
#include<bzlib.h>
5296
 
],
5297
 
            [ bz_stream s; (void) bzDecompress(&s); ],
5298
 
            eval "ac_cv_lib_bzip2='-lbz2'",
5299
 
            eval "ac_cv_lib_bzip2=no")
5300
 
LIBS="$kde_save_LIBS"
5301
 
CXXFLAGS="$kde_save_CXXFLAGS"
5302
 
AC_LANG_RESTORE
5303
 
])dnl
5304
 
AC_MSG_RESULT($ac_cv_lib_bzip2)
5305
 
 
5306
 
if test ! "$ac_cv_lib_bzip2" = no; then
5307
 
  BZIP2DIR=bzip2
5308
 
 
5309
 
  LIBBZ2="$ac_cv_lib_bzip2"
5310
 
  AC_SUBST(LIBBZ2)
5311
 
 
5312
 
else
5313
 
 
5314
 
   cxx_shared_flag=
5315
 
   ld_shared_flag=
5316
 
   KDE_CHECK_COMPILER_FLAG(shared, [
5317
 
        ld_shared_flag="-shared"
5318
 
   ])
5319
 
   KDE_CHECK_COMPILER_FLAG(fPIC, [
5320
 
        cxx_shared_flag="-fPIC"
5321
 
   ])
5322
 
 
5323
 
   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5324
 
   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5325
 
   [
5326
 
   AC_LANG_SAVE
5327
 
   AC_LANG_CPLUSPLUS
5328
 
   kde_save_LIBS="$LIBS"
5329
 
   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5330
 
   kde_save_CXXFLAGS="$CXXFLAGS"
5331
 
   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5332
 
 
5333
 
   AC_TRY_LINK(dnl
5334
 
   [
5335
 
   #define BZ_NO_STDIO
5336
 
   #include<bzlib.h>
5337
 
   ],
5338
 
               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5339
 
               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5340
 
               eval "ac_cv_lib_bzip2_prefix=no")
5341
 
   LIBS="$kde_save_LIBS"
5342
 
   CXXFLAGS="$kde_save_CXXFLAGS"
5343
 
   AC_LANG_RESTORE
5344
 
   ])dnl
5345
 
 
5346
 
   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5347
 
   
5348
 
   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5349
 
     BZIP2DIR=bzip2
5350
 
    
5351
 
     LIBBZ2="$ac_cv_lib_bzip2_prefix"
5352
 
     AC_SUBST(LIBBZ2)
5353
 
 
5354
 
     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5355
 
   dnl else, we just ignore this
5356
 
   fi
5357
 
 
5358
 
fi
5359
 
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5360
 
])
5361
 
 
5362
 
dnl ------------------------------------------------------------------------
5363
 
dnl Try to find the SSL headers and libraries.
5364
 
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5365
 
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5366
 
dnl ------------------------------------------------------------------------
5367
 
dnl
5368
 
AC_DEFUN([KDE_CHECK_SSL],
5369
 
[
5370
 
LIBSSL="-lssl -lcrypto"
5371
 
AC_REQUIRE([KDE_CHECK_LIB64])
5372
 
 
5373
 
ac_ssl_includes=NO ac_ssl_libraries=NO
5374
 
ssl_libraries=""
5375
 
ssl_includes=""
5376
 
AC_ARG_WITH(ssl-dir,
5377
 
    AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5378
 
    [  ac_ssl_includes="$withval"/include
5379
 
       ac_ssl_libraries="$withval"/lib$kdelibsuff
5380
 
    ])
5381
 
 
5382
 
want_ssl=yes
5383
 
AC_ARG_WITH(ssl,
5384
 
    AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5385
 
    [want_ssl=$withval])
5386
 
 
5387
 
if test $want_ssl = yes; then
5388
 
 
5389
 
AC_MSG_CHECKING(for OpenSSL)
5390
 
 
5391
 
AC_CACHE_VAL(ac_cv_have_ssl,
5392
 
[#try to guess OpenSSL locations
5393
 
  
5394
 
  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5395
 
  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5396
 
  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5397
 
  ac_ssl_includes="$ssl_incdir"
5398
 
 
5399
 
  ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5400
 
  if test ! "$ac_ssl_libraries" = "NO"; then
5401
 
    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5402
 
  fi
5403
 
 
5404
 
  test=NONE
5405
 
  ssl_libdir=NONE
5406
 
  for dir in $ssl_libdirs; do
5407
 
    try="ls -1 $dir/libssl*"
5408
 
    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5409
 
  done
5410
 
 
5411
 
  ac_ssl_libraries="$ssl_libdir"
5412
 
 
5413
 
  ac_ldflags_safe="$LDFLAGS"
5414
 
  ac_libs_safe="$LIBS"
5415
 
 
5416
 
  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5417
 
  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5418
 
 
5419
 
  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5420
 
  ac_ssl_rsaref="yes"
5421
 
  ,
5422
 
  ac_ssl_rsaref="no"
5423
 
  )
5424
 
 
5425
 
  LDFLAGS="$ac_ldflags_safe"
5426
 
  LIBS="$ac_libs_safe"
5427
 
 
5428
 
  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5429
 
    have_ssl=no
5430
 
  else
5431
 
    have_ssl=yes;
5432
 
  fi
5433
 
 
5434
 
  ])
5435
 
 
5436
 
  eval "$ac_cv_have_ssl"
5437
 
 
5438
 
  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5439
 
 
5440
 
  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5441
 
  AC_MSG_RESULT($ac_ssl_rsaref)
5442
 
 
5443
 
  AC_MSG_CHECKING([for easter eggs])
5444
 
  AC_MSG_RESULT([none found])
5445
 
 
5446
 
else
5447
 
  have_ssl=no
5448
 
fi
5449
 
 
5450
 
if test "$have_ssl" = yes; then
5451
 
  AC_MSG_CHECKING(for OpenSSL version)
5452
 
  dnl Check for SSL version
5453
 
  AC_CACHE_VAL(ac_cv_ssl_version,
5454
 
  [
5455
 
 
5456
 
    cat >conftest.$ac_ext <<EOF
5457
 
#include <openssl/opensslv.h>
5458
 
#include <stdio.h>
5459
 
    int main() {
5460
 
 
5461
 
#ifndef OPENSSL_VERSION_NUMBER
5462
 
      printf("ssl_version=\\"error\\"\n");
5463
 
#else
5464
 
      if (OPENSSL_VERSION_NUMBER < 0x00906000)
5465
 
        printf("ssl_version=\\"old\\"\n");
5466
 
      else
5467
 
        printf("ssl_version=\\"ok\\"\n");
5468
 
#endif
5469
 
     return (0);
5470
 
    }
5471
 
EOF
5472
 
 
5473
 
    ac_save_CPPFLAGS=$CPPFLAGS
5474
 
    if test "$ac_ssl_includes" != "/usr/include"; then
5475
 
        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5476
 
    fi
5477
 
 
5478
 
    if AC_TRY_EVAL(ac_link); then 
5479
 
 
5480
 
      if eval `./conftest 2>&5`; then
5481
 
        if test $ssl_version = error; then
5482
 
          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5483
 
        else
5484
 
          if test $ssl_version = old; then
5485
 
            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5486
 
            have_ssl=no
5487
 
          fi
5488
 
        fi
5489
 
        ac_cv_ssl_version="ssl_version=$ssl_version"
5490
 
      else
5491
 
        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5492
 
        Check config.log, and if you can't figure it out, send a mail to 
5493
 
        David Faure <faure@kde.org>, attaching your config.log])
5494
 
      fi
5495
 
 
5496
 
    else
5497
 
      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5498
 
      Check config.log, and if you can't figure it out, send a mail to 
5499
 
      David Faure <faure@kde.org>, attaching your config.log])
5500
 
    fi 
5501
 
    CPPFLAGS=$ac_save_CPPFLAGS
5502
 
 
5503
 
  ])
5504
 
 
5505
 
  eval "$ac_cv_ssl_version"
5506
 
  AC_MSG_RESULT($ssl_version)
5507
 
fi
5508
 
 
5509
 
if test "$have_ssl" != yes; then
5510
 
  LIBSSL="";
5511
 
else
5512
 
  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5513
 
  ac_cv_have_ssl="have_ssl=yes \
5514
 
    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5515
 
  
5516
 
  
5517
 
  ssl_libraries="$ac_ssl_libraries"
5518
 
  ssl_includes="$ac_ssl_includes"
5519
 
 
5520
 
  if test "$ac_ssl_rsaref" = yes; then
5521
 
    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
5522
 
  fi
5523
 
 
5524
 
  if test $ssl_version = "old"; then
5525
 
    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5526
 
  fi
5527
 
fi
5528
 
 
5529
 
SSL_INCLUDES=
5530
 
 
5531
 
if test "$ssl_includes" = "/usr/include"; then
5532
 
  if test -f /usr/kerberos/include/krb5.h; then
5533
 
        SSL_INCLUDES="-I/usr/kerberos/include"
5534
 
  fi
5535
 
elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5536
 
  SSL_INCLUDES="-I$ssl_includes"
5537
 
fi
5538
 
 
5539
 
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5540
 
 SSL_LDFLAGS=""
5541
 
else
5542
 
 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5543
 
fi
5544
 
 
5545
 
AC_SUBST(SSL_INCLUDES)
5546
 
AC_SUBST(SSL_LDFLAGS)
5547
 
AC_SUBST(LIBSSL)
5548
 
])
5549
 
 
5550
 
AC_DEFUN([KDE_CHECK_STRLCPY],
5551
 
[
5552
 
  AC_REQUIRE([AC_CHECK_STRLCAT])
5553
 
  AC_REQUIRE([AC_CHECK_STRLCPY])
5554
 
  AC_CHECK_SIZEOF(size_t)
5555
 
  AC_CHECK_SIZEOF(unsigned long)
5556
 
 
5557
 
  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5558
 
  AC_TRY_COMPILE(,[
5559
 
    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5560
 
       choke me
5561
 
    #endif
5562
 
    ],AC_MSG_RESULT([yes]),[
5563
 
      AC_MSG_RESULT(no)
5564
 
      AC_MSG_ERROR([
5565
 
       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
5566
 
       does not apply. Please mail kde-devel@kde.org with a description of your system!
5567
 
      ])
5568
 
  ])
5569
 
])
5570
 
 
5571
 
AC_DEFUN([KDE_CHECK_BINUTILS],
5572
 
[
5573
 
  AC_MSG_CHECKING([if ld supports unversioned version maps])
5574
 
 
5575
 
  kde_save_LDFLAGS="$LDFLAGS"
5576
 
  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5577
 
  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5578
 
  AC_TRY_LINK([int foo;],
5579
 
[
5580
 
#ifdef __INTEL_COMPILER
5581
 
icc apparently does not support libtools version-info and version-script
5582
 
at the same time. Dunno where the bug is, but until somebody figured out,
5583
 
better disable the optional version scripts.
5584
 
#endif
5585
 
 
5586
 
  foo = 42;
5587
 
], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5588
 
  LDFLAGS="$kde_save_LDFLAGS"
5589
 
  rm -f conftest.map
5590
 
  AM_CONDITIONAL(include_VERSION_SCRIPT, 
5591
 
    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5592
 
 
5593
 
  AC_MSG_RESULT($kde_supports_versionmaps)
5594
 
])
5595
 
 
5596
 
AC_DEFUN([AM_PROG_OBJC],[
5597
 
AC_CHECK_PROGS(OBJC, gcc, gcc)
5598
 
test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5599
 
if test "x${OBJCFLAGS-unset}" = xunset; then
5600
 
   OBJCFLAGS="-g -O2"
5601
 
fi
5602
 
AC_SUBST(OBJCFLAGS)
5603
 
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5604
 
])
5605
 
 
5606
 
AC_DEFUN([KDE_CHECK_PERL],
5607
 
[
5608
 
        KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5609
 
                    AC_MSG_ERROR([No Perl found in your $PATH.
5610
 
We need perl to generate some code.])
5611
 
        ])
5612
 
    AC_SUBST(PERL)
5613
 
])
5614
 
 
5615
 
AC_DEFUN([KDE_CHECK_LARGEFILE],
5616
 
[
5617
 
AC_SYS_LARGEFILE
5618
 
if test "$ac_cv_sys_file_offset_bits" != no; then
5619
 
  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5620
 
fi
5621
 
 
5622
 
if test "x$ac_cv_sys_large_files" != "xno"; then
5623
 
  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
5624
 
fi
5625
 
 
5626
 
])