~ubuntu-branches/ubuntu/jaunty/kaptain/jaunty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-06-25 14:49:04 UTC
  • Revision ID: james.westby@ubuntu.com-20060625144904-v34vrvxzq6fsx34v
* Non-maintainer upload.
* Pull in texinfo.tex from automake into admin/; it seems to be required
  for running admin/Makefile.common now.
* Remove lexer.cpp and parser.cpp from kaptain_SOURCES; they are
  automatically generated from lexer.lpp and parser.ypp respecively, which
  seems to cause duplicate symbols under some automake versions.
* Add AM_MAINTAINER_MODE to configure.in and rerun admin/Makefile.common;
  fixes FTBFS due to timestamp skew. (Closes: #375350)

Show diffs side-by-side

added added

removed removed

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