~ubuntu-branches/ubuntu/feisty/kdetv/feisty

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-09-17 23:25:16 UTC
  • Revision ID: james.westby@ubuntu.com-20050917232516-9wdsn3ckagbqieh8
Tags: upstream-0.8.8
ImportĀ upstreamĀ versionĀ 0.8.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##   -*- autoconf -*-
 
2
 
 
3
dnl    This file is part of the KDE libraries/packages
 
4
dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
 
5
dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
 
6
 
 
7
dnl    This file is free software; you can redistribute it and/or
 
8
dnl    modify it under the terms of the GNU Library General Public
 
9
dnl    License as published by the Free Software Foundation; either
 
10
dnl    version 2 of the License, or (at your option) any later version.
 
11
 
 
12
dnl    This library is distributed in the hope that it will be useful,
 
13
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
dnl    Library General Public License for more details.
 
16
 
 
17
dnl    You should have received a copy of the GNU Library General Public License
 
18
dnl    along with this library; see the file COPYING.LIB.  If not, write to
 
19
dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
dnl    Boston, MA 02111-1307, USA.
 
21
 
 
22
dnl IMPORTANT NOTE:
 
23
dnl Please do not modify this file unless you expect your modifications to be
 
24
dnl carried into every other module in the repository. 
 
25
dnl
 
26
dnl Single-module modifications are best placed in configure.in for kdelibs
 
27
dnl and kdebase or configure.in.in if present.
 
28
 
 
29
# KDE_PATH_X_DIRECT
 
30
dnl Internal subroutine of AC_PATH_X.
 
31
dnl Set ac_x_includes and/or ac_x_libraries.
 
32
AC_DEFUN([KDE_PATH_X_DIRECT],
 
33
[
 
34
AC_REQUIRE([KDE_CHECK_LIB64])
 
35
 
 
36
if test "$ac_x_includes" = NO; then
 
37
  # Guess where to find include files, by looking for this one X11 .h file.
 
38
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 
39
 
 
40
  # First, try using that file with no special directory specified.
 
41
AC_TRY_CPP([#include <$x_direct_test_include>],
 
42
[# We can compile using X headers with no special include directory.
 
43
ac_x_includes=],
 
44
[# Look for the header file in a standard set of common directories.
 
45
# Check X11 before X11Rn because it is often a symlink to the current release.
 
46
  for ac_dir in               \
 
47
    /usr/X11/include          \
 
48
    /usr/X11R6/include        \
 
49
    /usr/X11R5/include        \
 
50
    /usr/X11R4/include        \
 
51
                              \
 
52
    /usr/include/X11          \
 
53
    /usr/include/X11R6        \
 
54
    /usr/include/X11R5        \
 
55
    /usr/include/X11R4        \
 
56
                              \
 
57
    /usr/local/X11/include    \
 
58
    /usr/local/X11R6/include  \
 
59
    /usr/local/X11R5/include  \
 
60
    /usr/local/X11R4/include  \
 
61
                              \
 
62
    /usr/local/include/X11    \
 
63
    /usr/local/include/X11R6  \
 
64
    /usr/local/include/X11R5  \
 
65
    /usr/local/include/X11R4  \
 
66
                              \
 
67
    /usr/X386/include         \
 
68
    /usr/x386/include         \
 
69
    /usr/XFree86/include/X11  \
 
70
                              \
 
71
    /usr/include              \
 
72
    /usr/local/include        \
 
73
    /usr/unsupported/include  \
 
74
    /usr/athena/include       \
 
75
    /usr/local/x11r5/include  \
 
76
    /usr/lpp/Xamples/include  \
 
77
                              \
 
78
    /usr/openwin/include      \
 
79
    /usr/openwin/share/include \
 
80
    ; \
 
81
  do
 
82
    if test -r "$ac_dir/$x_direct_test_include"; then
 
83
      ac_x_includes=$ac_dir
 
84
      break
 
85
    fi
 
86
  done])
 
87
fi # $ac_x_includes = NO
 
88
 
 
89
if test "$ac_x_libraries" = NO; then
 
90
  # Check for the libraries.
 
91
 
 
92
  test -z "$x_direct_test_library" && x_direct_test_library=Xt
 
93
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
 
94
 
 
95
  # See if we find them without any special options.
 
96
  # Don't add to $LIBS permanently.
 
97
  ac_save_LIBS="$LIBS"
 
98
  LIBS="-l$x_direct_test_library $LIBS"
 
99
AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
 
100
[LIBS="$ac_save_LIBS"
 
101
# We can link X programs with no special library path.
 
102
ac_x_libraries=],
 
103
[LIBS="$ac_save_LIBS"
 
104
# First see if replacing the include by lib works.
 
105
# Check X11 before X11Rn because it is often a symlink to the current release.
 
106
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
 
107
    /usr/X11/lib${kdelibsuff}           \
 
108
    /usr/X11R6/lib${kdelibsuff}         \
 
109
    /usr/X11R5/lib${kdelibsuff}         \
 
110
    /usr/X11R4/lib${kdelibsuff}         \
 
111
                                        \
 
112
    /usr/lib${kdelibsuff}/X11           \
 
113
    /usr/lib${kdelibsuff}/X11R6         \
 
114
    /usr/lib${kdelibsuff}/X11R5         \
 
115
    /usr/lib${kdelibsuff}/X11R4         \
 
116
                                        \
 
117
    /usr/local/X11/lib${kdelibsuff}     \
 
118
    /usr/local/X11R6/lib${kdelibsuff}   \
 
119
    /usr/local/X11R5/lib${kdelibsuff}   \
 
120
    /usr/local/X11R4/lib${kdelibsuff}   \
 
121
                                        \
 
122
    /usr/local/lib${kdelibsuff}/X11     \
 
123
    /usr/local/lib${kdelibsuff}/X11R6   \
 
124
    /usr/local/lib${kdelibsuff}/X11R5   \
 
125
    /usr/local/lib${kdelibsuff}/X11R4   \
 
126
                                        \
 
127
    /usr/X386/lib${kdelibsuff}          \
 
128
    /usr/x386/lib${kdelibsuff}          \
 
129
    /usr/XFree86/lib${kdelibsuff}/X11   \
 
130
                                        \
 
131
    /usr/lib${kdelibsuff}               \
 
132
    /usr/local/lib${kdelibsuff}         \
 
133
    /usr/unsupported/lib${kdelibsuff}   \
 
134
    /usr/athena/lib${kdelibsuff}        \
 
135
    /usr/local/x11r5/lib${kdelibsuff}   \
 
136
    /usr/lpp/Xamples/lib${kdelibsuff}   \
 
137
    /lib/usr/lib${kdelibsuff}/X11       \
 
138
                                        \
 
139
    /usr/openwin/lib${kdelibsuff}       \
 
140
    /usr/openwin/share/lib${kdelibsuff} \
 
141
    ; \
 
142
do
 
143
dnl Don't even attempt the hair of trying to link an X program!
 
144
  for ac_extension in a so sl; do
 
145
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
 
146
      ac_x_libraries=$ac_dir
 
147
      break 2
 
148
    fi
 
149
  done
 
150
done])
 
151
fi # $ac_x_libraries = NO
 
152
])
 
153
 
 
154
 
 
155
dnl ------------------------------------------------------------------------
 
156
dnl Find a file (or one of more files in a list of dirs)
 
157
dnl ------------------------------------------------------------------------
 
158
dnl
 
159
AC_DEFUN([AC_FIND_FILE],
 
160
[
 
161
$3=NO
 
162
for i in $2;
 
163
do
 
164
  for j in $1;
 
165
  do
 
166
    echo "configure: __oline__: $i/$j" >&AC_FD_CC
 
167
    if test -r "$i/$j"; then
 
168
      echo "taking that" >&AC_FD_CC
 
169
      $3=$i
 
170
      break 2
 
171
    fi
 
172
  done
 
173
done
 
174
])
 
175
 
 
176
dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
 
177
dnl     if-not-found, test-parameter, prepend-path)
 
178
dnl
 
179
dnl Look for program-name in list-of-dirs+$PATH.
 
180
dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
 
181
dnl If found, $variable-name is set. If not, if-not-found is evaluated.
 
182
dnl test-parameter: if set, the program is executed with this arg,
 
183
dnl                 and only a successful exit code is required.
 
184
AC_DEFUN([KDE_FIND_PATH],
 
185
[
 
186
   AC_MSG_CHECKING([for $1])
 
187
   if test -n "$$2"; then
 
188
        kde_cv_path="$$2";
 
189
   else
 
190
        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
 
191
 
 
192
        AC_CACHE_VAL(kde_cv_path_$kde_cache,
 
193
        [
 
194
        kde_cv_path="NONE"
 
195
        kde_save_IFS=$IFS
 
196
        IFS=':'
 
197
        dirs=""
 
198
        for dir in $PATH; do
 
199
          dirs="$dirs $dir"
 
200
        done
 
201
        if test -z "$6"; then  dnl Append dirs in PATH (default)
 
202
          dirs="$3 $dirs"
 
203
        else  dnl Prepend dirs in PATH (if 6th arg is set)
 
204
          dirs="$dirs $3"
 
205
        fi
 
206
        IFS=$kde_save_IFS
 
207
 
 
208
        for dir in $dirs; do
 
209
          if test -x "$dir/$1"; then
 
210
            if test -n "$5"
 
211
            then
 
212
              evalstr="$dir/$1 $5 2>&1 "
 
213
              if eval $evalstr; then
 
214
                kde_cv_path="$dir/$1"
 
215
                break
 
216
              fi
 
217
            else
 
218
                kde_cv_path="$dir/$1"
 
219
                break
 
220
            fi
 
221
          fi
 
222
        done
 
223
 
 
224
        eval "kde_cv_path_$kde_cache=$kde_cv_path"
 
225
 
 
226
        ])
 
227
 
 
228
      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
 
229
 
 
230
   fi
 
231
 
 
232
   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
 
233
      AC_MSG_RESULT(not found)
 
234
      $4
 
235
   else
 
236
      AC_MSG_RESULT($kde_cv_path)
 
237
      $2=$kde_cv_path
 
238
 
 
239
   fi
 
240
])
 
241
 
 
242
AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
 
243
[
 
244
    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
 
245
Please check whether you installed Qt correctly.
 
246
You need to have a running moc binary.
 
247
configure tried to run $ac_cv_path_moc and the test didn't
 
248
succeed. If configure shouldn't have tried this one, set
 
249
the environment variable MOC to the right one before running
 
250
configure.
 
251
])
 
252
])
 
253
 
 
254
AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
 
255
[
 
256
    AC_MSG_WARN([No Qt ui compiler (uic) found!
 
257
Please check whether you installed Qt correctly.
 
258
You need to have a running uic binary.
 
259
configure tried to run $ac_cv_path_uic and the test didn't
 
260
succeed. If configure shouldn't have tried this one, set
 
261
the environment variable UIC to the right one before running
 
262
configure.
 
263
])
 
264
])
 
265
 
 
266
 
 
267
AC_DEFUN([KDE_CHECK_UIC_FLAG],
 
268
[
 
269
    AC_MSG_CHECKING([whether uic supports -$1 ])
 
270
    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
 
271
    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
 
272
    [
 
273
        cat >conftest.ui <<EOT
 
274
        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
 
275
EOT
 
276
        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
 
277
        if AC_TRY_EVAL(ac_uic_testrun); then
 
278
            eval "kde_cv_prog_uic_$kde_cache=yes"
 
279
        else
 
280
            eval "kde_cv_prog_uic_$kde_cache=no"
 
281
        fi
 
282
        rm -f conftest*
 
283
    ])
 
284
 
 
285
    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
 
286
        AC_MSG_RESULT([yes])
 
287
        :
 
288
        $3
 
289
    else
 
290
        AC_MSG_RESULT([no])
 
291
        :
 
292
        $4
 
293
    fi
 
294
])
 
295
 
 
296
 
 
297
dnl ------------------------------------------------------------------------
 
298
dnl Find the meta object compiler and the ui compiler in the PATH,
 
299
dnl in $QTDIR/bin, and some more usual places
 
300
dnl ------------------------------------------------------------------------
 
301
dnl
 
302
AC_DEFUN([AC_PATH_QT_MOC_UIC],
 
303
[
 
304
   AC_REQUIRE([KDE_CHECK_PERL])
 
305
   qt_bindirs=""
 
306
   for dir in $kde_qt_dirs; do
 
307
      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
 
308
   done
 
309
   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
 
310
   if test ! "$ac_qt_bindir" = "NO"; then
 
311
      qt_bindirs="$ac_qt_bindir $qt_bindirs"
 
312
   fi
 
313
 
 
314
   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
 
315
   if test -z "$UIC_NOT_NEEDED"; then
 
316
     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
 
317
     if test -z "$UIC_PATH" ; then
 
318
       KDE_UIC_ERROR_MESSAGE
 
319
       exit 1
 
320
     else
 
321
       UIC=$UIC_PATH
 
322
 
 
323
       if test $kde_qtver = 3; then
 
324
         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
 
325
         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
 
326
 
 
327
         if test x$ac_uic_supports_libpath = xyes; then
 
328
             UIC="$UIC -L \$(kde_widgetdir)"
 
329
         fi
 
330
         if test x$ac_uic_supports_nounload = xyes; then
 
331
             UIC="$UIC -nounload"
 
332
         fi
 
333
       fi
 
334
     fi
 
335
   else
 
336
     UIC="echo uic not available: "
 
337
   fi
 
338
 
 
339
   AC_SUBST(MOC)
 
340
   AC_SUBST(UIC)
 
341
 
 
342
   UIC_TR="i18n"
 
343
   if test $kde_qtver = 3; then
 
344
     UIC_TR="tr2i18n"
 
345
   fi
 
346
 
 
347
   AC_SUBST(UIC_TR)
 
348
])
 
349
 
 
350
AC_DEFUN([KDE_1_CHECK_PATHS],
 
351
[
 
352
  KDE_1_CHECK_PATH_HEADERS
 
353
 
 
354
  KDE_TEST_RPATH=
 
355
 
 
356
  if test -n "$USE_RPATH"; then
 
357
 
 
358
     if test -n "$kde_libraries"; then
 
359
       KDE_TEST_RPATH="-R $kde_libraries"
 
360
     fi
 
361
 
 
362
     if test -n "$qt_libraries"; then
 
363
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
 
364
     fi
 
365
 
 
366
     if test -n "$x_libraries"; then
 
367
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
 
368
     fi
 
369
 
 
370
     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
 
371
  fi
 
372
 
 
373
AC_MSG_CHECKING([for KDE libraries installed])
 
374
ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
 
375
 
 
376
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
377
  AC_MSG_RESULT(yes)
 
378
else
 
379
  AC_MSG_ERROR([your system fails at linking a small KDE application!
 
380
Check, if your compiler is installed correctly and if you have used the
 
381
same compiler to compile Qt and kdelibs as you did use now.
 
382
For more details about this problem, look at the end of config.log.])
 
383
fi
 
384
 
 
385
if eval `KDEDIR= ./conftest 2>&5`; then
 
386
  kde_result=done
 
387
else
 
388
  kde_result=problems
 
389
fi
 
390
 
 
391
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
 
392
kde_have_all_paths=yes
 
393
 
 
394
KDE_SET_PATHS($kde_result)
 
395
 
 
396
])
 
397
 
 
398
AC_DEFUN([KDE_SET_PATHS],
 
399
[
 
400
  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
 
401
        kde_htmldir=\"$kde_htmldir\" \
 
402
        kde_appsdir=\"$kde_appsdir\" \
 
403
        kde_icondir=\"$kde_icondir\" \
 
404
        kde_sounddir=\"$kde_sounddir\" \
 
405
        kde_datadir=\"$kde_datadir\" \
 
406
        kde_locale=\"$kde_locale\" \
 
407
        kde_cgidir=\"$kde_cgidir\" \
 
408
        kde_confdir=\"$kde_confdir\" \
 
409
        kde_kcfgdir=\"$kde_kcfgdir\" \
 
410
        kde_mimedir=\"$kde_mimedir\" \
 
411
        kde_toolbardir=\"$kde_toolbardir\" \
 
412
        kde_wallpaperdir=\"$kde_wallpaperdir\" \
 
413
        kde_templatesdir=\"$kde_templatesdir\" \
 
414
        kde_bindir=\"$kde_bindir\" \
 
415
        kde_servicesdir=\"$kde_servicesdir\" \
 
416
        kde_servicetypesdir=\"$kde_servicetypesdir\" \
 
417
        kde_moduledir=\"$kde_moduledir\" \
 
418
        kde_styledir=\"$kde_styledir\" \
 
419
        kde_widgetdir=\"$kde_widgetdir\" \
 
420
        xdg_appsdir=\"$xdg_appsdir\" \
 
421
        xdg_menudir=\"$xdg_menudir\" \
 
422
        xdg_directorydir=\"$xdg_directorydir\" \
 
423
        kde_result=$1"
 
424
])
 
425
 
 
426
AC_DEFUN([KDE_SET_DEFAULT_PATHS],
 
427
[
 
428
if test "$1" = "default"; then
 
429
 
 
430
  if test -z "$kde_htmldir"; then
 
431
    kde_htmldir='\${datadir}/doc/HTML'
 
432
  fi
 
433
  if test -z "$kde_appsdir"; then
 
434
    kde_appsdir='\${datadir}/applnk'
 
435
  fi
 
436
  if test -z "$kde_icondir"; then
 
437
    kde_icondir='\${datadir}/icons'
 
438
  fi
 
439
  if test -z "$kde_sounddir"; then
 
440
    kde_sounddir='\${datadir}/sounds'
 
441
  fi
 
442
  if test -z "$kde_datadir"; then
 
443
    kde_datadir='\${datadir}/apps'
 
444
  fi
 
445
  if test -z "$kde_locale"; then
 
446
    kde_locale='\${datadir}/locale'
 
447
  fi
 
448
  if test -z "$kde_cgidir"; then
 
449
    kde_cgidir='\${exec_prefix}/cgi-bin'
 
450
  fi
 
451
  if test -z "$kde_confdir"; then
 
452
    kde_confdir='\${datadir}/config'
 
453
  fi
 
454
  if test -z "$kde_kcfgdir"; then
 
455
    kde_kcfgdir='\${datadir}/config.kcfg'
 
456
  fi
 
457
  if test -z "$kde_mimedir"; then
 
458
    kde_mimedir='\${datadir}/mimelnk'
 
459
  fi
 
460
  if test -z "$kde_toolbardir"; then
 
461
    kde_toolbardir='\${datadir}/toolbar'
 
462
  fi
 
463
  if test -z "$kde_wallpaperdir"; then
 
464
    kde_wallpaperdir='\${datadir}/wallpapers'
 
465
  fi
 
466
  if test -z "$kde_templatesdir"; then
 
467
    kde_templatesdir='\${datadir}/templates'
 
468
  fi
 
469
  if test -z "$kde_bindir"; then
 
470
    kde_bindir='\${exec_prefix}/bin'
 
471
  fi
 
472
  if test -z "$kde_servicesdir"; then
 
473
    kde_servicesdir='\${datadir}/services'
 
474
  fi
 
475
  if test -z "$kde_servicetypesdir"; then
 
476
    kde_servicetypesdir='\${datadir}/servicetypes'
 
477
  fi
 
478
  if test -z "$kde_moduledir"; then
 
479
    if test "$kde_qtver" = "2"; then
 
480
      kde_moduledir='\${libdir}/kde2'
 
481
    else
 
482
      kde_moduledir='\${libdir}/kde3'
 
483
    fi
 
484
  fi
 
485
  if test -z "$kde_styledir"; then
 
486
    kde_styledir='\${libdir}/kde3/plugins/styles'
 
487
  fi
 
488
  if test -z "$kde_widgetdir"; then
 
489
    kde_widgetdir='\${libdir}/kde3/plugins/designer'
 
490
  fi
 
491
  if test -z "$xdg_appsdir"; then
 
492
    xdg_appsdir='\${datadir}/applications/kde'
 
493
  fi
 
494
  if test -z "$xdg_menudir"; then
 
495
    xdg_menudir='\${sysconfdir}/xdg/menus'
 
496
  fi
 
497
  if test -z "$xdg_directorydir"; then
 
498
    xdg_directorydir='\${datadir}/desktop-directories'
 
499
  fi
 
500
 
 
501
  KDE_SET_PATHS(defaults)
 
502
 
 
503
else
 
504
 
 
505
  if test $kde_qtver = 1; then
 
506
     AC_MSG_RESULT([compiling])
 
507
     KDE_1_CHECK_PATHS
 
508
  else
 
509
     AC_MSG_ERROR([path checking not yet supported for KDE 2])
 
510
  fi
 
511
 
 
512
fi
 
513
])
 
514
 
 
515
AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
 
516
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
 
517
   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
 
518
   test -z "$kde_datadir" || test -z "$kde_locale"  ||
 
519
   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
 
520
   test -z "$kde_kcfgdir" ||
 
521
   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
 
522
   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
 
523
   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
 
524
   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
 
525
   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
 
526
   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
 
527
   test "x$kde_have_all_paths" != "xyes"; then
 
528
     kde_have_all_paths=no
 
529
  fi
 
530
])
 
531
 
 
532
AC_DEFUN([KDE_MISSING_PROG_ERROR],
 
533
[
 
534
    AC_MSG_ERROR([The important program $1 was not found!
 
535
Please check whether you installed KDE correctly.
 
536
])
 
537
])
 
538
 
 
539
AC_DEFUN([KDE_MISSING_ARTS_ERROR],
 
540
[
 
541
    AC_MSG_ERROR([The important program $1 was not found!
 
542
Please check whether you installed aRts correctly or use
 
543
--without-arts to compile without aRts support (this will remove functionality).
 
544
])
 
545
])
 
546
 
 
547
AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
 
548
[
 
549
    kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
 
550
    test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
 
551
    if test -n "$KDEDIRS"; then
 
552
       kde_save_IFS=$IFS
 
553
       IFS=:
 
554
       for dir in $KDEDIRS; do
 
555
            kde_default_bindirs="$dir/bin $kde_default_bindirs "
 
556
       done
 
557
       IFS=$kde_save_IFS
 
558
    fi
 
559
])
 
560
 
 
561
AC_DEFUN([KDE_SUBST_PROGRAMS],
 
562
[
 
563
    AC_ARG_WITH(arts,
 
564
        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
 
565
        [build_arts=$withval],
 
566
        [build_arts=yes]
 
567
    )
 
568
    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
 
569
    if test "$build_arts" = "no"; then
 
570
        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
 
571
    fi
 
572
 
 
573
        KDE_SET_DEFAULT_BINDIRS
 
574
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
 
575
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
 
576
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
 
577
        if test "$build_arts" '!=' "no"; then
 
578
          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
 
579
          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
 
580
        fi
 
581
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
 
582
 
 
583
        kde32ornewer=1
 
584
        kde33ornewer=1
 
585
        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
 
586
            kde32ornewer=
 
587
            kde33ornewer=
 
588
        else
 
589
            if test "$kde_qtver" = "3"; then
 
590
              if test "$kde_qtsubver" -le 1; then
 
591
                kde32ornewer=
 
592
              fi
 
593
              if test "$kde_qtsubver" -le 2; then
 
594
                kde33ornewer=
 
595
              fi
 
596
            fi
 
597
        fi
 
598
 
 
599
        if test -n "$kde32ornewer"; then
 
600
            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
 
601
            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
 
602
        fi
 
603
        if test -n "$kde33ornewer"; then
 
604
            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
 
605
            AC_SUBST(MAKEKDEWIDGETS)
 
606
        fi
 
607
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
 
608
 
 
609
        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
 
610
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
 
611
            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
 
612
            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
 
613
            if test "$KDE_XSL_STYLESHEET" = "NO"; then
 
614
                KDE_XSL_STYLESHEET=""
 
615
            else
 
616
                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
 
617
            fi
 
618
        fi
 
619
 
 
620
        DCOP_DEPENDENCIES='$(DCOPIDL)'
 
621
        if test -n "$kde32ornewer"; then
 
622
            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
 
623
            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
 
624
            AC_SUBST(KCONFIG_COMPILER)
 
625
            AC_SUBST(KCFG_DEPENDENCIES)
 
626
            AC_SUBST(DCOPIDLNG)
 
627
        fi
 
628
        AC_SUBST(DCOPIDL)
 
629
        AC_SUBST(DCOPIDL2CPP)
 
630
        AC_SUBST(DCOP_DEPENDENCIES)
 
631
        AC_SUBST(MCOPIDL)
 
632
        AC_SUBST(ARTSCCONFIG)
 
633
        AC_SUBST(MEINPROC)
 
634
        AC_SUBST(KDE_XSL_STYLESHEET)
 
635
        AC_SUBST(XMLLINT)
 
636
])dnl
 
637
 
 
638
AC_DEFUN([AC_CREATE_KFSSTND],
 
639
[
 
640
AC_REQUIRE([AC_CHECK_RPATH])
 
641
 
 
642
AC_MSG_CHECKING([for KDE paths])
 
643
kde_result=""
 
644
kde_cached_paths=yes
 
645
AC_CACHE_VAL(kde_cv_all_paths,
 
646
[
 
647
  KDE_SET_DEFAULT_PATHS($1)
 
648
  kde_cached_paths=no
 
649
])
 
650
eval "$kde_cv_all_paths"
 
651
KDE_CHECK_PATHS_FOR_COMPLETENESS
 
652
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
 
653
  # wrong values were cached, may be, we can set better ones
 
654
  kde_result=
 
655
  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
 
656
  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
 
657
  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
 
658
  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
 
659
  kde_have_all_paths=
 
660
  kde_styledir=
 
661
  kde_widgetdir=
 
662
  xdg_appsdir = xdg_menudir= xdg_directorydir= 
 
663
  KDE_SET_DEFAULT_PATHS($1)
 
664
  eval "$kde_cv_all_paths"
 
665
  KDE_CHECK_PATHS_FOR_COMPLETENESS
 
666
  kde_result="$kde_result (cache overridden)"
 
667
fi
 
668
if test "$kde_have_all_paths" = "no"; then
 
669
  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
 
670
Since it had compiled and linked before, it must be a strange problem on your system.
 
671
Look at config.log for details. If you are not able to fix this, look at
 
672
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
 
673
(If you're using an egcs version on Linux, you may update binutils!)
 
674
])
 
675
else
 
676
  rm -f conftest*
 
677
  AC_MSG_RESULT($kde_result)
 
678
fi
 
679
 
 
680
bindir=$kde_bindir
 
681
 
 
682
KDE_SUBST_PROGRAMS
 
683
 
 
684
])
 
685
 
 
686
AC_DEFUN([AC_SUBST_KFSSTND],
 
687
[
 
688
AC_SUBST(kde_htmldir)
 
689
AC_SUBST(kde_appsdir)
 
690
AC_SUBST(kde_icondir)
 
691
AC_SUBST(kde_sounddir)
 
692
AC_SUBST(kde_datadir)
 
693
AC_SUBST(kde_locale)
 
694
AC_SUBST(kde_confdir)
 
695
AC_SUBST(kde_kcfgdir)
 
696
AC_SUBST(kde_mimedir)
 
697
AC_SUBST(kde_wallpaperdir)
 
698
AC_SUBST(kde_bindir)
 
699
dnl X Desktop Group standards
 
700
AC_SUBST(xdg_appsdir)
 
701
AC_SUBST(xdg_menudir)
 
702
AC_SUBST(xdg_directorydir)
 
703
dnl for KDE 2
 
704
AC_SUBST(kde_templatesdir)
 
705
AC_SUBST(kde_servicesdir)
 
706
AC_SUBST(kde_servicetypesdir)
 
707
AC_SUBST(kde_moduledir)
 
708
AC_SUBST(kdeinitdir, '$(kde_moduledir)')
 
709
AC_SUBST(kde_styledir)
 
710
AC_SUBST(kde_widgetdir)
 
711
if test "$kde_qtver" = 1; then
 
712
  kde_minidir="$kde_icondir/mini"
 
713
else
 
714
# for KDE 1 - this breaks KDE2 apps using minidir, but
 
715
# that's the plan ;-/
 
716
  kde_minidir="/dev/null"
 
717
fi
 
718
dnl AC_SUBST(kde_minidir)
 
719
dnl AC_SUBST(kde_cgidir)
 
720
dnl AC_SUBST(kde_toolbardir)
 
721
])
 
722
 
 
723
AC_DEFUN([KDE_MISC_TESTS],
 
724
[
 
725
   dnl Checks for libraries.
 
726
   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
 
727
   AC_SUBST(LIBUTIL)
 
728
   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
 
729
   AC_SUBST(LIBCOMPAT)
 
730
   kde_have_crypt=
 
731
   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
 
732
      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
 
733
        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
 
734
You should install libcrypt from another source or configure with PAM
 
735
support])
 
736
        kde_have_crypt=no
 
737
      ]))
 
738
   AC_SUBST(LIBCRYPT)
 
739
   if test $kde_have_crypt = yes; then
 
740
      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
 
741
   fi
 
742
   AC_CHECK_SOCKLEN_T
 
743
   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
 
744
   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
 
745
      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
 
746
        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
 
747
   fi
 
748
   AC_CHECK_FUNC(inet_ntoa)
 
749
   if test $ac_cv_func_inet_ntoa = no; then
 
750
     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
 
751
   fi
 
752
   AC_CHECK_FUNC(connect)
 
753
   if test $ac_cv_func_connect = no; then
 
754
      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
 
755
        $X_EXTRA_LIBS)
 
756
   fi
 
757
 
 
758
   AC_CHECK_FUNC(remove)
 
759
   if test $ac_cv_func_remove = no; then
 
760
      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
 
761
   fi
 
762
 
 
763
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
 
764
   AC_CHECK_FUNC(shmat, ,
 
765
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
 
766
   
 
767
   # more headers that need to be explicitly included on darwin
 
768
   AC_CHECK_HEADERS(sys/types.h stdint.h)
 
769
 
 
770
   # sys/bitypes.h is needed for uint32_t and friends on Tru64
 
771
   AC_CHECK_HEADERS(sys/bitypes.h)
 
772
 
 
773
   # darwin requires a poll emulation library
 
774
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
 
775
 
 
776
   # for some image handling on Mac OS X
 
777
   AC_CHECK_HEADERS(Carbon/Carbon.h)
 
778
 
 
779
   # CoreAudio framework
 
780
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
 
781
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
 
782
     FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
 
783
   ])
 
784
 
 
785
   AC_CHECK_RES_INIT
 
786
   AC_SUBST(LIB_POLL)
 
787
   AC_SUBST(FRAMEWORK_COREAUDIO)
 
788
   LIBSOCKET="$X_EXTRA_LIBS"
 
789
   AC_SUBST(LIBSOCKET)
 
790
   AC_SUBST(X_EXTRA_LIBS)
 
791
   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
 
792
   AC_SUBST(LIBUCB)
 
793
 
 
794
   case $host in  dnl this *is* LynxOS specific
 
795
   *-*-lynxos* )
 
796
        AC_MSG_CHECKING([LynxOS header file wrappers])
 
797
        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
 
798
        AC_MSG_RESULT(disabled)
 
799
        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
 
800
         ;;
 
801
    esac
 
802
 
 
803
   KDE_CHECK_TYPES
 
804
   KDE_CHECK_LIBDL
 
805
   KDE_CHECK_STRLCPY
 
806
 
 
807
# darwin needs this to initialize the environment
 
808
AC_CHECK_HEADERS(crt_externs.h)
 
809
AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
 
810
 
 
811
AH_VERBATIM(_DARWIN_ENVIRON,
 
812
[
 
813
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
 
814
# include <sys/time.h>
 
815
# include <crt_externs.h>
 
816
# define environ (*_NSGetEnviron())
 
817
#endif
 
818
])
 
819
 
 
820
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
 
821
[
 
822
/*
 
823
 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
 
824
 * that defines bzero.
 
825
 */
 
826
 
 
827
#if defined(_AIX)
 
828
#include <strings.h>
 
829
#endif
 
830
])
 
831
 
 
832
AC_CHECK_FUNCS([vsnprintf snprintf])
 
833
 
 
834
AH_VERBATIM(_TRU64,[
 
835
/*
 
836
 * On HP-UX, the declaration of vsnprintf() is needed every time !
 
837
 */
 
838
 
 
839
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
 
840
#if __STDC__
 
841
#include <stdarg.h>
 
842
#include <stdlib.h>
 
843
#else
 
844
#include <varargs.h>
 
845
#endif
 
846
#ifdef __cplusplus
 
847
extern "C"
 
848
#endif
 
849
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
 
850
#ifdef __cplusplus
 
851
extern "C"
 
852
#endif
 
853
int snprintf(char *str, size_t n, char const *fmt, ...);
 
854
#endif
 
855
])
 
856
 
 
857
])
 
858
 
 
859
dnl ------------------------------------------------------------------------
 
860
dnl Find the header files and libraries for X-Windows. Extended the
 
861
dnl macro AC_PATH_X
 
862
dnl ------------------------------------------------------------------------
 
863
dnl
 
864
AC_DEFUN([K_PATH_X],
 
865
[
 
866
AC_REQUIRE([KDE_MISC_TESTS])dnl
 
867
AC_REQUIRE([KDE_CHECK_LIB64])
 
868
 
 
869
AC_ARG_ENABLE(
 
870
  embedded,
 
871
  AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
 
872
  kde_use_qt_emb=$enableval,
 
873
  kde_use_qt_emb=no
 
874
)
 
875
 
 
876
AC_ARG_ENABLE(
 
877
  qtopia,
 
878
  AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
 
879
  kde_use_qt_emb_palm=$enableval,
 
880
  kde_use_qt_emb_palm=no
 
881
)
 
882
 
 
883
AC_ARG_ENABLE(
 
884
  mac,
 
885
  AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
 
886
  kde_use_qt_mac=$enableval,
 
887
  kde_use_qt_mac=no
 
888
)
 
889
 
 
890
# used to disable x11-specific stuff on special platforms
 
891
AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
 
892
 
 
893
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
 
894
 
 
895
AC_MSG_CHECKING(for X)
 
896
 
 
897
AC_CACHE_VAL(kde_cv_have_x,
 
898
[# One or both of the vars are not set, and there is no cached value.
 
899
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
 
900
   kde_x_includes=NO
 
901
else
 
902
   kde_x_includes=$x_includes
 
903
fi
 
904
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
 
905
   kde_x_libraries=NO
 
906
else
 
907
   kde_x_libraries=$x_libraries
 
908
fi
 
909
 
 
910
# below we use the standard autoconf calls
 
911
ac_x_libraries=$kde_x_libraries
 
912
ac_x_includes=$kde_x_includes
 
913
 
 
914
KDE_PATH_X_DIRECT
 
915
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
 
916
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
 
917
dnl location. The correct location is /usr/lib32 or an undefined value
 
918
dnl (the linker is smart enough to pick the correct default library).
 
919
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
 
920
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
 
921
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
 
922
dnl x_includes should be left alone.
 
923
case "$host" in
 
924
mips-sgi-irix6*)
 
925
  ;;
 
926
*-*-solaris*)
 
927
  ;;
 
928
*)
 
929
  _AC_PATH_X_XMKMF
 
930
  if test -z "$ac_x_includes"; then
 
931
    ac_x_includes="."
 
932
  fi
 
933
  if test -z "$ac_x_libraries"; then
 
934
    ac_x_libraries="/usr/lib${kdelibsuff}"
 
935
  fi
 
936
esac
 
937
#from now on we use our own again
 
938
 
 
939
# when the user already gave --x-includes, we ignore
 
940
# what the standard autoconf macros told us.
 
941
if test "$kde_x_includes" = NO; then
 
942
  kde_x_includes=$ac_x_includes
 
943
fi
 
944
 
 
945
# for --x-libraries too
 
946
if test "$kde_x_libraries" = NO; then
 
947
  kde_x_libraries=$ac_x_libraries
 
948
fi
 
949
 
 
950
if test "$kde_x_includes" = NO; then
 
951
  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
 
952
fi
 
953
 
 
954
if test "$kde_x_libraries" = NO; then
 
955
  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
 
956
fi
 
957
 
 
958
# Record where we found X for the cache.
 
959
kde_cv_have_x="have_x=yes \
 
960
         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
 
961
])dnl
 
962
 
 
963
eval "$kde_cv_have_x"
 
964
 
 
965
if test "$have_x" != yes; then
 
966
  AC_MSG_RESULT($have_x)
 
967
  no_x=yes
 
968
else
 
969
  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
 
970
fi
 
971
 
 
972
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
 
973
  X_INCLUDES=""
 
974
  x_includes="."; dnl better than nothing :-
 
975
 else
 
976
  x_includes=$kde_x_includes
 
977
  X_INCLUDES="-I$x_includes"
 
978
fi
 
979
 
 
980
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
 
981
  X_LDFLAGS=""
 
982
  x_libraries="/usr/lib"; dnl better than nothing :-
 
983
 else
 
984
  x_libraries=$kde_x_libraries
 
985
  X_LDFLAGS="-L$x_libraries"
 
986
fi
 
987
all_includes="$X_INCLUDES"
 
988
all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
 
989
 
 
990
# Check for libraries that X11R6 Xt/Xaw programs need.
 
991
ac_save_LDFLAGS="$LDFLAGS"
 
992
LDFLAGS="$LDFLAGS $X_LDFLAGS"
 
993
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
 
994
# check for ICE first), but we must link in the order -lSM -lICE or
 
995
# we get undefined symbols.  So assume we have SM if we have ICE.
 
996
# These have to be linked with before -lX11, unlike the other
 
997
# libraries we check for below, so use a different variable.
 
998
#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
 
999
AC_CHECK_LIB(ICE, IceConnectionNumber,
 
1000
  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
 
1001
LDFLAGS="$ac_save_LDFLAGS"
 
1002
 
 
1003
LIB_X11='-lX11 $(LIBSOCKET)'
 
1004
 
 
1005
AC_MSG_CHECKING(for libXext)
 
1006
AC_CACHE_VAL(kde_cv_have_libXext,
 
1007
[
 
1008
kde_ldflags_safe="$LDFLAGS"
 
1009
kde_libs_safe="$LIBS"
 
1010
 
 
1011
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
 
1012
LIBS="-lXext -lX11 $LIBSOCKET"
 
1013
 
 
1014
AC_TRY_LINK([
 
1015
#include <stdio.h>
 
1016
#ifdef STDC_HEADERS
 
1017
# include <stdlib.h>
 
1018
#endif
 
1019
],
 
1020
[
 
1021
printf("hello Xext\n");
 
1022
],
 
1023
kde_cv_have_libXext=yes,
 
1024
kde_cv_have_libXext=no
 
1025
)
 
1026
 
 
1027
LDFLAGS=$kde_ldflags_safe
 
1028
LIBS=$kde_libs_safe
 
1029
])
 
1030
 
 
1031
AC_MSG_RESULT($kde_cv_have_libXext)
 
1032
 
 
1033
if test "$kde_cv_have_libXext" = "no"; then
 
1034
  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
 
1035
can't find it itself, we stop here assuming that make wouldn't find
 
1036
them either.])
 
1037
fi
 
1038
 
 
1039
LIB_XEXT="-lXext"
 
1040
QTE_NORTTI=""
 
1041
 
 
1042
elif test "$kde_use_qt_emb" = "yes"; then
 
1043
  dnl We're using QT Embedded
 
1044
  CPPFLAGS=-DQWS
 
1045
  CXXFLAGS="$CXXFLAGS -fno-rtti"
 
1046
  QTE_NORTTI="-fno-rtti -DQWS"
 
1047
  X_PRE_LIBS=""
 
1048
  LIB_X11=""
 
1049
  LIB_XEXT=""
 
1050
  LIB_XRENDER=""
 
1051
  LIBSM=""
 
1052
  X_INCLUDES=""
 
1053
  X_LDFLAGS=""
 
1054
  x_includes=""
 
1055
  x_libraries=""
 
1056
elif test "$kde_use_qt_mac" = "yes"; then
 
1057
  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
 
1058
  dnl be included to get the information) --Sam
 
1059
  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
 
1060
  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
 
1061
  X_PRE_LIBS=""
 
1062
  LIB_X11=""
 
1063
  LIB_XEXT=""
 
1064
  LIB_XRENDER=""
 
1065
  LIBSM=""
 
1066
  X_INCLUDES=""
 
1067
  X_LDFLAGS=""
 
1068
  x_includes=""
 
1069
  x_libraries=""
 
1070
fi
 
1071
AC_SUBST(X_PRE_LIBS)
 
1072
AC_SUBST(LIB_X11)
 
1073
AC_SUBST(LIB_XRENDER)
 
1074
AC_SUBST(LIBSM)
 
1075
AC_SUBST(X_INCLUDES)
 
1076
AC_SUBST(X_LDFLAGS)
 
1077
AC_SUBST(x_includes)
 
1078
AC_SUBST(x_libraries)
 
1079
AC_SUBST(QTE_NORTTI)
 
1080
AC_SUBST(LIB_XEXT)
 
1081
 
 
1082
])
 
1083
 
 
1084
AC_DEFUN([KDE_PRINT_QT_PROGRAM],
 
1085
[
 
1086
AC_REQUIRE([KDE_USE_QT])
 
1087
cat > conftest.$ac_ext <<EOF
 
1088
#include "confdefs.h"
 
1089
#include <qglobal.h>
 
1090
#include <qapplication.h>
 
1091
EOF
 
1092
if test "$kde_qtver" = "2"; then
 
1093
cat >> conftest.$ac_ext <<EOF
 
1094
#include <qevent.h>
 
1095
#include <qstring.h>
 
1096
#include <qstyle.h>
 
1097
EOF
 
1098
 
 
1099
if test $kde_qtsubver -gt 0; then
 
1100
cat >> conftest.$ac_ext <<EOF
 
1101
#if QT_VERSION < 210
 
1102
#error 1
 
1103
#endif
 
1104
EOF
 
1105
fi
 
1106
fi
 
1107
 
 
1108
if test "$kde_qtver" = "3"; then
 
1109
cat >> conftest.$ac_ext <<EOF
 
1110
#include <qcursor.h>
 
1111
#include <qstylefactory.h>
 
1112
#include <private/qucomextra_p.h>
 
1113
EOF
 
1114
fi
 
1115
 
 
1116
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
 
1117
cat >> conftest.$ac_ext <<EOF
 
1118
#error 1
 
1119
#endif
 
1120
 
 
1121
int main() {
 
1122
EOF
 
1123
if test "$kde_qtver" = "2"; then
 
1124
cat >> conftest.$ac_ext <<EOF
 
1125
    QStringList *t = new QStringList();
 
1126
    Q_UNUSED(t);
 
1127
EOF
 
1128
if test $kde_qtsubver -gt 0; then
 
1129
cat >> conftest.$ac_ext <<EOF
 
1130
    QString s;
 
1131
    s.setLatin1("Elvis is alive", 14);
 
1132
EOF
 
1133
fi
 
1134
fi
 
1135
if test "$kde_qtver" = "3"; then
 
1136
cat >> conftest.$ac_ext <<EOF
 
1137
    (void)QStyleFactory::create(QString::null);
 
1138
    QCursor c(Qt::WhatsThisCursor);
 
1139
EOF
 
1140
fi
 
1141
cat >> conftest.$ac_ext <<EOF
 
1142
    return 0;
 
1143
}
 
1144
EOF
 
1145
])
 
1146
 
 
1147
AC_DEFUN([KDE_USE_QT],
 
1148
[
 
1149
if test -z "$1"; then
 
1150
  # Current default Qt version: 3.3
 
1151
  kde_qtver=3
 
1152
  kde_qtsubver=3
 
1153
else
 
1154
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
 
1155
  # following is the check if subversion isnt found in passed argument
 
1156
  if test "$kde_qtsubver" = "$1"; then
 
1157
    kde_qtsubver=1
 
1158
  fi
 
1159
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
 
1160
  if test "$kde_qtver" = "1"; then
 
1161
    kde_qtsubver=42
 
1162
  fi
 
1163
fi
 
1164
 
 
1165
if test -z "$2"; then
 
1166
  if test "$kde_qtver" = "2"; then
 
1167
    if test $kde_qtsubver -gt 0; then
 
1168
      kde_qt_minversion=">= Qt 2.2.2"
 
1169
    else
 
1170
      kde_qt_minversion=">= Qt 2.0.2"
 
1171
    fi
 
1172
  fi
 
1173
  if test "$kde_qtver" = "3"; then
 
1174
    if test $kde_qtsubver -gt 0; then
 
1175
         if test $kde_qtsubver -gt 1; then
 
1176
            if test $kde_qtsubver -gt 2; then
 
1177
                kde_qt_minversion=">= Qt 3.3"
 
1178
            else
 
1179
                kde_qt_minversion=">= Qt 3.2"
 
1180
            fi
 
1181
         else
 
1182
            kde_qt_minversion=">= Qt 3.1 (20021021)"
 
1183
         fi
 
1184
    else
 
1185
      kde_qt_minversion=">= Qt 3.0"
 
1186
    fi
 
1187
  fi
 
1188
  if test "$kde_qtver" = "1"; then
 
1189
    kde_qt_minversion=">= 1.42 and < 2.0"
 
1190
  fi
 
1191
else
 
1192
   kde_qt_minversion="$2"
 
1193
fi
 
1194
 
 
1195
if test -z "$3"; then
 
1196
   if test $kde_qtver = 3; then
 
1197
     if test $kde_qtsubver -gt 0; then
 
1198
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
 
1199
       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
 
1200
       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
 
1201
     else
 
1202
       kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
 
1203
     fi
 
1204
   fi
 
1205
   if test $kde_qtver = 2; then
 
1206
     if test $kde_qtsubver -gt 0; then
 
1207
       kde_qt_verstring="QT_VERSION >= 222"
 
1208
     else
 
1209
       kde_qt_verstring="QT_VERSION >= 200"
 
1210
     fi
 
1211
   fi
 
1212
   if test $kde_qtver = 1; then
 
1213
    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
 
1214
   fi
 
1215
else
 
1216
   kde_qt_verstring="$3"
 
1217
fi
 
1218
 
 
1219
if test $kde_qtver = 3; then
 
1220
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
 
1221
fi
 
1222
if test $kde_qtver = 2; then
 
1223
   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
 
1224
fi
 
1225
if test $kde_qtver = 1; then
 
1226
   kde_qt_dirs="$QTDIR /usr/lib/qt"
 
1227
fi
 
1228
])
 
1229
 
 
1230
AC_DEFUN([KDE_CHECK_QT_DIRECT],
 
1231
[
 
1232
AC_REQUIRE([KDE_USE_QT])
 
1233
AC_MSG_CHECKING([if Qt compiles without flags])
 
1234
AC_CACHE_VAL(kde_cv_qt_direct,
 
1235
[
 
1236
AC_LANG_SAVE
 
1237
AC_LANG_CPLUSPLUS
 
1238
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
 
1239
ac_LIBRARY_PATH="$LIBRARY_PATH"
 
1240
ac_cxxflags_safe="$CXXFLAGS"
 
1241
ac_ldflags_safe="$LDFLAGS"
 
1242
ac_libs_safe="$LIBS"
 
1243
 
 
1244
CXXFLAGS="$CXXFLAGS -I$qt_includes"
 
1245
LDFLAGS="$LDFLAGS $X_LDFLAGS"
 
1246
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1247
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
 
1248
else
 
1249
LIBS="$LIBQT $LIBSOCKET"
 
1250
fi
 
1251
LD_LIBRARY_PATH=
 
1252
export LD_LIBRARY_PATH
 
1253
LIBRARY_PATH=
 
1254
export LIBRARY_PATH
 
1255
 
 
1256
KDE_PRINT_QT_PROGRAM
 
1257
 
 
1258
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
1259
  kde_cv_qt_direct="yes"
 
1260
else
 
1261
  kde_cv_qt_direct="no"
 
1262
  echo "configure: failed program was:" >&AC_FD_CC
 
1263
  cat conftest.$ac_ext >&AC_FD_CC
 
1264
fi
 
1265
 
 
1266
rm -f conftest*
 
1267
CXXFLAGS="$ac_cxxflags_safe"
 
1268
LDFLAGS="$ac_ldflags_safe"
 
1269
LIBS="$ac_libs_safe"
 
1270
 
 
1271
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
 
1272
export LD_LIBRARY_PATH
 
1273
LIBRARY_PATH="$ac_LIBRARY_PATH"
 
1274
export LIBRARY_PATH
 
1275
AC_LANG_RESTORE
 
1276
])
 
1277
 
 
1278
if test "$kde_cv_qt_direct" = "yes"; then
 
1279
  AC_MSG_RESULT(yes)
 
1280
  $1
 
1281
else
 
1282
  AC_MSG_RESULT(no)
 
1283
  $2
 
1284
fi
 
1285
])
 
1286
 
 
1287
dnl ------------------------------------------------------------------------
 
1288
dnl Try to find the Qt headers and libraries.
 
1289
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
 
1290
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
 
1291
dnl ------------------------------------------------------------------------
 
1292
dnl
 
1293
AC_DEFUN([AC_PATH_QT_1_3],
 
1294
[
 
1295
AC_REQUIRE([K_PATH_X])
 
1296
AC_REQUIRE([KDE_USE_QT])
 
1297
AC_REQUIRE([KDE_CHECK_LIB64])
 
1298
 
 
1299
dnl ------------------------------------------------------------------------
 
1300
dnl Add configure flag to enable linking to MT version of Qt library.
 
1301
dnl ------------------------------------------------------------------------
 
1302
 
 
1303
AC_ARG_ENABLE(
 
1304
  mt,
 
1305
  AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
 
1306
  kde_use_qt_mt=$enableval,
 
1307
  [
 
1308
    if test $kde_qtver = 3; then
 
1309
      kde_use_qt_mt=yes
 
1310
    else
 
1311
      kde_use_qt_mt=no
 
1312
    fi
 
1313
  ]
 
1314
)
 
1315
 
 
1316
USING_QT_MT=""
 
1317
 
 
1318
dnl ------------------------------------------------------------------------
 
1319
dnl If we not get --disable-qt-mt then adjust some vars for the host.
 
1320
dnl ------------------------------------------------------------------------
 
1321
 
 
1322
KDE_MT_LDFLAGS=
 
1323
KDE_MT_LIBS=
 
1324
if test "x$kde_use_qt_mt" = "xyes"; then
 
1325
  KDE_CHECK_THREADING
 
1326
  if test "x$kde_use_threading" = "xyes"; then
 
1327
    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
 
1328
    KDE_MT_LDFLAGS="$USE_THREADS"
 
1329
    KDE_MT_LIBS="$LIBPTHREAD"
 
1330
  else
 
1331
    kde_use_qt_mt=no
 
1332
  fi
 
1333
fi
 
1334
AC_SUBST(KDE_MT_LDFLAGS)
 
1335
AC_SUBST(KDE_MT_LIBS)
 
1336
 
 
1337
kde_qt_was_given=yes
 
1338
 
 
1339
dnl ------------------------------------------------------------------------
 
1340
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
 
1341
dnl ------------------------------------------------------------------------
 
1342
if test -z "$LIBQT_GLOB"; then
 
1343
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1344
    LIBQT_GLOB="libqte.*"
 
1345
  else
 
1346
    LIBQT_GLOB="libqt.*"
 
1347
  fi
 
1348
fi
 
1349
 
 
1350
if test -z "$LIBQT"; then
 
1351
dnl ------------------------------------------------------------
 
1352
dnl If we got --enable-embedded then adjust the Qt library name.
 
1353
dnl ------------------------------------------------------------
 
1354
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1355
    qtlib="qte"
 
1356
  else
 
1357
    qtlib="qt"
 
1358
  fi
 
1359
 
 
1360
  kde_int_qt="-l$qtlib"
 
1361
else
 
1362
  kde_int_qt="$LIBQT"
 
1363
  kde_lib_qt_set=yes
 
1364
fi
 
1365
 
 
1366
if test -z "$LIBQPE"; then
 
1367
dnl ------------------------------------------------------------
 
1368
dnl If we got --enable-palmtop then add -lqpe to the link line
 
1369
dnl ------------------------------------------------------------
 
1370
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1371
    if test "x$kde_use_qt_emb_palm" = "xyes"; then
 
1372
      LIB_QPE="-lqpe"
 
1373
    else
 
1374
      LIB_QPE=""
 
1375
    fi
 
1376
  else
 
1377
    LIB_QPE=""
 
1378
  fi
 
1379
fi
 
1380
 
 
1381
dnl ------------------------------------------------------------------------
 
1382
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
 
1383
dnl ------------------------------------------------------------------------
 
1384
 
 
1385
if test "x$kde_use_qt_mt" = "xyes"; then
 
1386
  if test -z "$LIBQT"; then
 
1387
    LIBQT="-l$qtlib-mt"
 
1388
    kde_int_qt="-l$qtlib-mt"
 
1389
  else
 
1390
    LIBQT="$qtlib-mt"
 
1391
    kde_int_qt="$qtlib-mt"
 
1392
  fi
 
1393
  LIBQT_GLOB="lib$qtlib-mt.*"
 
1394
  USING_QT_MT="using -mt"
 
1395
else
 
1396
  LIBQT="-l$qtlib"
 
1397
fi
 
1398
 
 
1399
if test $kde_qtver != 1; then
 
1400
 
 
1401
  AC_REQUIRE([AC_FIND_PNG])
 
1402
  AC_REQUIRE([AC_FIND_JPEG])
 
1403
  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
 
1404
fi
 
1405
 
 
1406
if test $kde_qtver = 3; then
 
1407
  AC_REQUIRE([KDE_CHECK_LIBDL])
 
1408
  LIBQT="$LIBQT $LIBDL"
 
1409
fi
 
1410
 
 
1411
AC_MSG_CHECKING([for Qt])
 
1412
 
 
1413
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1414
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
 
1415
fi
 
1416
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
 
1417
qt_libraries=""
 
1418
qt_includes=""
 
1419
AC_ARG_WITH(qt-dir,
 
1420
    AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
 
1421
    [  ac_qt_includes="$withval"/include
 
1422
       ac_qt_libraries="$withval"/lib${kdelibsuff}
 
1423
       ac_qt_bindir="$withval"/bin
 
1424
    ])
 
1425
 
 
1426
AC_ARG_WITH(qt-includes,
 
1427
    AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
 
1428
    [
 
1429
       ac_qt_includes="$withval"
 
1430
    ])
 
1431
 
 
1432
kde_qt_libs_given=no
 
1433
 
 
1434
AC_ARG_WITH(qt-libraries,
 
1435
    AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
 
1436
    [  ac_qt_libraries="$withval"
 
1437
       kde_qt_libs_given=yes
 
1438
    ])
 
1439
 
 
1440
AC_CACHE_VAL(ac_cv_have_qt,
 
1441
[#try to guess Qt locations
 
1442
 
 
1443
qt_incdirs=""
 
1444
for dir in $kde_qt_dirs; do
 
1445
   qt_incdirs="$qt_incdirs $dir/include $dir"
 
1446
done
 
1447
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
 
1448
if test ! "$ac_qt_includes" = "NO"; then
 
1449
   qt_incdirs="$ac_qt_includes $qt_incdirs"
 
1450
fi
 
1451
 
 
1452
if test "$kde_qtver" != "1"; then
 
1453
  kde_qt_header=qstyle.h
 
1454
else
 
1455
  kde_qt_header=qglobal.h
 
1456
fi
 
1457
 
 
1458
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
 
1459
ac_qt_includes="$qt_incdir"
 
1460
 
 
1461
qt_libdirs=""
 
1462
for dir in $kde_qt_dirs; do
 
1463
   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
 
1464
done
 
1465
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
 
1466
if test ! "$ac_qt_libraries" = "NO"; then
 
1467
  qt_libdir=$ac_qt_libraries
 
1468
else
 
1469
  qt_libdirs="$ac_qt_libraries $qt_libdirs"
 
1470
  # if the Qt was given, the chance is too big that libqt.* doesn't exist
 
1471
  qt_libdir=NONE
 
1472
  for dir in $qt_libdirs; do
 
1473
    try="ls -1 $dir/${LIBQT_GLOB}"
 
1474
    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
1475
  done
 
1476
fi
 
1477
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
 
1478
  if test -e "$a"; then
 
1479
    LIBQT="$LIBQT ${kde_int_qt}_incremental"
 
1480
    break
 
1481
  fi
 
1482
done
 
1483
 
 
1484
ac_qt_libraries="$qt_libdir"
 
1485
 
 
1486
AC_LANG_SAVE
 
1487
AC_LANG_CPLUSPLUS
 
1488
 
 
1489
ac_cxxflags_safe="$CXXFLAGS"
 
1490
ac_ldflags_safe="$LDFLAGS"
 
1491
ac_libs_safe="$LIBS"
 
1492
 
 
1493
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
 
1494
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
 
1495
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
 
1496
 
 
1497
KDE_PRINT_QT_PROGRAM
 
1498
 
 
1499
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
1500
  rm -f conftest*
 
1501
else
 
1502
  echo "configure: failed program was:" >&AC_FD_CC
 
1503
  cat conftest.$ac_ext >&AC_FD_CC
 
1504
  ac_qt_libraries="NO"
 
1505
fi
 
1506
rm -f conftest*
 
1507
CXXFLAGS="$ac_cxxflags_safe"
 
1508
LDFLAGS="$ac_ldflags_safe"
 
1509
LIBS="$ac_libs_safe"
 
1510
 
 
1511
AC_LANG_RESTORE
 
1512
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
 
1513
  ac_cv_have_qt="have_qt=no"
 
1514
  ac_qt_notfound=""
 
1515
  missing_qt_mt=""
 
1516
  if test "$ac_qt_includes" = NO; then
 
1517
    if test "$ac_qt_libraries" = NO; then
 
1518
      ac_qt_notfound="(headers and libraries)";
 
1519
    else
 
1520
      ac_qt_notfound="(headers)";
 
1521
    fi
 
1522
  else
 
1523
    if test "x$kde_use_qt_mt" = "xyes"; then
 
1524
       missing_qt_mt="
 
1525
Make sure that you have compiled Qt with thread support!"
 
1526
       ac_qt_notfound="(library $qtlib-mt)";
 
1527
    else
 
1528
       ac_qt_notfound="(library $qtlib)";
 
1529
    fi
 
1530
  fi
 
1531
 
 
1532
  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
 
1533
For more details about this problem, look at the end of config.log.$missing_qt_mt])
 
1534
else
 
1535
  have_qt="yes"
 
1536
fi
 
1537
])
 
1538
 
 
1539
eval "$ac_cv_have_qt"
 
1540
 
 
1541
if test "$have_qt" != yes; then
 
1542
  AC_MSG_RESULT([$have_qt]);
 
1543
else
 
1544
  ac_cv_have_qt="have_qt=yes \
 
1545
    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
 
1546
  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
 
1547
 
 
1548
  qt_libraries="$ac_qt_libraries"
 
1549
  qt_includes="$ac_qt_includes"
 
1550
fi
 
1551
 
 
1552
if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
 
1553
     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
 
1554
fi
 
1555
 
 
1556
AC_SUBST(qt_libraries)
 
1557
AC_SUBST(qt_includes)
 
1558
 
 
1559
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
 
1560
 QT_INCLUDES=""
 
1561
else
 
1562
 QT_INCLUDES="-I$qt_includes"
 
1563
 all_includes="$QT_INCLUDES $all_includes"
 
1564
fi
 
1565
 
 
1566
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
 
1567
 QT_LDFLAGS=""
 
1568
else
 
1569
 QT_LDFLAGS="-L$qt_libraries"
 
1570
 all_libraries="$QT_LDFLAGS $all_libraries"
 
1571
fi
 
1572
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
 
1573
 
 
1574
AC_SUBST(QT_INCLUDES)
 
1575
AC_SUBST(QT_LDFLAGS)
 
1576
AC_PATH_QT_MOC_UIC
 
1577
 
 
1578
KDE_CHECK_QT_JPEG
 
1579
 
 
1580
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1581
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
 
1582
else
 
1583
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
 
1584
fi
 
1585
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
 
1586
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
 
1587
  if test -e "$a"; then
 
1588
     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
 
1589
     break
 
1590
  fi
 
1591
done
 
1592
 
 
1593
AC_SUBST(LIB_QT)
 
1594
AC_SUBST(LIB_QPE)
 
1595
 
 
1596
AC_SUBST(kde_qtver)
 
1597
])
 
1598
 
 
1599
AC_DEFUN([AC_PATH_QT],
 
1600
[
 
1601
AC_PATH_QT_1_3
 
1602
])
 
1603
 
 
1604
AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
 
1605
[
 
1606
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
 
1607
 
 
1608
if test x$ac_uic_supports_libpath = xyes; then
 
1609
 
 
1610
AC_MSG_CHECKING([if UIC has KDE plugins available])
 
1611
AC_CACHE_VAL(kde_cv_uic_plugins,
 
1612
[
 
1613
cat > actest.ui << EOF
 
1614
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
 
1615
<class>NewConnectionDialog</class>
 
1616
<widget class="QDialog">
 
1617
   <widget class="KLineEdit">
 
1618
        <property name="name">
 
1619
           <cstring>testInput</cstring>
 
1620
        </property>
 
1621
   </widget>
 
1622
</widget>
 
1623
</UI>
 
1624
EOF
 
1625
       
 
1626
 
 
1627
 
 
1628
kde_cv_uic_plugins=no
 
1629
kde_line="$UIC_PATH -L $kde_widgetdir"
 
1630
if test x$ac_uic_supports_nounload = xyes; then
 
1631
   kde_line="$kde_line -nounload"
 
1632
fi
 
1633
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
 
1634
if AC_TRY_EVAL(kde_line); then
 
1635
        # if you're trying to debug this check and think it's incorrect,
 
1636
        # better check your installation. The check _is_ correct - your
 
1637
        # installation is not.
 
1638
        if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
 
1639
                kde_cv_uic_plugins=yes
 
1640
        fi
 
1641
fi
 
1642
rm -f actest.ui actest.cpp
 
1643
])
 
1644
 
 
1645
AC_MSG_RESULT([$kde_cv_uic_plugins])
 
1646
if test "$kde_cv_uic_plugins" != yes; then
 
1647
        AC_MSG_ERROR([
 
1648
you need to install kdelibs first.
 
1649
 
 
1650
If you did install kdelibs, then the Qt version that is picked up by
 
1651
this configure is not the same version you used to compile kdelibs. 
 
1652
The Qt Plugin installed by kdelibs is *ONLY* loadable if its the 
 
1653
same Qt version, compiled with the same compiler and the same Qt
 
1654
configuration settings.
 
1655
])
 
1656
fi
 
1657
fi
 
1658
])
 
1659
 
 
1660
AC_DEFUN([KDE_CHECK_FINAL],
 
1661
[
 
1662
  AC_ARG_ENABLE(final,
 
1663
        AC_HELP_STRING([--enable-final],
 
1664
                       [build size optimized apps (experimental - needs lots of memory)]),
 
1665
        kde_use_final=$enableval, kde_use_final=no)
 
1666
 
 
1667
  if test "x$kde_use_final" = "xyes"; then
 
1668
      KDE_USE_FINAL_TRUE=""
 
1669
      KDE_USE_FINAL_FALSE="#"
 
1670
   else
 
1671
      KDE_USE_FINAL_TRUE="#"
 
1672
      KDE_USE_FINAL_FALSE=""
 
1673
  fi
 
1674
  AC_SUBST(KDE_USE_FINAL_TRUE)
 
1675
  AC_SUBST(KDE_USE_FINAL_FALSE)
 
1676
])
 
1677
 
 
1678
AC_DEFUN([KDE_CHECK_CLOSURE],
 
1679
[
 
1680
  AC_ARG_ENABLE(closure,
 
1681
                AC_HELP_STRING([--enable-closure],[delay template instantiation]),
 
1682
        kde_use_closure=$enableval, kde_use_closure=no)
 
1683
 
 
1684
  KDE_NO_UNDEFINED=""
 
1685
  if test "x$kde_use_closure" = "xyes"; then
 
1686
       KDE_USE_CLOSURE_TRUE=""
 
1687
       KDE_USE_CLOSURE_FALSE="#"
 
1688
#       CXXFLAGS="$CXXFLAGS $REPO"
 
1689
  else
 
1690
       KDE_USE_CLOSURE_TRUE="#"
 
1691
       KDE_USE_CLOSURE_FALSE=""
 
1692
       KDE_NO_UNDEFINED=""
 
1693
       case $host in 
 
1694
         *-*-linux-gnu)
 
1695
           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
 
1696
                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
 
1697
                [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
 
1698
                [KDE_NO_UNDEFINED=""])],
 
1699
            [KDE_NO_UNDEFINED=""])
 
1700
           ;;
 
1701
       esac
 
1702
  fi
 
1703
  AC_SUBST(KDE_USE_CLOSURE_TRUE)
 
1704
  AC_SUBST(KDE_USE_CLOSURE_FALSE)
 
1705
  AC_SUBST(KDE_NO_UNDEFINED)
 
1706
])
 
1707
 
 
1708
dnl Check if the linker supports --enable-new-dtags and --as-needed
 
1709
AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
 
1710
[
 
1711
  AC_ARG_ENABLE(new_ldflags,
 
1712
                AC_HELP_STRING([--enable-new-ldflags],
 
1713
                [enable the new linker flags]),
 
1714
        kde_use_new_ldflags=$enableval, 
 
1715
        kde_use_new_ldflags=no)
 
1716
 
 
1717
  LDFLAGS_AS_NEEDED=""
 
1718
  LDFLAGS_NEW_DTAGS=""
 
1719
  if test "x$kde_use_new_ldflags" = "xyes"; then
 
1720
       LDFLAGS_NEW_DTAGS=""
 
1721
       KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
 
1722
                [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
 
1723
 
 
1724
       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
 
1725
                [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
 
1726
  fi
 
1727
  AC_SUBST(LDFLAGS_AS_NEEDED)
 
1728
  AC_SUBST(LDFLAGS_NEW_DTAGS)
 
1729
])
 
1730
 
 
1731
AC_DEFUN([KDE_CHECK_NMCHECK],
 
1732
[
 
1733
  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
 
1734
        kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
 
1735
 
 
1736
  if test "$kde_use_nmcheck" = "yes"; then
 
1737
      KDE_USE_NMCHECK_TRUE=""
 
1738
      KDE_USE_NMCHECK_FALSE="#"
 
1739
   else
 
1740
      KDE_USE_NMCHECK_TRUE="#"
 
1741
      KDE_USE_NMCHECK_FALSE=""
 
1742
  fi
 
1743
  AC_SUBST(KDE_USE_NMCHECK_TRUE)
 
1744
  AC_SUBST(KDE_USE_NMCHECK_FALSE)
 
1745
])
 
1746
 
 
1747
AC_DEFUN([KDE_EXPAND_MAKEVAR], [
 
1748
savex=$exec_prefix
 
1749
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
1750
tmp=$$2
 
1751
while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
 
1752
exec_prefix=$savex
 
1753
])
 
1754
 
 
1755
dnl ------------------------------------------------------------------------
 
1756
dnl Now, the same with KDE
 
1757
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
 
1758
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
 
1759
dnl ------------------------------------------------------------------------
 
1760
dnl
 
1761
AC_DEFUN([AC_BASE_PATH_KDE],
 
1762
[
 
1763
AC_REQUIRE([KDE_CHECK_STL])
 
1764
AC_REQUIRE([AC_PATH_QT])dnl
 
1765
AC_REQUIRE([KDE_CHECK_LIB64])
 
1766
 
 
1767
AC_CHECK_RPATH
 
1768
AC_MSG_CHECKING([for KDE])
 
1769
 
 
1770
if test "${prefix}" != NONE; then
 
1771
  kde_includes=${includedir}
 
1772
  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
 
1773
 
 
1774
  kde_libraries=${libdir}
 
1775
  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
 
1776
 
 
1777
else
 
1778
  ac_kde_includes=
 
1779
  ac_kde_libraries=
 
1780
  kde_libraries=""
 
1781
  kde_includes=""
 
1782
fi
 
1783
 
 
1784
AC_CACHE_VAL(ac_cv_have_kde,
 
1785
[#try to guess kde locations
 
1786
 
 
1787
if test "$kde_qtver" = 1; then
 
1788
  kde_check_header="ksock.h"
 
1789
  kde_check_lib="libkdecore.la"
 
1790
else
 
1791
  kde_check_header="ksharedptr.h"
 
1792
  kde_check_lib="libkio.la"
 
1793
fi
 
1794
 
 
1795
if test -z "$1"; then
 
1796
 
 
1797
kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
 
1798
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
 
1799
kde_incdirs="$ac_kde_includes $kde_incdirs"
 
1800
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
 
1801
ac_kde_includes="$kde_incdir"
 
1802
 
 
1803
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
 
1804
  AC_MSG_ERROR([
 
1805
in the prefix, you've chosen, are no KDE headers installed. This will fail.
 
1806
So, check this please and use another prefix!])
 
1807
fi
 
1808
 
 
1809
kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
 
1810
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
 
1811
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
 
1812
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
 
1813
ac_kde_libraries="$kde_libdir"
 
1814
 
 
1815
kde_widgetdir=NO
 
1816
dnl this might be somewhere else
 
1817
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
 
1818
 
 
1819
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
 
1820
AC_MSG_ERROR([
 
1821
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
 
1822
So, check this please and use another prefix!])
 
1823
fi
 
1824
 
 
1825
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
 
1826
AC_MSG_ERROR([
 
1827
I can't find the designer plugins. These are required and should have been installed
 
1828
by kdelibs])
 
1829
fi
 
1830
 
 
1831
if test -n "$kde_widgetdir"; then
 
1832
    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
 
1833
fi
 
1834
 
 
1835
 
 
1836
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
 
1837
  ac_cv_have_kde="have_kde=no"
 
1838
else
 
1839
  ac_cv_have_kde="have_kde=yes \
 
1840
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
 
1841
fi
 
1842
 
 
1843
else dnl test -z $1, e.g. from kdelibs
 
1844
 
 
1845
  ac_cv_have_kde="have_kde=no"
 
1846
 
 
1847
fi
 
1848
])dnl
 
1849
 
 
1850
eval "$ac_cv_have_kde"
 
1851
 
 
1852
if test "$have_kde" != "yes"; then
 
1853
 if test "${prefix}" = NONE; then
 
1854
  ac_kde_prefix="$ac_default_prefix"
 
1855
 else
 
1856
  ac_kde_prefix="$prefix"
 
1857
 fi
 
1858
 if test "$exec_prefix" = NONE; then
 
1859
  ac_kde_exec_prefix="$ac_kde_prefix"
 
1860
  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
 
1861
 else
 
1862
  ac_kde_exec_prefix="$exec_prefix"
 
1863
  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
 
1864
 fi
 
1865
 
 
1866
 kde_libraries="${libdir}"
 
1867
 kde_includes="${includedir}"
 
1868
 
 
1869
else
 
1870
  ac_cv_have_kde="have_kde=yes \
 
1871
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
 
1872
  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
 
1873
 
 
1874
  kde_libraries="$ac_kde_libraries"
 
1875
  kde_includes="$ac_kde_includes"
 
1876
fi
 
1877
AC_SUBST(kde_libraries)
 
1878
AC_SUBST(kde_includes)
 
1879
 
 
1880
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
 
1881
 KDE_INCLUDES=""
 
1882
else
 
1883
 KDE_INCLUDES="-I$kde_includes"
 
1884
 all_includes="$KDE_INCLUDES $all_includes"
 
1885
fi
 
1886
 
 
1887
KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
 
1888
 
 
1889
KDE_LDFLAGS="-L$kde_libraries"
 
1890
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
 
1891
 all_libraries="$KDE_LDFLAGS $all_libraries"
 
1892
fi
 
1893
 
 
1894
AC_SUBST(KDE_LDFLAGS)
 
1895
AC_SUBST(KDE_INCLUDES)
 
1896
 
 
1897
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
1898
 
 
1899
all_libraries="$all_libraries $USER_LDFLAGS"
 
1900
all_includes="$all_includes $USER_INCLUDES"
 
1901
AC_SUBST(all_includes)
 
1902
AC_SUBST(all_libraries)
 
1903
 
 
1904
if test -z "$1"; then
 
1905
KDE_CHECK_UIC_PLUGINS
 
1906
fi
 
1907
 
 
1908
ac_kde_libraries="$kde_libdir"
 
1909
 
 
1910
AC_SUBST(AUTODIRS)
 
1911
 
 
1912
 
 
1913
])
 
1914
 
 
1915
AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
 
1916
[
 
1917
AC_MSG_CHECKING(for extra includes)
 
1918
AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
 
1919
  kde_use_extra_includes="$withval",
 
1920
  kde_use_extra_includes=NONE
 
1921
)
 
1922
kde_extra_includes=
 
1923
if test -n "$kde_use_extra_includes" && \
 
1924
   test "$kde_use_extra_includes" != "NONE"; then
 
1925
 
 
1926
   ac_save_ifs=$IFS
 
1927
   IFS=':'
 
1928
   for dir in $kde_use_extra_includes; do
 
1929
     kde_extra_includes="$kde_extra_includes $dir"
 
1930
     USER_INCLUDES="$USER_INCLUDES -I$dir"
 
1931
   done
 
1932
   IFS=$ac_save_ifs
 
1933
   kde_use_extra_includes="added"
 
1934
else
 
1935
   kde_use_extra_includes="no"
 
1936
fi
 
1937
AC_SUBST(USER_INCLUDES)
 
1938
 
 
1939
AC_MSG_RESULT($kde_use_extra_includes)
 
1940
 
 
1941
kde_extra_libs=
 
1942
AC_MSG_CHECKING(for extra libs)
 
1943
AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
 
1944
  kde_use_extra_libs=$withval,
 
1945
  kde_use_extra_libs=NONE
 
1946
)
 
1947
if test -n "$kde_use_extra_libs" && \
 
1948
   test "$kde_use_extra_libs" != "NONE"; then
 
1949
 
 
1950
   ac_save_ifs=$IFS
 
1951
   IFS=':'
 
1952
   for dir in $kde_use_extra_libs; do
 
1953
     kde_extra_libs="$kde_extra_libs $dir"
 
1954
     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
 
1955
     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
 
1956
   done
 
1957
   IFS=$ac_save_ifs
 
1958
   kde_use_extra_libs="added"
 
1959
else
 
1960
   kde_use_extra_libs="no"
 
1961
fi
 
1962
 
 
1963
AC_SUBST(USER_LDFLAGS)
 
1964
 
 
1965
AC_MSG_RESULT($kde_use_extra_libs)
 
1966
 
 
1967
])
 
1968
 
 
1969
AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
 
1970
[
 
1971
    AC_MSG_CHECKING([for KDE headers installed])
 
1972
    AC_LANG_SAVE
 
1973
    AC_LANG_CPLUSPLUS
 
1974
cat > conftest.$ac_ext <<EOF
 
1975
#ifdef STDC_HEADERS
 
1976
# include <stdlib.h>
 
1977
#endif
 
1978
#include <stdio.h>
 
1979
#include "confdefs.h"
 
1980
#include <kapp.h>
 
1981
 
 
1982
int main() {
 
1983
    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
 
1984
    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
 
1985
    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
 
1986
    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
 
1987
    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
 
1988
    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
 
1989
    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
 
1990
    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
 
1991
    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
 
1992
    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
 
1993
    printf("kde_wallpaperdir=\\"%s\\"\n",
 
1994
        KApplication::kde_wallpaperdir().data());
 
1995
    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
 
1996
    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
 
1997
    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
 
1998
    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
 
1999
    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
 
2000
    printf("kde_styledir=\\"/tmp/dummy\\"\n");
 
2001
    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
 
2002
    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
 
2003
    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
 
2004
    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
 
2005
    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
 
2006
    return 0;
 
2007
    }
 
2008
EOF
 
2009
 
 
2010
 ac_save_CPPFLAGS=$CPPFLAGS
 
2011
 CPPFLAGS="$all_includes $CPPFLAGS"
 
2012
 if AC_TRY_EVAL(ac_compile); then
 
2013
   AC_MSG_RESULT(yes)
 
2014
 else
 
2015
   AC_MSG_ERROR([your system is not able to compile a small KDE application!
 
2016
Check, if you installed the KDE header files correctly.
 
2017
For more details about this problem, look at the end of config.log.])
 
2018
  fi
 
2019
  CPPFLAGS=$ac_save_CPPFLAGS
 
2020
 
 
2021
  AC_LANG_RESTORE
 
2022
])
 
2023
 
 
2024
AC_DEFUN([KDE_CHECK_KDEQTADDON],
 
2025
[
 
2026
AC_MSG_CHECKING(for kde-qt-addon)
 
2027
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
 
2028
[
 
2029
 kde_ldflags_safe="$LDFLAGS"
 
2030
 kde_libs_safe="$LIBS"
 
2031
 kde_cxxflags_safe="$CXXFLAGS"
 
2032
 
 
2033
 LIBS="-lkde-qt-addon $LIBQT $LIBS"
 
2034
 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
 
2035
 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
 
2036
 
 
2037
 AC_TRY_LINK([
 
2038
   #include <qdom.h>
 
2039
 ],
 
2040
 [
 
2041
   QDomDocument doc;
 
2042
 ],
 
2043
  kde_cv_have_kdeqtaddon=yes,
 
2044
  kde_cv_have_kdeqtaddon=no
 
2045
 )
 
2046
 
 
2047
 LDFLAGS=$kde_ldflags_safe
 
2048
 LIBS=$kde_libs_safe
 
2049
 CXXFLAGS=$kde_cxxflags_safe
 
2050
])
 
2051
 
 
2052
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
 
2053
 
 
2054
if test "$kde_cv_have_kdeqtaddon" = "no"; then
 
2055
  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
 
2056
It is a separate package (and CVS module) named kde-qt-addon.])
 
2057
fi
 
2058
])
 
2059
 
 
2060
AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
 
2061
[
 
2062
   AC_REQUIRE([KDE_MISC_TESTS])
 
2063
   AC_REQUIRE([KDE_CHECK_LIBDL])
 
2064
   AC_REQUIRE([K_PATH_X])
 
2065
 
 
2066
if test $kde_qtver = 3; then
 
2067
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
2068
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
2069
   AC_SUBST(LIB_KIO, "-lkio")
 
2070
   AC_SUBST(LIB_KJS, "-lkjs")
 
2071
   AC_SUBST(LIB_SMB, "-lsmb")
 
2072
   AC_SUBST(LIB_KAB, "-lkab")
 
2073
   AC_SUBST(LIB_KABC, "-lkabc")
 
2074
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
2075
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
2076
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
2077
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
 
2078
   AC_SUBST(LIB_KUTILS, "-lkutils")
 
2079
   AC_SUBST(LIB_KDEPIM, "-lkdepim")
 
2080
   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
 
2081
   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
 
2082
   AC_SUBST(LIB_KDNSSD, "-lkdnssd")
 
2083
# these are for backward compatibility
 
2084
   AC_SUBST(LIB_KSYCOCA, "-lkio")
 
2085
   AC_SUBST(LIB_KFILE, "-lkio")
 
2086
elif test $kde_qtver = 2; then
 
2087
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
2088
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
2089
   AC_SUBST(LIB_KIO, "-lkio")
 
2090
   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
 
2091
   AC_SUBST(LIB_SMB, "-lsmb")
 
2092
   AC_SUBST(LIB_KFILE, "-lkfile")
 
2093
   AC_SUBST(LIB_KAB, "-lkab")
 
2094
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
2095
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
2096
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
2097
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
 
2098
else
 
2099
   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
 
2100
   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
 
2101
   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
 
2102
   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
 
2103
   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
 
2104
fi
 
2105
])
 
2106
 
 
2107
AC_DEFUN([AC_PATH_KDE],
 
2108
[
 
2109
  AC_BASE_PATH_KDE
 
2110
  AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
 
2111
  [
 
2112
  if test "$enableval" = "no";
 
2113
    then ac_use_path_checking="default"
 
2114
    else ac_use_path_checking=""
 
2115
  fi
 
2116
  ],
 
2117
  [
 
2118
  if test "$kde_qtver" = 1;
 
2119
    then ac_use_path_checking=""
 
2120
    else ac_use_path_checking="default"
 
2121
  fi
 
2122
  ]
 
2123
  )
 
2124
 
 
2125
  AC_CREATE_KFSSTND($ac_use_path_checking)
 
2126
 
 
2127
  AC_SUBST_KFSSTND
 
2128
  KDE_CREATE_LIBS_ALIASES
 
2129
])
 
2130
 
 
2131
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
 
2132
AC_DEFUN([KDE_CHECK_FUNC_EXT],
 
2133
[
 
2134
AC_MSG_CHECKING(for $1)
 
2135
AC_CACHE_VAL(kde_cv_func_$1,
 
2136
[
 
2137
AC_LANG_SAVE
 
2138
AC_LANG_CPLUSPLUS
 
2139
save_CXXFLAGS="$CXXFLAGS"
 
2140
kde_safe_LIBS="$LIBS"
 
2141
LIBS="$LIBS $X_EXTRA_LIBS"
 
2142
if test "$GXX" = "yes"; then
 
2143
CXXFLAGS="$CXXFLAGS -pedantic-errors"
 
2144
fi
 
2145
AC_TRY_COMPILE([
 
2146
$2
 
2147
],
 
2148
[
 
2149
$3
 
2150
],
 
2151
kde_cv_func_$1=yes,
 
2152
kde_cv_func_$1=no)
 
2153
CXXFLAGS="$save_CXXFLAGS"
 
2154
LIBS="$kde_safe_LIBS"
 
2155
AC_LANG_RESTORE
 
2156
])
 
2157
 
 
2158
AC_MSG_RESULT($kde_cv_func_$1)
 
2159
 
 
2160
AC_MSG_CHECKING([if $1 needs custom prototype])
 
2161
AC_CACHE_VAL(kde_cv_proto_$1,
 
2162
[
 
2163
if test "x$kde_cv_func_$1" = xyes; then
 
2164
  kde_cv_proto_$1=no
 
2165
else
 
2166
  case "$1" in
 
2167
        setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
 
2168
                kde_cv_proto_$1="yes - in libkdefakes"
 
2169
                ;;
 
2170
        *)
 
2171
                kde_cv_proto_$1=unknown
 
2172
                ;;
 
2173
  esac
 
2174
fi
 
2175
 
 
2176
if test "x$kde_cv_proto_$1" = xunknown; then
 
2177
 
 
2178
AC_LANG_SAVE
 
2179
AC_LANG_CPLUSPLUS
 
2180
  kde_safe_libs=$LIBS
 
2181
  LIBS="$LIBS $X_EXTRA_LIBS"
 
2182
  AC_TRY_LINK([
 
2183
$2
 
2184
 
 
2185
extern "C" $4;
 
2186
],
 
2187
[
 
2188
$3
 
2189
],
 
2190
[ kde_cv_func_$1=yes
 
2191
  kde_cv_proto_$1=yes ],
 
2192
  [kde_cv_proto_$1="$1 unavailable"]
 
2193
)
 
2194
LIBS=$kde_safe_libs
 
2195
AC_LANG_RESTORE
 
2196
fi
 
2197
])
 
2198
AC_MSG_RESULT($kde_cv_proto_$1)
 
2199
 
 
2200
if test "x$kde_cv_func_$1" = xyes; then
 
2201
  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
 
2202
  $6
 
2203
fi
 
2204
if test "x$kde_cv_proto_$1" = xno; then
 
2205
  AC_DEFINE(HAVE_$5_PROTO, 1,
 
2206
  [Define if you have the $1 prototype])
 
2207
fi
 
2208
 
 
2209
AH_VERBATIM([_HAVE_$5_PROTO],
 
2210
[
 
2211
#if !defined(HAVE_$5_PROTO)
 
2212
#ifdef __cplusplus
 
2213
extern "C" {
 
2214
#endif
 
2215
$4;
 
2216
#ifdef __cplusplus
 
2217
}
 
2218
#endif
 
2219
#endif
 
2220
])
 
2221
])
 
2222
 
 
2223
AC_DEFUN([AC_CHECK_SETENV],
 
2224
[
 
2225
        KDE_CHECK_FUNC_EXT(setenv, [
 
2226
#include <stdlib.h>
 
2227
], 
 
2228
                [setenv("VAR", "VALUE", 1);],
 
2229
                [int setenv (const char *, const char *, int)],
 
2230
                [SETENV])
 
2231
])
 
2232
 
 
2233
AC_DEFUN([AC_CHECK_UNSETENV],
 
2234
[
 
2235
        KDE_CHECK_FUNC_EXT(unsetenv, [
 
2236
#include <stdlib.h>
 
2237
], 
 
2238
                [unsetenv("VAR");],
 
2239
                [void unsetenv (const char *)],
 
2240
                [UNSETENV])
 
2241
])
 
2242
 
 
2243
AC_DEFUN([AC_CHECK_GETDOMAINNAME],
 
2244
[
 
2245
        KDE_CHECK_FUNC_EXT(getdomainname, [
 
2246
#include <stdlib.h>
 
2247
#include <unistd.h>
 
2248
#include <netdb.h>
 
2249
], 
 
2250
                [
 
2251
char buffer[200];
 
2252
getdomainname(buffer, 200);
 
2253
],      
 
2254
                [#include <sys/types.h>
 
2255
                int getdomainname (char *, size_t)],
 
2256
                [GETDOMAINNAME])
 
2257
])
 
2258
 
 
2259
AC_DEFUN([AC_CHECK_GETHOSTNAME],
 
2260
[
 
2261
        KDE_CHECK_FUNC_EXT(gethostname, [
 
2262
#include <stdlib.h>
 
2263
#include <unistd.h>
 
2264
], 
 
2265
                [
 
2266
char buffer[200];
 
2267
gethostname(buffer, 200);
 
2268
],      
 
2269
                [int gethostname (char *, unsigned int)],
 
2270
                [GETHOSTNAME])
 
2271
])
 
2272
 
 
2273
AC_DEFUN([AC_CHECK_USLEEP],
 
2274
[
 
2275
        KDE_CHECK_FUNC_EXT(usleep, [
 
2276
#include <unistd.h>
 
2277
], 
 
2278
                [
 
2279
usleep(200);
 
2280
],      
 
2281
                [int usleep (unsigned int)],
 
2282
                [USLEEP])
 
2283
])
 
2284
 
 
2285
 
 
2286
AC_DEFUN([AC_CHECK_RANDOM],
 
2287
[
 
2288
        KDE_CHECK_FUNC_EXT(random, [
 
2289
#include <stdlib.h>
 
2290
], 
 
2291
                [
 
2292
random();
 
2293
],      
 
2294
                [long int random(void)],
 
2295
                [RANDOM])
 
2296
 
 
2297
        KDE_CHECK_FUNC_EXT(srandom, [
 
2298
#include <stdlib.h>
 
2299
], 
 
2300
                [
 
2301
srandom(27);
 
2302
],      
 
2303
                [void srandom(unsigned int)],
 
2304
                [SRANDOM])
 
2305
 
 
2306
])
 
2307
 
 
2308
AC_DEFUN([AC_CHECK_INITGROUPS],
 
2309
[
 
2310
        KDE_CHECK_FUNC_EXT(initgroups, [
 
2311
#include <sys/types.h>
 
2312
#include <unistd.h>
 
2313
#include <grp.h>
 
2314
],
 
2315
        [
 
2316
char buffer[200];
 
2317
initgroups(buffer, 27);
 
2318
],
 
2319
        [int initgroups(const char *, gid_t)],
 
2320
        [INITGROUPS])
 
2321
])
 
2322
 
 
2323
AC_DEFUN([AC_CHECK_MKSTEMPS],
 
2324
[
 
2325
        KDE_CHECK_FUNC_EXT(mkstemps, [
 
2326
#include <stdlib.h>
 
2327
#include <unistd.h>
 
2328
],
 
2329
        [
 
2330
mkstemps("/tmp/aaaXXXXXX", 6);
 
2331
],
 
2332
        [int mkstemps(char *, int)],
 
2333
        [MKSTEMPS])
 
2334
])
 
2335
 
 
2336
AC_DEFUN([AC_CHECK_MKSTEMP],
 
2337
[
 
2338
        KDE_CHECK_FUNC_EXT(mkstemp, [
 
2339
#include <stdlib.h>
 
2340
#include <unistd.h>
 
2341
],
 
2342
        [
 
2343
mkstemp("/tmp/aaaXXXXXX");
 
2344
],
 
2345
        [int mkstemp(char *)],
 
2346
        [MKSTEMP])
 
2347
])
 
2348
 
 
2349
AC_DEFUN([AC_CHECK_MKDTEMP],
 
2350
[
 
2351
        KDE_CHECK_FUNC_EXT(mkdtemp, [
 
2352
#include <stdlib.h>
 
2353
#include <unistd.h>
 
2354
],
 
2355
        [
 
2356
mkdtemp("/tmp/aaaXXXXXX");
 
2357
],
 
2358
        [char *mkdtemp(char *)],
 
2359
        [MKDTEMP])
 
2360
])
 
2361
 
 
2362
 
 
2363
AC_DEFUN([AC_CHECK_RES_INIT],
 
2364
[
 
2365
  AC_MSG_CHECKING([if res_init needs -lresolv])
 
2366
  kde_libs_safe="$LIBS"
 
2367
  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
 
2368
  AC_TRY_LINK(
 
2369
    [
 
2370
#include <sys/types.h>
 
2371
#include <netinet/in.h>
 
2372
#include <arpa/nameser.h>
 
2373
#include <resolv.h>
 
2374
    ],
 
2375
    [
 
2376
      res_init(); 
 
2377
    ],
 
2378
    [
 
2379
      LIBRESOLV="-lresolv"
 
2380
      AC_MSG_RESULT(yes)
 
2381
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
 
2382
    ],
 
2383
    [ AC_MSG_RESULT(no) ]
 
2384
  )
 
2385
  LIBS=$kde_libs_safe
 
2386
  AC_SUBST(LIBRESOLV)
 
2387
 
 
2388
  KDE_CHECK_FUNC_EXT(res_init,
 
2389
    [
 
2390
#include <sys/types.h>
 
2391
#include <netinet/in.h>
 
2392
#include <arpa/nameser.h>
 
2393
#include <resolv.h>
 
2394
    ],
 
2395
    [res_init()],
 
2396
    [int res_init(void)],
 
2397
    [RES_INIT])
 
2398
])
 
2399
 
 
2400
AC_DEFUN([AC_CHECK_STRLCPY],
 
2401
[
 
2402
        KDE_CHECK_FUNC_EXT(strlcpy, [
 
2403
#include <string.h>
 
2404
],
 
2405
[ char buf[20];
 
2406
  strlcpy(buf, "KDE function test", sizeof(buf));
 
2407
],
 
2408
        [unsigned long strlcpy(char*, const char*, unsigned long)],
 
2409
        [STRLCPY])
 
2410
])
 
2411
 
 
2412
AC_DEFUN([AC_CHECK_STRLCAT],
 
2413
[
 
2414
        KDE_CHECK_FUNC_EXT(strlcat, [
 
2415
#include <string.h>
 
2416
],
 
2417
[ char buf[20];
 
2418
  buf[0]='\0';
 
2419
  strlcat(buf, "KDE function test", sizeof(buf));
 
2420
],
 
2421
        [unsigned long strlcat(char*, const char*, unsigned long)],
 
2422
        [STRLCAT])
 
2423
])
 
2424
 
 
2425
AC_DEFUN([AC_CHECK_RES_QUERY],
 
2426
[
 
2427
        KDE_CHECK_FUNC_EXT(res_query, [
 
2428
#include <sys/types.h>
 
2429
#include <netinet/in.h>
 
2430
#include <arpa/nameser.h>
 
2431
#include <resolv.h>
 
2432
#include <netdb.h>
 
2433
],
 
2434
[
 
2435
res_query(NULL, 0, 0, NULL, 0);
 
2436
],
 
2437
        [int res_query(const char *, int, int, unsigned char *, int)],
 
2438
        [RES_QUERY])
 
2439
])
 
2440
 
 
2441
AC_DEFUN([AC_CHECK_DN_SKIPNAME],
 
2442
[
 
2443
        KDE_CHECK_FUNC_EXT(dn_skipname, [
 
2444
#include <sys/types.h>
 
2445
#include <netinet/in.h>
 
2446
#include <arpa/nameser.h>
 
2447
#include <resolv.h>
 
2448
],
 
2449
[
 
2450
dn_skipname (NULL, NULL);
 
2451
],
 
2452
        [int dn_skipname (unsigned char *, unsigned char *)],
 
2453
        [DN_SKIPNAME])
 
2454
])
 
2455
 
 
2456
 
 
2457
AC_DEFUN([AC_FIND_GIF],
 
2458
   [AC_MSG_CHECKING([for giflib])
 
2459
AC_CACHE_VAL(ac_cv_lib_gif,
 
2460
[ac_save_LIBS="$LIBS"
 
2461
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2462
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
 
2463
else
 
2464
LIBS="$all_libraries -lgif"
 
2465
fi
 
2466
AC_TRY_LINK(dnl
 
2467
[
 
2468
#ifdef __cplusplus
 
2469
extern "C" {
 
2470
#endif
 
2471
int GifLastError(void);
 
2472
#ifdef __cplusplus
 
2473
}
 
2474
#endif
 
2475
/* We use char because int might match the return type of a gcc2
 
2476
    builtin and then its argument prototype would still apply.  */
 
2477
],
 
2478
            [return GifLastError();],
 
2479
            eval "ac_cv_lib_gif=yes",
 
2480
            eval "ac_cv_lib_gif=no")
 
2481
LIBS="$ac_save_LIBS"
 
2482
])dnl
 
2483
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
 
2484
  AC_MSG_RESULT(yes)
 
2485
  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
 
2486
else
 
2487
  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
 
2488
fi
 
2489
])
 
2490
 
 
2491
AC_DEFUN([KDE_FIND_JPEG_HELPER],
 
2492
[
 
2493
AC_MSG_CHECKING([for libjpeg$2])
 
2494
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
 
2495
[
 
2496
ac_save_LIBS="$LIBS"
 
2497
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
 
2498
ac_save_CFLAGS="$CFLAGS"
 
2499
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2500
AC_TRY_LINK(
 
2501
[/* Override any gcc2 internal prototype to avoid an error.  */
 
2502
struct jpeg_decompress_struct;
 
2503
typedef struct jpeg_decompress_struct * j_decompress_ptr;
 
2504
typedef int size_t;
 
2505
#ifdef __cplusplus
 
2506
extern "C" {
 
2507
#endif
 
2508
    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
 
2509
                                    int version, size_t structsize);
 
2510
#ifdef __cplusplus
 
2511
}
 
2512
#endif
 
2513
/* We use char because int might match the return type of a gcc2
 
2514
    builtin and then its argument prototype would still apply.  */
 
2515
],
 
2516
            [jpeg_CreateDecompress(0L, 0, 0);],
 
2517
            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
 
2518
            eval "ac_cv_lib_jpeg_$1=no")
 
2519
LIBS="$ac_save_LIBS"
 
2520
CFLAGS="$ac_save_CFLAGS"
 
2521
])
 
2522
 
 
2523
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
 
2524
  LIBJPEG="$ac_cv_lib_jpeg_$1"
 
2525
  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
 
2526
else
 
2527
  AC_MSG_RESULT(no)
 
2528
  $3
 
2529
fi
 
2530
 
 
2531
])
 
2532
 
 
2533
AC_DEFUN([AC_FIND_JPEG],
 
2534
[
 
2535
dnl first look for libraries
 
2536
KDE_FIND_JPEG_HELPER(6b, 6b,
 
2537
   KDE_FIND_JPEG_HELPER(normal, [],
 
2538
    [
 
2539
       LIBJPEG=
 
2540
    ]
 
2541
   )
 
2542
)
 
2543
 
 
2544
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
 
2545
dnl requires system dependent includes loaded before it)
 
2546
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
 
2547
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
 
2548
test "x$jpeg_incdir" = xNO && jpeg_incdir=
 
2549
 
 
2550
dnl if headers _and_ libraries are missing, this is no error, and we
 
2551
dnl continue with a warning (the user will get no jpeg support in khtml)
 
2552
dnl if only one is missing, it means a configuration error, but we still
 
2553
dnl only warn
 
2554
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
 
2555
  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
 
2556
else
 
2557
  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
 
2558
    AC_MSG_WARN([
 
2559
There is an installation error in jpeg support. You seem to have only one
 
2560
of either the headers _or_ the libraries installed. You may need to either
 
2561
provide correct --with-extra-... options, or the development package of
 
2562
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
 
2563
Disabling JPEG support.
 
2564
])
 
2565
  else
 
2566
    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
 
2567
  fi
 
2568
  jpeg_incdir=
 
2569
  LIBJPEG=
 
2570
fi
 
2571
 
 
2572
AC_SUBST(LIBJPEG)
 
2573
AH_VERBATIM(_AC_CHECK_JPEG,
 
2574
[/*
 
2575
 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
 
2576
 * headers and I'm too lazy to write a configure test as long as only
 
2577
 * unixware is related
 
2578
 */
 
2579
#ifdef _UNIXWARE
 
2580
#define HAVE_BOOLEAN
 
2581
#endif
 
2582
])
 
2583
])
 
2584
 
 
2585
AC_DEFUN([KDE_CHECK_QT_JPEG],
 
2586
[
 
2587
if test -n "$LIBJPEG"; then
 
2588
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
 
2589
AC_CACHE_VAL(kde_cv_qt_jpeg,
 
2590
[
 
2591
AC_LANG_SAVE
 
2592
AC_LANG_CPLUSPLUS
 
2593
ac_save_LIBS="$LIBS"
 
2594
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
 
2595
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
 
2596
ac_save_CXXFLAGS="$CXXFLAGS"
 
2597
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
2598
AC_TRY_LINK(
 
2599
[#include <qapplication.h>],
 
2600
            [
 
2601
            int argc;
 
2602
            char** argv;
 
2603
            QApplication app(argc, argv);],
 
2604
            eval "kde_cv_qt_jpeg=no",
 
2605
            eval "kde_cv_qt_jpeg=yes")
 
2606
LIBS="$ac_save_LIBS"
 
2607
CXXFLAGS="$ac_save_CXXFLAGS"
 
2608
AC_LANG_RESTORE
 
2609
fi
 
2610
])
 
2611
 
 
2612
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
 
2613
  AC_MSG_RESULT(yes)
 
2614
  LIBJPEG_QT='$(LIBJPEG)'
 
2615
else
 
2616
  AC_MSG_RESULT(no)
 
2617
  LIBJPEG_QT=
 
2618
fi
 
2619
 
 
2620
])
 
2621
 
 
2622
AC_DEFUN([AC_FIND_ZLIB],
 
2623
[
 
2624
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2625
AC_MSG_CHECKING([for libz])
 
2626
AC_CACHE_VAL(ac_cv_lib_z,
 
2627
[
 
2628
kde_save_LIBS="$LIBS"
 
2629
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
 
2630
kde_save_CFLAGS="$CFLAGS"
 
2631
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2632
AC_TRY_LINK(dnl
 
2633
[
 
2634
#include<zlib.h>
 
2635
],
 
2636
[
 
2637
  char buf[42];
 
2638
  gzFile f = (gzFile) 0;
 
2639
  /* this would segfault.. but we only link, don't run */
 
2640
  (void) gzgets(f, buf, sizeof(buf));
 
2641
 
 
2642
  return (zlibVersion() == ZLIB_VERSION); 
 
2643
],
 
2644
            eval "ac_cv_lib_z='-lz'",
 
2645
            eval "ac_cv_lib_z=no")
 
2646
LIBS="$kde_save_LIBS"
 
2647
CFLAGS="$kde_save_CFLAGS"
 
2648
])dnl
 
2649
if test ! "$ac_cv_lib_z" = no; then
 
2650
  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
 
2651
  LIBZ="$ac_cv_lib_z"
 
2652
  AC_MSG_RESULT($ac_cv_lib_z)
 
2653
else
 
2654
  AC_MSG_ERROR(not found. 
 
2655
          Possibly configure picks up an outdated version
 
2656
          installed by XFree86. Remove it from your system.
 
2657
 
 
2658
          Check your installation and look into config.log)
 
2659
  LIBZ=""
 
2660
fi
 
2661
AC_SUBST(LIBZ)
 
2662
])
 
2663
 
 
2664
AC_DEFUN([KDE_TRY_TIFFLIB],
 
2665
[
 
2666
AC_MSG_CHECKING([for libtiff $1])
 
2667
 
 
2668
AC_CACHE_VAL(kde_cv_libtiff_$1,
 
2669
[
 
2670
AC_LANG_SAVE
 
2671
AC_LANG_CPLUSPLUS
 
2672
kde_save_LIBS="$LIBS"
 
2673
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2674
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
 
2675
else
 
2676
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
 
2677
fi
 
2678
kde_save_CXXFLAGS="$CXXFLAGS"
 
2679
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
2680
 
 
2681
AC_TRY_LINK(dnl
 
2682
[
 
2683
#include<tiffio.h>
 
2684
],
 
2685
    [return (TIFFOpen( "", "r") == 0); ],
 
2686
[
 
2687
    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
 
2688
], [
 
2689
    kde_cv_libtiff_$1=no
 
2690
])
 
2691
 
 
2692
LIBS="$kde_save_LIBS"
 
2693
CXXFLAGS="$kde_save_CXXFLAGS"
 
2694
AC_LANG_RESTORE
 
2695
])
 
2696
 
 
2697
if test "$kde_cv_libtiff_$1" = "no"; then
 
2698
    AC_MSG_RESULT(no)
 
2699
    LIBTIFF=""
 
2700
    $3
 
2701
else
 
2702
    LIBTIFF="$kde_cv_libtiff_$1"
 
2703
    AC_MSG_RESULT(yes)
 
2704
    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
 
2705
    $2
 
2706
fi
 
2707
 
 
2708
])
 
2709
 
 
2710
AC_DEFUN([AC_FIND_TIFF],
 
2711
[
 
2712
AC_REQUIRE([K_PATH_X])
 
2713
AC_REQUIRE([AC_FIND_ZLIB])
 
2714
AC_REQUIRE([AC_FIND_JPEG])
 
2715
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2716
 
 
2717
KDE_TRY_TIFFLIB(tiff, [],
 
2718
   KDE_TRY_TIFFLIB(tiff34))
 
2719
 
 
2720
AC_SUBST(LIBTIFF)
 
2721
])
 
2722
 
 
2723
 
 
2724
AC_DEFUN([AC_FIND_PNG],
 
2725
[
 
2726
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2727
AC_REQUIRE([AC_FIND_ZLIB])
 
2728
AC_MSG_CHECKING([for libpng])
 
2729
AC_CACHE_VAL(ac_cv_lib_png,
 
2730
[
 
2731
kde_save_LIBS="$LIBS"
 
2732
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2733
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
 
2734
else
 
2735
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
 
2736
fi
 
2737
kde_save_CFLAGS="$CFLAGS"
 
2738
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2739
 
 
2740
AC_TRY_LINK(dnl
 
2741
    [
 
2742
    #include<png.h>
 
2743
    ],
 
2744
    [
 
2745
    png_structp png_ptr = png_create_read_struct(  /* image ptr */
 
2746
                PNG_LIBPNG_VER_STRING, 0, 0, 0 );
 
2747
    return( png_ptr != 0 );
 
2748
    ],
 
2749
    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
 
2750
    eval "ac_cv_lib_png=no"
 
2751
)
 
2752
LIBS="$kde_save_LIBS"
 
2753
CFLAGS="$kde_save_CFLAGS"
 
2754
])dnl
 
2755
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
 
2756
  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
 
2757
  LIBPNG="$ac_cv_lib_png"
 
2758
  AC_SUBST(LIBPNG)
 
2759
  AC_MSG_RESULT($ac_cv_lib_png)
 
2760
else
 
2761
  AC_MSG_RESULT(no)
 
2762
  LIBPNG=""
 
2763
  AC_SUBST(LIBPNG)
 
2764
fi
 
2765
])
 
2766
 
 
2767
 
 
2768
AC_DEFUN([AC_FIND_JASPER],
 
2769
[
 
2770
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2771
AC_REQUIRE([AC_FIND_JPEG])
 
2772
AC_MSG_CHECKING([for jasper])
 
2773
AC_CACHE_VAL(ac_cv_jasper,
 
2774
[
 
2775
kde_save_LIBS="$LIBS"
 
2776
LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
 
2777
kde_save_CFLAGS="$CFLAGS"
 
2778
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2779
 
 
2780
AC_TRY_LINK(dnl
 
2781
    [
 
2782
    #include<jasper/jasper.h>
 
2783
    ],
 
2784
    [
 
2785
    return( jas_init() );
 
2786
    ],
 
2787
    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
 
2788
    eval "ac_cv_jasper=no"
 
2789
)
 
2790
LIBS="$kde_save_LIBS"
 
2791
CFLAGS="$kde_save_CFLAGS"
 
2792
])dnl
 
2793
if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
 
2794
  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
 
2795
  LIB_JASPER="$ac_cv_jasper"
 
2796
  AC_MSG_RESULT($ac_cv_jasper)
 
2797
else
 
2798
  AC_MSG_RESULT(no)
 
2799
  LIB_JASPER=""
 
2800
fi
 
2801
AC_SUBST(LIB_JASPER)
 
2802
])
 
2803
 
 
2804
AC_DEFUN([AC_CHECK_BOOL],
 
2805
[
 
2806
  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
 
2807
])
 
2808
 
 
2809
AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
 
2810
[
 
2811
AC_MSG_CHECKING(if you need GNU extensions)
 
2812
AC_CACHE_VAL(ac_cv_gnu_extensions,
 
2813
[
 
2814
cat > conftest.c << EOF
 
2815
#include <features.h>
 
2816
 
 
2817
#ifdef __GNU_LIBRARY__
 
2818
yes
 
2819
#endif
 
2820
EOF
 
2821
 
 
2822
if (eval "$ac_cpp conftest.c") 2>&5 |
 
2823
  egrep "yes" >/dev/null 2>&1; then
 
2824
  rm -rf conftest*
 
2825
  ac_cv_gnu_extensions=yes
 
2826
else
 
2827
  ac_cv_gnu_extensions=no
 
2828
fi
 
2829
])
 
2830
 
 
2831
AC_MSG_RESULT($ac_cv_gnu_extensions)
 
2832
if test "$ac_cv_gnu_extensions" = "yes"; then
 
2833
  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
 
2834
fi
 
2835
])
 
2836
 
 
2837
AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
 
2838
[
 
2839
AC_MSG_CHECKING([whether $CXX supports -$1])
 
2840
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
 
2841
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
 
2842
[
 
2843
  AC_LANG_SAVE
 
2844
  AC_LANG_CPLUSPLUS
 
2845
  save_CXXFLAGS="$CXXFLAGS"
 
2846
  CXXFLAGS="$CXXFLAGS -$1"
 
2847
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
 
2848
  CXXFLAGS="$save_CXXFLAGS"
 
2849
  AC_LANG_RESTORE
 
2850
])
 
2851
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
 
2852
 AC_MSG_RESULT(yes)
 
2853
 :
 
2854
 $2
 
2855
else
 
2856
 AC_MSG_RESULT(no)
 
2857
 :
 
2858
 $3
 
2859
fi
 
2860
])
 
2861
 
 
2862
AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
 
2863
[
 
2864
AC_MSG_CHECKING([whether $CC supports -$1])
 
2865
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
 
2866
AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
 
2867
[
 
2868
  AC_LANG_SAVE
 
2869
  AC_LANG_C
 
2870
  save_CFLAGS="$CFLAGS"
 
2871
  CFLAGS="$CFLAGS -$1"
 
2872
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
 
2873
  CFLAGS="$save_CFLAGS"
 
2874
  AC_LANG_RESTORE
 
2875
])
 
2876
if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
 
2877
 AC_MSG_RESULT(yes)
 
2878
 :
 
2879
 $2
 
2880
else
 
2881
 AC_MSG_RESULT(no)
 
2882
 :
 
2883
 $3
 
2884
fi
 
2885
])
 
2886
 
 
2887
 
 
2888
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
 
2889
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
 
2890
dnl it's all white-space separated
 
2891
AC_DEFUN([AC_REMOVE_FORBIDDEN],
 
2892
[ __val=$$1
 
2893
  __forbid=" $2 "
 
2894
  if test -n "$__val"; then
 
2895
    __new=""
 
2896
    ac_save_IFS=$IFS
 
2897
    IFS="       "
 
2898
    for i in $__val; do
 
2899
      case "$__forbid" in
 
2900
        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
 
2901
        *) # Careful to not add spaces, where there were none, because otherwise
 
2902
           # libtool gets confused, if we change e.g. CXX
 
2903
           if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
 
2904
      esac
 
2905
    done
 
2906
    IFS=$ac_save_IFS
 
2907
    $1=$__new
 
2908
  fi
 
2909
])
 
2910
 
 
2911
 
 
2912
AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
 
2913
[
 
2914
  AC_MSG_CHECKING([whether $CC is blacklisted])
 
2915
 
 
2916
  dnl In theory we have tu run this test against $CC and $CXX
 
2917
  dnl in C and in C++ mode, because its perfectly legal for
 
2918
  dnl the user to mix compiler versions, since C has a defined
 
2919
  dnl ABI. 
 
2920
  dnl 
 
2921
  dnl For now, we assume the user is not on crack.
 
2922
 
 
2923
  AC_TRY_COMPILE([
 
2924
#ifdef __GNUC__
 
2925
#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
 
2926
choke me
 
2927
#endif
 
2928
#endif
 
2929
], ,
 
2930
  kde_bad_compiler=no, 
 
2931
  kde_bad_compiler=yes
 
2932
)
 
2933
 
 
2934
  AC_MSG_RESULT($kde_bad_compiler)
 
2935
 
 
2936
if test "$kde_bad_compiler" = "yes"; then
 
2937
  AC_MSG_ERROR([
 
2938
 
 
2939
This particular compiler version is blacklisted because it
 
2940
is known to miscompile KDE. Please use a newer version, or
 
2941
if that is not yet available, choose an older version. 
 
2942
 
 
2943
Please do not report a bug or bother us reporting this
 
2944
configure error. We know about it, and we introduced
 
2945
it by intention to avoid untraceable bugs or crashes in KDE.
 
2946
 
 
2947
])
 
2948
fi
 
2949
 
 
2950
])
 
2951
 
 
2952
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
 
2953
AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
 
2954
[dnl
 
2955
if test "x$kde_use_qt_emb" != "xyes"; then
 
2956
 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
 
2957
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
 
2958
else
 
2959
 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
 
2960
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
 
2961
fi
 
2962
])
 
2963
 
 
2964
AC_DEFUN([AC_CHECK_COMPILERS],
 
2965
[
 
2966
  AC_ARG_ENABLE(debug,
 
2967
                AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
 
2968
  [
 
2969
    case $enableval in
 
2970
      yes)
 
2971
        kde_use_debug_code="yes"
 
2972
        kde_use_debug_define=no
 
2973
        ;;
 
2974
      full)
 
2975
        kde_use_debug_code="full"
 
2976
        kde_use_debug_define=no
 
2977
        ;;
 
2978
      *)
 
2979
        kde_use_debug_code="no"
 
2980
        kde_use_debug_define=yes
 
2981
        ;;
 
2982
    esac
 
2983
  ], 
 
2984
    [kde_use_debug_code="no"
 
2985
      kde_use_debug_define=no
 
2986
  ])
 
2987
 
 
2988
  dnl Just for configure --help
 
2989
  AC_ARG_ENABLE(dummyoption,
 
2990
                AC_HELP_STRING([--disable-debug],
 
2991
                               [disables debug output and debug symbols [default=no]]),
 
2992
                [],[])
 
2993
 
 
2994
  AC_ARG_ENABLE(strict,
 
2995
                AC_HELP_STRING([--enable-strict],
 
2996
                              [compiles with strict compiler options (may not work!)]),
 
2997
   [
 
2998
    if test $enableval = "no"; then
 
2999
         kde_use_strict_options="no"
 
3000
       else
 
3001
         kde_use_strict_options="yes"
 
3002
    fi
 
3003
   ], [kde_use_strict_options="no"])
 
3004
 
 
3005
  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
 
3006
   [
 
3007
    if test $enableval = "no"; then
 
3008
         kde_use_warnings="no"
 
3009
       else
 
3010
         kde_use_warnings="yes"
 
3011
    fi
 
3012
   ], [kde_use_warnings="yes"])
 
3013
 
 
3014
  dnl enable warnings for debug build
 
3015
  if test "$kde_use_debug_code" != "no"; then
 
3016
    kde_use_warnings=yes
 
3017
  fi
 
3018
 
 
3019
  AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
 
3020
    [kde_use_profiling=$enableval],
 
3021
    [kde_use_profiling="no"]
 
3022
  )
 
3023
 
 
3024
  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
 
3025
  CFLAGS=" $CFLAGS"
 
3026
 
 
3027
  AC_PROG_CC 
 
3028
 
 
3029
  AC_PROG_CPP
 
3030
 
 
3031
  if test "$GCC" = "yes"; then
 
3032
    if test "$kde_use_debug_code" != "no"; then
 
3033
      if test $kde_use_debug_code = "full"; then
 
3034
        CFLAGS="-g3 -fno-inline $CFLAGS"
 
3035
      else
 
3036
        CFLAGS="-g -O2 $CFLAGS"
 
3037
      fi
 
3038
    else
 
3039
      CFLAGS="-O2 $CFLAGS"
 
3040
    fi
 
3041
  fi
 
3042
 
 
3043
  if test "$kde_use_debug_define" = "yes"; then
 
3044
    CFLAGS="-DNDEBUG $CFLAGS"
 
3045
  fi
 
3046
 
 
3047
 
 
3048
  case "$host" in
 
3049
  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
 
3050
  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
 
3051
  esac
 
3052
 
 
3053
  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
 
3054
     LDFLAGS=""
 
3055
  fi
 
3056
 
 
3057
  CXXFLAGS=" $CXXFLAGS"
 
3058
 
 
3059
  AC_PROG_CXX
 
3060
 
 
3061
  KDE_CHECK_FOR_BAD_COMPILER
 
3062
 
 
3063
  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
 
3064
    if test "$kde_use_debug_code" != "no"; then
 
3065
      if test "$CXX" = "KCC"; then
 
3066
        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
 
3067
      else
 
3068
        if test "$kde_use_debug_code" = "full"; then
 
3069
          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
 
3070
        else
 
3071
          CXXFLAGS="-g -O2 $CXXFLAGS"
 
3072
        fi
 
3073
      fi
 
3074
      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
 
3075
 
 
3076
      dnl convenience compiler flags
 
3077
      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
 
3078
      AC_SUBST(WOVERLOADED_VIRTUAL)
 
3079
    else
 
3080
      if test "$CXX" = "KCC"; then
 
3081
        CXXFLAGS="+K3 $CXXFLAGS"
 
3082
      else
 
3083
        CXXFLAGS="-O2 $CXXFLAGS"
 
3084
      fi  
 
3085
    fi
 
3086
  fi
 
3087
 
 
3088
  if test "$kde_use_debug_define" = "yes"; then
 
3089
    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
 
3090
  fi  
 
3091
 
 
3092
  if test "$kde_use_profiling" = "yes"; then
 
3093
    KDE_CHECK_COMPILER_FLAG(pg,
 
3094
    [
 
3095
      CFLAGS="-pg $CFLAGS"
 
3096
      CXXFLAGS="-pg $CXXFLAGS"
 
3097
    ])
 
3098
  fi
 
3099
 
 
3100
  if test "$kde_use_warnings" = "yes"; then
 
3101
      if test "$GCC" = "yes"; then
 
3102
        dnl ### FIXME: remove -Wno-non-virtual-dtor for KDE 4
 
3103
        CXXFLAGS="-Wall -W -Wpointer-arith -Wno-non-virtual-dtor $CXXFLAGS"
 
3104
        case $host in
 
3105
          *-*-linux-gnu)        
 
3106
            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
 
3107
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
 
3108
            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
 
3109
            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
 
3110
          ;;
 
3111
        esac
 
3112
        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
 
3113
        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
 
3114
        KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
 
3115
     fi
 
3116
  fi
 
3117
 
 
3118
  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
 
3119
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
 
3120
  fi
 
3121
 
 
3122
  AC_ARG_ENABLE(pch,
 
3123
     AC_HELP_STRING([--enable-pch],
 
3124
                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
 
3125
    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
 
3126
 
 
3127
  HAVE_GCC_VISIBILITY=0
 
3128
  AC_SUBST([HAVE_GCC_VISIBILITY])
 
3129
 
 
3130
  if test "$GXX" = "yes"; then
 
3131
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
 
3132
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
 
3133
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
 
3134
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
 
3135
    ENABLE_PERMISSIVE_FLAG="-fpermissive"
 
3136
 
 
3137
    if test "$kde_use_pch" = "yes"; then
 
3138
        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
 
3139
        echo >conftest.h
 
3140
        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
 
3141
            kde_gcc_supports_pch=yes
 
3142
            AC_MSG_RESULT(yes)
 
3143
        else
 
3144
            kde_gcc_supports_pch=no
 
3145
            AC_MSG_RESULT(no)
 
3146
        fi
 
3147
        if test "$kde_gcc_supports_pch" = "yes"; then
 
3148
            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
 
3149
            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
 
3150
                kde_gcc_supports_pch=yes
 
3151
                AC_MSG_RESULT(yes)
 
3152
            else
 
3153
                kde_gcc_supports_pch=no
 
3154
                AC_MSG_RESULT(no)
 
3155
            fi
 
3156
        fi
 
3157
        rm -f conftest.h conftest.h.gch
 
3158
    fi
 
3159
  fi
 
3160
  AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
 
3161
  if test "$CXX" = "KCC"; then
 
3162
    dnl unfortunately we currently cannot disable exception support in KCC
 
3163
    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
 
3164
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
 
3165
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
 
3166
 
 
3167
    if test "$kde_use_pch" = "yes"; then
 
3168
      dnl TODO: support --pch-dir!
 
3169
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
 
3170
      dnl the below works (but the dir must exist), but it's
 
3171
      dnl useless for a whole package.
 
3172
      dnl The are precompiled headers for each source file, so when compiling
 
3173
      dnl from scratch, it doesn't make a difference, and they take up
 
3174
      dnl around ~5Mb _per_ sourcefile.
 
3175
      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
 
3176
      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
 
3177
    fi
 
3178
    dnl this flag controls inlining. by default KCC inlines in optimisation mode
 
3179
    dnl all implementations that are defined inside the class {} declaration. 
 
3180
    dnl because of templates-compatibility with broken gcc compilers, this
 
3181
    dnl can cause excessive inlining. This flag limits it to a sane level
 
3182
    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
 
3183
    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
 
3184
    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
 
3185
    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
 
3186
    dnl Some source files are shared between multiple executables
 
3187
    dnl (or libraries) and some of those need template instantiations.
 
3188
    dnl In that case KCC needs to compile those sources with
 
3189
    dnl --one_instantiation_per_object.  To make it easy for us we compile
 
3190
    dnl _all_ objects with that flag (--one_per is a shorthand).
 
3191
    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
 
3192
  fi
 
3193
  AC_SUBST(USE_EXCEPTIONS)
 
3194
  dnl obsolete macro - provided to keep things going
 
3195
  USE_RTTI=
 
3196
  AC_SUBST(USE_RTTI)
 
3197
 
 
3198
  case "$host" in
 
3199
      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
 
3200
      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
 
3201
      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
 
3202
      *-*-solaris*) 
 
3203
        if test "$GXX" = yes; then
 
3204
          libstdcpp=`$CXX -print-file-name=libstdc++.so`
 
3205
          if test ! -f $libstdcpp; then
 
3206
             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])
 
3207
          fi
 
3208
        fi
 
3209
        ;;
 
3210
  esac
 
3211
 
 
3212
  AC_VALIDIFY_CXXFLAGS
 
3213
 
 
3214
  AC_PROG_CXXCPP
 
3215
 
 
3216
  if test "$GCC" = yes; then
 
3217
     NOOPT_CFLAGS=-O0
 
3218
  fi
 
3219
  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
 
3220
 
 
3221
  AC_ARG_ENABLE(coverage,
 
3222
    AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
 
3223
      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
 
3224
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
 
3225
        ac_coverage_linker="-lgcc"
 
3226
      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
 
3227
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
 
3228
        ac_coverage_linker=""
 
3229
      else
 
3230
        AC_MSG_ERROR([coverage with your compiler is not supported])
 
3231
      fi
 
3232
      CFLAGS="$CFLAGS $ac_coverage_compiler"
 
3233
      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
 
3234
      LDFLAGS="$LDFLAGS $ac_coverage_linker"
 
3235
    ])
 
3236
 
 
3237
  AC_SUBST(NOOPT_CXXFLAGS)
 
3238
  AC_SUBST(NOOPT_CFLAGS)
 
3239
  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
 
3240
 
 
3241
  KDE_CHECK_NEW_LDFLAGS
 
3242
  KDE_CHECK_FINAL
 
3243
  KDE_CHECK_CLOSURE
 
3244
  KDE_CHECK_NMCHECK
 
3245
 
 
3246
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
 
3247
])
 
3248
 
 
3249
AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
 
3250
  [
 
3251
    AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
 
3252
      [
 
3253
        AC_LANG_SAVE
 
3254
        AC_LANG_CPLUSPLUS
 
3255
 
 
3256
        safe_CXXFLAGS=$CXXFLAGS
 
3257
        safe_LDFLAGS=$LDFLAGS
 
3258
        CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
 
3259
        LDFLAGS="$LDFLAGS -shared -fPIC"
 
3260
 
 
3261
        AC_TRY_LINK(
 
3262
        [
 
3263
          /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
 
3264
          #include <string>
 
3265
          int some_function( void ) __attribute__ ((visibility("default")));
 
3266
          int some_function( void )
 
3267
          {
 
3268
            std::string s("blafasel");
 
3269
            return 0;
 
3270
          }
 
3271
        ], [/* elvis is alive */],
 
3272
        kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
 
3273
 
 
3274
        CXXFLAGS=$safe_CXXFLAGS
 
3275
        LDFLAGS=$safe_LDFLAGS
 
3276
        AC_LANG_RESTORE
 
3277
      ]
 
3278
    )
 
3279
 
 
3280
    if test x$kde_cv_val_gcc_visibility_bug = xno; then
 
3281
      CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
 
3282
    fi
 
3283
  ]
 
3284
)
 
3285
 
 
3286
AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
 
3287
[
 
3288
  if test "$GXX" = "yes"; then
 
3289
    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
 
3290
    [
 
3291
        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
 
3292
        KDE_CHECK_VISIBILITY_GCC_BUG
 
3293
 
 
3294
        HAVE_GCC_VISIBILITY=1
 
3295
        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
 
3296
    ])
 
3297
  fi
 
3298
])
 
3299
 
 
3300
AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
 
3301
[
 
3302
  AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
 
3303
])
 
3304
 
 
3305
AC_DEFUN([KDE_ADD_DEPENDENCIES],
 
3306
[
 
3307
   [A]M_DEPENDENCIES(CC)
 
3308
   [A]M_DEPENDENCIES(CXX)
 
3309
])
 
3310
 
 
3311
dnl just a wrapper to clean up configure.in
 
3312
AC_DEFUN([KDE_PROG_LIBTOOL],
 
3313
[
 
3314
AC_REQUIRE([AC_CHECK_COMPILERS])
 
3315
AC_REQUIRE([AC_ENABLE_SHARED])
 
3316
AC_REQUIRE([AC_ENABLE_STATIC])
 
3317
 
 
3318
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
 
3319
AC_REQUIRE([KDE_CHECK_LIB64])
 
3320
 
 
3321
AC_OBJEXT
 
3322
AC_EXEEXT
 
3323
 
 
3324
AM_PROG_LIBTOOL
 
3325
AC_LIBTOOL_CXX
 
3326
 
 
3327
LIBTOOL_SHELL="/bin/sh ./libtool"
 
3328
#  LIBTOOL="$LIBTOOL --silent"
 
3329
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
 
3330
AC_SUBST(KDE_PLUGIN)
 
3331
 
 
3332
# we patch configure quite some so we better keep that consistent for incremental runs 
 
3333
AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
 
3334
])
 
3335
 
 
3336
AC_DEFUN([KDE_CHECK_LIB64],
 
3337
[
 
3338
    kdelibsuff="$kde_libs_suffix"
 
3339
    if test -z "$kdelibsuff"; then
 
3340
       kdelibsuff=no
 
3341
    fi
 
3342
    AC_ARG_ENABLE(libsuffix,
 
3343
        AC_HELP_STRING([--enable-libsuffix],
 
3344
            [/lib directory suffix (64,32,none[=default])]),
 
3345
            kdelibsuff=$enableval)
 
3346
    # TODO: add an auto case that compiles a little C app to check
 
3347
    # where the glibc is
 
3348
    if test "$kdelibsuff" = "no"; then
 
3349
       kdelibsuff=
 
3350
    fi
 
3351
    if test -z "$kdelibsuff"; then
 
3352
        AC_MSG_RESULT([not using lib directory suffix])
 
3353
        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
 
3354
    else
 
3355
        if test "$libdir" = '${exec_prefix}/lib'; then
 
3356
            libdir="$libdir${kdelibsuff}"
 
3357
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
 
3358
        fi
 
3359
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
 
3360
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
 
3361
    fi
 
3362
])
 
3363
 
 
3364
AC_DEFUN([KDE_CHECK_TYPES],
 
3365
[  AC_CHECK_SIZEOF(int, 4)dnl
 
3366
   AC_CHECK_SIZEOF(short)dnl
 
3367
  AC_CHECK_SIZEOF(long, 4)dnl
 
3368
  AC_CHECK_SIZEOF(char *, 4)dnl
 
3369
])dnl
 
3370
 
 
3371
dnl Not used - kept for compat only?
 
3372
AC_DEFUN([KDE_DO_IT_ALL],
 
3373
[
 
3374
AC_CANONICAL_SYSTEM
 
3375
AC_ARG_PROGRAM
 
3376
AM_INIT_AUTOMAKE($1, $2)
 
3377
AM_DISABLE_LIBRARIES
 
3378
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
 
3379
AC_CHECK_COMPILERS
 
3380
KDE_PROG_LIBTOOL
 
3381
AM_KDE_WITH_NLS
 
3382
AC_PATH_KDE
 
3383
])
 
3384
 
 
3385
AC_DEFUN([AC_CHECK_RPATH],
 
3386
[
 
3387
AC_MSG_CHECKING(for rpath)
 
3388
AC_ARG_ENABLE(rpath,
 
3389
      AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
 
3390
      USE_RPATH=$enableval, USE_RPATH=yes)
 
3391
 
 
3392
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
 
3393
 
 
3394
  KDE_RPATH="-R \$(libdir)"
 
3395
 
 
3396
  if test "$kde_libraries" != "$libdir"; then
 
3397
      KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
 
3398
  fi
 
3399
 
 
3400
  if test -n "$qt_libraries"; then
 
3401
    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
 
3402
  fi
 
3403
  dnl $x_libraries is set to /usr/lib in case
 
3404
  if test -n "$X_LDFLAGS"; then
 
3405
    X_RPATH="-R \$(x_libraries)"
 
3406
    KDE_RPATH="$KDE_RPATH $X_RPATH"
 
3407
  fi
 
3408
  if test -n "$KDE_EXTRA_RPATH"; then
 
3409
    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
 
3410
  fi
 
3411
fi
 
3412
AC_SUBST(KDE_EXTRA_RPATH)
 
3413
AC_SUBST(KDE_RPATH)
 
3414
AC_SUBST(X_RPATH)
 
3415
AC_MSG_RESULT($USE_RPATH)
 
3416
])
 
3417
 
 
3418
dnl Check for the type of the third argument of getsockname
 
3419
AC_DEFUN([AC_CHECK_SOCKLEN_T],
 
3420
[
 
3421
   AC_MSG_CHECKING(for socklen_t)
 
3422
   AC_CACHE_VAL(kde_cv_socklen_t,
 
3423
   [
 
3424
      AC_LANG_PUSH(C++)
 
3425
      kde_cv_socklen_t=no
 
3426
      AC_TRY_COMPILE([
 
3427
         #include <sys/types.h>
 
3428
         #include <sys/socket.h>
 
3429
      ],
 
3430
      [
 
3431
         socklen_t len;
 
3432
         getpeername(0,0,&len);
 
3433
      ],
 
3434
      [
 
3435
         kde_cv_socklen_t=yes
 
3436
         kde_cv_socklen_t_equiv=socklen_t
 
3437
      ])
 
3438
      AC_LANG_POP(C++)
 
3439
   ])
 
3440
   AC_MSG_RESULT($kde_cv_socklen_t)
 
3441
   if test $kde_cv_socklen_t = no; then
 
3442
      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
 
3443
      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
 
3444
      [
 
3445
         kde_cv_socklen_t_equiv=int
 
3446
         AC_LANG_PUSH(C++)
 
3447
         for t in int size_t unsigned long "unsigned long"; do
 
3448
            AC_TRY_COMPILE([
 
3449
               #include <sys/types.h>
 
3450
               #include <sys/socket.h>
 
3451
            ],
 
3452
            [
 
3453
               $t len;
 
3454
               getpeername(0,0,&len);
 
3455
            ],
 
3456
            [
 
3457
               kde_cv_socklen_t_equiv="$t"
 
3458
               break
 
3459
            ])
 
3460
         done
 
3461
         AC_LANG_POP(C++)
 
3462
      ])
 
3463
      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
 
3464
   fi
 
3465
   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
 
3466
                     [type to use in place of socklen_t if not defined])
 
3467
   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
 
3468
                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
 
3469
])
 
3470
 
 
3471
dnl This is a merge of some macros out of the gettext aclocal.m4
 
3472
dnl since we don't need anything, I took the things we need
 
3473
dnl the copyright for them is:
 
3474
dnl >
 
3475
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
3476
dnl This Makefile.in is free software; the Free Software Foundation
 
3477
dnl gives unlimited permission to copy and/or distribute it,
 
3478
dnl with or without modifications, as long as this notice is preserved.
 
3479
 
 
3480
dnl This program is distributed in the hope that it will be useful,
 
3481
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
3482
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
3483
dnl PARTICULAR PURPOSE.
 
3484
dnl >
 
3485
dnl for this file it is relicensed under LGPL
 
3486
 
 
3487
AC_DEFUN([AM_KDE_WITH_NLS],
 
3488
  [
 
3489
    dnl If we use NLS figure out what method
 
3490
 
 
3491
    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
 
3492
        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
 
3493
    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
3494
 
 
3495
     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
 
3496
        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
 
3497
        GMSGFMT=":"
 
3498
      fi
 
3499
      MSGFMT=$GMSGFMT
 
3500
      AC_SUBST(GMSGFMT)
 
3501
      AC_SUBST(MSGFMT)
 
3502
 
 
3503
      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
 
3504
        [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
3505
 
 
3506
      dnl Test whether we really found GNU xgettext.
 
3507
      if test "$XGETTEXT" != ":"; then
 
3508
        dnl If it is no GNU xgettext we define it as : so that the
 
3509
        dnl Makefiles still can work.
 
3510
        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
3511
          : ;
 
3512
        else
 
3513
          AC_MSG_RESULT(
 
3514
            [found xgettext programs is not GNU xgettext; ignore it])
 
3515
          XGETTEXT=":"
 
3516
        fi
 
3517
      fi
 
3518
     AC_SUBST(XGETTEXT)
 
3519
 
 
3520
  ])
 
3521
 
 
3522
# Search path for a program which passes the given test.
 
3523
# Ulrich Drepper <drepper@cygnus.com>, 1996.
 
3524
 
 
3525
# serial 1
 
3526
# Stephan Kulow: I appended a _KDE against name conflicts
 
3527
 
 
3528
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
 
3529
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
3530
AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
 
3531
[# Extract the first word of "$2", so it can be a program name with args.
 
3532
set dummy $2; ac_word=[$]2
 
3533
AC_MSG_CHECKING([for $ac_word])
 
3534
AC_CACHE_VAL(ac_cv_path_$1,
 
3535
[case "[$]$1" in
 
3536
  /*)
 
3537
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
3538
  ;;
 
3539
  *)
 
3540
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
3541
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
3542
    test -z "$ac_dir" && ac_dir=.
 
3543
    if test -f $ac_dir/$ac_word; then
 
3544
      if [$3]; then
 
3545
        ac_cv_path_$1="$ac_dir/$ac_word"
 
3546
        break
 
3547
      fi
 
3548
    fi
 
3549
  done
 
3550
  IFS="$ac_save_ifs"
 
3551
dnl If no 4th arg is given, leave the cache variable unset,
 
3552
dnl so AC_PATH_PROGS will keep looking.
 
3553
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
3554
])dnl
 
3555
  ;;
 
3556
esac])dnl
 
3557
$1="$ac_cv_path_$1"
 
3558
if test -n "[$]$1"; then
 
3559
  AC_MSG_RESULT([$]$1)
 
3560
else
 
3561
  AC_MSG_RESULT(no)
 
3562
fi
 
3563
AC_SUBST($1)dnl
 
3564
])
 
3565
 
 
3566
 
 
3567
# Check whether LC_MESSAGES is available in <locale.h>.
 
3568
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
3569
 
 
3570
# serial 1
 
3571
 
 
3572
AC_DEFUN([AM_LC_MESSAGES],
 
3573
  [if test $ac_cv_header_locale_h = yes; then
 
3574
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
3575
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
3576
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
3577
    if test $am_cv_val_LC_MESSAGES = yes; then
 
3578
      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
 
3579
    fi
 
3580
  fi])
 
3581
 
 
3582
dnl From Jim Meyering.
 
3583
dnl FIXME: migrate into libit.
 
3584
 
 
3585
AC_DEFUN([AM_FUNC_OBSTACK],
 
3586
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
 
3587
 [AC_TRY_LINK([#include "obstack.h"],
 
3588
              [struct obstack *mem;obstack_free(mem,(char *) 0)],
 
3589
              am_cv_func_obstack=yes,
 
3590
              am_cv_func_obstack=no)])
 
3591
 if test $am_cv_func_obstack = yes; then
 
3592
   AC_DEFINE(HAVE_OBSTACK)
 
3593
 else
 
3594
   LIBOBJS="$LIBOBJS obstack.o"
 
3595
 fi
 
3596
])
 
3597
 
 
3598
dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
 
3599
dnl FIXME: Migrate into libit
 
3600
 
 
3601
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
 
3602
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
 
3603
 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
 
3604
              am_cv_lib_error_at_line=yes,
 
3605
              am_cv_lib_error_at_line=no)])
 
3606
 if test $am_cv_lib_error_at_line = no; then
 
3607
   LIBOBJS="$LIBOBJS error.o"
 
3608
 fi
 
3609
 AC_SUBST(LIBOBJS)dnl
 
3610
])
 
3611
 
 
3612
# Macro to add for using GNU gettext.
 
3613
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
3614
 
 
3615
# serial 1
 
3616
# Stephan Kulow: I put a KDE in it to avoid name conflicts
 
3617
 
 
3618
AC_DEFUN([AM_KDE_GNU_GETTEXT],
 
3619
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
3620
   AC_REQUIRE([AC_PROG_RANLIB])dnl
 
3621
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
3622
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
3623
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
3624
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
3625
   AC_REQUIRE([AC_FUNC_MMAP])dnl
 
3626
   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
 
3627
   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
 
3628
   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
 
3629
__argz_count __argz_stringify __argz_next])
 
3630
 
 
3631
   AC_MSG_CHECKING(for stpcpy)
 
3632
   AC_CACHE_VAL(kde_cv_func_stpcpy,
 
3633
   [
 
3634
   kde_safe_cxxflags=$CXXFLAGS
 
3635
   CXXFLAGS="-Werror"
 
3636
   AC_LANG_SAVE
 
3637
   AC_LANG_CPLUSPLUS
 
3638
   AC_TRY_COMPILE([
 
3639
   #include <string.h>
 
3640
   ],
 
3641
   [
 
3642
   char buffer[200];
 
3643
   stpcpy(buffer, buffer);
 
3644
   ],
 
3645
   kde_cv_func_stpcpy=yes,
 
3646
   kde_cv_func_stpcpy=no)
 
3647
   AC_LANG_RESTORE
 
3648
   CXXFLAGS=$kde_safe_cxxflags
 
3649
   ])
 
3650
   AC_MSG_RESULT($kde_cv_func_stpcpy)
 
3651
   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
 
3652
     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
 
3653
   fi
 
3654
 
 
3655
   AM_LC_MESSAGES
 
3656
 
 
3657
   if test "x$CATOBJEXT" != "x"; then
 
3658
     if test "x$ALL_LINGUAS" = "x"; then
 
3659
       LINGUAS=
 
3660
     else
 
3661
       AC_MSG_CHECKING(for catalogs to be installed)
 
3662
       NEW_LINGUAS=
 
3663
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
 
3664
         case "$ALL_LINGUAS" in
 
3665
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
 
3666
         esac
 
3667
       done
 
3668
       LINGUAS=$NEW_LINGUAS
 
3669
       AC_MSG_RESULT($LINGUAS)
 
3670
     fi
 
3671
 
 
3672
     dnl Construct list of names of catalog files to be constructed.
 
3673
     if test -n "$LINGUAS"; then
 
3674
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
3675
     fi
 
3676
   fi
 
3677
 
 
3678
  ])
 
3679
 
 
3680
AC_DEFUN([AC_HAVE_XPM],
 
3681
 [AC_REQUIRE_CPP()dnl
 
3682
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3683
 
 
3684
 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
 
3685
 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
 
3686
 
 
3687
 AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
 
3688
        xpm_test=$withval, xpm_test="yes")
 
3689
 if test "x$xpm_test" = xno; then
 
3690
   ac_cv_have_xpm=no
 
3691
 else
 
3692
   AC_MSG_CHECKING(for XPM)
 
3693
   AC_CACHE_VAL(ac_cv_have_xpm,
 
3694
   [
 
3695
    ac_save_ldflags="$LDFLAGS"
 
3696
    ac_save_cflags="$CFLAGS"
 
3697
    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
3698
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
 
3699
    else
 
3700
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
 
3701
    fi
 
3702
    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
 
3703
    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
 
3704
    AC_TRY_LINK([#include <X11/xpm.h>],[],
 
3705
        ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
 
3706
    LDFLAGS="$ac_save_ldflags"
 
3707
    CFLAGS="$ac_save_cflags"
 
3708
   ])dnl
 
3709
 
 
3710
  if test "$ac_cv_have_xpm" = no; then
 
3711
    AC_MSG_RESULT(no)
 
3712
    XPM_LDFLAGS=""
 
3713
    XPMINC=""
 
3714
    $2
 
3715
  else
 
3716
    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
 
3717
    if test "$XPM_LDFLAGS" = ""; then
 
3718
       XPMLIB='-lXpm $(LIB_X11)'
 
3719
    else
 
3720
       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
 
3721
    fi
 
3722
    if test "$XPM_INCLUDE" = ""; then
 
3723
       XPMINC=""
 
3724
    else
 
3725
       XPMINC="-I$XPM_INCLUDE"
 
3726
    fi
 
3727
    AC_MSG_RESULT(yes)
 
3728
    $1
 
3729
  fi
 
3730
 fi
 
3731
 AC_SUBST(XPMINC)
 
3732
 AC_SUBST(XPMLIB)
 
3733
])
 
3734
 
 
3735
AC_DEFUN([AC_HAVE_DPMS],
 
3736
 [AC_REQUIRE_CPP()dnl
 
3737
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3738
 
 
3739
 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
 
3740
 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
 
3741
 DPMS_LIB=
 
3742
 
 
3743
 AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
 
3744
        dpms_test=$withval, dpms_test="yes")
 
3745
 if test "x$dpms_test" = xno; then
 
3746
   ac_cv_have_dpms=no
 
3747
 else
 
3748
   AC_MSG_CHECKING(for DPMS)
 
3749
   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
 
3750
   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
 
3751
   AC_CACHE_VAL(ac_cv_have_dpms,
 
3752
   [
 
3753
    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
 
3754
      AC_MSG_RESULT(no)
 
3755
      ac_cv_have_dpms="no"
 
3756
    else
 
3757
      ac_save_ldflags="$LDFLAGS"
 
3758
      ac_save_cflags="$CFLAGS"
 
3759
      ac_save_libs="$LIBS"
 
3760
      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
 
3761
      CFLAGS="$CFLAGS $X_INCLUDES"
 
3762
      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3763
      AC_TRY_LINK([
 
3764
          #include <X11/Xproto.h>
 
3765
          #include <X11/X.h>
 
3766
          #include <X11/Xlib.h>
 
3767
          #include <X11/extensions/dpms.h>
 
3768
          int foo_test_dpms()
 
3769
          { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
 
3770
          ac_cv_have_dpms="yes", [
 
3771
              LDFLAGS="$ac_save_ldflags"
 
3772
              CFLAGS="$ac_save_cflags"
 
3773
              LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
 
3774
              LIBS="$LIBS -lXdpms"
 
3775
              CFLAGS="$CFLAGS $X_INCLUDES"
 
3776
              test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3777
              AC_TRY_LINK([
 
3778
                  #include <X11/Xproto.h>
 
3779
                  #include <X11/X.h>
 
3780
                  #include <X11/Xlib.h>
 
3781
                  #include <X11/extensions/dpms.h>
 
3782
                  int foo_test_dpms()
 
3783
                  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
 
3784
                  [
 
3785
                  ac_cv_have_dpms="-lXdpms"
 
3786
                  ],ac_cv_have_dpms="no")
 
3787
              ])
 
3788
      LDFLAGS="$ac_save_ldflags"
 
3789
      CFLAGS="$ac_save_cflags"
 
3790
      LIBS="$ac_save_libs"
 
3791
    fi
 
3792
   ])dnl
 
3793
 
 
3794
  if test "$ac_cv_have_dpms" = no; then
 
3795
    AC_MSG_RESULT(no)
 
3796
    DPMS_LDFLAGS=""
 
3797
    DPMSINC=""
 
3798
    $2
 
3799
  else
 
3800
    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
 
3801
    if test "$ac_cv_have_dpms" = "-lXdpms"; then
 
3802
       DPMS_LIB="-lXdpms"
 
3803
    fi
 
3804
    if test "$DPMS_LDFLAGS" = ""; then
 
3805
       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
 
3806
    else
 
3807
       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
 
3808
    fi
 
3809
    if test "$DPMS_INCLUDE" = ""; then
 
3810
       DPMSINC=""
 
3811
    else
 
3812
       DPMSINC="-I$DPMS_INCLUDE"
 
3813
    fi
 
3814
    AC_MSG_RESULT(yes)
 
3815
    $1
 
3816
  fi
 
3817
 fi
 
3818
 ac_save_cflags="$CFLAGS"
 
3819
 CFLAGS="$CFLAGS $X_INCLUDES"
 
3820
 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3821
 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
 
3822
   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
 
3823
 AC_CHECK_DECL(DPMSCapable,
 
3824
   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
 
3825
   [#include <X11/extensions/dpms.h>])
 
3826
 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
 
3827
   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
 
3828
 AC_CHECK_DECL(DPMSInfo,
 
3829
   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
 
3830
   [#include <X11/extensions/dpms.h>])
 
3831
 CFLAGS="$ac_save_cflags"
 
3832
 AC_SUBST(DPMSINC)
 
3833
 AC_SUBST(DPMSLIB)
 
3834
])
 
3835
 
 
3836
AC_DEFUN([AC_HAVE_GL],
 
3837
 [AC_REQUIRE_CPP()dnl
 
3838
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3839
 
 
3840
 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
 
3841
 test -z "$GL_INCLUDE" && GL_INCLUDE=
 
3842
 
 
3843
 AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
 
3844
        gl_test=$withval, gl_test="yes")
 
3845
 if test "x$kde_use_qt_emb" = "xyes"; then
 
3846
   # GL and Qt Embedded is a no-go for now.
 
3847
   ac_cv_have_gl=no
 
3848
 elif test "x$gl_test" = xno; then
 
3849
   ac_cv_have_gl=no
 
3850
 else
 
3851
   AC_MSG_CHECKING(for GL)
 
3852
   AC_CACHE_VAL(ac_cv_have_gl,
 
3853
   [
 
3854
    AC_LANG_SAVE
 
3855
    AC_LANG_CPLUSPLUS
 
3856
    ac_save_ldflags=$LDFLAGS
 
3857
    ac_save_cxxflags=$CXXFLAGS
 
3858
    ac_save_libs=$LIBS
 
3859
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
 
3860
    LIBS="$LIBS -lGL -lGLU"
 
3861
    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
 
3862
    LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
 
3863
    CXXFLAGS="$CFLAGS $X_INCLUDES"
 
3864
    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
 
3865
    AC_TRY_LINK([#include <GL/gl.h>
 
3866
#include <GL/glu.h>
 
3867
], [],
 
3868
        ac_cv_have_gl="yes", ac_cv_have_gl="no")
 
3869
    AC_LANG_RESTORE
 
3870
    LDFLAGS=$ac_save_ldflags
 
3871
    CXXFLAGS=$ac_save_cxxflags
 
3872
    LIBS=$ac_save_libs
 
3873
   ])dnl
 
3874
 
 
3875
  if test "$ac_cv_have_gl" = "no"; then
 
3876
    AC_MSG_RESULT(no)
 
3877
    GL_LDFLAGS=""
 
3878
    GLINC=""
 
3879
    $2
 
3880
  else
 
3881
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
 
3882
    if test "$GL_LDFLAGS" = ""; then
 
3883
       GLLIB='-lGLU -lGL $(LIB_X11)'
 
3884
    else
 
3885
       GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
 
3886
    fi
 
3887
    if test "$GL_INCLUDE" = ""; then
 
3888
       GLINC=""
 
3889
    else
 
3890
       GLINC="-I$GL_INCLUDE"
 
3891
    fi
 
3892
    AC_MSG_RESULT($ac_cv_have_gl)
 
3893
    $1
 
3894
  fi
 
3895
 fi
 
3896
 AC_SUBST(GLINC)
 
3897
 AC_SUBST(GLLIB)
 
3898
])
 
3899
 
 
3900
 
 
3901
 dnl shadow password and PAM magic - maintained by ossi@kde.org
 
3902
 
 
3903
AC_DEFUN([KDE_PAM], [
 
3904
  AC_REQUIRE([KDE_CHECK_LIBDL])
 
3905
 
 
3906
  want_pam=
 
3907
  AC_ARG_WITH(pam,
 
3908
    AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
 
3909
    [ if test "x$withval" = "xyes"; then
 
3910
        want_pam=yes
 
3911
        pam_service=kde
 
3912
      elif test "x$withval" = "xno"; then
 
3913
        want_pam=no
 
3914
      else
 
3915
        want_pam=yes
 
3916
        pam_service=$withval
 
3917
      fi
 
3918
    ], [ pam_service=kde ])
 
3919
 
 
3920
  use_pam=
 
3921
  PAMLIBS=
 
3922
  if test "x$want_pam" != xno; then
 
3923
    AC_CHECK_LIB(pam, pam_start, [
 
3924
      AC_CHECK_HEADER(security/pam_appl.h,
 
3925
        [ pam_header=security/pam_appl.h ],
 
3926
        [ AC_CHECK_HEADER(pam/pam_appl.h,
 
3927
            [ pam_header=pam/pam_appl.h ],
 
3928
            [
 
3929
    AC_MSG_WARN([PAM detected, but no headers found!
 
3930
Make sure you have the necessary development packages installed.])
 
3931
            ]
 
3932
          )
 
3933
        ]
 
3934
      )
 
3935
    ], , $LIBDL)
 
3936
    if test -z "$pam_header"; then
 
3937
      if test "x$want_pam" = xyes; then
 
3938
        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
 
3939
      fi
 
3940
    else
 
3941
      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
 
3942
      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
 
3943
      use_pam=yes
 
3944
 
 
3945
      dnl darwin claims to be something special
 
3946
      if test "$pam_header" = "pam/pam_appl.h"; then
 
3947
        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
 
3948
      fi
 
3949
 
 
3950
      dnl test whether struct pam_message is const (Linux) or not (Sun)
 
3951
      AC_MSG_CHECKING(for const pam_message)
 
3952
      AC_EGREP_HEADER([struct pam_message], $pam_header,
 
3953
        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
 
3954
                          [AC_MSG_RESULT([const: Linux-type PAM])],
 
3955
                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
 
3956
                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
 
3957
                          )],
 
3958
        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
 
3959
    fi
 
3960
  fi
 
3961
 
 
3962
  AC_SUBST(PAMLIBS)
 
3963
])
 
3964
 
 
3965
dnl DEF_PAM_SERVICE(arg name, full name, define name)
 
3966
AC_DEFUN([DEF_PAM_SERVICE], [
 
3967
  AC_ARG_WITH($1-pam,
 
3968
    AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
 
3969
    [ if test "x$use_pam" = xyes; then
 
3970
        $3_PAM_SERVICE=$withval
 
3971
      else
 
3972
        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
 
3973
You may want to enforce it by using --with-pam.])
 
3974
      fi
 
3975
    ], 
 
3976
    [ if test "x$use_pam" = xyes; then
 
3977
        $3_PAM_SERVICE="$pam_service"
 
3978
      fi
 
3979
    ])
 
3980
    if test -n "$$3_PAM_SERVICE"; then
 
3981
      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
 
3982
      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
 
3983
    fi
 
3984
    AC_SUBST($3_PAM_SERVICE)
 
3985
])
 
3986
 
 
3987
AC_DEFUN([KDE_SHADOWPASSWD], [
 
3988
  AC_REQUIRE([KDE_PAM])
 
3989
 
 
3990
  AC_CHECK_LIB(shadow, getspent,
 
3991
    [ LIBSHADOW="-lshadow"
 
3992
      ac_use_shadow=yes
 
3993
    ],
 
3994
    [ dnl for UnixWare
 
3995
      AC_CHECK_LIB(gen, getspent, 
 
3996
        [ LIBGEN="-lgen"
 
3997
          ac_use_shadow=yes
 
3998
        ], 
 
3999
        [ AC_CHECK_FUNC(getspent, 
 
4000
            [ ac_use_shadow=yes ],
 
4001
            [ ac_use_shadow=no ])
 
4002
        ])
 
4003
    ])
 
4004
  AC_SUBST(LIBSHADOW)
 
4005
  AC_SUBST(LIBGEN)
 
4006
  
 
4007
  AC_MSG_CHECKING([for shadow passwords])
 
4008
 
 
4009
  AC_ARG_WITH(shadow,
 
4010
    AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
 
4011
    [ if test "x$withval" != "xno"; then
 
4012
        use_shadow=yes
 
4013
      else
 
4014
        use_shadow=no
 
4015
      fi
 
4016
    ], [
 
4017
      use_shadow="$ac_use_shadow"
 
4018
    ])
 
4019
 
 
4020
  if test "x$use_shadow" = xyes; then
 
4021
    AC_MSG_RESULT(yes)
 
4022
    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
 
4023
  else
 
4024
    AC_MSG_RESULT(no)
 
4025
    LIBSHADOW=
 
4026
    LIBGEN=
 
4027
  fi
 
4028
 
 
4029
  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
 
4030
  dnl this still applies, if we could use it indirectly through pam.
 
4031
  if test "x$use_shadow" = xyes || 
 
4032
     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
 
4033
      case $host in
 
4034
      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
 
4035
        SETUIDFLAGS="-m 4755 -o root";;
 
4036
      *)
 
4037
        SETUIDFLAGS="-m 4755";;
 
4038
      esac
 
4039
  fi
 
4040
  AC_SUBST(SETUIDFLAGS)
 
4041
 
 
4042
])
 
4043
 
 
4044
AC_DEFUN([KDE_PASSWDLIBS], [
 
4045
  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
 
4046
  AC_REQUIRE([KDE_PAM])
 
4047
  AC_REQUIRE([KDE_SHADOWPASSWD])
 
4048
 
 
4049
  if test "x$use_pam" = "xyes"; then 
 
4050
    PASSWDLIBS="$PAMLIBS"
 
4051
  else
 
4052
    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
 
4053
  fi
 
4054
 
 
4055
  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
 
4056
  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
 
4057
  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
 
4058
  dnl may need to read /etc/master.passwd).
 
4059
  case $host in
 
4060
  *-*-freebsd*)
 
4061
    SETUIDFLAGS="-m 4755 -o root"
 
4062
    ;;
 
4063
  *)
 
4064
    ;;
 
4065
  esac
 
4066
 
 
4067
  AC_SUBST(PASSWDLIBS)
 
4068
])
 
4069
 
 
4070
AC_DEFUN([KDE_CHECK_LIBDL],
 
4071
[
 
4072
AC_CHECK_LIB(dl, dlopen, [
 
4073
LIBDL="-ldl"
 
4074
ac_cv_have_dlfcn=yes
 
4075
])
 
4076
 
 
4077
AC_CHECK_LIB(dld, shl_unload, [
 
4078
LIBDL="-ldld"
 
4079
ac_cv_have_shload=yes
 
4080
])
 
4081
 
 
4082
AC_SUBST(LIBDL)
 
4083
])
 
4084
 
 
4085
AC_DEFUN([KDE_CHECK_DLOPEN],
 
4086
[
 
4087
KDE_CHECK_LIBDL
 
4088
AC_CHECK_HEADERS(dlfcn.h dl.h)
 
4089
if test "$ac_cv_header_dlfcn_h" = "no"; then
 
4090
  ac_cv_have_dlfcn=no
 
4091
fi
 
4092
 
 
4093
if test "$ac_cv_header_dl_h" = "no"; then
 
4094
  ac_cv_have_shload=no
 
4095
fi
 
4096
 
 
4097
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
 
4098
dnl (MM)
 
4099
AC_ARG_ENABLE(dlopen,
 
4100
AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
 
4101
enable_dlopen=$enableval,
 
4102
enable_dlopen=yes)
 
4103
 
 
4104
# override the user's opinion, if we know it better ;)
 
4105
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
 
4106
  enable_dlopen=no
 
4107
fi
 
4108
 
 
4109
if test "$ac_cv_have_dlfcn" = "yes"; then
 
4110
  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
 
4111
fi
 
4112
 
 
4113
if test "$ac_cv_have_shload" = "yes"; then
 
4114
  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
 
4115
fi
 
4116
 
 
4117
if test "$enable_dlopen" = no ; then
 
4118
  test -n "$1" && eval $1
 
4119
else
 
4120
  test -n "$2" && eval $2
 
4121
fi
 
4122
 
 
4123
])
 
4124
 
 
4125
AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
 
4126
[
 
4127
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
 
4128
KDE_PROG_LIBTOOL
 
4129
AC_MSG_CHECKING([dynamic loading])
 
4130
eval "`egrep '^build_libtool_libs=' libtool`"
 
4131
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
 
4132
  dynamic_loading=yes
 
4133
  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
 
4134
else
 
4135
  dynamic_loading=no
 
4136
fi
 
4137
AC_MSG_RESULT($dynamic_loading)
 
4138
if test "$dynamic_loading" = "yes"; then
 
4139
  $1
 
4140
else
 
4141
  $2
 
4142
fi
 
4143
])
 
4144
 
 
4145
AC_DEFUN([KDE_ADD_INCLUDES],
 
4146
[
 
4147
if test -z "$1"; then
 
4148
  test_include="Pix.h"
 
4149
else
 
4150
  test_include="$1"
 
4151
fi
 
4152
 
 
4153
AC_MSG_CHECKING([for libg++ ($test_include)])
 
4154
 
 
4155
AC_CACHE_VAL(kde_cv_libgpp_includes,
 
4156
[
 
4157
kde_cv_libgpp_includes=no
 
4158
 
 
4159
   for ac_dir in               \
 
4160
                               \
 
4161
     /usr/include/g++          \
 
4162
     /usr/include              \
 
4163
     /usr/unsupported/include  \
 
4164
     /opt/include              \
 
4165
     $extra_include            \
 
4166
     ; \
 
4167
   do
 
4168
     if test -r "$ac_dir/$test_include"; then
 
4169
       kde_cv_libgpp_includes=$ac_dir
 
4170
       break
 
4171
     fi
 
4172
   done
 
4173
])
 
4174
 
 
4175
AC_MSG_RESULT($kde_cv_libgpp_includes)
 
4176
if test "$kde_cv_libgpp_includes" != "no"; then
 
4177
  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
 
4178
fi
 
4179
])
 
4180
])
 
4181
 
 
4182
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
 
4183
[
 
4184
  dnl This code is here specifically to handle the
 
4185
  dnl various flavors of threading library on FreeBSD
 
4186
  dnl 4-, 5-, and 6-, and the (weird) rules around it.
 
4187
  dnl There may be an environment PTHREAD_LIBS that 
 
4188
  dnl specifies what to use; otherwise, search for it.
 
4189
  dnl -pthread is special cased and unsets LIBPTHREAD
 
4190
  dnl below if found.
 
4191
  LIBPTHREAD=""
 
4192
 
 
4193
  if test -n "$PTHREAD_LIBS"; then
 
4194
    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
 
4195
      LIBPTHREAD="PTHREAD"
 
4196
    else
 
4197
      PTHREAD_LIBS_save="$PTHREAD_LIBS"
 
4198
      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
 
4199
      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
 
4200
      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
 
4201
          LIBPTHREAD="$PTHREAD_LIBS_save"])
 
4202
      PTHREAD_LIBS="$PTHREAD_LIBS_save"
 
4203
    fi
 
4204
  fi
 
4205
 
 
4206
  dnl Is this test really needed, in the face of the Tru64 test below?
 
4207
  if test -z "$LIBPTHREAD"; then
 
4208
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
 
4209
  fi
 
4210
 
 
4211
  dnl This is a special Tru64 check, see BR 76171 issue #18.
 
4212
  if test -z "$LIBPTHREAD" ; then
 
4213
    AC_MSG_CHECKING([for pthread_create in -lpthread])
 
4214
    kde_safe_libs=$LIBS
 
4215
    LIBS="$LIBS -lpthread"
 
4216
    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
 
4217
        AC_MSG_RESULT(yes)
 
4218
        LIBPTHREAD="-lpthread"],[
 
4219
        AC_MSG_RESULT(no)])
 
4220
    LIBS=$kde_safe_libs
 
4221
  fi
 
4222
 
 
4223
  dnl Un-special-case for FreeBSD.
 
4224
  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
 
4225
    LIBPTHREAD=""
 
4226
  fi
 
4227
 
 
4228
  AC_SUBST(LIBPTHREAD)
 
4229
])
 
4230
 
 
4231
AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
 
4232
[
 
4233
      USE_THREADS=""
 
4234
      if test -z "$LIBPTHREAD"; then
 
4235
        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
 
4236
      fi
 
4237
 
 
4238
    AH_VERBATIM(__svr_define, [
 
4239
#if defined(__SVR4) && !defined(__svr4__)
 
4240
#define __svr4__ 1
 
4241
#endif
 
4242
])
 
4243
    case $host_os in
 
4244
        solaris*)
 
4245
                KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
 
4246
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
 
4247
                ;;
 
4248
        freebsd*)
 
4249
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
 
4250
                ;;
 
4251
        aix*)
 
4252
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
 
4253
                LIBPTHREAD="$LIBPTHREAD -lc_r"
 
4254
                ;;
 
4255
        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
4256
                if test "$CXX" = "KCC"; then
 
4257
                  CXXFLAGS="$CXXFLAGS --thread_safe"
 
4258
                  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
 
4259
                fi
 
4260
                ;;
 
4261
        *)
 
4262
                ;;
 
4263
    esac
 
4264
    AC_SUBST(USE_THREADS)
 
4265
    AC_SUBST(LIBPTHREAD)
 
4266
])
 
4267
 
 
4268
AC_DEFUN([KDE_CHECK_THREADING],
 
4269
[
 
4270
  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
 
4271
  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
 
4272
  dnl default is yes if libpthread is found and no if no libpthread is available
 
4273
  if test -z "$LIBPTHREAD"; then
 
4274
    if test -z "$USE_THREADS"; then
 
4275
      kde_check_threading_default=no
 
4276
    else
 
4277
      kde_check_threading_default=yes
 
4278
    fi
 
4279
  else
 
4280
    kde_check_threading_default=yes
 
4281
  fi
 
4282
  AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
 
4283
   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
 
4284
  if test "x$kde_use_threading" = "xyes"; then
 
4285
    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
 
4286
  fi
 
4287
])
 
4288
 
 
4289
AC_DEFUN([KDE_TRY_LINK_PYTHON],
 
4290
[
 
4291
if test "$kde_python_link_found" = no; then
 
4292
 
 
4293
if test "$1" = normal; then
 
4294
  AC_MSG_CHECKING(if a Python application links)
 
4295
else
 
4296
  AC_MSG_CHECKING(if Python depends on $2)
 
4297
fi
 
4298
 
 
4299
AC_CACHE_VAL(kde_cv_try_link_python_$1,
 
4300
[
 
4301
kde_save_cflags="$CFLAGS"
 
4302
CFLAGS="$CFLAGS $PYTHONINC"
 
4303
kde_save_libs="$LIBS"
 
4304
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
 
4305
kde_save_ldflags="$LDFLAGS"
 
4306
LDFLAGS="$LDFLAGS $PYTHONLIB"
 
4307
 
 
4308
AC_TRY_LINK(
 
4309
[
 
4310
#include <Python.h>
 
4311
],[
 
4312
        PySys_SetArgv(1, 0);
 
4313
],
 
4314
        [kde_cv_try_link_python_$1=yes],
 
4315
        [kde_cv_try_link_python_$1=no]
 
4316
)
 
4317
CFLAGS="$kde_save_cflags"
 
4318
LIBS="$kde_save_libs"
 
4319
LDFLAGS="$kde_save_ldflags"
 
4320
])
 
4321
 
 
4322
if test "$kde_cv_try_link_python_$1" = "yes"; then
 
4323
  AC_MSG_RESULT(yes)
 
4324
  kde_python_link_found=yes
 
4325
  if test ! "$1" = normal; then
 
4326
    LIBPYTHON="$LIBPYTHON $2"
 
4327
  fi
 
4328
  $3
 
4329
else
 
4330
  AC_MSG_RESULT(no)
 
4331
  $4
 
4332
fi
 
4333
 
 
4334
fi
 
4335
 
 
4336
])
 
4337
 
 
4338
AC_DEFUN([KDE_CHECK_PYTHON_DIR],
 
4339
[
 
4340
AC_MSG_CHECKING([for Python directory])
 
4341
 
 
4342
AC_CACHE_VAL(kde_cv_pythondir,
 
4343
[
 
4344
  if test -z "$PYTHONDIR"; then
 
4345
    kde_cv_pythondir=/usr/local
 
4346
  else
 
4347
    kde_cv_pythondir="$PYTHONDIR"
 
4348
  fi
 
4349
])
 
4350
 
 
4351
AC_ARG_WITH(pythondir,
 
4352
AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
 
4353
[
 
4354
  ac_python_dir=$withval
 
4355
], ac_python_dir=$kde_cv_pythondir
 
4356
)
 
4357
 
 
4358
AC_MSG_RESULT($ac_python_dir)
 
4359
])
 
4360
 
 
4361
AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
 
4362
[
 
4363
AC_REQUIRE([KDE_CHECK_LIBDL])
 
4364
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
 
4365
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
 
4366
 
 
4367
if test -z "$1"; then
 
4368
  version="1.5"
 
4369
else
 
4370
  version="$1"
 
4371
fi
 
4372
 
 
4373
AC_MSG_CHECKING([for Python$version])
 
4374
 
 
4375
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
 
4376
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
 
4377
if test ! -r $python_incdir/Python.h; then
 
4378
  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
 
4379
  python_incdir=$python_incdir/python$version
 
4380
  if test ! -r $python_incdir/Python.h; then
 
4381
    python_incdir=no
 
4382
  fi
 
4383
fi
 
4384
 
 
4385
PYTHONINC=-I$python_incdir
 
4386
 
 
4387
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
 
4388
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
 
4389
if test ! -r $python_libdir/libpython$version.so; then
 
4390
  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
 
4391
  if test ! -r $python_libdir/libpython$version.a; then
 
4392
    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
 
4393
    python_libdir=$python_libdir/python$version/config
 
4394
    if test ! -r $python_libdir/libpython$version.a; then
 
4395
      python_libdir=no
 
4396
    fi
 
4397
  fi
 
4398
fi
 
4399
 
 
4400
PYTHONLIB=-L$python_libdir
 
4401
kde_orig_LIBPYTHON=$LIBPYTHON
 
4402
if test -z "$LIBPYTHON"; then
 
4403
  LIBPYTHON=-lpython$version
 
4404
fi
 
4405
 
 
4406
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
 
4407
python_moddir=$python_moddir/python$version
 
4408
if test ! -r $python_moddir/copy.py; then
 
4409
  python_moddir=no
 
4410
fi
 
4411
 
 
4412
PYTHONMODDIR=$python_moddir
 
4413
 
 
4414
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
 
4415
 
 
4416
if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
 
4417
   LIBPYTHON=$kde_orig_LIBPYTHON
 
4418
   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
 
4419
   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
 
4420
   $2
 
4421
else 
 
4422
  dnl Note: this test is very weak
 
4423
  kde_python_link_found=no
 
4424
  KDE_TRY_LINK_PYTHON(normal)
 
4425
  KDE_TRY_LINK_PYTHON(m, -lm)
 
4426
  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
 
4427
  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
 
4428
  KDE_TRY_LINK_PYTHON(db2, -ldb2)
 
4429
  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
 
4430
  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
 
4431
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
 
4432
  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
 
4433
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
 
4434
  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
 
4435
  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
 
4436
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
 
4437
        [AC_MSG_WARN([it seems, Python depends on another library.
 
4438
    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
 
4439
    and contact the authors to let them know about this problem])
 
4440
        ])
 
4441
 
 
4442
  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
 
4443
  AC_SUBST(PYTHONINC)
 
4444
  AC_SUBST(PYTHONLIB)
 
4445
  AC_SUBST(LIBPYTHON)
 
4446
  AC_SUBST(PYTHONMODDIR)
 
4447
  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
 
4448
fi
 
4449
 
 
4450
])
 
4451
 
 
4452
 
 
4453
AC_DEFUN([KDE_CHECK_PYTHON],
 
4454
[
 
4455
  KDE_CHECK_PYTHON_INTERN("2.4",
 
4456
   [KDE_CHECK_PYTHON_INTERN("2.3", 
 
4457
     [KDE_CHECK_PYTHON_INTERN("2.2", 
 
4458
       [KDE_CHECK_PYTHON_INTERN("2.1", 
 
4459
         [KDE_CHECK_PYTHON_INTERN("2.0", 
 
4460
           [KDE_CHECK_PYTHON_INTERN($1, $2) ])
 
4461
         ])
 
4462
       ])
 
4463
     ])
 
4464
  ])
 
4465
])
 
4466
 
 
4467
AC_DEFUN([KDE_CHECK_STL],
 
4468
[
 
4469
    AC_LANG_SAVE
 
4470
    AC_LANG_CPLUSPLUS
 
4471
    ac_save_CXXFLAGS="$CXXFLAGS"
 
4472
    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
 
4473
 
 
4474
    AC_MSG_CHECKING([if C++ programs can be compiled])
 
4475
    AC_CACHE_VAL(kde_cv_stl_works,
 
4476
    [
 
4477
      AC_TRY_COMPILE([
 
4478
#include <string>
 
4479
using namespace std;
 
4480
],[
 
4481
  string astring="Hallo Welt.";
 
4482
  astring.erase(0, 6); // now astring is "Welt"
 
4483
  return 0;
 
4484
], kde_cv_stl_works=yes,
 
4485
   kde_cv_stl_works=no)
 
4486
])
 
4487
 
 
4488
   AC_MSG_RESULT($kde_cv_stl_works)
 
4489
 
 
4490
   if test "$kde_cv_stl_works" = "yes"; then
 
4491
     # back compatible
 
4492
         AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
 
4493
   else
 
4494
         AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
 
4495
Check config.log for details - if you're using a Linux distribution you might miss
 
4496
a package named similar to libstdc++-dev.])
 
4497
   fi
 
4498
 
 
4499
   CXXFLAGS="$ac_save_CXXFLAGS"
 
4500
   AC_LANG_RESTORE
 
4501
])
 
4502
 
 
4503
AC_DEFUN([AC_FIND_QIMGIO],
 
4504
   [AC_REQUIRE([AC_FIND_JPEG])
 
4505
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
4506
AC_MSG_CHECKING([for qimgio])
 
4507
AC_CACHE_VAL(ac_cv_lib_qimgio,
 
4508
[
 
4509
AC_LANG_SAVE
 
4510
AC_LANG_CPLUSPLUS
 
4511
ac_save_LIBS="$LIBS"
 
4512
ac_save_CXXFLAGS="$CXXFLAGS"
 
4513
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
 
4514
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
 
4515
AC_TRY_RUN(dnl
 
4516
[
 
4517
#include <qimageio.h>
 
4518
#include <qstring.h>
 
4519
int main() {
 
4520
                QString t = "hallo";
 
4521
                t.fill('t');
 
4522
                qInitImageIO();
 
4523
}
 
4524
],
 
4525
            ac_cv_lib_qimgio=yes,
 
4526
            ac_cv_lib_qimgio=no,
 
4527
            ac_cv_lib_qimgio=no)
 
4528
LIBS="$ac_save_LIBS"
 
4529
CXXFLAGS="$ac_save_CXXFLAGS"
 
4530
AC_LANG_RESTORE
 
4531
])dnl
 
4532
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
 
4533
  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
 
4534
  AC_MSG_RESULT(yes)
 
4535
  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
 
4536
  AC_SUBST(LIBQIMGIO)
 
4537
else
 
4538
  AC_MSG_RESULT(not found)
 
4539
fi
 
4540
])
 
4541
 
 
4542
AC_DEFUN([AM_DISABLE_LIBRARIES],
 
4543
[
 
4544
    AC_PROVIDE([AM_ENABLE_STATIC])
 
4545
    AC_PROVIDE([AM_ENABLE_SHARED])
 
4546
    enable_static=no
 
4547
    enable_shared=yes
 
4548
])
 
4549
 
 
4550
 
 
4551
AC_DEFUN([AC_CHECK_UTMP_FILE],
 
4552
[
 
4553
    AC_MSG_CHECKING([for utmp file])
 
4554
 
 
4555
    AC_CACHE_VAL(kde_cv_utmp_file,
 
4556
    [
 
4557
    kde_cv_utmp_file=no
 
4558
 
 
4559
    for ac_file in    \
 
4560
                      \
 
4561
        /var/run/utmp \
 
4562
        /var/adm/utmp \
 
4563
        /etc/utmp     \
 
4564
     ; \
 
4565
    do
 
4566
     if test -r "$ac_file"; then
 
4567
       kde_cv_utmp_file=$ac_file
 
4568
       break
 
4569
     fi
 
4570
    done
 
4571
    ])
 
4572
 
 
4573
    if test "$kde_cv_utmp_file" != "no"; then
 
4574
        AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
 
4575
        $1
 
4576
        AC_MSG_RESULT($kde_cv_utmp_file)
 
4577
    else
 
4578
        $2
 
4579
        AC_MSG_RESULT([non found])
 
4580
    fi
 
4581
])
 
4582
 
 
4583
 
 
4584
AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
 
4585
[
 
4586
 
 
4587
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
 
4588
TOPSUBDIRS=""
 
4589
 
 
4590
if test ! -s $srcdir/subdirs; then
 
4591
  dnl Note: Makefile.common creates subdirs, so this is just a fallback
 
4592
  files=`cd $srcdir && ls -1`
 
4593
  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
 
4594
  for i in $dirs; do
 
4595
    echo $i >> $srcdir/subdirs
 
4596
  done
 
4597
fi
 
4598
 
 
4599
ac_topsubdirs=
 
4600
if test -s $srcdir/inst-apps; then
 
4601
  ac_topsubdirs="`cat $srcdir/inst-apps`"
 
4602
elif test -s $srcdir/subdirs; then
 
4603
  ac_topsubdirs="`cat $srcdir/subdirs`"
 
4604
fi
 
4605
 
 
4606
for i in $ac_topsubdirs; do
 
4607
  AC_MSG_CHECKING([if $i should be compiled])
 
4608
  if test -d $srcdir/$i; then
 
4609
    install_it="yes"
 
4610
    for j in $DO_NOT_COMPILE; do
 
4611
      if test $i = $j; then
 
4612
        install_it="no"
 
4613
      fi
 
4614
    done
 
4615
  else
 
4616
    install_it="no"
 
4617
  fi
 
4618
  AC_MSG_RESULT($install_it)
 
4619
  vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
 
4620
  if test $install_it = "yes"; then
 
4621
    TOPSUBDIRS="$TOPSUBDIRS $i"
 
4622
    eval "$vari""_SUBDIR_included=yes"
 
4623
  else
 
4624
    eval "$vari""_SUBDIR_included=no"
 
4625
  fi
 
4626
done
 
4627
 
 
4628
AC_SUBST(TOPSUBDIRS)
 
4629
])
 
4630
 
 
4631
AC_DEFUN([KDE_CHECK_NAMESPACES],
 
4632
[
 
4633
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
 
4634
AC_LANG_SAVE
 
4635
AC_LANG_CPLUSPLUS
 
4636
AC_TRY_COMPILE([
 
4637
],
 
4638
[
 
4639
namespace Foo {
 
4640
  extern int i;
 
4641
  namespace Bar {
 
4642
    extern int i;
 
4643
  }
 
4644
}
 
4645
 
 
4646
int Foo::i = 0;
 
4647
int Foo::Bar::i = 1;
 
4648
],[
 
4649
  AC_MSG_RESULT(yes)
 
4650
  AC_DEFINE(HAVE_NAMESPACES)
 
4651
], [
 
4652
AC_MSG_RESULT(no)
 
4653
])
 
4654
AC_LANG_RESTORE
 
4655
])
 
4656
 
 
4657
dnl ------------------------------------------------------------------------
 
4658
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
 
4659
dnl ------------------------------------------------------------------------
 
4660
dnl
 
4661
AC_DEFUN([AC_CHECK_S_ISSOCK],
 
4662
[
 
4663
AC_MSG_CHECKING(for S_ISSOCK)
 
4664
AC_CACHE_VAL(ac_cv_have_s_issock,
 
4665
[
 
4666
AC_TRY_LINK(
 
4667
[
 
4668
#include <sys/stat.h>
 
4669
],
 
4670
[
 
4671
struct stat buff;
 
4672
int b = S_ISSOCK( buff.st_mode );
 
4673
],
 
4674
ac_cv_have_s_issock=yes,
 
4675
ac_cv_have_s_issock=no)
 
4676
])
 
4677
AC_MSG_RESULT($ac_cv_have_s_issock)
 
4678
if test "$ac_cv_have_s_issock" = "yes"; then
 
4679
  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
 
4680
fi
 
4681
 
 
4682
AH_VERBATIM(_ISSOCK,
 
4683
[
 
4684
#ifndef HAVE_S_ISSOCK
 
4685
#define HAVE_S_ISSOCK
 
4686
#define S_ISSOCK(mode) (1==0)
 
4687
#endif
 
4688
])
 
4689
 
 
4690
])
 
4691
 
 
4692
dnl ------------------------------------------------------------------------
 
4693
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
 
4694
dnl ------------------------------------------------------------------------
 
4695
dnl
 
4696
AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
 
4697
[
 
4698
AC_MSG_CHECKING(for MAXPATHLEN)
 
4699
AC_CACHE_VAL(ac_cv_maxpathlen,
 
4700
[
 
4701
cat > conftest.$ac_ext <<EOF
 
4702
#ifdef STDC_HEADERS
 
4703
# include <stdlib.h>
 
4704
#endif
 
4705
#include <stdio.h>
 
4706
#include <sys/param.h>
 
4707
#ifndef MAXPATHLEN
 
4708
#define MAXPATHLEN 1024
 
4709
#endif
 
4710
 
 
4711
KDE_HELLO MAXPATHLEN
 
4712
 
 
4713
EOF
 
4714
 
 
4715
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
 
4716
 
 
4717
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
 
4718
    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
 
4719
else
 
4720
    ac_cv_maxpathlen=1024
 
4721
fi
 
4722
 
 
4723
rm conftest.*
 
4724
 
 
4725
])
 
4726
AC_MSG_RESULT($ac_cv_maxpathlen)
 
4727
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
 
4728
])
 
4729
 
 
4730
AC_DEFUN([KDE_CHECK_HEADER],
 
4731
[
 
4732
   kde_safe_cppflags=$CPPFLAGS
 
4733
   CPPFLAGS="$CPPFLAGS $all_includes"
 
4734
   AC_LANG_SAVE
 
4735
   AC_LANG_CPLUSPLUS
 
4736
   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
 
4737
   AC_LANG_RESTORE
 
4738
   CPPFLAGS=$kde_safe_cppflags
 
4739
])
 
4740
 
 
4741
AC_DEFUN([KDE_CHECK_HEADERS],
 
4742
[
 
4743
   AH_CHECK_HEADERS([$1])
 
4744
   AC_LANG_SAVE
 
4745
   kde_safe_cppflags=$CPPFLAGS
 
4746
   CPPFLAGS="$CPPFLAGS $all_includes"
 
4747
   AC_LANG_CPLUSPLUS
 
4748
   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
 
4749
   CPPFLAGS=$kde_safe_cppflags
 
4750
   AC_LANG_RESTORE
 
4751
])
 
4752
 
 
4753
AC_DEFUN([KDE_FAST_CONFIGURE],
 
4754
[
 
4755
  dnl makes configure fast (needs perl)
 
4756
  AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
 
4757
      with_fast_perl=$enableval, with_fast_perl=yes)
 
4758
])
 
4759
 
 
4760
AC_DEFUN([KDE_CONF_FILES],
 
4761
[
 
4762
  val=
 
4763
  if test -f $srcdir/configure.files ; then
 
4764
    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
 
4765
  fi
 
4766
  CONF_FILES=
 
4767
  if test -n "$val" ; then
 
4768
    for i in $val ; do
 
4769
      CONF_FILES="$CONF_FILES $i"
 
4770
    done
 
4771
  fi
 
4772
  AC_SUBST(CONF_FILES)
 
4773
])dnl
 
4774
 
 
4775
dnl This sets the prefix, for arts and kdelibs
 
4776
dnl Do NOT use in any other module.
 
4777
dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
 
4778
AC_DEFUN([KDE_SET_PREFIX_CORE],
 
4779
[
 
4780
  unset CDPATH
 
4781
  dnl make $KDEDIR the default for the installation
 
4782
  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
 
4783
 
 
4784
  if test "x$prefix" = "xNONE"; then
 
4785
    prefix=$ac_default_prefix
 
4786
    ac_configure_args="$ac_configure_args --prefix=$prefix"
 
4787
  fi
 
4788
  # And delete superfluous '/' to make compares easier
 
4789
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4790
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4791
 
 
4792
  kde_libs_prefix='$(prefix)'
 
4793
  kde_libs_htmldir='$(kde_htmldir)'
 
4794
  AC_SUBST(kde_libs_prefix)
 
4795
  AC_SUBST(kde_libs_htmldir)
 
4796
  KDE_FAST_CONFIGURE
 
4797
  KDE_CONF_FILES
 
4798
])
 
4799
 
 
4800
 
 
4801
AC_DEFUN([KDE_SET_PREFIX],
 
4802
[
 
4803
  unset CDPATH
 
4804
  dnl We can't give real code to that macro, only a value.
 
4805
  dnl It only matters for --help, since we set the prefix in this function anyway.
 
4806
  AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
 
4807
 
 
4808
  KDE_SET_DEFAULT_BINDIRS
 
4809
  if test "x$prefix" = "xNONE"; then
 
4810
    dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
 
4811
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
 
4812
  else
 
4813
    dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
 
4814
    kde_save_PATH="$PATH"
 
4815
    PATH="$exec_prefix/bin:$prefix/bin:$PATH"
 
4816
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
 
4817
    PATH="$kde_save_PATH"
 
4818
  fi
 
4819
 
 
4820
  kde_libs_prefix=`$KDECONFIG --prefix`
 
4821
  if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
 
4822
       AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
 
4823
                    This means it has been moved since you installed it.
 
4824
                    This won't work. Please recompile kdelibs for the new prefix.
 
4825
                    ])
 
4826
  fi
 
4827
  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
 
4828
  kde_libs_suffix=`$KDECONFIG --libsuffix`
 
4829
 
 
4830
  AC_MSG_CHECKING([where to install])
 
4831
  if test "x$prefix" = "xNONE"; then
 
4832
    prefix=$kde_libs_prefix
 
4833
    AC_MSG_RESULT([$prefix (as returned by kde-config)])
 
4834
  else
 
4835
    dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
 
4836
    given_prefix=$prefix
 
4837
    AC_MSG_RESULT([$prefix (as requested)])
 
4838
  fi
 
4839
 
 
4840
  # And delete superfluous '/' to make compares easier
 
4841
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4842
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4843
  given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4844
 
 
4845
  AC_SUBST(KDECONFIG)
 
4846
  AC_SUBST(kde_libs_prefix)
 
4847
  AC_SUBST(kde_libs_htmldir)
 
4848
 
 
4849
  KDE_FAST_CONFIGURE
 
4850
  KDE_CONF_FILES
 
4851
])
 
4852
 
 
4853
pushdef([AC_PROG_INSTALL],
 
4854
[
 
4855
  dnl our own version, testing for a -p flag
 
4856
  popdef([AC_PROG_INSTALL])
 
4857
  dnl as AC_PROG_INSTALL works as it works we first have
 
4858
  dnl to save if the user didn't specify INSTALL, as the
 
4859
  dnl autoconf one overwrites INSTALL and we have no chance to find
 
4860
  dnl out afterwards
 
4861
  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
 
4862
  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
 
4863
  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
 
4864
  AC_PROG_INSTALL
 
4865
 
 
4866
  if test -z "$kde_save_INSTALL_given" ; then
 
4867
    # OK, user hasn't given any INSTALL, autoconf found one for us
 
4868
    # now we test, if it supports the -p flag
 
4869
    AC_MSG_CHECKING(for -p flag to install)
 
4870
    rm -f confinst.$$.* > /dev/null 2>&1
 
4871
    echo "Testtest" > confinst.$$.orig
 
4872
    ac_res=no
 
4873
    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
 
4874
      if test -f confinst.$$.new ; then
 
4875
        # OK, -p seems to do no harm to install
 
4876
        INSTALL="${INSTALL} -p"
 
4877
        ac_res=yes
 
4878
      fi
 
4879
    fi
 
4880
    rm -f confinst.$$.*
 
4881
    AC_MSG_RESULT($ac_res)
 
4882
  fi
 
4883
  dnl the following tries to resolve some signs and wonders coming up
 
4884
  dnl with different autoconf/automake versions
 
4885
  dnl e.g.:
 
4886
  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
 
4887
  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
 
4888
  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
 
4889
  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
 
4890
  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
 
4891
  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
 
4892
  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
 
4893
  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
 
4894
  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
 
4895
  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
 
4896
  dnl   automake (due to broken Makefile.am or whatever) to install programs,
 
4897
  dnl   and so does not see the -s flag in automake > 1.4
 
4898
  dnl to clean up that mess we:
 
4899
  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
 
4900
  dnl   which cleans KDE's program with automake > 1.4;
 
4901
  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
 
4902
  dnl   with automake<=1.4
 
4903
  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
 
4904
  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
 
4905
  dnl
 
4906
  dnl And to all this comes, that I even can't write in comments variable
 
4907
  dnl  names used by automake, because it is so stupid to think I wanted to
 
4908
  dnl  _use_ them, therefor I have written A_M_... instead of AM_
 
4909
  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
 
4910
 
 
4911
  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
 
4912
    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
 
4913
  fi
 
4914
  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
 
4915
    INSTALL_SCRIPT='${INSTALL}'
 
4916
  fi
 
4917
])dnl
 
4918
 
 
4919
AC_DEFUN([KDE_LANG_CPLUSPLUS],
 
4920
[AC_LANG_CPLUSPLUS
 
4921
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
 
4922
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
 
4923
])
 
4924
 
 
4925
pushdef([AC_LANG_CPLUSPLUS],
 
4926
[popdef([AC_LANG_CPLUSPLUS])
 
4927
KDE_LANG_CPLUSPLUS
 
4928
])
 
4929
 
 
4930
AC_DEFUN([KDE_CHECK_LONG_LONG],
 
4931
[
 
4932
AC_MSG_CHECKING(for long long)
 
4933
AC_CACHE_VAL(kde_cv_c_long_long,
 
4934
[
 
4935
  AC_LANG_SAVE
 
4936
  AC_LANG_CPLUSPLUS
 
4937
  AC_TRY_LINK([], [
 
4938
  long long foo = 0;
 
4939
  foo = foo+1;
 
4940
  ],
 
4941
  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
 
4942
  AC_LANG_RESTORE
 
4943
])
 
4944
AC_MSG_RESULT($kde_cv_c_long_long)
 
4945
if test "$kde_cv_c_long_long" = yes; then
 
4946
   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
 
4947
fi
 
4948
])
 
4949
 
 
4950
AC_DEFUN([KDE_CHECK_LIB],
 
4951
[
 
4952
     kde_save_LDFLAGS="$LDFLAGS"
 
4953
     dnl AC_CHECK_LIB modifies LIBS, so save it here
 
4954
     kde_save_LIBS="$LIBS"
 
4955
     LDFLAGS="$LDFLAGS $all_libraries"
 
4956
     case $host_os in
 
4957
      aix*) LDFLAGS="-brtl $LDFLAGS"
 
4958
        test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
 
4959
        ;;
 
4960
     esac
 
4961
     AC_CHECK_LIB($1, $2, $3, $4, $5)
 
4962
     LDFLAGS="$kde_save_LDFLAGS"
 
4963
     LIBS="$kde_save_LIBS"
 
4964
])
 
4965
 
 
4966
AC_DEFUN([KDE_JAVA_PREFIX],
 
4967
[
 
4968
        dir=`dirname "$1"`
 
4969
        base=`basename "$1"`
 
4970
        list=`ls -1 $dir 2> /dev/null`
 
4971
        for entry in $list; do 
 
4972
                if test -d $dir/$entry/bin; then
 
4973
                        case $entry in
 
4974
                           $base)
 
4975
                                javadirs="$javadirs $dir/$entry/bin"
 
4976
                                ;;
 
4977
                        esac
 
4978
                elif test -d $dir/$entry/jre/bin; then
 
4979
                        case $entry in
 
4980
                           $base)
 
4981
                                javadirs="$javadirs $dir/$entry/jre/bin"
 
4982
                                ;;
 
4983
                        esac
 
4984
                fi
 
4985
        done
 
4986
])
 
4987
 
 
4988
dnl KDE_CHEC_JAVA_DIR(onlyjre)
 
4989
AC_DEFUN([KDE_CHECK_JAVA_DIR],
 
4990
[
 
4991
 
 
4992
AC_ARG_WITH(java,
 
4993
AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
 
4994
[  ac_java_dir=$withval
 
4995
], ac_java_dir=""
 
4996
)
 
4997
 
 
4998
AC_MSG_CHECKING([for Java])
 
4999
 
 
5000
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
 
5001
if test "x$ac_java_dir" = "xno"; then
 
5002
   kde_java_bindir=no
 
5003
   kde_java_includedir=no
 
5004
   kde_java_libjvmdir=no
 
5005
   kde_java_libgcjdir=no
 
5006
   kde_java_libhpidir=no
 
5007
else
 
5008
  if test "x$ac_java_dir" = "x"; then
 
5009
     
 
5010
     
 
5011
      dnl No option set -> collect list of candidate paths
 
5012
      if test -n "$JAVA_HOME"; then
 
5013
        KDE_JAVA_PREFIX($JAVA_HOME)
 
5014
      fi
 
5015
      KDE_JAVA_PREFIX(/usr/j2se)
 
5016
      KDE_JAVA_PREFIX(/usr/lib/j2se)
 
5017
      KDE_JAVA_PREFIX(/usr/j*dk*)
 
5018
      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
 
5019
      KDE_JAVA_PREFIX(/opt/j*sdk*)
 
5020
      KDE_JAVA_PREFIX(/usr/lib/java*)
 
5021
      KDE_JAVA_PREFIX(/usr/java*)
 
5022
      KDE_JAVA_PREFIX(/usr/java/j*dk*)
 
5023
      KDE_JAVA_PREFIX(/usr/java/j*re*)
 
5024
      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
 
5025
      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
 
5026
      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
 
5027
      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
 
5028
      KDE_JAVA_PREFIX(/opt/java*)
 
5029
 
 
5030
      kde_cv_path="NONE"
 
5031
      kde_save_IFS=$IFS
 
5032
      IFS=':'
 
5033
      for dir in $PATH; do
 
5034
          if test -d "$dir"; then
 
5035
              javadirs="$javadirs $dir"
 
5036
          fi
 
5037
      done
 
5038
      IFS=$kde_save_IFS
 
5039
      jredirs=
 
5040
 
 
5041
      dnl Now javadirs contains a list of paths that exist, all ending with bin/
 
5042
      for dir in $javadirs; do
 
5043
          dnl Check for the java executable
 
5044
          if test -x "$dir/java"; then
 
5045
              dnl And also check for a libjvm.so somewhere under there
 
5046
              dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
 
5047
              if test "$dir" != "/usr/bin"; then
 
5048
                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
5049
                  if test ! -f $libjvmdir/libjvm.so; then continue; fi
 
5050
                  jredirs="$jredirs $dir"
 
5051
              fi
 
5052
          fi
 
5053
      done
 
5054
 
 
5055
      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
 
5056
      JAVAC=
 
5057
      JAVA=
 
5058
      kde_java_bindir=no
 
5059
      for dir in $jredirs; do
 
5060
          JAVA="$dir/java"
 
5061
          kde_java_bindir=$dir
 
5062
          if test -x "$dir/javac"; then
 
5063
                JAVAC="$dir/javac"
 
5064
                break
 
5065
          fi
 
5066
      done
 
5067
 
 
5068
      if test -n "$JAVAC"; then
 
5069
          dnl this substitution might not work - well, we test for jni.h below
 
5070
          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
 
5071
      else
 
5072
          kde_java_includedir=no
 
5073
      fi
 
5074
  else
 
5075
    dnl config option set
 
5076
    kde_java_bindir=$ac_java_dir/bin
 
5077
    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
 
5078
        kde_java_includedir=no
 
5079
    else
 
5080
        kde_java_includedir=$ac_java_dir/include
 
5081
    fi
 
5082
  fi
 
5083
fi
 
5084
 
 
5085
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
 
5086
if test "x$kde_java_bindir" != "xno"; then
 
5087
 
 
5088
  dnl Look for libjvm.so
 
5089
  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
5090
  dnl Look for libgcj.so
 
5091
  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
 
5092
  dnl Look for libhpi.so and avoid green threads
 
5093
  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
 
5094
 
 
5095
  dnl Now check everything's fine under there
 
5096
  dnl the include dir is our flag for having the JDK
 
5097
  if test -d "$kde_java_includedir"; then
 
5098
    if test ! -x "$kde_java_bindir/javac"; then
 
5099
      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
 
5100
    fi
 
5101
    if test ! -x "$kde_java_bindir/javah"; then
 
5102
      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
5103
    fi
 
5104
    if test ! -x "$kde_java_bindir/jar"; then
 
5105
      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
5106
    fi
 
5107
    if test ! -r "$kde_java_includedir/jni.h"; then
 
5108
      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
 
5109
    fi
 
5110
 
 
5111
    jni_includes="-I$kde_java_includedir"
 
5112
    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
 
5113
    dnl and under linux here.. 
 
5114
    
 
5115
    dnl not needed for gcj
 
5116
 
 
5117
    if test "x$kde_java_libgcjdir" = "x"; then 
 
5118
      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
 
5119
      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
 
5120
      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
 
5121
    fi
 
5122
 
 
5123
  else
 
5124
    JAVAC=
 
5125
    jni_includes=
 
5126
  fi
 
5127
 
 
5128
  if test "x$kde_java_libgcjdir" = "x"; then 
 
5129
     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
 
5130
        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
 
5131
     fi 
 
5132
  else
 
5133
     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
 
5134
        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
 
5135
     fi 
 
5136
  fi
 
5137
 
 
5138
  if test ! -x "$kde_java_bindir/java"; then
 
5139
      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
5140
  fi
 
5141
 
 
5142
  dnl not needed for gcj compile
 
5143
 
 
5144
  if test "x$kde_java_libgcjdir" = "x"; then 
 
5145
      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
 
5146
        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
 
5147
      fi
 
5148
  fi
 
5149
 
 
5150
  if test -n "$jni_includes"; then
 
5151
    dnl Check for JNI version
 
5152
    AC_LANG_SAVE
 
5153
    AC_LANG_CPLUSPLUS
 
5154
    ac_cxxflags_safe="$CXXFLAGS"
 
5155
    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
 
5156
 
 
5157
    AC_TRY_COMPILE([
 
5158
  #include <jni.h>
 
5159
              ],
 
5160
              [
 
5161
  #ifndef JNI_VERSION_1_2
 
5162
  Syntax Error
 
5163
  #endif
 
5164
              ],[ kde_jni_works=yes ],
 
5165
              [ kde_jni_works=no ])
 
5166
 
 
5167
    if test $kde_jni_works = no; then
 
5168
      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
 
5169
                    You need to have Java Development Kit (JDK) version 1.2. 
 
5170
 
 
5171
                    Use --with-java to specify another location.
 
5172
                    Use --without-java to configure without java support.
 
5173
                    Or download a newer JDK and try again. 
 
5174
                    See e.g. http://java.sun.com/products/jdk/1.2 ])
 
5175
    fi
 
5176
 
 
5177
    CXXFLAGS="$ac_cxxflags_safe"    
 
5178
    AC_LANG_RESTORE
 
5179
 
 
5180
    dnl All tests ok, inform and subst the variables
 
5181
 
 
5182
    JAVAC=$kde_java_bindir/javac
 
5183
    JAVAH=$kde_java_bindir/javah
 
5184
    JAR=$kde_java_bindir/jar
 
5185
    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
5186
    if test "x$kde_java_libgcjdir" = "x"; then 
 
5187
      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
 
5188
    else
 
5189
      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
 
5190
    fi
 
5191
    AC_MSG_RESULT([java JDK in $kde_java_bindir])
 
5192
 
 
5193
  else
 
5194
      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
5195
      AC_MSG_RESULT([java JRE in $kde_java_bindir])
 
5196
  fi
 
5197
elif test -d "/Library/Java/Home"; then
 
5198
  kde_java_bindir="/Library/Java/Home/bin"
 
5199
  jni_includes="-I/Library/Java/Home/include"
 
5200
 
 
5201
  JAVAC=$kde_java_bindir/javac
 
5202
  JAVAH=$kde_java_bindir/javah
 
5203
  JAR=$kde_java_bindir/jar
 
5204
  JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
 
5205
 
 
5206
  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
5207
  AC_MSG_RESULT([Apple Java Framework])
 
5208
else
 
5209
  AC_MSG_RESULT([none found])
 
5210
fi
 
5211
 
 
5212
AC_SUBST(JAVAC)
 
5213
AC_SUBST(JAVAH)
 
5214
AC_SUBST(JAR)
 
5215
AC_SUBST(JVMLIBS)
 
5216
AC_SUBST(jni_includes)
 
5217
 
 
5218
# for backward compat
 
5219
kde_cv_java_includedir=$kde_java_includedir
 
5220
kde_cv_java_bindir=$kde_java_bindir
 
5221
])
 
5222
 
 
5223
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
 
5224
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
 
5225
dnl big packages, m4_foreach is dog-slow.  So use our own version of
 
5226
dnl it.  (matz@kde.org)
 
5227
m4_define([mm_foreach],
 
5228
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
 
5229
m4_define([mm_car], [[$1]])
 
5230
m4_define([mm_car2], [[$@]])
 
5231
m4_define([_mm_foreach],
 
5232
[m4_if(m4_quote($2), [], [],
 
5233
       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
 
5234
                                                   mm_car2(m4_shift($2)),
 
5235
                                                   [$3])])])
 
5236
m4_define([AC_FOREACH],
 
5237
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
 
5238
 
 
5239
AC_DEFUN([KDE_NEED_FLEX],
 
5240
[
 
5241
kde_libs_safe=$LIBS
 
5242
LIBS="$LIBS $USER_LDFLAGS"
 
5243
AM_PROG_LEX
 
5244
LIBS=$kde_libs_safe
 
5245
if test -z "$LEXLIB"; then
 
5246
    AC_MSG_ERROR([You need to have flex installed.])
 
5247
fi
 
5248
AC_SUBST(LEXLIB)
 
5249
])
 
5250
 
 
5251
AC_DEFUN([AC_PATH_QTOPIA],
 
5252
[
 
5253
  dnl TODO: use AC_CACHE_VAL
 
5254
 
 
5255
  if test -z "$1"; then
 
5256
    qtopia_minver_maj=1
 
5257
    qtopia_minver_min=5
 
5258
    qtopia_minver_pat=0
 
5259
  else
 
5260
    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
 
5261
    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
 
5262
    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
 
5263
  fi
 
5264
 
 
5265
  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
 
5266
  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
 
5267
 
 
5268
  AC_REQUIRE([AC_PATH_QT])
 
5269
 
 
5270
  AC_MSG_CHECKING([for Qtopia])
 
5271
 
 
5272
  LIB_QTOPIA="-lqpe"
 
5273
  AC_SUBST(LIB_QTOPIA)
 
5274
 
 
5275
  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
 
5276
 
 
5277
  ac_qtopia_incdir=NO
 
5278
 
 
5279
  AC_ARG_WITH(qtopia-dir,
 
5280
              AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
 
5281
              [  ac_qtopia_incdir="$withval"/include] ) 
 
5282
  
 
5283
  qtopia_incdirs=""
 
5284
  for dir in $kde_qtopia_dirs; do
 
5285
    qtopia_incdirs="$qtopia_incdirs $dir/include"
 
5286
  done
 
5287
 
 
5288
  if test ! "$ac_qtopia_incdir" = "NO"; then
 
5289
    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
 
5290
  fi
 
5291
 
 
5292
  qtopia_incdir=""
 
5293
  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
 
5294
  ac_qtopia_incdir="$qtopia_incdir"
 
5295
 
 
5296
  if test -z "$qtopia_incdir"; then
 
5297
    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
 
5298
  fi
 
5299
 
 
5300
  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
 
5301
  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
 
5302
  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
 
5303
 
 
5304
  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
 
5305
  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
 
5306
  if test "$qtopia_ver" -lt "$qtopia_minver"; then
 
5307
    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
 
5308
is required.])
 
5309
  fi
 
5310
 
 
5311
  AC_LANG_SAVE
 
5312
  AC_LANG_CPLUSPLUS
 
5313
 
 
5314
  ac_cxxflags_safe="$CXXFLAGS"
 
5315
  ac_ldflags_safe="$LDFLAGS"
 
5316
  ac_libs_safe="$LIBS"
 
5317
 
 
5318
  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
 
5319
  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
 
5320
  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
 
5321
 
 
5322
  cat > conftest.$ac_ext <<EOF
 
5323
#include "confdefs.h"
 
5324
#include <qpe/qpeapplication.h>
 
5325
#include <qpe/version.h>
 
5326
 
 
5327
int main( int argc, char **argv )
 
5328
{
 
5329
    QPEApplication app( argc, argv );
 
5330
    return 0;
 
5331
}
 
5332
EOF
 
5333
 
 
5334
  if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
5335
    rm -f conftest*
 
5336
  else
 
5337
    rm -f conftest*
 
5338
    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
 
5339
the end of config.log])
 
5340
  fi
 
5341
 
 
5342
  CXXFLAGS="$ac_cxxflags_safe"
 
5343
  LDFLAGS="$ac_ldflags_safe"
 
5344
  LIBS="$ac_libs_safe"
 
5345
 
 
5346
  AC_LANG_RESTORE
 
5347
 
 
5348
  QTOPIA_INCLUDES="-I$qtopia_incdir"
 
5349
  AC_SUBST(QTOPIA_INCLUDES)
 
5350
 
 
5351
  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
 
5352
])
 
5353
 
 
5354
 
 
5355
AC_DEFUN([KDE_INIT_DOXYGEN],
 
5356
[
 
5357
AC_MSG_CHECKING([for Qt docs])
 
5358
kde_qtdir=
 
5359
if test "${with_qt_dir+set}" = set; then
 
5360
  kde_qtdir="$with_qt_dir"
 
5361
fi
 
5362
 
 
5363
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
 
5364
AC_MSG_RESULT($QTDOCDIR)
 
5365
 
 
5366
AC_SUBST(QTDOCDIR)
 
5367
 
 
5368
KDE_FIND_PATH(dot, DOT, [], [])
 
5369
if test -n "$DOT"; then
 
5370
  KDE_HAVE_DOT="YES"
 
5371
else
 
5372
  KDE_HAVE_DOT="NO"
 
5373
fi
 
5374
AC_SUBST(KDE_HAVE_DOT)
 
5375
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
 
5376
AC_SUBST(DOXYGEN)
 
5377
 
 
5378
DOXYGEN_PROJECT_NAME="$1"
 
5379
DOXYGEN_PROJECT_NUMBER="$2"
 
5380
AC_SUBST(DOXYGEN_PROJECT_NAME)
 
5381
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
 
5382
 
 
5383
KDE_HAS_DOXYGEN=no
 
5384
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
 
5385
  KDE_HAS_DOXYGEN=yes
 
5386
fi
 
5387
AC_SUBST(KDE_HAS_DOXYGEN)
 
5388
 
 
5389
])
 
5390
 
 
5391
 
 
5392
AC_DEFUN([AC_FIND_BZIP2],
 
5393
[
 
5394
AC_MSG_CHECKING([for bzDecompress in libbz2])
 
5395
AC_CACHE_VAL(ac_cv_lib_bzip2,
 
5396
[
 
5397
AC_LANG_SAVE
 
5398
AC_LANG_CPLUSPLUS
 
5399
kde_save_LIBS="$LIBS"
 
5400
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
 
5401
kde_save_CXXFLAGS="$CXXFLAGS"
 
5402
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
5403
AC_TRY_LINK(dnl
 
5404
[
 
5405
#define BZ_NO_STDIO
 
5406
#include<bzlib.h>
 
5407
],
 
5408
            [ bz_stream s; (void) bzDecompress(&s); ],
 
5409
            eval "ac_cv_lib_bzip2='-lbz2'",
 
5410
            eval "ac_cv_lib_bzip2=no")
 
5411
LIBS="$kde_save_LIBS"
 
5412
CXXFLAGS="$kde_save_CXXFLAGS"
 
5413
AC_LANG_RESTORE
 
5414
])dnl
 
5415
AC_MSG_RESULT($ac_cv_lib_bzip2)
 
5416
 
 
5417
if test ! "$ac_cv_lib_bzip2" = no; then
 
5418
  BZIP2DIR=bzip2
 
5419
 
 
5420
  LIBBZ2="$ac_cv_lib_bzip2"
 
5421
  AC_SUBST(LIBBZ2)
 
5422
 
 
5423
else
 
5424
 
 
5425
   cxx_shared_flag=
 
5426
   ld_shared_flag=
 
5427
   KDE_CHECK_COMPILER_FLAG(shared, [
 
5428
        ld_shared_flag="-shared"
 
5429
   ])
 
5430
   KDE_CHECK_COMPILER_FLAG(fPIC, [
 
5431
        cxx_shared_flag="-fPIC"
 
5432
   ])
 
5433
 
 
5434
   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
 
5435
   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
 
5436
   [
 
5437
   AC_LANG_SAVE
 
5438
   AC_LANG_CPLUSPLUS
 
5439
   kde_save_LIBS="$LIBS"
 
5440
   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
 
5441
   kde_save_CXXFLAGS="$CXXFLAGS"
 
5442
   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
 
5443
 
 
5444
   AC_TRY_LINK(dnl
 
5445
   [
 
5446
   #define BZ_NO_STDIO
 
5447
   #include<bzlib.h>
 
5448
   ],
 
5449
               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
 
5450
               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
 
5451
               eval "ac_cv_lib_bzip2_prefix=no")
 
5452
   LIBS="$kde_save_LIBS"
 
5453
   CXXFLAGS="$kde_save_CXXFLAGS"
 
5454
   AC_LANG_RESTORE
 
5455
   ])dnl
 
5456
 
 
5457
   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
 
5458
   
 
5459
   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
 
5460
     BZIP2DIR=bzip2
 
5461
    
 
5462
     LIBBZ2="$ac_cv_lib_bzip2_prefix"
 
5463
     AC_SUBST(LIBBZ2)
 
5464
 
 
5465
     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
 
5466
   dnl else, we just ignore this
 
5467
   fi
 
5468
 
 
5469
fi
 
5470
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
 
5471
])
 
5472
 
 
5473
dnl ------------------------------------------------------------------------
 
5474
dnl Try to find the SSL headers and libraries.
 
5475
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
 
5476
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
 
5477
dnl ------------------------------------------------------------------------
 
5478
dnl
 
5479
AC_DEFUN([KDE_CHECK_SSL],
 
5480
[
 
5481
LIBSSL="-lssl -lcrypto"
 
5482
AC_REQUIRE([KDE_CHECK_LIB64])
 
5483
 
 
5484
ac_ssl_includes=NO ac_ssl_libraries=NO
 
5485
ssl_libraries=""
 
5486
ssl_includes=""
 
5487
AC_ARG_WITH(ssl-dir,
 
5488
    AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
 
5489
    [  ac_ssl_includes="$withval"/include
 
5490
       ac_ssl_libraries="$withval"/lib$kdelibsuff
 
5491
    ])
 
5492
 
 
5493
want_ssl=yes
 
5494
AC_ARG_WITH(ssl,
 
5495
    AC_HELP_STRING([--without-ssl],[disable SSL checks]),
 
5496
    [want_ssl=$withval])
 
5497
 
 
5498
if test $want_ssl = yes; then
 
5499
 
 
5500
AC_MSG_CHECKING(for OpenSSL)
 
5501
 
 
5502
AC_CACHE_VAL(ac_cv_have_ssl,
 
5503
[#try to guess OpenSSL locations
 
5504
  
 
5505
  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
 
5506
  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
 
5507
  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
 
5508
  ac_ssl_includes="$ssl_incdir"
 
5509
 
 
5510
  ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
 
5511
  if test ! "$ac_ssl_libraries" = "NO"; then
 
5512
    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
 
5513
  fi
 
5514
 
 
5515
  test=NONE
 
5516
  ssl_libdir=NONE
 
5517
  for dir in $ssl_libdirs; do
 
5518
    try="ls -1 $dir/libssl*"
 
5519
    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
5520
  done
 
5521
 
 
5522
  ac_ssl_libraries="$ssl_libdir"
 
5523
 
 
5524
  ac_ldflags_safe="$LDFLAGS"
 
5525
  ac_libs_safe="$LIBS"
 
5526
 
 
5527
  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
 
5528
  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
 
5529
 
 
5530
  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
 
5531
  ac_ssl_rsaref="yes"
 
5532
  ,
 
5533
  ac_ssl_rsaref="no"
 
5534
  )
 
5535
 
 
5536
  LDFLAGS="$ac_ldflags_safe"
 
5537
  LIBS="$ac_libs_safe"
 
5538
 
 
5539
  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
 
5540
    have_ssl=no
 
5541
  else
 
5542
    have_ssl=yes;
 
5543
  fi
 
5544
 
 
5545
  ])
 
5546
 
 
5547
  eval "$ac_cv_have_ssl"
 
5548
 
 
5549
  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
 
5550
 
 
5551
  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
 
5552
  AC_MSG_RESULT($ac_ssl_rsaref)
 
5553
 
 
5554
  AC_MSG_CHECKING([for easter eggs])
 
5555
  AC_MSG_RESULT([none found])
 
5556
 
 
5557
else
 
5558
  have_ssl=no
 
5559
fi
 
5560
 
 
5561
if test "$have_ssl" = yes; then
 
5562
  AC_MSG_CHECKING(for OpenSSL version)
 
5563
  dnl Check for SSL version
 
5564
  AC_CACHE_VAL(ac_cv_ssl_version,
 
5565
  [
 
5566
 
 
5567
    cat >conftest.$ac_ext <<EOF
 
5568
#include <openssl/opensslv.h>
 
5569
#include <stdio.h>
 
5570
    int main() {
 
5571
 
 
5572
#ifndef OPENSSL_VERSION_NUMBER
 
5573
      printf("ssl_version=\\"error\\"\n");
 
5574
#else
 
5575
      if (OPENSSL_VERSION_NUMBER < 0x00906000)
 
5576
        printf("ssl_version=\\"old\\"\n");
 
5577
      else
 
5578
        printf("ssl_version=\\"ok\\"\n");
 
5579
#endif
 
5580
     return (0);
 
5581
    }
 
5582
EOF
 
5583
 
 
5584
    ac_save_CPPFLAGS=$CPPFLAGS
 
5585
    if test "$ac_ssl_includes" != "/usr/include"; then
 
5586
        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
 
5587
    fi
 
5588
 
 
5589
    if AC_TRY_EVAL(ac_link); then 
 
5590
 
 
5591
      if eval `./conftest 2>&5`; then
 
5592
        if test $ssl_version = error; then
 
5593
          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
 
5594
        else
 
5595
          if test $ssl_version = old; then
 
5596
            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
 
5597
            have_ssl=no
 
5598
          fi
 
5599
        fi
 
5600
        ac_cv_ssl_version="ssl_version=$ssl_version"
 
5601
      else
 
5602
        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
 
5603
        Check config.log, and if you can't figure it out, send a mail to 
 
5604
        David Faure <faure@kde.org>, attaching your config.log])
 
5605
      fi
 
5606
 
 
5607
    else
 
5608
      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
 
5609
      Check config.log, and if you can't figure it out, send a mail to 
 
5610
      David Faure <faure@kde.org>, attaching your config.log])
 
5611
    fi 
 
5612
    CPPFLAGS=$ac_save_CPPFLAGS
 
5613
 
 
5614
  ])
 
5615
 
 
5616
  eval "$ac_cv_ssl_version"
 
5617
  AC_MSG_RESULT($ssl_version)
 
5618
fi
 
5619
 
 
5620
if test "$have_ssl" != yes; then
 
5621
  LIBSSL="";
 
5622
else
 
5623
  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
 
5624
  ac_cv_have_ssl="have_ssl=yes \
 
5625
    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
 
5626
  
 
5627
  
 
5628
  ssl_libraries="$ac_ssl_libraries"
 
5629
  ssl_includes="$ac_ssl_includes"
 
5630
 
 
5631
  if test "$ac_ssl_rsaref" = yes; then
 
5632
    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
 
5633
  fi
 
5634
 
 
5635
  if test $ssl_version = "old"; then
 
5636
    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
 
5637
  fi
 
5638
fi
 
5639
 
 
5640
SSL_INCLUDES=
 
5641
 
 
5642
if test "$ssl_includes" = "/usr/include"; then
 
5643
  if test -f /usr/kerberos/include/krb5.h; then
 
5644
        SSL_INCLUDES="-I/usr/kerberos/include"
 
5645
  fi
 
5646
elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
 
5647
  SSL_INCLUDES="-I$ssl_includes"
 
5648
fi
 
5649
 
 
5650
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
 
5651
 SSL_LDFLAGS=""
 
5652
else
 
5653
 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
 
5654
fi
 
5655
 
 
5656
AC_SUBST(SSL_INCLUDES)
 
5657
AC_SUBST(SSL_LDFLAGS)
 
5658
AC_SUBST(LIBSSL)
 
5659
])
 
5660
 
 
5661
AC_DEFUN([KDE_CHECK_STRLCPY],
 
5662
[
 
5663
  AC_REQUIRE([AC_CHECK_STRLCAT])
 
5664
  AC_REQUIRE([AC_CHECK_STRLCPY])
 
5665
  AC_CHECK_SIZEOF(size_t)
 
5666
  AC_CHECK_SIZEOF(unsigned long)
 
5667
 
 
5668
  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
 
5669
  AC_TRY_COMPILE(,[
 
5670
    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
 
5671
       choke me
 
5672
    #endif
 
5673
    ],AC_MSG_RESULT([yes]),[
 
5674
      AC_MSG_RESULT(no)
 
5675
      AC_MSG_ERROR([
 
5676
       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
 
5677
       does not apply. Please mail kde-devel@kde.org with a description of your system!
 
5678
      ])
 
5679
  ])
 
5680
])
 
5681
 
 
5682
AC_DEFUN([KDE_CHECK_BINUTILS],
 
5683
[
 
5684
  AC_MSG_CHECKING([if ld supports unversioned version maps])
 
5685
 
 
5686
  kde_save_LDFLAGS="$LDFLAGS"
 
5687
  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
 
5688
  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
 
5689
  AC_TRY_LINK([int foo;],
 
5690
[
 
5691
#ifdef __INTEL_COMPILER
 
5692
icc apparently does not support libtools version-info and version-script
 
5693
at the same time. Dunno where the bug is, but until somebody figured out,
 
5694
better disable the optional version scripts.
 
5695
#endif
 
5696
 
 
5697
  foo = 42;
 
5698
], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
 
5699
  LDFLAGS="$kde_save_LDFLAGS"
 
5700
  rm -f conftest.map
 
5701
  AM_CONDITIONAL(include_VERSION_SCRIPT, 
 
5702
    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
 
5703
 
 
5704
  AC_MSG_RESULT($kde_supports_versionmaps)
 
5705
])
 
5706
 
 
5707
AC_DEFUN([AM_PROG_OBJC],[
 
5708
AC_CHECK_PROGS(OBJC, gcc, gcc)
 
5709
test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
 
5710
if test "x${OBJCFLAGS-unset}" = xunset; then
 
5711
   OBJCFLAGS="-g -O2"
 
5712
fi
 
5713
AC_SUBST(OBJCFLAGS)
 
5714
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
 
5715
])
 
5716
 
 
5717
AC_DEFUN([KDE_CHECK_PERL],
 
5718
[
 
5719
        KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
 
5720
                    AC_MSG_ERROR([No Perl found in your $PATH.
 
5721
We need perl to generate some code.])
 
5722
        ])
 
5723
    AC_SUBST(PERL)
 
5724
])
 
5725
 
 
5726
AC_DEFUN([KDE_CHECK_LARGEFILE],
 
5727
[
 
5728
AC_SYS_LARGEFILE
 
5729
if test "$ac_cv_sys_file_offset_bits" != no; then
 
5730
  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
 
5731
fi
 
5732
 
 
5733
if test "x$ac_cv_sys_large_files" != "xno"; then
 
5734
  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
 
5735
fi
 
5736
 
 
5737
])
 
5738
 
 
5739
dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
 
5740
dnl which allows to search for libs that get installed into the KDE prefix.
 
5741
dnl
 
5742
dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
 
5743
dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
 
5744
dnl also defines KSTUFF_PKG_ERRORS on error
 
5745
AC_DEFUN([KDE_PKG_CHECK_MODULES], [
 
5746
 
 
5747
   PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
 
5748
   if test "$prefix" != "$kde_libs_prefix"; then
 
5749
       PKG_CONFIG_PATH="$kde_libs_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
 
5750
   fi
 
5751
   export PKG_CONFIG_PATH
 
5752
   PKG_CHECK_MODULES($1,$2,$3,$4)
 
5753
])
 
5754
 
 
5755
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
5756
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
 
5757
## Free Software Foundation, Inc.
 
5758
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
5759
##
 
5760
## This program is free software; you can redistribute it and/or modify
 
5761
## it under the terms of the GNU General Public License as published by
 
5762
## the Free Software Foundation; either version 2 of the License, or
 
5763
## (at your option) any later version.
 
5764
##
 
5765
## This program is distributed in the hope that it will be useful, but
 
5766
## WITHOUT ANY WARRANTY; without even the implied warranty of
 
5767
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
5768
## General Public License for more details.
 
5769
##
 
5770
## You should have received a copy of the GNU General Public License
 
5771
## along with this program; if not, write to the Free Software
 
5772
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
5773
##
 
5774
## As a special exception to the GNU General Public License, if you
 
5775
## distribute this file as part of a program that contains a
 
5776
## configuration script generated by Autoconf, you may include it under
 
5777
## the same distribution terms that you use for the rest of that program.
 
5778
 
 
5779
# serial 47 AC_PROG_LIBTOOL
 
5780
 
 
5781
 
 
5782
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
 
5783
# -----------------------------------------------------------
 
5784
# If this macro is not defined by Autoconf, define it here.
 
5785
m4_ifdef([AC_PROVIDE_IFELSE],
 
5786
         [],
 
5787
         [m4_define([AC_PROVIDE_IFELSE],
 
5788
                 [m4_ifdef([AC_PROVIDE_$1],
 
5789
                           [$2], [$3])])])
 
5790
 
 
5791
 
 
5792
# AC_PROG_LIBTOOL
 
5793
# ---------------
 
5794
AC_DEFUN([AC_PROG_LIBTOOL],
 
5795
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
 
5796
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
 
5797
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
 
5798
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
 
5799
    [AC_LIBTOOL_CXX],
 
5800
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
 
5801
  ])])
 
5802
dnl And a similar setup for Fortran 77 support
 
5803
  AC_PROVIDE_IFELSE([AC_PROG_F77],
 
5804
    [AC_LIBTOOL_F77],
 
5805
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
 
5806
])])
 
5807
 
 
5808
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
 
5809
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
 
5810
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
 
5811
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
 
5812
    [AC_LIBTOOL_GCJ],
 
5813
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
 
5814
      [AC_LIBTOOL_GCJ],
 
5815
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
 
5816
        [AC_LIBTOOL_GCJ],
 
5817
      [ifdef([AC_PROG_GCJ],
 
5818
             [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
 
5819
       ifdef([A][M_PROG_GCJ],
 
5820
             [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
 
5821
       ifdef([LT_AC_PROG_GCJ],
 
5822
             [define([LT_AC_PROG_GCJ],
 
5823
                defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
 
5824
])])# AC_PROG_LIBTOOL
 
5825
 
 
5826
 
 
5827
# _AC_PROG_LIBTOOL
 
5828
# ----------------
 
5829
AC_DEFUN([_AC_PROG_LIBTOOL],
 
5830
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 
5831
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
 
5832
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
 
5833
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
 
5834
 
 
5835
# This can be used to rebuild libtool when needed
 
5836
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
5837
 
 
5838
# Always use our own libtool.
 
5839
LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
 
5840
AC_SUBST(LIBTOOL)dnl
 
5841
 
 
5842
# Prevent multiple expansion
 
5843
define([AC_PROG_LIBTOOL], [])
 
5844
])# _AC_PROG_LIBTOOL
 
5845
 
 
5846
 
 
5847
# AC_LIBTOOL_SETUP
 
5848
# ----------------
 
5849
AC_DEFUN([AC_LIBTOOL_SETUP],
 
5850
[AC_PREREQ(2.50)dnl
 
5851
AC_REQUIRE([AC_ENABLE_SHARED])dnl
 
5852
AC_REQUIRE([AC_ENABLE_STATIC])dnl
 
5853
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
 
5854
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
5855
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
5856
AC_REQUIRE([AC_PROG_CC])dnl
 
5857
AC_REQUIRE([AC_PROG_LD])dnl
 
5858
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
 
5859
AC_REQUIRE([AC_PROG_NM])dnl
 
5860
 
 
5861
AC_REQUIRE([AC_PROG_LN_S])dnl
 
5862
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
 
5863
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
5864
AC_REQUIRE([AC_OBJEXT])dnl
 
5865
AC_REQUIRE([AC_EXEEXT])dnl
 
5866
dnl
 
5867
 
 
5868
AC_LIBTOOL_SYS_MAX_CMD_LEN
 
5869
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
5870
AC_LIBTOOL_OBJDIR
 
5871
 
 
5872
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
5873
_LT_AC_PROG_ECHO_BACKSLASH
 
5874
 
 
5875
case $host_os in
 
5876
aix3*)
 
5877
  # AIX sometimes has problems with the GCC collect2 program.  For some
 
5878
  # reason, if we set the COLLECT_NAMES environment variable, the problems
 
5879
  # vanish in a puff of smoke.
 
5880
  if test "X${COLLECT_NAMES+set}" != Xset; then
 
5881
    COLLECT_NAMES=
 
5882
    export COLLECT_NAMES
 
5883
  fi
 
5884
  ;;
 
5885
esac
 
5886
 
 
5887
# Sed substitution that helps us do robust quoting.  It backslashifies
 
5888
# metacharacters that are still active within double-quoted strings.
 
5889
Xsed='sed -e s/^X//'
 
5890
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
5891
 
 
5892
# Same as above, but do not quote variable references.
 
5893
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
 
5894
 
 
5895
# Sed substitution to delay expansion of an escaped shell variable in a
 
5896
# double_quote_subst'ed string.
 
5897
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
5898
 
 
5899
# Sed substitution to avoid accidental globbing in evaled expressions
 
5900
no_glob_subst='s/\*/\\\*/g'
 
5901
 
 
5902
# Constants:
 
5903
rm="rm -f"
 
5904
 
 
5905
# Global variables:
 
5906
default_ofile=libtool
 
5907
can_build_shared=yes
 
5908
 
 
5909
# All known linkers require a `.a' archive for static linking (except M$VC,
 
5910
# which needs '.lib').
 
5911
libext=a
 
5912
ltmain="$ac_aux_dir/ltmain.sh"
 
5913
ofile="$default_ofile"
 
5914
with_gnu_ld="$lt_cv_prog_gnu_ld"
 
5915
 
 
5916
AC_CHECK_TOOL(AR, ar, false)
 
5917
AC_CHECK_TOOL(RANLIB, ranlib, :)
 
5918
AC_CHECK_TOOL(STRIP, strip, :)
 
5919
 
 
5920
old_CC="$CC"
 
5921
old_CFLAGS="$CFLAGS"
 
5922
 
 
5923
# Set sane defaults for various variables
 
5924
test -z "$AR" && AR=ar
 
5925
test -z "$AR_FLAGS" && AR_FLAGS=cru
 
5926
test -z "$AS" && AS=as
 
5927
test -z "$CC" && CC=cc
 
5928
test -z "$LTCC" && LTCC=$CC
 
5929
test -z "$DLLTOOL" && DLLTOOL=dlltool
 
5930
test -z "$LD" && LD=ld
 
5931
test -z "$LN_S" && LN_S="ln -s"
 
5932
test -z "$MAGIC_CMD" && MAGIC_CMD=file
 
5933
test -z "$NM" && NM=nm
 
5934
test -z "$SED" && SED=sed
 
5935
test -z "$OBJDUMP" && OBJDUMP=objdump
 
5936
test -z "$RANLIB" && RANLIB=:
 
5937
test -z "$STRIP" && STRIP=:
 
5938
test -z "$ac_objext" && ac_objext=o
 
5939
 
 
5940
# Determine commands to create old-style static archives.
 
5941
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
 
5942
old_postinstall_cmds='chmod 644 $oldlib'
 
5943
old_postuninstall_cmds=
 
5944
 
 
5945
if test -n "$RANLIB"; then
 
5946
  case $host_os in
 
5947
  openbsd*)
 
5948
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
 
5949
    ;;
 
5950
  *)
 
5951
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
 
5952
    ;;
 
5953
  esac
 
5954
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 
5955
fi
 
5956
 
 
5957
# Only perform the check for file, if the check method requires it
 
5958
case $deplibs_check_method in
 
5959
file_magic*)
 
5960
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
 
5961
    AC_PATH_MAGIC
 
5962
  fi
 
5963
  ;;
 
5964
esac
 
5965
 
 
5966
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
 
5967
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 
5968
enable_win32_dll=yes, enable_win32_dll=no)
 
5969
 
 
5970
AC_ARG_ENABLE([libtool-lock],
 
5971
    [AC_HELP_STRING([--disable-libtool-lock],
 
5972
        [avoid locking (might break parallel builds)])])
 
5973
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
5974
 
 
5975
AC_ARG_WITH([pic],
 
5976
    [AC_HELP_STRING([--with-pic],
 
5977
        [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
 
5978
    [pic_mode="$withval"],
 
5979
    [pic_mode=default])
 
5980
test -z "$pic_mode" && pic_mode=default
 
5981
 
 
5982
# Use C for the default configuration in the libtool script
 
5983
tagname=
 
5984
AC_LIBTOOL_LANG_C_CONFIG
 
5985
_LT_AC_TAGCONFIG
 
5986
])# AC_LIBTOOL_SETUP
 
5987
 
 
5988
 
 
5989
# _LT_AC_SYS_COMPILER
 
5990
# -------------------
 
5991
AC_DEFUN([_LT_AC_SYS_COMPILER],
 
5992
[AC_REQUIRE([AC_PROG_CC])dnl
 
5993
 
 
5994
# If no C compiler was specified, use CC.
 
5995
LTCC=${LTCC-"$CC"}
 
5996
 
 
5997
# Allow CC to be a program name with arguments.
 
5998
compiler=$CC
 
5999
])# _LT_AC_SYS_COMPILER
 
6000
 
 
6001
 
 
6002
# _LT_AC_SYS_LIBPATH_AIX
 
6003
# ----------------------
 
6004
# Links a minimal program and checks the executable
 
6005
# for the system default hardcoded library path. In most cases,
 
6006
# this is /usr/lib:/lib, but when the MPI compilers are used
 
6007
# the location of the communication and MPI libs are included too.
 
6008
# If we don't find anything, use the default library path according
 
6009
# to the aix ld manual.
 
6010
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
 
6011
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
 
6012
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
 
6013
}'`
 
6014
# Check for a 64-bit object if we didn't find anything.
 
6015
if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
 
6016
}'`; fi],[])
 
6017
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
6018
])# _LT_AC_SYS_LIBPATH_AIX
 
6019
 
 
6020
 
 
6021
# _LT_AC_SHELL_INIT(ARG)
 
6022
# ----------------------
 
6023
AC_DEFUN([_LT_AC_SHELL_INIT],
 
6024
[ifdef([AC_DIVERSION_NOTICE],
 
6025
             [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
 
6026
         [AC_DIVERT_PUSH(NOTICE)])
 
6027
$1
 
6028
AC_DIVERT_POP
 
6029
])# _LT_AC_SHELL_INIT
 
6030
 
 
6031
 
 
6032
# _LT_AC_PROG_ECHO_BACKSLASH
 
6033
# --------------------------
 
6034
# Add some code to the start of the generated configure script which
 
6035
# will find an echo command which doesn't interpret backslashes.
 
6036
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
 
6037
[_LT_AC_SHELL_INIT([
 
6038
# Check that we are running under the correct shell.
 
6039
SHELL=${CONFIG_SHELL-/bin/sh}
 
6040
 
 
6041
case X$ECHO in
 
6042
X*--fallback-echo)
 
6043
  # Remove one level of quotation (which was required for Make).
 
6044
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
 
6045
  ;;
 
6046
esac
 
6047
 
 
6048
echo=${ECHO-echo}
 
6049
if test "X[$]1" = X--no-reexec; then
 
6050
  # Discard the --no-reexec flag, and continue.
 
6051
  shift
 
6052
elif test "X[$]1" = X--fallback-echo; then
 
6053
  # Avoid inline document here, it may be left over
 
6054
  :
 
6055
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
 
6056
  # Yippee, $echo works!
 
6057
  :
 
6058
else
 
6059
  # Restart under the correct shell.
 
6060
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
 
6061
fi
 
6062
 
 
6063
if test "X[$]1" = X--fallback-echo; then
 
6064
  # used as fallback echo
 
6065
  shift
 
6066
  cat <<EOF
 
6067
[$]*
 
6068
EOF
 
6069
  exit 0
 
6070
fi
 
6071
 
 
6072
# The HP-UX ksh and POSIX shell print the target directory to stdout
 
6073
# if CDPATH is set.
 
6074
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
 
6075
 
 
6076
if test -z "$ECHO"; then
 
6077
if test "X${echo_test_string+set}" != Xset; then
 
6078
# find a string as large as possible, as long as the shell can cope with it
 
6079
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
 
6080
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
 
6081
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
 
6082
       echo_test_string="`eval $cmd`" &&
 
6083
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
 
6084
    then
 
6085
      break
 
6086
    fi
 
6087
  done
 
6088
fi
 
6089
 
 
6090
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
 
6091
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
 
6092
   test "X$echo_testing_string" = "X$echo_test_string"; then
 
6093
  :
 
6094
else
 
6095
  # The Solaris, AIX, and Digital Unix default echo programs unquote
 
6096
  # backslashes.  This makes it impossible to quote backslashes using
 
6097
  #   echo "$something" | sed 's/\\/\\\\/g'
 
6098
  #
 
6099
  # So, first we look for a working echo in the user's PATH.
 
6100
 
 
6101
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
6102
  for dir in $PATH /usr/ucb; do
 
6103
    IFS="$lt_save_ifs"
 
6104
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
 
6105
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
 
6106
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
 
6107
       test "X$echo_testing_string" = "X$echo_test_string"; then
 
6108
      echo="$dir/echo"
 
6109
      break
 
6110
    fi
 
6111
  done
 
6112
  IFS="$lt_save_ifs"
 
6113
 
 
6114
  if test "X$echo" = Xecho; then
 
6115
    # We didn't find a better echo, so look for alternatives.
 
6116
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
 
6117
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
 
6118
       test "X$echo_testing_string" = "X$echo_test_string"; then
 
6119
      # This shell has a builtin print -r that does the trick.
 
6120
      echo='print -r'
 
6121
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
 
6122
         test "X$CONFIG_SHELL" != X/bin/ksh; then
 
6123
      # If we have ksh, try running configure again with it.
 
6124
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 
6125
      export ORIGINAL_CONFIG_SHELL
 
6126
      CONFIG_SHELL=/bin/ksh
 
6127
      export CONFIG_SHELL
 
6128
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
 
6129
    else
 
6130
      # Try using printf.
 
6131
      echo='printf %s\n'
 
6132
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
 
6133
         echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
 
6134
         test "X$echo_testing_string" = "X$echo_test_string"; then
 
6135
        # Cool, printf works
 
6136
        :
 
6137
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
 
6138
           test "X$echo_testing_string" = 'X\t' &&
 
6139
           echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
 
6140
           test "X$echo_testing_string" = "X$echo_test_string"; then
 
6141
        CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
 
6142
        export CONFIG_SHELL
 
6143
        SHELL="$CONFIG_SHELL"
 
6144
        export SHELL
 
6145
        echo="$CONFIG_SHELL [$]0 --fallback-echo"
 
6146
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
 
6147
           test "X$echo_testing_string" = 'X\t' &&
 
6148
           echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
 
6149
           test "X$echo_testing_string" = "X$echo_test_string"; then
 
6150
        echo="$CONFIG_SHELL [$]0 --fallback-echo"
 
6151
      else
 
6152
        # maybe with a smaller string...
 
6153
        prev=:
 
6154
 
 
6155
        for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
 
6156
          if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
 
6157
          then
 
6158
            break
 
6159
          fi
 
6160
          prev="$cmd"
 
6161
        done
 
6162
 
 
6163
        if test "$prev" != 'sed 50q "[$]0"'; then
 
6164
          echo_test_string=`eval $prev`
 
6165
          export echo_test_string
 
6166
          exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
 
6167
        else
 
6168
          # Oops.  We lost completely, so just stick with echo.
 
6169
          echo=echo
 
6170
        fi
 
6171
      fi
 
6172
    fi
 
6173
  fi
 
6174
fi
 
6175
fi
 
6176
 
 
6177
# Copy echo and quote the copy suitably for passing to libtool from
 
6178
# the Makefile, instead of quoting the original, which is used later.
 
6179
ECHO=$echo
 
6180
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
 
6181
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
 
6182
fi
 
6183
 
 
6184
AC_SUBST(ECHO)
 
6185
])])# _LT_AC_PROG_ECHO_BACKSLASH
 
6186
 
 
6187
 
 
6188
# _LT_AC_LOCK
 
6189
# -----------
 
6190
AC_DEFUN([_LT_AC_LOCK],
 
6191
[AC_ARG_ENABLE([libtool-lock],
 
6192
    [AC_HELP_STRING([--disable-libtool-lock],
 
6193
        [avoid locking (might break parallel builds)])])
 
6194
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
6195
 
 
6196
# Some flags need to be propagated to the compiler or linker for good
 
6197
# libtool support.
 
6198
case $host in
 
6199
ia64-*-hpux*)
 
6200
  # Find out which ABI we are using.
 
6201
  echo 'int i;' > conftest.$ac_ext
 
6202
  if AC_TRY_EVAL(ac_compile); then
 
6203
    case `/usr/bin/file conftest.$ac_objext` in
 
6204
    *ELF-32*)
 
6205
      HPUX_IA64_MODE="32"
 
6206
      ;;
 
6207
    *ELF-64*)
 
6208
      HPUX_IA64_MODE="64"
 
6209
      ;;
 
6210
    esac
 
6211
  fi
 
6212
  rm -rf conftest*
 
6213
  ;;
 
6214
*-*-irix6*)
 
6215
  # Find out which ABI we are using.
 
6216
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
 
6217
  if AC_TRY_EVAL(ac_compile); then
 
6218
   if test "$lt_cv_prog_gnu_ld" = yes; then
 
6219
    case `/usr/bin/file conftest.$ac_objext` in
 
6220
    *32-bit*)
 
6221
      LD="${LD-ld} -melf32bsmip"
 
6222
      ;;
 
6223
    *N32*)
 
6224
      LD="${LD-ld} -melf32bmipn32"
 
6225
      ;;
 
6226
    *64-bit*)
 
6227
      LD="${LD-ld} -melf64bmip"
 
6228
      ;;
 
6229
    esac
 
6230
   else
 
6231
    case `/usr/bin/file conftest.$ac_objext` in
 
6232
    *32-bit*)
 
6233
      LD="${LD-ld} -32"
 
6234
      ;;
 
6235
    *N32*)
 
6236
      LD="${LD-ld} -n32"
 
6237
      ;;
 
6238
    *64-bit*)
 
6239
      LD="${LD-ld} -64"
 
6240
      ;;
 
6241
    esac
 
6242
   fi
 
6243
  fi
 
6244
  rm -rf conftest*
 
6245
  ;;
 
6246
 
 
6247
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
 
6248
  # Find out which ABI we are using.
 
6249
  echo 'int i;' > conftest.$ac_ext
 
6250
  if AC_TRY_EVAL(ac_compile); then
 
6251
    case "`/usr/bin/file conftest.o`" in
 
6252
    *32-bit*)
 
6253
      LINUX_64_MODE="32"
 
6254
      case $host in
 
6255
        x86_64-*linux*)
 
6256
          LD="${LD-ld} -m elf_i386"
 
6257
          ;;
 
6258
        ppc64-*linux*)
 
6259
          LD="${LD-ld} -m elf32ppclinux"
 
6260
          ;;
 
6261
        s390x-*linux*)
 
6262
          LD="${LD-ld} -m elf_s390"
 
6263
          ;;
 
6264
        sparc64-*linux*)
 
6265
          LD="${LD-ld} -m elf32_sparc"
 
6266
          ;;
 
6267
      esac
 
6268
      ;;
 
6269
    *64-bit*)
 
6270
      LINUX_64_MODE="64"
 
6271
      case $host in
 
6272
        x86_64-*linux*)
 
6273
          LD="${LD-ld} -m elf_x86_64"
 
6274
          ;;
 
6275
        ppc*-*linux*|powerpc*-*linux*)
 
6276
          LD="${LD-ld} -m elf64ppc"
 
6277
          ;;
 
6278
        s390*-*linux*)
 
6279
          LD="${LD-ld} -m elf64_s390"
 
6280
          ;;
 
6281
        sparc*-*linux*)
 
6282
          LD="${LD-ld} -m elf64_sparc"
 
6283
          ;;
 
6284
      esac
 
6285
      ;;
 
6286
    esac
 
6287
  fi
 
6288
  rm -rf conftest*
 
6289
  ;;
 
6290
 
 
6291
*-*-sco3.2v5*)
 
6292
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
 
6293
  SAVE_CFLAGS="$CFLAGS"
 
6294
  CFLAGS="$CFLAGS -belf"
 
6295
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
 
6296
    [AC_LANG_PUSH(C)
 
6297
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
 
6298
     AC_LANG_POP])
 
6299
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
 
6300
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
 
6301
    CFLAGS="$SAVE_CFLAGS"
 
6302
  fi
 
6303
  ;;
 
6304
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 
6305
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
 
6306
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
 
6307
  AC_CHECK_TOOL(AS, as, false)
 
6308
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
 
6309
  ;;
 
6310
  ])
 
6311
esac
 
6312
 
 
6313
need_locks="$enable_libtool_lock"
 
6314
 
 
6315
])# _LT_AC_LOCK
 
6316
 
 
6317
 
 
6318
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
 
6319
#               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
 
6320
# ----------------------------------------------------------------
 
6321
# Check whether the given compiler option works
 
6322
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
 
6323
[AC_REQUIRE([LT_AC_PROG_SED])
 
6324
AC_CACHE_CHECK([$1], [$2],
 
6325
  [$2=no
 
6326
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
 
6327
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
6328
   lt_compiler_flag="$3"
 
6329
   # Insert the option either (1) after the last *FLAGS variable, or
 
6330
   # (2) before a word containing "conftest.", or (3) at the end.
 
6331
   # Note that $ac_compile itself does not contain backslashes and begins
 
6332
   # with a dollar sign (not a hyphen), so the echo should work correctly.
 
6333
   # The option is referenced via a variable to avoid confusing sed.
 
6334
   lt_compile=`echo "$ac_compile" | $SED \
 
6335
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
 
6336
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
 
6337
   -e 's:$: $lt_compiler_flag:'`
 
6338
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
 
6339
   (eval "$lt_compile" 2>conftest.err)
 
6340
   ac_status=$?
 
6341
   cat conftest.err >&AS_MESSAGE_LOG_FD
 
6342
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
6343
   if (exit $ac_status) && test -s "$ac_outfile"; then
 
6344
     # The compiler can only warn and ignore the option if not recognized
 
6345
     # So say no if there are warnings
 
6346
     if test ! -s conftest.err; then
 
6347
       $2=yes
 
6348
     fi
 
6349
   fi
 
6350
   $rm conftest*
 
6351
])
 
6352
 
 
6353
if test x"[$]$2" = xyes; then
 
6354
    ifelse([$5], , :, [$5])
 
6355
else
 
6356
    ifelse([$6], , :, [$6])
 
6357
fi
 
6358
])# AC_LIBTOOL_COMPILER_OPTION
 
6359
 
 
6360
 
 
6361
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
 
6362
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
 
6363
# ------------------------------------------------------------
 
6364
# Check whether the given compiler option works
 
6365
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
 
6366
[AC_CACHE_CHECK([$1], [$2],
 
6367
  [$2=no
 
6368
   save_LDFLAGS="$LDFLAGS"
 
6369
   LDFLAGS="$LDFLAGS $3"
 
6370
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
 
6371
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
 
6372
     # The compiler can only warn and ignore the option if not recognized
 
6373
     # So say no if there are warnings
 
6374
     if test -s conftest.err; then
 
6375
       # Append any errors to the config.log.
 
6376
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
 
6377
     else
 
6378
       $2=yes
 
6379
     fi
 
6380
   fi
 
6381
   $rm conftest*
 
6382
   LDFLAGS="$save_LDFLAGS"
 
6383
])
 
6384
 
 
6385
if test x"[$]$2" = xyes; then
 
6386
    ifelse([$4], , :, [$4])
 
6387
else
 
6388
    ifelse([$5], , :, [$5])
 
6389
fi
 
6390
])# AC_LIBTOOL_LINKER_OPTION
 
6391
 
 
6392
 
 
6393
# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
6394
# --------------------------
 
6395
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
 
6396
[# find the maximum length of command line arguments
 
6397
AC_MSG_CHECKING([the maximum length of command line arguments])
 
6398
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
 
6399
  i=0
 
6400
  testring="ABCD"
 
6401
 
 
6402
  case $build_os in
 
6403
  msdosdjgpp*)
 
6404
    # On DJGPP, this test can blow up pretty badly due to problems in libc
 
6405
    # (any single argument exceeding 2000 bytes causes a buffer overrun
 
6406
    # during glob expansion).  Even if it were fixed, the result of this
 
6407
    # check would be larger than it should be.
 
6408
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
 
6409
    ;;
 
6410
 
 
6411
  gnu*)
 
6412
    # Under GNU Hurd, this test is not required because there is
 
6413
    # no limit to the length of command line arguments.
 
6414
    # Libtool will interpret -1 as no limit whatsoever
 
6415
    lt_cv_sys_max_cmd_len=-1;
 
6416
    ;;
 
6417
 
 
6418
  cygwin* | mingw*)
 
6419
    # On Win9x/ME, this test blows up -- it succeeds, but takes
 
6420
    # about 5 minutes as the teststring grows exponentially.
 
6421
    # Worse, since 9x/ME are not pre-emptively multitasking,
 
6422
    # you end up with a "frozen" computer, even though with patience
 
6423
    # the test eventually succeeds (with a max line length of 256k).
 
6424
    # Instead, let's just punt: use the minimum linelength reported by
 
6425
    # all of the supported platforms: 8192 (on NT/2K/XP).
 
6426
    lt_cv_sys_max_cmd_len=8192;
 
6427
    ;;
 
6428
 
 
6429
 *)
 
6430
    # If test is not a shell built-in, we'll probably end up computing a
 
6431
    # maximum length that is only half of the actual maximum length, but
 
6432
    # we can't tell.
 
6433
    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
 
6434
               = "XX$testring") >/dev/null 2>&1 &&
 
6435
            new_result=`expr "X$testring" : ".*" 2>&1` &&
 
6436
            lt_cv_sys_max_cmd_len=$new_result &&
 
6437
            test $i != 17 # 1/2 MB should be enough
 
6438
    do
 
6439
      i=`expr $i + 1`
 
6440
      testring=$testring$testring
 
6441
    done
 
6442
    testring=
 
6443
    # Add a significant safety factor because C++ compilers can tack on massive
 
6444
    # amounts of additional arguments before passing them to the linker.
 
6445
    # It appears as though 1/2 is a usable value.
 
6446
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
 
6447
    ;;
 
6448
  esac
 
6449
])
 
6450
if test -n $lt_cv_sys_max_cmd_len ; then
 
6451
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 
6452
else
 
6453
  AC_MSG_RESULT(none)
 
6454
fi
 
6455
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
6456
 
 
6457
 
 
6458
# _LT_AC_CHECK_DLFCN
 
6459
# --------------------
 
6460
AC_DEFUN([_LT_AC_CHECK_DLFCN],
 
6461
[AC_CHECK_HEADERS(dlfcn.h)dnl
 
6462
])# _LT_AC_CHECK_DLFCN
 
6463
 
 
6464
 
 
6465
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
 
6466
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
 
6467
# ------------------------------------------------------------------
 
6468
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
 
6469
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 
6470
if test "$cross_compiling" = yes; then :
 
6471
  [$4]
 
6472
else
 
6473
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
 
6474
  lt_status=$lt_dlunknown
 
6475
  cat > conftest.$ac_ext <<EOF
 
6476
[#line __oline__ "configure"
 
6477
#include "confdefs.h"
 
6478
 
 
6479
#if HAVE_DLFCN_H
 
6480
#include <dlfcn.h>
 
6481
#endif
 
6482
 
 
6483
#include <stdio.h>
 
6484
 
 
6485
#ifdef RTLD_GLOBAL
 
6486
#  define LT_DLGLOBAL           RTLD_GLOBAL
 
6487
#else
 
6488
#  ifdef DL_GLOBAL
 
6489
#    define LT_DLGLOBAL         DL_GLOBAL
 
6490
#  else
 
6491
#    define LT_DLGLOBAL         0
 
6492
#  endif
 
6493
#endif
 
6494
 
 
6495
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
 
6496
   find out it does not work in some platform. */
 
6497
#ifndef LT_DLLAZY_OR_NOW
 
6498
#  ifdef RTLD_LAZY
 
6499
#    define LT_DLLAZY_OR_NOW            RTLD_LAZY
 
6500
#  else
 
6501
#    ifdef DL_LAZY
 
6502
#      define LT_DLLAZY_OR_NOW          DL_LAZY
 
6503
#    else
 
6504
#      ifdef RTLD_NOW
 
6505
#        define LT_DLLAZY_OR_NOW        RTLD_NOW
 
6506
#      else
 
6507
#        ifdef DL_NOW
 
6508
#          define LT_DLLAZY_OR_NOW      DL_NOW
 
6509
#        else
 
6510
#          define LT_DLLAZY_OR_NOW      0
 
6511
#        endif
 
6512
#      endif
 
6513
#    endif
 
6514
#  endif
 
6515
#endif
 
6516
 
 
6517
#ifdef __cplusplus
 
6518
extern "C" void exit (int);
 
6519
#endif
 
6520
 
 
6521
void fnord() { int i=42;}
 
6522
int main ()
 
6523
{
 
6524
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
 
6525
  int status = $lt_dlunknown;
 
6526
 
 
6527
  if (self)
 
6528
    {
 
6529
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
 
6530
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
 
6531
      /* dlclose (self); */
 
6532
    }
 
6533
 
 
6534
    exit (status);
 
6535
}]
 
6536
EOF
 
6537
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
 
6538
    (./conftest; exit; ) 2>/dev/null
 
6539
    lt_status=$?
 
6540
    case x$lt_status in
 
6541
      x$lt_dlno_uscore) $1 ;;
 
6542
      x$lt_dlneed_uscore) $2 ;;
 
6543
      x$lt_unknown|x*) $3 ;;
 
6544
    esac
 
6545
  else :
 
6546
    # compilation failed
 
6547
    $3
 
6548
  fi
 
6549
fi
 
6550
rm -fr conftest*
 
6551
])# _LT_AC_TRY_DLOPEN_SELF
 
6552
 
 
6553
 
 
6554
# AC_LIBTOOL_DLOPEN_SELF
 
6555
# -------------------
 
6556
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
 
6557
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 
6558
if test "x$enable_dlopen" != xyes; then
 
6559
  enable_dlopen=unknown
 
6560
  enable_dlopen_self=unknown
 
6561
  enable_dlopen_self_static=unknown
 
6562
else
 
6563
  lt_cv_dlopen=no
 
6564
  lt_cv_dlopen_libs=
 
6565
 
 
6566
  case $host_os in
 
6567
  beos*)
 
6568
    lt_cv_dlopen="load_add_on"
 
6569
    lt_cv_dlopen_libs=
 
6570
    lt_cv_dlopen_self=yes
 
6571
    ;;
 
6572
 
 
6573
  mingw* | pw32*)
 
6574
    lt_cv_dlopen="LoadLibrary"
 
6575
    lt_cv_dlopen_libs=
 
6576
   ;;
 
6577
 
 
6578
  cygwin*)
 
6579
    lt_cv_dlopen="dlopen"
 
6580
    lt_cv_dlopen_libs=
 
6581
   ;;
 
6582
 
 
6583
  darwin*)
 
6584
  # if libdl is installed we need to link against it
 
6585
    AC_CHECK_LIB([dl], [dlopen],
 
6586
                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
 
6587
    lt_cv_dlopen="dyld"
 
6588
    lt_cv_dlopen_libs=
 
6589
    lt_cv_dlopen_self=yes
 
6590
    ])
 
6591
   ;;
 
6592
    
 
6593
  *)
 
6594
    AC_CHECK_FUNC([shl_load],
 
6595
          [lt_cv_dlopen="shl_load"],
 
6596
      [AC_CHECK_LIB([dld], [shl_load],
 
6597
            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
 
6598
        [AC_CHECK_FUNC([dlopen],
 
6599
              [lt_cv_dlopen="dlopen"],
 
6600
          [AC_CHECK_LIB([dl], [dlopen],
 
6601
                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
 
6602
            [AC_CHECK_LIB([svld], [dlopen],
 
6603
                  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
 
6604
              [AC_CHECK_LIB([dld], [dld_link],
 
6605
                    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
 
6606
              ])
 
6607
            ])
 
6608
          ])
 
6609
        ])
 
6610
      ])
 
6611
    ;;
 
6612
  esac
 
6613
 
 
6614
  if test "x$lt_cv_dlopen" != xno; then
 
6615
    enable_dlopen=yes
 
6616
  else
 
6617
    enable_dlopen=no
 
6618
  fi
 
6619
 
 
6620
  case $lt_cv_dlopen in
 
6621
  dlopen)
 
6622
    save_CPPFLAGS="$CPPFLAGS"
 
6623
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
6624
 
 
6625
    save_LDFLAGS="$LDFLAGS"
 
6626
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
6627
 
 
6628
    save_LIBS="$LIBS"
 
6629
    LIBS="$lt_cv_dlopen_libs $LIBS"
 
6630
 
 
6631
    AC_CACHE_CHECK([whether a program can dlopen itself],
 
6632
          lt_cv_dlopen_self, [dnl
 
6633
          _LT_AC_TRY_DLOPEN_SELF(
 
6634
            lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
 
6635
            lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
 
6636
    ])
 
6637
 
 
6638
    if test "x$lt_cv_dlopen_self" = xyes; then
 
6639
      LDFLAGS="$LDFLAGS $link_static_flag"
 
6640
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 
6641
          lt_cv_dlopen_self_static, [dnl
 
6642
          _LT_AC_TRY_DLOPEN_SELF(
 
6643
            lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
 
6644
            lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
 
6645
      ])
 
6646
    fi
 
6647
 
 
6648
    CPPFLAGS="$save_CPPFLAGS"
 
6649
    LDFLAGS="$save_LDFLAGS"
 
6650
    LIBS="$save_LIBS"
 
6651
    ;;
 
6652
  esac
 
6653
 
 
6654
  case $lt_cv_dlopen_self in
 
6655
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
 
6656
  *) enable_dlopen_self=unknown ;;
 
6657
  esac
 
6658
 
 
6659
  case $lt_cv_dlopen_self_static in
 
6660
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
 
6661
  *) enable_dlopen_self_static=unknown ;;
 
6662
  esac
 
6663
fi
 
6664
])# AC_LIBTOOL_DLOPEN_SELF
 
6665
 
 
6666
 
 
6667
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
 
6668
# ---------------------------------
 
6669
# Check to see if options -c and -o are simultaneously supported by compiler
 
6670
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
 
6671
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
6672
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
 
6673
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
 
6674
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
 
6675
   $rm -r conftest 2>/dev/null
 
6676
   mkdir conftest
 
6677
   cd conftest
 
6678
   mkdir out
 
6679
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
6680
 
 
6681
   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
 
6682
   # that will create temporary files in the current directory regardless of
 
6683
   # the output directory.  Thus, making CWD read-only will cause this test
 
6684
   # to fail, enabling locking or at least warning the user not to do parallel
 
6685
   # builds.
 
6686
   chmod -w .
 
6687
 
 
6688
   lt_compiler_flag="-o out/conftest2.$ac_objext"
 
6689
   # Insert the option either (1) after the last *FLAGS variable, or
 
6690
   # (2) before a word containing "conftest.", or (3) at the end.
 
6691
   # Note that $ac_compile itself does not contain backslashes and begins
 
6692
   # with a dollar sign (not a hyphen), so the echo should work correctly.
 
6693
   lt_compile=`echo "$ac_compile" | $SED \
 
6694
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
 
6695
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
 
6696
   -e 's:$: $lt_compiler_flag:'`
 
6697
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
 
6698
   (eval "$lt_compile" 2>out/conftest.err)
 
6699
   ac_status=$?
 
6700
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
 
6701
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
6702
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
 
6703
   then
 
6704
     # The compiler can only warn and ignore the option if not recognized
 
6705
     # So say no if there are warnings
 
6706
     if test ! -s out/conftest.err; then
 
6707
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
6708
     fi
 
6709
   fi
 
6710
   chmod u+w .
 
6711
   $rm conftest* out/*
 
6712
   rmdir out
 
6713
   cd ..
 
6714
   rmdir conftest
 
6715
   $rm conftest*
 
6716
])
 
6717
])# AC_LIBTOOL_PROG_CC_C_O
 
6718
 
 
6719
 
 
6720
# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
 
6721
# -----------------------------------------
 
6722
# Check to see if we can do hard links to lock some files if needed
 
6723
AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
 
6724
[AC_REQUIRE([_LT_AC_LOCK])dnl
 
6725
 
 
6726
hard_links="nottested"
 
6727
if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
 
6728
  # do not overwrite the value of need_locks provided by the user
 
6729
  AC_MSG_CHECKING([if we can lock with hard links])
 
6730
  hard_links=yes
 
6731
  $rm conftest*
 
6732
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 
6733
  touch conftest.a
 
6734
  ln conftest.a conftest.b 2>&5 || hard_links=no
 
6735
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 
6736
  AC_MSG_RESULT([$hard_links])
 
6737
  if test "$hard_links" = no; then
 
6738
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
 
6739
    need_locks=warn
 
6740
  fi
 
6741
else
 
6742
  need_locks=no
 
6743
fi
 
6744
])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
 
6745
 
 
6746
 
 
6747
# AC_LIBTOOL_OBJDIR
 
6748
# -----------------
 
6749
AC_DEFUN([AC_LIBTOOL_OBJDIR],
 
6750
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
 
6751
[rm -f .libs 2>/dev/null
 
6752
mkdir .libs 2>/dev/null
 
6753
if test -d .libs; then
 
6754
  lt_cv_objdir=.libs
 
6755
else
 
6756
  # MS-DOS does not allow filenames that begin with a dot.
 
6757
  lt_cv_objdir=_libs
 
6758
fi
 
6759
rmdir .libs 2>/dev/null])
 
6760
objdir=$lt_cv_objdir
 
6761
])# AC_LIBTOOL_OBJDIR
 
6762
 
 
6763
 
 
6764
# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
 
6765
# ----------------------------------------------
 
6766
# Check hardcoding attributes.
 
6767
AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
 
6768
[AC_MSG_CHECKING([how to hardcode library paths into programs])
 
6769
_LT_AC_TAGVAR(hardcode_action, $1)=
 
6770
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
 
6771
   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
 
6772
   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
 
6773
 
 
6774
  # We can hardcode non-existant directories.
 
6775
  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
 
6776
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
 
6777
     # have to relink, otherwise we might link with an installed library
 
6778
     # when we should be linking with a yet-to-be-installed one
 
6779
     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
 
6780
     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
 
6781
    # Linking always hardcodes the temporary library directory.
 
6782
    _LT_AC_TAGVAR(hardcode_action, $1)=relink
 
6783
  else
 
6784
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
 
6785
    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
 
6786
  fi
 
6787
else
 
6788
  # We cannot hardcode anything, or else we can only hardcode existing
 
6789
  # directories.
 
6790
  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
 
6791
fi
 
6792
AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
 
6793
 
 
6794
if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
 
6795
  # Fast installation is not supported
 
6796
  enable_fast_install=no
 
6797
elif test "$shlibpath_overrides_runpath" = yes ||
 
6798
     test "$enable_shared" = no; then
 
6799
  # Fast installation is not necessary
 
6800
  enable_fast_install=needless
 
6801
fi
 
6802
])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
 
6803
 
 
6804
 
 
6805
# AC_LIBTOOL_SYS_LIB_STRIP
 
6806
# ------------------------
 
6807
AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
 
6808
[striplib=
 
6809
old_striplib=
 
6810
AC_MSG_CHECKING([whether stripping libraries is possible])
 
6811
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
 
6812
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
 
6813
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
 
6814
  AC_MSG_RESULT([yes])
 
6815
else
 
6816
# FIXME - insert some real tests, host_os isn't really good enough
 
6817
  case $host_os in
 
6818
   darwin*)
 
6819
       if test -n "$STRIP" ; then
 
6820
         striplib="$STRIP -x"
 
6821
         AC_MSG_RESULT([yes])
 
6822
       else
 
6823
  AC_MSG_RESULT([no])
 
6824
fi
 
6825
       ;;
 
6826
   *)
 
6827
  AC_MSG_RESULT([no])
 
6828
    ;;
 
6829
  esac  
 
6830
fi
 
6831
])# AC_LIBTOOL_SYS_LIB_STRIP
 
6832
 
 
6833
 
 
6834
# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
6835
# -----------------------------
 
6836
# PORTME Fill in your ld.so characteristics
 
6837
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
 
6838
[AC_MSG_CHECKING([dynamic linker characteristics])
 
6839
library_names_spec=
 
6840
libname_spec='lib$name'
 
6841
soname_spec=
 
6842
shrext=".so"
 
6843
postinstall_cmds=
 
6844
postuninstall_cmds=
 
6845
finish_cmds=
 
6846
finish_eval=
 
6847
shlibpath_var=
 
6848
shlibpath_overrides_runpath=unknown
 
6849
version_type=none
 
6850
dynamic_linker="$host_os ld.so"
 
6851
sys_lib_dlsearch_path_spec="/lib /usr/lib"
 
6852
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 
6853
need_lib_prefix=unknown
 
6854
hardcode_into_libs=no
 
6855
 
 
6856
# when you set need_version to no, make sure it does not cause -set_version
 
6857
# flags to be left without arguments
 
6858
need_version=unknown
 
6859
 
 
6860
case $host_os in
 
6861
aix3*)
 
6862
  version_type=linux
 
6863
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
 
6864
  shlibpath_var=LIBPATH
 
6865
 
 
6866
  # AIX 3 has no versioning support, so we append a major version to the name.
 
6867
  soname_spec='${libname}${release}${shared_ext}$major'
 
6868
  ;;
 
6869
 
 
6870
aix4* | aix5*)
 
6871
  version_type=linux
 
6872
  need_lib_prefix=no
 
6873
  need_version=no
 
6874
  hardcode_into_libs=yes
 
6875
  if test "$host_cpu" = ia64; then
 
6876
    # AIX 5 supports IA64
 
6877
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
 
6878
    shlibpath_var=LD_LIBRARY_PATH
 
6879
  else
 
6880
    # With GCC up to 2.95.x, collect2 would create an import file
 
6881
    # for dependence libraries.  The import file would start with
 
6882
    # the line `#! .'.  This would cause the generated library to
 
6883
    # depend on `.', always an invalid library.  This was fixed in
 
6884
    # development snapshots of GCC prior to 3.0.
 
6885
    case $host_os in
 
6886
      aix4 | aix4.[[01]] | aix4.[[01]].*)
 
6887
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 
6888
           echo ' yes '
 
6889
           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
 
6890
        :
 
6891
      else
 
6892
        can_build_shared=no
 
6893
      fi
 
6894
      ;;
 
6895
    esac
 
6896
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
 
6897
    # soname into executable. Probably we can add versioning support to
 
6898
    # collect2, so additional links can be useful in future.
 
6899
    if test "$aix_use_runtimelinking" = yes; then
 
6900
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
 
6901
      # instead of lib<name>.a to let people know that these are not
 
6902
      # typical AIX shared libraries.
 
6903
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6904
    else
 
6905
      # We preserve .a as extension for shared libraries through AIX4.2
 
6906
      # and later when we are not doing run time linking.
 
6907
      library_names_spec='${libname}${release}.a $libname.a'
 
6908
      soname_spec='${libname}${release}${shared_ext}$major'
 
6909
    fi
 
6910
    shlibpath_var=LIBPATH
 
6911
  fi
 
6912
  ;;
 
6913
 
 
6914
amigaos*)
 
6915
  library_names_spec='$libname.ixlibrary $libname.a'
 
6916
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
 
6917
  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
 
6918
  ;;
 
6919
 
 
6920
beos*)
 
6921
  library_names_spec='${libname}${shared_ext}'
 
6922
  dynamic_linker="$host_os ld.so"
 
6923
  shlibpath_var=LIBRARY_PATH
 
6924
  ;;
 
6925
 
 
6926
bsdi4*)
 
6927
  version_type=linux
 
6928
  need_version=no
 
6929
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6930
  soname_spec='${libname}${release}${shared_ext}$major'
 
6931
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
 
6932
  shlibpath_var=LD_LIBRARY_PATH
 
6933
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
 
6934
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
 
6935
  # the default ld.so.conf also contains /usr/contrib/lib and
 
6936
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
 
6937
  # libtool to hard-code these into programs
 
6938
  ;;
 
6939
 
 
6940
cygwin* | mingw* | pw32*)
 
6941
  version_type=windows
 
6942
  shrext=".dll"
 
6943
  need_version=no
 
6944
  need_lib_prefix=no
 
6945
 
 
6946
  case $GCC,$host_os in
 
6947
  yes,cygwin* | yes,mingw* | yes,pw32*)
 
6948
    library_names_spec='$libname.dll.a'
 
6949
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
 
6950
    postinstall_cmds='base_file=`basename \${file}`~
 
6951
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
 
6952
      dldir=$destdir/`dirname \$dlpath`~
 
6953
      test -d \$dldir || mkdir -p \$dldir~
 
6954
      $install_prog $dir/$dlname \$dldir/$dlname'
 
6955
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
 
6956
      dlpath=$dir/\$dldll~
 
6957
       $rm \$dlpath'
 
6958
    shlibpath_overrides_runpath=yes
 
6959
 
 
6960
    case $host_os in
 
6961
    cygwin*)
 
6962
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
 
6963
      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
 
6964
      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
 
6965
      ;;
 
6966
    mingw*)
 
6967
      # MinGW DLLs use traditional 'lib' prefix
 
6968
      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
 
6969
      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
 
6970
      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
 
6971
        # It is most probably a Windows format PATH printed by
 
6972
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
 
6973
        # path with ; separators, and with drive letters. We can handle the
 
6974
        # drive letters (cygwin fileutils understands them), so leave them,
 
6975
        # especially as we might pass files found there to a mingw objdump,
 
6976
        # which wouldn't understand a cygwinified path. Ahh.
 
6977
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
 
6978
      else
 
6979
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
 
6980
      fi
 
6981
      ;;
 
6982
    pw32*)
 
6983
      # pw32 DLLs use 'pw' prefix rather than 'lib'
 
6984
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
 
6985
      ;;
 
6986
    esac
 
6987
    ;;
 
6988
 
 
6989
  *)
 
6990
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
 
6991
    ;;
 
6992
  esac
 
6993
  dynamic_linker='Win32 ld.exe'
 
6994
  # FIXME: first we should search . and the directory the executable is in
 
6995
  shlibpath_var=PATH
 
6996
  ;;
 
6997
 
 
6998
darwin* | rhapsody*)
 
6999
  dynamic_linker="$host_os dyld"
 
7000
  version_type=darwin
 
7001
  need_lib_prefix=no
 
7002
  need_version=no
 
7003
  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
 
7004
  soname_spec='${libname}${release}${major}$shared_ext'
 
7005
  shlibpath_overrides_runpath=yes
 
7006
  shlibpath_var=DYLD_LIBRARY_PATH
 
7007
  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
 
7008
  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
 
7009
  if test "$GCC" = yes; then
 
7010
    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
 
7011
  else
 
7012
    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
 
7013
  fi
 
7014
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
 
7015
  ;;
 
7016
 
 
7017
dgux*)
 
7018
  version_type=linux
 
7019
  need_lib_prefix=no
 
7020
  need_version=no
 
7021
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
 
7022
  soname_spec='${libname}${release}${shared_ext}$major'
 
7023
  shlibpath_var=LD_LIBRARY_PATH
 
7024
  ;;
 
7025
 
 
7026
freebsd1*)
 
7027
  dynamic_linker=no
 
7028
  ;;
 
7029
 
 
7030
freebsd*-gnu*)
 
7031
  version_type=linux
 
7032
  need_lib_prefix=no
 
7033
  need_version=no
 
7034
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
 
7035
  soname_spec='${libname}${release}${shared_ext}$major'
 
7036
  shlibpath_var=LD_LIBRARY_PATH
 
7037
  shlibpath_overrides_runpath=no
 
7038
  hardcode_into_libs=yes
 
7039
  dynamic_linker='GNU ld.so'
 
7040
  ;;
 
7041
 
 
7042
freebsd*)
 
7043
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
 
7044
  version_type=freebsd-$objformat
 
7045
  case $version_type in
 
7046
    freebsd-elf*)
 
7047
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
 
7048
      need_version=no
 
7049
      need_lib_prefix=no
 
7050
      ;;
 
7051
    freebsd-*)
 
7052
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
 
7053
      need_version=yes
 
7054
      ;;
 
7055
  esac
 
7056
  shlibpath_var=LD_LIBRARY_PATH
 
7057
  case $host_os in
 
7058
  freebsd2*)
 
7059
    shlibpath_overrides_runpath=yes
 
7060
    ;;
 
7061
  freebsd3.[01]* | freebsdelf3.[01]*)
 
7062
    shlibpath_overrides_runpath=yes
 
7063
    hardcode_into_libs=yes
 
7064
    ;;
 
7065
  *) # from 3.2 on
 
7066
    shlibpath_overrides_runpath=no
 
7067
    hardcode_into_libs=yes
 
7068
    ;;
 
7069
  esac
 
7070
  ;;
 
7071
 
 
7072
gnu*)
 
7073
  version_type=linux
 
7074
  need_lib_prefix=no
 
7075
  need_version=no
 
7076
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
 
7077
  soname_spec='${libname}${release}${shared_ext}$major'
 
7078
  shlibpath_var=LD_LIBRARY_PATH
 
7079
  hardcode_into_libs=yes
 
7080
  ;;
 
7081
 
 
7082
hpux9* | hpux10* | hpux11*)
 
7083
  # Give a soname corresponding to the major version so that dld.sl refuses to
 
7084
  # link against other versions.
 
7085
  version_type=sunos
 
7086
  need_lib_prefix=no
 
7087
  need_version=no
 
7088
  case "$host_cpu" in
 
7089
  ia64*)
 
7090
    shrext='.so'
 
7091
    hardcode_into_libs=yes
 
7092
    dynamic_linker="$host_os dld.so"
 
7093
    shlibpath_var=LD_LIBRARY_PATH
 
7094
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
 
7095
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7096
    soname_spec='${libname}${release}${shared_ext}$major'
 
7097
    if test "X$HPUX_IA64_MODE" = X32; then
 
7098
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
 
7099
    else
 
7100
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
 
7101
    fi
 
7102
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
 
7103
    ;;
 
7104
   hppa*64*)
 
7105
     shrext='.sl'
 
7106
     hardcode_into_libs=yes
 
7107
     dynamic_linker="$host_os dld.sl"
 
7108
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
 
7109
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
 
7110
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7111
     soname_spec='${libname}${release}${shared_ext}$major'
 
7112
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
 
7113
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
 
7114
     ;;
 
7115
   *)
 
7116
    shrext='.sl'
 
7117
    dynamic_linker="$host_os dld.sl"
 
7118
    shlibpath_var=SHLIB_PATH
 
7119
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
 
7120
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7121
    soname_spec='${libname}${release}${shared_ext}$major'
 
7122
    ;;
 
7123
  esac
 
7124
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
 
7125
  postinstall_cmds='chmod 555 $lib'
 
7126
  ;;
 
7127
 
 
7128
irix5* | irix6* | nonstopux*)
 
7129
  case $host_os in
 
7130
    nonstopux*) version_type=nonstopux ;;
 
7131
    *)
 
7132
        if test "$lt_cv_prog_gnu_ld" = yes; then
 
7133
                version_type=linux
 
7134
        else
 
7135
                version_type=irix
 
7136
        fi ;;
 
7137
  esac
 
7138
  need_lib_prefix=no
 
7139
  need_version=no
 
7140
  soname_spec='${libname}${release}${shared_ext}$major'
 
7141
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
 
7142
  case $host_os in
 
7143
  irix5* | nonstopux*)
 
7144
    libsuff= shlibsuff=
 
7145
    ;;
 
7146
  *)
 
7147
    case $LD in # libtool.m4 will add one of these switches to LD
 
7148
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
 
7149
      libsuff= shlibsuff= libmagic=32-bit;;
 
7150
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
 
7151
      libsuff=32 shlibsuff=N32 libmagic=N32;;
 
7152
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
 
7153
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
 
7154
    *) libsuff= shlibsuff= libmagic=never-match;;
 
7155
    esac
 
7156
    ;;
 
7157
  esac
 
7158
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
 
7159
  shlibpath_overrides_runpath=no
 
7160
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
 
7161
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
 
7162
  hardcode_into_libs=yes
 
7163
  ;;
 
7164
 
 
7165
# No shared lib support for Linux oldld, aout, or coff.
 
7166
linux*oldld* | linux*aout* | linux*coff*)
 
7167
  dynamic_linker=no
 
7168
  ;;
 
7169
 
 
7170
# This must be Linux ELF.
 
7171
linux*)
 
7172
  version_type=linux
 
7173
  need_lib_prefix=no
 
7174
  need_version=no
 
7175
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7176
  soname_spec='${libname}${release}${shared_ext}$major'
 
7177
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
 
7178
  libsuff=
 
7179
  if test "x$LINUX_64_MODE" = x64; then
 
7180
    # Some platforms are per default 64-bit, so there's no /lib64
 
7181
    if test -d /lib64; then
 
7182
      libsuff=64
 
7183
    fi
 
7184
  fi
 
7185
  shlibpath_var=LD_LIBRARY_PATH
 
7186
  shlibpath_overrides_runpath=no
 
7187
  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
 
7188
  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
 
7189
  # This implies no fast_install, which is unacceptable.
 
7190
  # Some rework will be needed to allow for fast_install
 
7191
  # before this can be enabled.
 
7192
  hardcode_into_libs=yes
 
7193
 
 
7194
  # We used to test for /lib/ld.so.1 and disable shared libraries on
 
7195
  # powerpc, because MkLinux only supported shared libraries with the
 
7196
  # GNU dynamic linker.  Since this was broken with cross compilers,
 
7197
  # most powerpc-linux boxes support dynamic linking these days and
 
7198
  # people can always --disable-shared, the test was removed, and we
 
7199
  # assume the GNU/Linux dynamic linker is in use.
 
7200
  dynamic_linker='GNU/Linux ld.so'
 
7201
  ;;
 
7202
 
 
7203
netbsd*)
 
7204
  version_type=sunos
 
7205
  need_lib_prefix=no
 
7206
  need_version=no
 
7207
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
7208
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
7209
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
 
7210
    dynamic_linker='NetBSD (a.out) ld.so'
 
7211
  else
 
7212
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
 
7213
    soname_spec='${libname}${release}${shared_ext}$major'
 
7214
    dynamic_linker='NetBSD ld.elf_so'
 
7215
  fi
 
7216
  shlibpath_var=LD_LIBRARY_PATH
 
7217
  shlibpath_overrides_runpath=yes
 
7218
  hardcode_into_libs=yes
 
7219
  ;;
 
7220
 
 
7221
newsos6)
 
7222
  version_type=linux
 
7223
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7224
  shlibpath_var=LD_LIBRARY_PATH
 
7225
  shlibpath_overrides_runpath=yes
 
7226
  ;;
 
7227
 
 
7228
nto-qnx*)
 
7229
  version_type=linux
 
7230
  need_lib_prefix=no
 
7231
  need_version=no
 
7232
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7233
  soname_spec='${libname}${release}${shared_ext}$major'
 
7234
  shlibpath_var=LD_LIBRARY_PATH
 
7235
  shlibpath_overrides_runpath=yes
 
7236
  ;;
 
7237
 
 
7238
openbsd*)
 
7239
  version_type=sunos
 
7240
  need_lib_prefix=no
 
7241
  need_version=no
 
7242
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
7243
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
 
7244
  shlibpath_var=LD_LIBRARY_PATH
 
7245
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
7246
    case $host_os in
 
7247
      openbsd2.[[89]] | openbsd2.[[89]].*)
 
7248
        shlibpath_overrides_runpath=no
 
7249
        ;;
 
7250
      *)
 
7251
        shlibpath_overrides_runpath=yes
 
7252
        ;;
 
7253
      esac
 
7254
  else
 
7255
    shlibpath_overrides_runpath=yes
 
7256
  fi
 
7257
  ;;
 
7258
 
 
7259
os2*)
 
7260
  libname_spec='$name'
 
7261
  shrext=".dll"
 
7262
  need_lib_prefix=no
 
7263
  library_names_spec='$libname${shared_ext} $libname.a'
 
7264
  dynamic_linker='OS/2 ld.exe'
 
7265
  shlibpath_var=LIBPATH
 
7266
  ;;
 
7267
 
 
7268
osf3* | osf4* | osf5*)
 
7269
  version_type=osf
 
7270
  need_lib_prefix=no
 
7271
  need_version=no
 
7272
  soname_spec='${libname}${release}${shared_ext}$major'
 
7273
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7274
  shlibpath_var=LD_LIBRARY_PATH
 
7275
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
 
7276
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
 
7277
  ;;
 
7278
 
 
7279
sco3.2v5*)
 
7280
  version_type=osf
 
7281
  soname_spec='${libname}${release}${shared_ext}$major'
 
7282
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7283
  shlibpath_var=LD_LIBRARY_PATH
 
7284
  ;;
 
7285
 
 
7286
solaris*)
 
7287
  version_type=linux
 
7288
  need_lib_prefix=no
 
7289
  need_version=no
 
7290
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7291
  soname_spec='${libname}${release}${shared_ext}$major'
 
7292
  shlibpath_var=LD_LIBRARY_PATH
 
7293
  shlibpath_overrides_runpath=yes
 
7294
  hardcode_into_libs=yes
 
7295
  # ldd complains unless libraries are executable
 
7296
  postinstall_cmds='chmod +x $lib'
 
7297
  ;;
 
7298
 
 
7299
sunos4*)
 
7300
  version_type=sunos
 
7301
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
7302
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
 
7303
  shlibpath_var=LD_LIBRARY_PATH
 
7304
  shlibpath_overrides_runpath=yes
 
7305
  if test "$with_gnu_ld" = yes; then
 
7306
    need_lib_prefix=no
 
7307
  fi
 
7308
  need_version=yes
 
7309
  ;;
 
7310
 
 
7311
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
7312
  version_type=linux
 
7313
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7314
  soname_spec='${libname}${release}${shared_ext}$major'
 
7315
  shlibpath_var=LD_LIBRARY_PATH
 
7316
  case $host_vendor in
 
7317
    sni)
 
7318
      shlibpath_overrides_runpath=no
 
7319
      need_lib_prefix=no
 
7320
      export_dynamic_flag_spec='${wl}-Blargedynsym'
 
7321
      runpath_var=LD_RUN_PATH
 
7322
      ;;
 
7323
    siemens)
 
7324
      need_lib_prefix=no
 
7325
      ;;
 
7326
    motorola)
 
7327
      need_lib_prefix=no
 
7328
      need_version=no
 
7329
      shlibpath_overrides_runpath=no
 
7330
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
 
7331
      ;;
 
7332
  esac
 
7333
  ;;
 
7334
 
 
7335
sysv4*MP*)
 
7336
  if test -d /usr/nec ;then
 
7337
    version_type=linux
 
7338
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
 
7339
    soname_spec='$libname${shared_ext}.$major'
 
7340
    shlibpath_var=LD_LIBRARY_PATH
 
7341
  fi
 
7342
  ;;
 
7343
 
 
7344
uts4*)
 
7345
  version_type=linux
 
7346
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
7347
  soname_spec='${libname}${release}${shared_ext}$major'
 
7348
  shlibpath_var=LD_LIBRARY_PATH
 
7349
  ;;
 
7350
 
 
7351
*)
 
7352
  dynamic_linker=no
 
7353
  ;;
 
7354
esac
 
7355
AC_MSG_RESULT([$dynamic_linker])
 
7356
test "$dynamic_linker" = no && can_build_shared=no
 
7357
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
7358
 
 
7359
 
 
7360
# _LT_AC_TAGCONFIG
 
7361
# ----------------
 
7362
AC_DEFUN([_LT_AC_TAGCONFIG],
 
7363
[AC_ARG_WITH([tags],
 
7364
    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
 
7365
        [include additional configurations @<:@automatic@:>@])],
 
7366
    [tagnames="$withval"])
 
7367
 
 
7368
if test -f "$ltmain" && test -n "$tagnames"; then
 
7369
  if test ! -f "${ofile}"; then
 
7370
    AC_MSG_WARN([output file `$ofile' does not exist])
 
7371
  fi
 
7372
 
 
7373
  if test -z "$LTCC"; then
 
7374
    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
 
7375
    if test -z "$LTCC"; then
 
7376
      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
 
7377
    else
 
7378
      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
 
7379
    fi
 
7380
  fi
 
7381
 
 
7382
  # Extract list of available tagged configurations in $ofile.
 
7383
  # Note that this assumes the entire list is on one line.
 
7384
  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
 
7385
 
 
7386
  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7387
  for tagname in $tagnames; do
 
7388
    IFS="$lt_save_ifs"
 
7389
    # Check whether tagname contains only valid characters
 
7390
    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
 
7391
    "") ;;
 
7392
    *)  AC_MSG_ERROR([invalid tag name: $tagname])
 
7393
        ;;
 
7394
    esac
 
7395
 
 
7396
    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
 
7397
    then
 
7398
      AC_MSG_ERROR([tag name \"$tagname\" already exists])
 
7399
    fi
 
7400
 
 
7401
    # Update the list of available tags.
 
7402
    if test -n "$tagname"; then
 
7403
      echo appending configuration tag \"$tagname\" to $ofile
 
7404
 
 
7405
      case $tagname in
 
7406
      CXX)
 
7407
        if test -n "$CXX" && test "X$CXX" != "Xno"; then
 
7408
          AC_LIBTOOL_LANG_CXX_CONFIG
 
7409
        else
 
7410
          tagname=""
 
7411
        fi
 
7412
        ;;
 
7413
 
 
7414
      F77)
 
7415
        if test -n "$F77" && test "X$F77" != "Xno"; then
 
7416
          AC_LIBTOOL_LANG_F77_CONFIG
 
7417
        else
 
7418
          tagname=""
 
7419
        fi
 
7420
        ;;
 
7421
 
 
7422
      GCJ)
 
7423
        if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
 
7424
          AC_LIBTOOL_LANG_GCJ_CONFIG
 
7425
        else
 
7426
          tagname=""
 
7427
        fi
 
7428
        ;;
 
7429
 
 
7430
      RC)
 
7431
        AC_LIBTOOL_LANG_RC_CONFIG
 
7432
        ;;
 
7433
 
 
7434
      *)
 
7435
        AC_MSG_ERROR([Unsupported tag name: $tagname])
 
7436
        ;;
 
7437
      esac
 
7438
 
 
7439
      # Append the new tag name to the list of available tags.
 
7440
      if test -n "$tagname" ; then
 
7441
      available_tags="$available_tags $tagname"
 
7442
    fi
 
7443
    fi
 
7444
  done
 
7445
  IFS="$lt_save_ifs"
 
7446
 
 
7447
  # Now substitute the updated list of available tags.
 
7448
  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
 
7449
    mv "${ofile}T" "$ofile"
 
7450
    chmod +x "$ofile"
 
7451
  else
 
7452
    rm -f "${ofile}T"
 
7453
    AC_MSG_ERROR([unable to update list of available tagged configurations.])
 
7454
  fi
 
7455
fi
 
7456
])# _LT_AC_TAGCONFIG
 
7457
 
 
7458
 
 
7459
# AC_LIBTOOL_DLOPEN
 
7460
# -----------------
 
7461
# enable checks for dlopen support
 
7462
AC_DEFUN([AC_LIBTOOL_DLOPEN],
 
7463
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
 
7464
])# AC_LIBTOOL_DLOPEN
 
7465
 
 
7466
 
 
7467
# AC_LIBTOOL_WIN32_DLL
 
7468
# --------------------
 
7469
# declare package support for building win32 dll's
 
7470
AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
 
7471
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
 
7472
])# AC_LIBTOOL_WIN32_DLL
 
7473
 
 
7474
 
 
7475
# AC_ENABLE_SHARED([DEFAULT])
 
7476
# ---------------------------
 
7477
# implement the --enable-shared flag
 
7478
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7479
AC_DEFUN([AC_ENABLE_SHARED],
 
7480
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 
7481
AC_ARG_ENABLE([shared],
 
7482
    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
 
7483
        [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
 
7484
    [p=${PACKAGE-default}
 
7485
    case $enableval in
 
7486
    yes) enable_shared=yes ;;
 
7487
    no) enable_shared=no ;;
 
7488
    *)
 
7489
      enable_shared=no
 
7490
      # Look at the argument we got.  We use all the common list separators.
 
7491
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7492
      for pkg in $enableval; do
 
7493
        IFS="$lt_save_ifs"
 
7494
        if test "X$pkg" = "X$p"; then
 
7495
          enable_shared=yes
 
7496
        fi
 
7497
      done
 
7498
      IFS="$lt_save_ifs"
 
7499
      ;;
 
7500
    esac],
 
7501
    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
 
7502
])# AC_ENABLE_SHARED
 
7503
 
 
7504
 
 
7505
# AC_DISABLE_SHARED
 
7506
# -----------------
 
7507
#- set the default shared flag to --disable-shared
 
7508
AC_DEFUN([AC_DISABLE_SHARED],
 
7509
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7510
AC_ENABLE_SHARED(no)
 
7511
])# AC_DISABLE_SHARED
 
7512
 
 
7513
 
 
7514
# AC_ENABLE_STATIC([DEFAULT])
 
7515
# ---------------------------
 
7516
# implement the --enable-static flag
 
7517
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7518
AC_DEFUN([AC_ENABLE_STATIC],
 
7519
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 
7520
AC_ARG_ENABLE([static],
 
7521
    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
 
7522
        [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
 
7523
    [p=${PACKAGE-default}
 
7524
    case $enableval in
 
7525
    yes) enable_static=yes ;;
 
7526
    no) enable_static=no ;;
 
7527
    *)
 
7528
     enable_static=no
 
7529
      # Look at the argument we got.  We use all the common list separators.
 
7530
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7531
      for pkg in $enableval; do
 
7532
        IFS="$lt_save_ifs"
 
7533
        if test "X$pkg" = "X$p"; then
 
7534
          enable_static=yes
 
7535
        fi
 
7536
      done
 
7537
      IFS="$lt_save_ifs"
 
7538
      ;;
 
7539
    esac],
 
7540
    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
 
7541
])# AC_ENABLE_STATIC
 
7542
 
 
7543
 
 
7544
# AC_DISABLE_STATIC
 
7545
# -----------------
 
7546
# set the default static flag to --disable-static
 
7547
AC_DEFUN([AC_DISABLE_STATIC],
 
7548
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7549
AC_ENABLE_STATIC(no)
 
7550
])# AC_DISABLE_STATIC
 
7551
 
 
7552
 
 
7553
# AC_ENABLE_FAST_INSTALL([DEFAULT])
 
7554
# ---------------------------------
 
7555
# implement the --enable-fast-install flag
 
7556
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7557
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
 
7558
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
 
7559
AC_ARG_ENABLE([fast-install],
 
7560
    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
 
7561
    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
 
7562
    [p=${PACKAGE-default}
 
7563
    case $enableval in
 
7564
    yes) enable_fast_install=yes ;;
 
7565
    no) enable_fast_install=no ;;
 
7566
    *)
 
7567
      enable_fast_install=no
 
7568
      # Look at the argument we got.  We use all the common list separators.
 
7569
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7570
      for pkg in $enableval; do
 
7571
        IFS="$lt_save_ifs"
 
7572
        if test "X$pkg" = "X$p"; then
 
7573
          enable_fast_install=yes
 
7574
        fi
 
7575
      done
 
7576
      IFS="$lt_save_ifs"
 
7577
      ;;
 
7578
    esac],
 
7579
    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
 
7580
])# AC_ENABLE_FAST_INSTALL
 
7581
 
 
7582
 
 
7583
# AC_DISABLE_FAST_INSTALL
 
7584
# -----------------------
 
7585
# set the default to --disable-fast-install
 
7586
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
 
7587
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7588
AC_ENABLE_FAST_INSTALL(no)
 
7589
])# AC_DISABLE_FAST_INSTALL
 
7590
 
 
7591
 
 
7592
# AC_LIBTOOL_PICMODE([MODE])
 
7593
# --------------------------
 
7594
# implement the --with-pic flag
 
7595
# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 
7596
AC_DEFUN([AC_LIBTOOL_PICMODE],
 
7597
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7598
pic_mode=ifelse($#,1,$1,default)
 
7599
])# AC_LIBTOOL_PICMODE
 
7600
 
 
7601
 
 
7602
# AC_PROG_EGREP
 
7603
# -------------
 
7604
# This is predefined starting with Autoconf 2.54, so this conditional
 
7605
# definition can be removed once we require Autoconf 2.54 or later.
 
7606
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
 
7607
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
 
7608
   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
 
7609
    then ac_cv_prog_egrep='grep -E'
 
7610
    else ac_cv_prog_egrep='egrep'
 
7611
    fi])
 
7612
 EGREP=$ac_cv_prog_egrep
 
7613
 AC_SUBST([EGREP])
 
7614
])])
 
7615
 
 
7616
 
 
7617
# AC_PATH_TOOL_PREFIX
 
7618
# -------------------
 
7619
# find a file program which can recognise shared library
 
7620
AC_DEFUN([AC_PATH_TOOL_PREFIX],
 
7621
[AC_REQUIRE([AC_PROG_EGREP])dnl
 
7622
AC_MSG_CHECKING([for $1])
 
7623
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 
7624
[case $MAGIC_CMD in
 
7625
[[\\/*] |  ?:[\\/]*])
 
7626
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
 
7627
  ;;
 
7628
*)
 
7629
  lt_save_MAGIC_CMD="$MAGIC_CMD"
 
7630
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
7631
dnl $ac_dummy forces splitting on constant user-supplied paths.
 
7632
dnl POSIX.2 word splitting is done only on the output of word expansions,
 
7633
dnl not every word.  This closes a longstanding sh security hole.
 
7634
  ac_dummy="ifelse([$2], , $PATH, [$2])"
 
7635
  for ac_dir in $ac_dummy; do
 
7636
    IFS="$lt_save_ifs"
 
7637
    test -z "$ac_dir" && ac_dir=.
 
7638
    if test -f $ac_dir/$1; then
 
7639
      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
 
7640
      if test -n "$file_magic_test_file"; then
 
7641
        case $deplibs_check_method in
 
7642
        "file_magic "*)
 
7643
          file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
 
7644
          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 
7645
          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 
7646
            $EGREP "$file_magic_regex" > /dev/null; then
 
7647
            :
 
7648
          else
 
7649
            cat <<EOF 1>&2
 
7650
 
 
7651
*** Warning: the command libtool uses to detect shared libraries,
 
7652
*** $file_magic_cmd, produces output that libtool cannot recognize.
 
7653
*** The result is that libtool may fail to recognize shared libraries
 
7654
*** as such.  This will affect the creation of libtool libraries that
 
7655
*** depend on shared libraries, but programs linked with such libtool
 
7656
*** libraries will work regardless of this problem.  Nevertheless, you
 
7657
*** may want to report the problem to your system manager and/or to
 
7658
*** bug-libtool@gnu.org
 
7659
 
 
7660
EOF
 
7661
          fi ;;
 
7662
        esac
 
7663
      fi
 
7664
      break
 
7665
    fi
 
7666
  done
 
7667
  IFS="$lt_save_ifs"
 
7668
  MAGIC_CMD="$lt_save_MAGIC_CMD"
 
7669
  ;;
 
7670
esac])
 
7671
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 
7672
if test -n "$MAGIC_CMD"; then
 
7673
  AC_MSG_RESULT($MAGIC_CMD)
 
7674
else
 
7675
  AC_MSG_RESULT(no)
 
7676
fi
 
7677
])# AC_PATH_TOOL_PREFIX
 
7678
 
 
7679
 
 
7680
# AC_PATH_MAGIC
 
7681
# -------------
 
7682
# find a file program which can recognise a shared library
 
7683
AC_DEFUN([AC_PATH_MAGIC],
 
7684
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 
7685
if test -z "$lt_cv_path_MAGIC_CMD"; then
 
7686
  if test -n "$ac_tool_prefix"; then
 
7687
    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
 
7688
  else
 
7689
    MAGIC_CMD=:
 
7690
  fi
 
7691
fi
 
7692
])# AC_PATH_MAGIC
 
7693
 
 
7694
 
 
7695
# AC_PROG_LD
 
7696
# ----------
 
7697
# find the pathname to the GNU or non-GNU linker
 
7698
AC_DEFUN([AC_PROG_LD],
 
7699
[AC_ARG_WITH([gnu-ld],
 
7700
    [AC_HELP_STRING([--with-gnu-ld],
 
7701
        [assume the C compiler uses GNU ld @<:@default=no@:>@])],
 
7702
    [test "$withval" = no || with_gnu_ld=yes],
 
7703
    [with_gnu_ld=no])
 
7704
AC_REQUIRE([LT_AC_PROG_SED])dnl
 
7705
AC_REQUIRE([AC_PROG_CC])dnl
 
7706
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
7707
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
7708
ac_prog=ld
 
7709
if test "$GCC" = yes; then
 
7710
  # Check if gcc -print-prog-name=ld gives a path.
 
7711
  AC_MSG_CHECKING([for ld used by $CC])
 
7712
  case $host in
 
7713
  *-*-mingw*)
 
7714
    # gcc leaves a trailing carriage return which upsets mingw
 
7715
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
7716
  *)
 
7717
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
7718
  esac
 
7719
  case $ac_prog in
 
7720
    # Accept absolute paths.
 
7721
    [[\\/]]* | ?:[[\\/]]*)
 
7722
      re_direlt='/[[^/]][[^/]]*/\.\./'
 
7723
      # Canonicalize the pathname of ld
 
7724
      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
 
7725
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
7726
        ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
 
7727
      done
 
7728
      test -z "$LD" && LD="$ac_prog"
 
7729
      ;;
 
7730
  "")
 
7731
    # If it fails, then pretend we aren't using GCC.
 
7732
    ac_prog=ld
 
7733
    ;;
 
7734
  *)
 
7735
    # If it is relative, then search for the first ld in PATH.
 
7736
    with_gnu_ld=unknown
 
7737
    ;;
 
7738
  esac
 
7739
elif test "$with_gnu_ld" = yes; then
 
7740
  AC_MSG_CHECKING([for GNU ld])
 
7741
else
 
7742
  AC_MSG_CHECKING([for non-GNU ld])
 
7743
fi
 
7744
AC_CACHE_VAL(lt_cv_path_LD,
 
7745
[if test -z "$LD"; then
 
7746
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
7747
  for ac_dir in $PATH; do
 
7748
    IFS="$lt_save_ifs"
 
7749
    test -z "$ac_dir" && ac_dir=.
 
7750
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
7751
      lt_cv_path_LD="$ac_dir/$ac_prog"
 
7752
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
7753
      # but apparently some GNU ld's only accept -v.
 
7754
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
7755
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
 
7756
      *GNU* | *'with BFD'*)
 
7757
        test "$with_gnu_ld" != no && break
 
7758
        ;;
 
7759
      *)
 
7760
        test "$with_gnu_ld" != yes && break
 
7761
        ;;
 
7762
      esac
 
7763
    fi
 
7764
  done
 
7765
  IFS="$lt_save_ifs"
 
7766
else
 
7767
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 
7768
fi])
 
7769
LD="$lt_cv_path_LD"
 
7770
if test -n "$LD"; then
 
7771
  AC_MSG_RESULT($LD)
 
7772
else
 
7773
  AC_MSG_RESULT(no)
 
7774
fi
 
7775
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
7776
AC_PROG_LD_GNU
 
7777
])# AC_PROG_LD
 
7778
 
 
7779
 
 
7780
# AC_PROG_LD_GNU
 
7781
# --------------
 
7782
AC_DEFUN([AC_PROG_LD_GNU],
 
7783
[AC_REQUIRE([AC_PROG_EGREP])dnl
 
7784
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
 
7785
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
7786
case `$LD -v 2>&1 </dev/null` in
 
7787
*GNU* | *'with BFD'*)
 
7788
  lt_cv_prog_gnu_ld=yes
 
7789
  ;;
 
7790
*)
 
7791
  lt_cv_prog_gnu_ld=no
 
7792
  ;;
 
7793
esac])
 
7794
with_gnu_ld=$lt_cv_prog_gnu_ld
 
7795
])# AC_PROG_LD_GNU
 
7796
 
 
7797
 
 
7798
# AC_PROG_LD_RELOAD_FLAG
 
7799
# ----------------------
 
7800
# find reload flag for linker
 
7801
#   -- PORTME Some linkers may need a different reload flag.
 
7802
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
 
7803
[AC_CACHE_CHECK([for $LD option to reload object files],
 
7804
  lt_cv_ld_reload_flag,
 
7805
  [lt_cv_ld_reload_flag='-r'])
 
7806
reload_flag=$lt_cv_ld_reload_flag
 
7807
case $reload_flag in
 
7808
"" | " "*) ;;
 
7809
*) reload_flag=" $reload_flag" ;;
 
7810
esac
 
7811
reload_cmds='$LD$reload_flag -o $output$reload_objs'
 
7812
])# AC_PROG_LD_RELOAD_FLAG
 
7813
 
 
7814
 
 
7815
# AC_DEPLIBS_CHECK_METHOD
 
7816
# -----------------------
 
7817
# how to check for library dependencies
 
7818
#  -- PORTME fill in with the dynamic library characteristics
 
7819
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
 
7820
[AC_CACHE_CHECK([how to recognise dependent libraries],
 
7821
lt_cv_deplibs_check_method,
 
7822
[lt_cv_file_magic_cmd='$MAGIC_CMD'
 
7823
lt_cv_file_magic_test_file=
 
7824
lt_cv_deplibs_check_method='unknown'
 
7825
# Need to set the preceding variable on all platforms that support
 
7826
# interlibrary dependencies.
 
7827
# 'none' -- dependencies not supported.
 
7828
# `unknown' -- same as none, but documents that we really don't know.
 
7829
# 'pass_all' -- all dependencies passed with no checks.
 
7830
# 'test_compile' -- check by making test program.
 
7831
# 'file_magic [[regex]]' -- check by looking for files in library path
 
7832
# which responds to the $file_magic_cmd with a given extended regex.
 
7833
# If you have `file' or equivalent on your system and you're not sure
 
7834
# whether `pass_all' will *always* work, you probably want this one.
 
7835
 
 
7836
case $host_os in
 
7837
aix4* | aix5*)
 
7838
  lt_cv_deplibs_check_method=pass_all
 
7839
  ;;
 
7840
 
 
7841
beos*)
 
7842
  lt_cv_deplibs_check_method=pass_all
 
7843
  ;;
 
7844
 
 
7845
bsdi4*)
 
7846
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
 
7847
  lt_cv_file_magic_cmd='/usr/bin/file -L'
 
7848
  lt_cv_file_magic_test_file=/shlib/libc.so
 
7849
  ;;
 
7850
 
 
7851
cygwin*)
 
7852
  lt_cv_deplibs_check_method=pass_all
 
7853
  ;;
 
7854
  
 
7855
mingw* | pw32*)
 
7856
  # win32_libid is a shell function defined in ltmain.sh
 
7857
  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
 
7858
  lt_cv_file_magic_cmd='win32_libid'
 
7859
  ;;
 
7860
 
 
7861
darwin* | rhapsody*)
 
7862
  # this will be overwritten by pass_all, but leave it in just in case
 
7863
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
 
7864
  lt_cv_file_magic_cmd='/usr/bin/file -L'
 
7865
  case "$host_os" in
 
7866
  rhapsody* | darwin1.[[012]])
 
7867
    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
 
7868
    ;;
 
7869
  *) # Darwin 1.3 on
 
7870
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
 
7871
    ;;
 
7872
  esac
 
7873
  lt_cv_deplibs_check_method=pass_all
 
7874
  ;;
 
7875
 
 
7876
freebsd*)
 
7877
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 
7878
    case $host_cpu in
 
7879
    i*86 )
 
7880
      # Not sure whether the presence of OpenBSD here was a mistake.
 
7881
      # Let's accept both of them until this is cleared up.
 
7882
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
 
7883
      lt_cv_file_magic_cmd=/usr/bin/file
 
7884
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
 
7885
      ;;
 
7886
    esac
 
7887
  else
 
7888
    lt_cv_deplibs_check_method=pass_all
 
7889
  fi
 
7890
  ;;
 
7891
 
 
7892
gnu*)
 
7893
  lt_cv_deplibs_check_method=pass_all
 
7894
  ;;
 
7895
 
 
7896
hpux10.20* | hpux11*)
 
7897
  lt_cv_file_magic_cmd=/usr/bin/file
 
7898
  case "$host_cpu" in
 
7899
  ia64*)
 
7900
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
 
7901
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
 
7902
    ;;
 
7903
  hppa*64*)
 
7904
    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
 
7905
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
 
7906
    ;;
 
7907
  *)
 
7908
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
 
7909
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
 
7910
    ;;
 
7911
  esac
 
7912
  ;;
 
7913
 
 
7914
irix5* | irix6* | nonstopux*)
 
7915
  case $host_os in
 
7916
  irix5* | nonstopux*)
 
7917
    # this will be overridden with pass_all, but let us keep it just in case
 
7918
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
 
7919
    ;;
 
7920
  *)
 
7921
    case $LD in
 
7922
    *-32|*"-32 ") libmagic=32-bit;;
 
7923
    *-n32|*"-n32 ") libmagic=N32;;
 
7924
    *-64|*"-64 ") libmagic=64-bit;;
 
7925
    *) libmagic=never-match;;
 
7926
    esac
 
7927
    # this will be overridden with pass_all, but let us keep it just in case
 
7928
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
 
7929
    ;;
 
7930
  esac
 
7931
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
 
7932
  lt_cv_deplibs_check_method=pass_all
 
7933
  ;;
 
7934
 
 
7935
# This must be Linux ELF.
 
7936
linux*)
 
7937
  case $host_cpu in
 
7938
  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
 
7939
    lt_cv_deplibs_check_method=pass_all ;;
 
7940
  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
 
7941
  arm* )
 
7942
    lt_cv_deplibs_check_method=pass_all ;;
 
7943
  *)
 
7944
    # glibc up to 2.1.1 does not perform some relocations on ARM
 
7945
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
 
7946
  esac
 
7947
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
 
7948
  ;;
 
7949
 
 
7950
netbsd*)
 
7951
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 
7952
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
 
7953
  else
 
7954
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
 
7955
  fi
 
7956
  ;;
 
7957
 
 
7958
newos6*)
 
7959
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
 
7960
  lt_cv_file_magic_cmd=/usr/bin/file
 
7961
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
 
7962
  ;;
 
7963
 
 
7964
nto-qnx*)
 
7965
  lt_cv_deplibs_check_method=unknown
 
7966
  ;;
 
7967
 
 
7968
openbsd*)
 
7969
  lt_cv_file_magic_cmd=/usr/bin/file
 
7970
  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
 
7971
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
7972
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
 
7973
  else
 
7974
    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
 
7975
  fi
 
7976
  ;;
 
7977
 
 
7978
osf3* | osf4* | osf5*)
 
7979
  # this will be overridden with pass_all, but let us keep it just in case
 
7980
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
 
7981
  lt_cv_file_magic_test_file=/shlib/libc.so
 
7982
  lt_cv_deplibs_check_method=pass_all
 
7983
  ;;
 
7984
 
 
7985
sco3.2v5*)
 
7986
  lt_cv_deplibs_check_method=pass_all
 
7987
  ;;
 
7988
 
 
7989
solaris*)
 
7990
  lt_cv_deplibs_check_method=pass_all
 
7991
  lt_cv_file_magic_test_file=/lib/libc.so
 
7992
  ;;
 
7993
 
 
7994
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
7995
  case $host_vendor in
 
7996
  motorola)
 
7997
    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]]'
 
7998
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
 
7999
    ;;
 
8000
  ncr)
 
8001
    lt_cv_deplibs_check_method=pass_all
 
8002
    ;;
 
8003
  sequent)
 
8004
    lt_cv_file_magic_cmd='/bin/file'
 
8005
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
 
8006
    ;;
 
8007
  sni)
 
8008
    lt_cv_file_magic_cmd='/bin/file'
 
8009
    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
 
8010
    lt_cv_file_magic_test_file=/lib/libc.so
 
8011
    ;;
 
8012
  siemens)
 
8013
    lt_cv_deplibs_check_method=pass_all
 
8014
    ;;
 
8015
  esac
 
8016
  ;;
 
8017
 
 
8018
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
 
8019
  lt_cv_deplibs_check_method=pass_all
 
8020
  ;;
 
8021
esac
 
8022
])
 
8023
file_magic_cmd=$lt_cv_file_magic_cmd
 
8024
deplibs_check_method=$lt_cv_deplibs_check_method
 
8025
test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
8026
])# AC_DEPLIBS_CHECK_METHOD
 
8027
 
 
8028
 
 
8029
# AC_PROG_NM
 
8030
# ----------
 
8031
# find the pathname to a BSD-compatible name lister
 
8032
AC_DEFUN([AC_PROG_NM],
 
8033
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
 
8034
[if test -n "$NM"; then
 
8035
  # Let the user override the test.
 
8036
  lt_cv_path_NM="$NM"
 
8037
else
 
8038
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
8039
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
 
8040
    IFS="$lt_save_ifs"
 
8041
    test -z "$ac_dir" && ac_dir=.
 
8042
    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
 
8043
    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
 
8044
      # Check to see if the nm accepts a BSD-compat flag.
 
8045
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
 
8046
      #   nm: unknown option "B" ignored
 
8047
      # Tru64's nm complains that /dev/null is an invalid object file
 
8048
      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
 
8049
      */dev/null* | *'Invalid file or object type'*)
 
8050
        lt_cv_path_NM="$tmp_nm -B"
 
8051
        break
 
8052
        ;;
 
8053
      *)
 
8054
        case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 
8055
        */dev/null*)
 
8056
          lt_cv_path_NM="$tmp_nm -p"
 
8057
          break
 
8058
          ;;
 
8059
        *)
 
8060
          lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
 
8061
          continue # so that we can try to find one that supports BSD flags
 
8062
          ;;
 
8063
        esac
 
8064
      esac
 
8065
    fi
 
8066
  done
 
8067
  IFS="$lt_save_ifs"
 
8068
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 
8069
fi])
 
8070
NM="$lt_cv_path_NM"
 
8071
])# AC_PROG_NM
 
8072
 
 
8073
 
 
8074
# AC_CHECK_LIBM
 
8075
# -------------
 
8076
# check for math library
 
8077
AC_DEFUN([AC_CHECK_LIBM],
 
8078
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
8079
LIBM=
 
8080
case $host in
 
8081
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
 
8082
  # These system don't have libm, or don't need it
 
8083
  ;;
 
8084
*-ncr-sysv4.3*)
 
8085
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
 
8086
  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
 
8087
  ;;
 
8088
*)
 
8089
  AC_CHECK_LIB(m, cos, LIBM="-lm")
 
8090
  ;;
 
8091
esac
 
8092
])# AC_CHECK_LIBM
 
8093
 
 
8094
 
 
8095
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
 
8096
# -----------------------------------
 
8097
# sets LIBLTDL to the link flags for the libltdl convenience library and
 
8098
# LTDLINCL to the include flags for the libltdl header and adds
 
8099
# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
 
8100
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
 
8101
# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
 
8102
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
 
8103
# '${top_srcdir}/' (note the single quotes!).  If your package is not
 
8104
# flat and you're not using automake, define top_builddir and
 
8105
# top_srcdir appropriately in the Makefiles.
 
8106
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 
8107
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
8108
  case $enable_ltdl_convenience in
 
8109
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
 
8110
  "") enable_ltdl_convenience=yes
 
8111
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
 
8112
  esac
 
8113
  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
 
8114
  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
 
8115
  # For backwards non-gettext consistent compatibility...
 
8116
  INCLTDL="$LTDLINCL"
 
8117
])# AC_LIBLTDL_CONVENIENCE
 
8118
 
 
8119
 
 
8120
# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
 
8121
# -----------------------------------
 
8122
# sets LIBLTDL to the link flags for the libltdl installable library and
 
8123
# LTDLINCL to the include flags for the libltdl header and adds
 
8124
# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
 
8125
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
 
8126
# DIRECTORY is not provided and an installed libltdl is not found, it is
 
8127
# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
 
8128
# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
 
8129
# quotes!).  If your package is not flat and you're not using automake,
 
8130
# define top_builddir and top_srcdir appropriately in the Makefiles.
 
8131
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 
8132
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
 
8133
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
8134
  AC_CHECK_LIB(ltdl, lt_dlinit,
 
8135
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
 
8136
  [if test x"$enable_ltdl_install" = xno; then
 
8137
     AC_MSG_WARN([libltdl not installed, but installation disabled])
 
8138
   else
 
8139
     enable_ltdl_install=yes
 
8140
   fi
 
8141
  ])
 
8142
  if test x"$enable_ltdl_install" = x"yes"; then
 
8143
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
 
8144
    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
 
8145
    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
 
8146
  else
 
8147
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
 
8148
    LIBLTDL="-lltdl"
 
8149
    LTDLINCL=
 
8150
  fi
 
8151
  # For backwards non-gettext consistent compatibility...
 
8152
  INCLTDL="$LTDLINCL"
 
8153
])# AC_LIBLTDL_INSTALLABLE
 
8154
 
 
8155
 
 
8156
# AC_LIBTOOL_CXX
 
8157
# --------------
 
8158
# enable support for C++ libraries
 
8159
AC_DEFUN([AC_LIBTOOL_CXX],
 
8160
[AC_REQUIRE([_LT_AC_LANG_CXX])
 
8161
])# AC_LIBTOOL_CXX
 
8162
 
 
8163
 
 
8164
# _LT_AC_LANG_CXX
 
8165
# ---------------
 
8166
AC_DEFUN([_LT_AC_LANG_CXX],
 
8167
[AC_REQUIRE([AC_PROG_CXX])
 
8168
AC_REQUIRE([AC_PROG_CXXCPP])
 
8169
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
 
8170
])# _LT_AC_LANG_CXX
 
8171
 
 
8172
 
 
8173
# AC_LIBTOOL_F77
 
8174
# --------------
 
8175
# enable support for Fortran 77 libraries
 
8176
AC_DEFUN([AC_LIBTOOL_F77],
 
8177
[AC_REQUIRE([_LT_AC_LANG_F77])
 
8178
])# AC_LIBTOOL_F77
 
8179
 
 
8180
 
 
8181
# _LT_AC_LANG_F77
 
8182
# ---------------
 
8183
AC_DEFUN([_LT_AC_LANG_F77],
 
8184
[AC_REQUIRE([AC_PROG_F77])
 
8185
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
 
8186
])# _LT_AC_LANG_F77
 
8187
 
 
8188
 
 
8189
# AC_LIBTOOL_GCJ
 
8190
# --------------
 
8191
# enable support for GCJ libraries
 
8192
AC_DEFUN([AC_LIBTOOL_GCJ],
 
8193
[AC_REQUIRE([_LT_AC_LANG_GCJ])
 
8194
])# AC_LIBTOOL_GCJ
 
8195
 
 
8196
 
 
8197
# _LT_AC_LANG_GCJ
 
8198
# ---------------
 
8199
AC_DEFUN([_LT_AC_LANG_GCJ],
 
8200
[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
 
8201
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
 
8202
    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
 
8203
      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
 
8204
         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
 
8205
           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
 
8206
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
 
8207
])# _LT_AC_LANG_GCJ
 
8208
 
 
8209
 
 
8210
# AC_LIBTOOL_RC
 
8211
# --------------
 
8212
# enable support for Windows resource files
 
8213
AC_DEFUN([AC_LIBTOOL_RC],
 
8214
[AC_REQUIRE([LT_AC_PROG_RC])
 
8215
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
 
8216
])# AC_LIBTOOL_RC
 
8217
 
 
8218
 
 
8219
# AC_LIBTOOL_LANG_C_CONFIG
 
8220
# ------------------------
 
8221
# Ensure that the configuration vars for the C compiler are
 
8222
# suitably defined.  Those variables are subsequently used by
 
8223
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
8224
AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
 
8225
AC_DEFUN([_LT_AC_LANG_C_CONFIG],
 
8226
[lt_save_CC="$CC"
 
8227
AC_LANG_PUSH(C)
 
8228
 
 
8229
# Source file extension for C test sources.
 
8230
ac_ext=c
 
8231
 
 
8232
# Object file extension for compiled C test sources.
 
8233
objext=o
 
8234
_LT_AC_TAGVAR(objext, $1)=$objext
 
8235
 
 
8236
# Code to be used in simple compile tests
 
8237
lt_simple_compile_test_code="int some_variable = 0;\n"
 
8238
 
 
8239
# Code to be used in simple link tests
 
8240
lt_simple_link_test_code='int main(){return(0);}\n'
 
8241
 
 
8242
_LT_AC_SYS_COMPILER
 
8243
 
 
8244
#
 
8245
# Check for any special shared library compilation flags.
 
8246
#
 
8247
_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
 
8248
if test "$GCC" = no; then
 
8249
  case $host_os in
 
8250
  sco3.2v5*)
 
8251
    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
 
8252
    ;;
 
8253
  esac
 
8254
fi
 
8255
if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
 
8256
  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
 
8257
  if echo "$old_CC $old_CFLAGS " | grep "[[     ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
 
8258
  else
 
8259
    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
 
8260
    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
 
8261
  fi
 
8262
fi
 
8263
 
 
8264
 
 
8265
#
 
8266
# Check to make sure the static flag actually works.
 
8267
#
 
8268
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
 
8269
  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
 
8270
  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
 
8271
  [],
 
8272
  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
 
8273
 
 
8274
 
 
8275
## CAVEAT EMPTOR:
 
8276
## There is no encapsulation within the following macros, do not change
 
8277
## the running order or otherwise move them around unless you know exactly
 
8278
## what you are doing...
 
8279
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 
8280
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
8281
AC_LIBTOOL_PROG_CC_C_O($1)
 
8282
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
8283
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
8284
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
8285
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
8286
AC_LIBTOOL_SYS_LIB_STRIP
 
8287
AC_LIBTOOL_DLOPEN_SELF($1)
 
8288
 
 
8289
# Report which librarie types wil actually be built
 
8290
AC_MSG_CHECKING([if libtool supports shared libraries])
 
8291
AC_MSG_RESULT([$can_build_shared])
 
8292
 
 
8293
AC_MSG_CHECKING([whether to build shared libraries])
 
8294
test "$can_build_shared" = "no" && enable_shared=no
 
8295
 
 
8296
# On AIX, shared libraries and static libraries use the same namespace, and
 
8297
# are all built from PIC.
 
8298
case "$host_os" in
 
8299
aix3*)
 
8300
  test "$enable_shared" = yes && enable_static=no
 
8301
  if test -n "$RANLIB"; then
 
8302
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
 
8303
    postinstall_cmds='$RANLIB $lib'
 
8304
  fi
 
8305
  ;;
 
8306
 
 
8307
aix4*)
 
8308
  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
 
8309
    test "$enable_shared" = yes && enable_static=no
 
8310
  fi
 
8311
  ;;
 
8312
  darwin* | rhapsody*)
 
8313
  if test "$GCC" = yes; then
 
8314
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8315
    case "$host_os" in
 
8316
    rhapsody* | darwin1.[[012]])
 
8317
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
 
8318
      ;;
 
8319
    *) # Darwin 1.3 on
 
8320
      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
 
8321
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
8322
      else
 
8323
        case ${MACOSX_DEPLOYMENT_TARGET} in
 
8324
          10.[012])
 
8325
            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
8326
            ;;
 
8327
          10.*)
 
8328
            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
 
8329
            ;;
 
8330
        esac
 
8331
      fi
 
8332
      ;;
 
8333
    esac
 
8334
    output_verbose_link_cmd='echo'
 
8335
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
 
8336
    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
 
8337
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
8338
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8339
    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8340
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8341
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
8342
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
8343
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
8344
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8345
  else
 
8346
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8347
  fi  
 
8348
    ;;  
 
8349
esac
 
8350
AC_MSG_RESULT([$enable_shared])
 
8351
 
 
8352
AC_MSG_CHECKING([whether to build static libraries])
 
8353
# Make sure either enable_shared or enable_static is yes.
 
8354
test "$enable_shared" = yes || enable_static=yes
 
8355
AC_MSG_RESULT([$enable_static])
 
8356
 
 
8357
AC_LIBTOOL_CONFIG($1)
 
8358
 
 
8359
AC_LANG_POP
 
8360
CC="$lt_save_CC"
 
8361
])# AC_LIBTOOL_LANG_C_CONFIG
 
8362
 
 
8363
 
 
8364
# AC_LIBTOOL_LANG_CXX_CONFIG
 
8365
# --------------------------
 
8366
# Ensure that the configuration vars for the C compiler are
 
8367
# suitably defined.  Those variables are subsequently used by
 
8368
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
8369
AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
 
8370
AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
 
8371
[AC_LANG_PUSH(C++)
 
8372
AC_REQUIRE([AC_PROG_CXX])
 
8373
AC_REQUIRE([AC_PROG_CXXCPP])
 
8374
 
 
8375
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8376
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
8377
_LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8378
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
8379
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
8380
_LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8381
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
8382
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
8383
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
8384
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
8385
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
8386
_LT_AC_TAGVAR(module_cmds, $1)=
 
8387
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
 
8388
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
8389
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
8390
_LT_AC_TAGVAR(no_undefined_flag, $1)=
 
8391
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
8392
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
8393
 
 
8394
# Dependencies to place before and after the object being linked:
 
8395
_LT_AC_TAGVAR(predep_objects, $1)=
 
8396
_LT_AC_TAGVAR(postdep_objects, $1)=
 
8397
_LT_AC_TAGVAR(predeps, $1)=
 
8398
_LT_AC_TAGVAR(postdeps, $1)=
 
8399
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
8400
 
 
8401
# Source file extension for C++ test sources.
 
8402
ac_ext=cc
 
8403
 
 
8404
# Object file extension for compiled C++ test sources.
 
8405
objext=o
 
8406
_LT_AC_TAGVAR(objext, $1)=$objext
 
8407
 
 
8408
# Code to be used in simple compile tests
 
8409
lt_simple_compile_test_code="int some_variable = 0;\n"
 
8410
 
 
8411
# Code to be used in simple link tests
 
8412
lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
8413
 
 
8414
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
8415
_LT_AC_SYS_COMPILER
 
8416
 
 
8417
# Allow CC to be a program name with arguments.
 
8418
lt_save_CC=$CC
 
8419
lt_save_LD=$LD
 
8420
lt_save_GCC=$GCC
 
8421
GCC=$GXX
 
8422
lt_save_with_gnu_ld=$with_gnu_ld
 
8423
lt_save_path_LD=$lt_cv_path_LD
 
8424
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
 
8425
  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 
8426
else
 
8427
  unset lt_cv_prog_gnu_ld
 
8428
fi
 
8429
if test -n "${lt_cv_path_LDCXX+set}"; then
 
8430
  lt_cv_path_LD=$lt_cv_path_LDCXX
 
8431
else
 
8432
  unset lt_cv_path_LD
 
8433
fi
 
8434
test -z "${LDCXX+set}" || LD=$LDCXX
 
8435
CC=${CXX-"c++"}
 
8436
compiler=$CC
 
8437
_LT_AC_TAGVAR(compiler, $1)=$CC
 
8438
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
8439
 
 
8440
# We don't want -fno-exception wen compiling C++ code, so set the
 
8441
# no_builtin_flag separately
 
8442
if test "$GXX" = yes; then
 
8443
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
8444
else
 
8445
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
8446
fi
 
8447
 
 
8448
if test "$GXX" = yes; then
 
8449
  # Set up default GNU C++ configuration
 
8450
 
 
8451
  AC_PROG_LD
 
8452
 
 
8453
  # Check if GNU C++ uses GNU ld as the underlying linker, since the
 
8454
  # archiving commands below assume that GNU ld is being used.
 
8455
  if test "$with_gnu_ld" = yes; then
 
8456
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
 
8457
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
8458
 
 
8459
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 
8460
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8461
 
 
8462
    # If archive_cmds runs LD, not CC, wlarc should be empty
 
8463
    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
 
8464
    #     investigate it a little bit more. (MM)
 
8465
    wlarc='${wl}'
 
8466
 
 
8467
    # ancient GNU ld didn't support --whole-archive et. al.
 
8468
    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
 
8469
        grep 'no-whole-archive' > /dev/null; then
 
8470
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 
8471
    else
 
8472
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
8473
    fi
 
8474
  else
 
8475
    with_gnu_ld=no
 
8476
    wlarc=
 
8477
 
 
8478
    # A generic and very simple default shared library creation
 
8479
    # command for GNU C++ for the case where it uses the native
 
8480
    # linker, instead of GNU ld.  If possible, this setting should
 
8481
    # overridden to take advantage of the native linker features on
 
8482
    # the platform it is being used on.
 
8483
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
 
8484
  fi
 
8485
 
 
8486
  # Commands to make compiler produce verbose output that lists
 
8487
  # what "hidden" libraries, object files and flags are used when
 
8488
  # linking a shared library.
 
8489
  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
8490
 
 
8491
else
 
8492
  GXX=no
 
8493
  with_gnu_ld=no
 
8494
  wlarc=
 
8495
fi
 
8496
 
 
8497
# PORTME: fill in a description of your system's C++ link characteristics
 
8498
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 
8499
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
8500
case $host_os in
 
8501
  aix3*)
 
8502
    # FIXME: insert proper C++ library support
 
8503
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8504
    ;;
 
8505
  aix4* | aix5*)
 
8506
    if test "$host_cpu" = ia64; then
 
8507
      # On IA64, the linker does run time linking by default, so we don't
 
8508
      # have to do anything special.
 
8509
      aix_use_runtimelinking=no
 
8510
      exp_sym_flag='-Bexport'
 
8511
      no_entry_flag=""
 
8512
    else
 
8513
      # KDE requires run time linking.  Make it the default.
 
8514
      aix_use_runtimelinking=yes
 
8515
      exp_sym_flag='-bexport'
 
8516
      no_entry_flag='-bnoentry'
 
8517
    fi
 
8518
 
 
8519
    # When large executables or shared objects are built, AIX ld can
 
8520
    # have problems creating the table of contents.  If linking a library
 
8521
    # or program results in "error TOC overflow" add -mminimal-toc to
 
8522
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
 
8523
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
8524
 
 
8525
    _LT_AC_TAGVAR(archive_cmds, $1)=''
 
8526
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8527
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
 
8528
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8529
 
 
8530
    if test "$GXX" = yes; then
 
8531
      case $host_os in aix4.[012]|aix4.[012].*)
 
8532
      # We only want to do this on AIX 4.2 and lower, the check
 
8533
      # below for broken collect2 doesn't work under 4.3+
 
8534
        collect2name=`${CC} -print-prog-name=collect2`
 
8535
        if test -f "$collect2name" && \
 
8536
           strings "$collect2name" | grep resolve_lib_name >/dev/null
 
8537
        then
 
8538
          # We have reworked collect2
 
8539
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8540
        else
 
8541
          # We have old collect2
 
8542
          _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
8543
          # It fails to find uninstalled libraries when the uninstalled
 
8544
          # path is not listed in the libpath.  Setting hardcode_minus_L
 
8545
          # to unsupported forces relinking
 
8546
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
8547
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8548
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
8549
        fi
 
8550
      esac
 
8551
      shared_flag='-shared'
 
8552
    else
 
8553
      # not using gcc
 
8554
      if test "$host_cpu" = ia64; then
 
8555
        # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 
8556
        # chokes on -Wl,-G. The following line is correct:
 
8557
        shared_flag='-G'
 
8558
      else
 
8559
        if test "$aix_use_runtimelinking" = yes; then
 
8560
          shared_flag='-qmkshrobj ${wl}-G'
 
8561
        else
 
8562
          shared_flag='-qmkshrobj'
 
8563
        fi
 
8564
      fi
 
8565
    fi
 
8566
 
 
8567
    # Let the compiler handle the export list.
 
8568
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8569
    if test "$aix_use_runtimelinking" = yes; then
 
8570
      # Warning - without using the other runtime loading flags (-brtl),
 
8571
      # -berok will link without error, but may produce a broken library.
 
8572
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
 
8573
      # Determine the default libpath from the value encoded in an empty executable.
 
8574
      _LT_AC_SYS_LIBPATH_AIX
 
8575
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
8576
 
 
8577
      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
 
8578
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
 
8579
     else
 
8580
      if test "$host_cpu" = ia64; then
 
8581
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 
8582
        _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
 
8583
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
 
8584
      else
 
8585
        # Determine the default libpath from the value encoded in an empty executable.
 
8586
        _LT_AC_SYS_LIBPATH_AIX
 
8587
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
8588
        # Warning - without using the other run time loading flags,
 
8589
        # -berok will link without error, but may produce a broken library.
 
8590
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 
8591
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
 
8592
        # -bexpall does not export symbols beginning with underscore (_)
 
8593
        _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
8594
        # Exported symbols can be pulled into shared objects from archives
 
8595
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 
8596
        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
8597
        # This is similar to how AIX traditionally builds it's shared libraries.
 
8598
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 
8599
      fi
 
8600
    fi
 
8601
    ;;
 
8602
  chorus*)
 
8603
    case $cc_basename in
 
8604
      *)
 
8605
        # FIXME: insert proper C++ library support
 
8606
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8607
        ;;
 
8608
    esac
 
8609
    ;;
 
8610
 
 
8611
  cygwin* | mingw* | pw32*)
 
8612
    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 
8613
    # as there is no search path for DLLs.
 
8614
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8615
    _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
 
8616
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8617
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
8618
 
 
8619
    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
 
8620
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
8621
      # If the export-symbols file already is a .def file (1st line
 
8622
      # is EXPORTS), use it as is; otherwise, prepend...
 
8623
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
 
8624
        cp $export_symbols $output_objdir/$soname.def;
 
8625
      else
 
8626
        echo EXPORTS > $output_objdir/$soname.def;
 
8627
        cat $export_symbols >> $output_objdir/$soname.def;
 
8628
      fi~
 
8629
      $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
8630
    else
 
8631
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8632
    fi
 
8633
  ;;
 
8634
 
 
8635
  darwin* | rhapsody*)
 
8636
  if test "$GXX" = yes; then
 
8637
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8638
    case "$host_os" in
 
8639
    rhapsody* | darwin1.[[012]])
 
8640
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
 
8641
      ;;
 
8642
    *) # Darwin 1.3 on
 
8643
      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
 
8644
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
8645
      else
 
8646
        case ${MACOSX_DEPLOYMENT_TARGET} in
 
8647
          10.[012])
 
8648
            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
8649
            ;;
 
8650
          10.*)
 
8651
            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
 
8652
            ;;
 
8653
        esac
 
8654
      fi
 
8655
      ;;
 
8656
    esac
 
8657
    lt_int_apple_cc_single_mod=no
 
8658
    output_verbose_link_cmd='echo'
 
8659
    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
 
8660
      lt_int_apple_cc_single_mod=yes
 
8661
    fi
 
8662
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
8663
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
 
8664
    else
 
8665
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
 
8666
    fi
 
8667
    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
 
8668
 
 
8669
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
8670
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
8671
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8672
    else
 
8673
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8674
    fi
 
8675
    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8676
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8677
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
8678
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
8679
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
8680
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8681
  else
 
8682
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8683
  fi
 
8684
    ;;
 
8685
 
 
8686
  dgux*)
 
8687
    case $cc_basename in
 
8688
      ec++)
 
8689
        # FIXME: insert proper C++ library support
 
8690
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8691
        ;;
 
8692
      ghcx)
 
8693
        # Green Hills C++ Compiler
 
8694
        # FIXME: insert proper C++ library support
 
8695
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8696
        ;;
 
8697
      *)
 
8698
        # FIXME: insert proper C++ library support
 
8699
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8700
        ;;
 
8701
    esac
 
8702
    ;;
 
8703
  freebsd[12]*)
 
8704
    # C++ shared libraries reported to be fairly broken before switch to ELF
 
8705
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8706
    ;;
 
8707
  freebsd-elf*)
 
8708
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8709
    ;;
 
8710
  freebsd*)
 
8711
    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
 
8712
    # conventions
 
8713
    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
8714
    ;;
 
8715
  gnu*)
 
8716
    ;;
 
8717
  hpux9*)
 
8718
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8719
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8720
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
8721
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8722
    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8723
                                # but as the default
 
8724
                                # location of the library.
 
8725
 
 
8726
    case $cc_basename in
 
8727
    CC)
 
8728
      # FIXME: insert proper C++ library support
 
8729
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8730
      ;;
 
8731
    aCC)
 
8732
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
8733
      # Commands to make compiler produce verbose output that lists
 
8734
      # what "hidden" libraries, object files and flags are used when
 
8735
      # linking a shared library.
 
8736
      #
 
8737
      # There doesn't appear to be a way to prevent this compiler from
 
8738
      # explicitly linking system object files so we need to strip them
 
8739
      # from the output so that they don't get included in the library
 
8740
      # dependencies.
 
8741
      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
8742
      ;;
 
8743
    *)
 
8744
      if test "$GXX" = yes; then
 
8745
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
8746
      else
 
8747
        # FIXME: insert proper C++ library support
 
8748
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8749
      fi
 
8750
      ;;
 
8751
    esac
 
8752
    ;;
 
8753
  hpux10*|hpux11*)
 
8754
    if test $with_gnu_ld = no; then
 
8755
      case "$host_cpu" in
 
8756
      hppa*64*)
 
8757
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8758
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 
8759
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8760
        ;;
 
8761
      ia64*)
 
8762
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8763
        ;;
 
8764
      *)
 
8765
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8766
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8767
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
8768
        ;;
 
8769
      esac
 
8770
    fi
 
8771
    case "$host_cpu" in
 
8772
    hppa*64*)
 
8773
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8774
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8775
      ;;
 
8776
    ia64*)
 
8777
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8778
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8779
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8780
                                              # but as the default
 
8781
                                              # location of the library.
 
8782
      ;;
 
8783
    *)
 
8784
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8785
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8786
                                              # but as the default
 
8787
                                              # location of the library.
 
8788
      ;;
 
8789
    esac
 
8790
 
 
8791
    case $cc_basename in
 
8792
      CC)
 
8793
        # FIXME: insert proper C++ library support
 
8794
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8795
        ;;
 
8796
      aCC)
 
8797
        case "$host_cpu" in
 
8798
        hppa*64*|ia64*)
 
8799
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 
8800
          ;;
 
8801
        *)
 
8802
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
 
8803
          ;;
 
8804
        esac
 
8805
        # Commands to make compiler produce verbose output that lists
 
8806
        # what "hidden" libraries, object files and flags are used when
 
8807
        # linking a shared library.
 
8808
        #
 
8809
        # There doesn't appear to be a way to prevent this compiler from
 
8810
        # explicitly linking system object files so we need to strip them
 
8811
        # from the output so that they don't get included in the library
 
8812
        # dependencies.
 
8813
        output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
8814
        ;;
 
8815
      *)
 
8816
        if test "$GXX" = yes; then
 
8817
          if test $with_gnu_ld = no; then
 
8818
            case "$host_cpu" in
 
8819
            ia64*|hppa*64*)
 
8820
              _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 
8821
              ;;
 
8822
            *)
 
8823
              _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
 
8824
              ;;
 
8825
            esac
 
8826
          fi
 
8827
        else
 
8828
          # FIXME: insert proper C++ library support
 
8829
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8830
        fi
 
8831
        ;;
 
8832
    esac
 
8833
    ;;
 
8834
  irix5* | irix6*)
 
8835
    case $cc_basename in
 
8836
      CC)
 
8837
        # SGI C++
 
8838
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
8839
 
 
8840
        # Archives containing C++ object files must be created using
 
8841
        # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
 
8842
        # necessary to make sure instantiated templates are included
 
8843
        # in the archive.
 
8844
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 
8845
        ;;
 
8846
      *)
 
8847
        if test "$GXX" = yes; then
 
8848
          if test "$with_gnu_ld" = no; then
 
8849
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
8850
          else
 
8851
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
 
8852
          fi
 
8853
        fi
 
8854
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8855
        ;;
 
8856
    esac
 
8857
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8858
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8859
    ;;
 
8860
  linux*)
 
8861
    case $cc_basename in
 
8862
      KCC)
 
8863
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
8864
 
 
8865
        # KCC will only create a shared library if the output file
 
8866
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
8867
        # to its proper name (with version) after linking.
 
8868
        _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
 
8869
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
 
8870
        # Commands to make compiler produce verbose output that lists
 
8871
        # what "hidden" libraries, object files and flags are used when
 
8872
        # linking a shared library.
 
8873
        #
 
8874
        # There doesn't appear to be a way to prevent this compiler from
 
8875
        # explicitly linking system object files so we need to strip them
 
8876
        # from the output so that they don't get included in the library
 
8877
        # dependencies.
 
8878
        output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
8879
 
 
8880
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
 
8881
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8882
 
 
8883
        # Archives containing C++ object files must be created using
 
8884
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
 
8885
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
8886
        ;;
 
8887
      icpc)
 
8888
        # Intel C++
 
8889
        with_gnu_ld=yes
 
8890
        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8891
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
 
8892
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
8893
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
8894
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8895
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 
8896
        ;;
 
8897
      cxx)
 
8898
        # Compaq C++
 
8899
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
 
8900
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
8901
 
 
8902
        runpath_var=LD_RUN_PATH
 
8903
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
8904
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8905
 
 
8906
        # Commands to make compiler produce verbose output that lists
 
8907
        # what "hidden" libraries, object files and flags are used when
 
8908
        # linking a shared library.
 
8909
        #
 
8910
        # There doesn't appear to be a way to prevent this compiler from
 
8911
        # explicitly linking system object files so we need to strip them
 
8912
        # from the output so that they don't get included in the library
 
8913
        # dependencies.
 
8914
        output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
8915
        ;;
 
8916
    esac
 
8917
    ;;
 
8918
  lynxos*)
 
8919
    # FIXME: insert proper C++ library support
 
8920
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8921
    ;;
 
8922
  m88k*)
 
8923
    # FIXME: insert proper C++ library support
 
8924
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8925
    ;;
 
8926
  mvs*)
 
8927
    case $cc_basename in
 
8928
      cxx)
 
8929
        # FIXME: insert proper C++ library support
 
8930
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8931
        ;;
 
8932
      *)
 
8933
        # FIXME: insert proper C++ library support
 
8934
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8935
        ;;
 
8936
    esac
 
8937
    ;;
 
8938
  netbsd*)
 
8939
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
8940
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
 
8941
      wlarc=
 
8942
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
8943
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8944
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8945
    fi
 
8946
    # Workaround some broken pre-1.5 toolchains
 
8947
    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
 
8948
    ;;
 
8949
  osf3*)
 
8950
    case $cc_basename in
 
8951
      KCC)
 
8952
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
8953
 
 
8954
        # KCC will only create a shared library if the output file
 
8955
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
8956
        # to its proper name (with version) after linking.
 
8957
        _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
 
8958
 
 
8959
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
8960
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8961
 
 
8962
        # Archives containing C++ object files must be created using
 
8963
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
 
8964
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
8965
 
 
8966
        ;;
 
8967
      RCC)
 
8968
        # Rational C++ 2.4.1
 
8969
        # FIXME: insert proper C++ library support
 
8970
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8971
        ;;
 
8972
      cxx)
 
8973
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
8974
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
8975
 
 
8976
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8977
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8978
 
 
8979
        # Commands to make compiler produce verbose output that lists
 
8980
        # what "hidden" libraries, object files and flags are used when
 
8981
        # linking a shared library.
 
8982
        #
 
8983
        # There doesn't appear to be a way to prevent this compiler from
 
8984
        # explicitly linking system object files so we need to strip them
 
8985
        # from the output so that they don't get included in the library
 
8986
        # dependencies.
 
8987
        output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
8988
        ;;
 
8989
      *)
 
8990
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
8991
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
8992
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
8993
 
 
8994
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8995
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8996
 
 
8997
          # Commands to make compiler produce verbose output that lists
 
8998
          # what "hidden" libraries, object files and flags are used when
 
8999
          # linking a shared library.
 
9000
          output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
9001
 
 
9002
        else
 
9003
          # FIXME: insert proper C++ library support
 
9004
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9005
        fi
 
9006
        ;;
 
9007
    esac
 
9008
    ;;
 
9009
  osf4* | osf5*)
 
9010
    case $cc_basename in
 
9011
      KCC)
 
9012
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
9013
 
 
9014
        # KCC will only create a shared library if the output file
 
9015
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
9016
        # to its proper name (with version) after linking.
 
9017
        _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
 
9018
 
 
9019
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
9020
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
9021
 
 
9022
        # Archives containing C++ object files must be created using
 
9023
        # the KAI C++ compiler.
 
9024
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
 
9025
        ;;
 
9026
      RCC)
 
9027
        # Rational C++ 2.4.1
 
9028
        # FIXME: insert proper C++ library support
 
9029
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9030
        ;;
 
9031
      cxx)
 
9032
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
9033
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
9034
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 
9035
          echo "-hidden">> $lib.exp~
 
9036
          $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
 
9037
          $rm $lib.exp'
 
9038
 
 
9039
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
9040
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
9041
 
 
9042
        # Commands to make compiler produce verbose output that lists
 
9043
        # what "hidden" libraries, object files and flags are used when
 
9044
        # linking a shared library.
 
9045
        #
 
9046
        # There doesn't appear to be a way to prevent this compiler from
 
9047
        # explicitly linking system object files so we need to strip them
 
9048
        # from the output so that they don't get included in the library
 
9049
        # dependencies.
 
9050
        output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
9051
        ;;
 
9052
      *)
 
9053
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
9054
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
9055
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
9056
 
 
9057
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
9058
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
9059
 
 
9060
          # Commands to make compiler produce verbose output that lists
 
9061
          # what "hidden" libraries, object files and flags are used when
 
9062
          # linking a shared library.
 
9063
          output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
9064
 
 
9065
        else
 
9066
          # FIXME: insert proper C++ library support
 
9067
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9068
        fi
 
9069
        ;;
 
9070
    esac
 
9071
    ;;
 
9072
  psos*)
 
9073
    # FIXME: insert proper C++ library support
 
9074
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9075
    ;;
 
9076
  sco*)
 
9077
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
9078
    case $cc_basename in
 
9079
      CC)
 
9080
        # FIXME: insert proper C++ library support
 
9081
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9082
        ;;
 
9083
      *)
 
9084
        # FIXME: insert proper C++ library support
 
9085
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9086
        ;;
 
9087
    esac
 
9088
    ;;
 
9089
  sunos4*)
 
9090
    case $cc_basename in
 
9091
      CC)
 
9092
        # Sun C++ 4.x
 
9093
        # FIXME: insert proper C++ library support
 
9094
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9095
        ;;
 
9096
      lcc)
 
9097
        # Lucid
 
9098
        # FIXME: insert proper C++ library support
 
9099
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9100
        ;;
 
9101
      *)
 
9102
        # FIXME: insert proper C++ library support
 
9103
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9104
        ;;
 
9105
    esac
 
9106
    ;;
 
9107
  solaris*)
 
9108
    case $cc_basename in
 
9109
      CC)
 
9110
        # Sun C++ 4.2, 5.x and Centerline C++
 
9111
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
 
9112
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
 
9113
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
9114
        $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
 
9115
 
 
9116
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
9117
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
9118
        case $host_os in
 
9119
          solaris2.[0-5] | solaris2.[0-5].*) ;;
 
9120
          *)
 
9121
            # The C++ compiler is used as linker so we must use $wl
 
9122
            # flag to pass the commands to the underlying system
 
9123
            # linker.
 
9124
            # Supported since Solaris 2.6 (maybe 2.5.1?)
 
9125
            _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 
9126
            ;;
 
9127
        esac
 
9128
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
9129
 
 
9130
        # Commands to make compiler produce verbose output that lists
 
9131
        # what "hidden" libraries, object files and flags are used when
 
9132
        # linking a shared library.
 
9133
        #
 
9134
        # There doesn't appear to be a way to prevent this compiler from
 
9135
        # explicitly linking system object files so we need to strip them
 
9136
        # from the output so that they don't get included in the library
 
9137
        # dependencies.
 
9138
        output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
9139
 
 
9140
        # Archives containing C++ object files must be created using
 
9141
        # "CC -xar", where "CC" is the Sun C++ compiler.  This is
 
9142
        # necessary to make sure instantiated templates are included
 
9143
        # in the archive.
 
9144
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
 
9145
        ;;
 
9146
      gcx)
 
9147
        # Green Hills C++ Compiler
 
9148
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
 
9149
 
 
9150
        # The C++ compiler must be used to create the archive.
 
9151
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 
9152
        ;;
 
9153
      *)
 
9154
        # GNU C++ compiler with Solaris linker
 
9155
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
9156
          _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
 
9157
          if $CC --version | grep -v '^2\.7' > /dev/null; then
 
9158
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
 
9159
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
9160
                $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
 
9161
 
 
9162
            # Commands to make compiler produce verbose output that lists
 
9163
            # what "hidden" libraries, object files and flags are used when
 
9164
            # linking a shared library.
 
9165
            output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
 
9166
          else
 
9167
            # g++ 2.7 appears to require `-G' NOT `-shared' on this
 
9168
            # platform.
 
9169
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
 
9170
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
9171
                $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
 
9172
 
 
9173
            # Commands to make compiler produce verbose output that lists
 
9174
            # what "hidden" libraries, object files and flags are used when
 
9175
            # linking a shared library.
 
9176
            output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
 
9177
          fi
 
9178
 
 
9179
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
 
9180
        fi
 
9181
        ;;
 
9182
    esac
 
9183
    ;;
 
9184
  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
 
9185
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
9186
    ;;
 
9187
  tandem*)
 
9188
    case $cc_basename in
 
9189
      NCC)
 
9190
        # NonStop-UX NCC 3.20
 
9191
        # FIXME: insert proper C++ library support
 
9192
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9193
        ;;
 
9194
      *)
 
9195
        # FIXME: insert proper C++ library support
 
9196
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9197
        ;;
 
9198
    esac
 
9199
    ;;
 
9200
  vxworks*)
 
9201
    # FIXME: insert proper C++ library support
 
9202
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9203
    ;;
 
9204
  *)
 
9205
    # FIXME: insert proper C++ library support
 
9206
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
9207
    ;;
 
9208
esac
 
9209
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 
9210
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
9211
 
 
9212
_LT_AC_TAGVAR(GCC, $1)="$GXX"
 
9213
_LT_AC_TAGVAR(LD, $1)="$LD"
 
9214
 
 
9215
## CAVEAT EMPTOR:
 
9216
## There is no encapsulation within the following macros, do not change
 
9217
## the running order or otherwise move them around unless you know exactly
 
9218
## what you are doing...
 
9219
AC_LIBTOOL_POSTDEP_PREDEP($1)
 
9220
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
9221
AC_LIBTOOL_PROG_CC_C_O($1)
 
9222
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
9223
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
9224
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
9225
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
9226
AC_LIBTOOL_SYS_LIB_STRIP
 
9227
AC_LIBTOOL_DLOPEN_SELF($1)
 
9228
 
 
9229
AC_LIBTOOL_CONFIG($1)
 
9230
 
 
9231
AC_LANG_POP
 
9232
CC=$lt_save_CC
 
9233
LDCXX=$LD
 
9234
LD=$lt_save_LD
 
9235
GCC=$lt_save_GCC
 
9236
with_gnu_ldcxx=$with_gnu_ld
 
9237
with_gnu_ld=$lt_save_with_gnu_ld
 
9238
lt_cv_path_LDCXX=$lt_cv_path_LD
 
9239
lt_cv_path_LD=$lt_save_path_LD
 
9240
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
 
9241
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 
9242
])# AC_LIBTOOL_LANG_CXX_CONFIG
 
9243
 
 
9244
# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
 
9245
# ------------------------
 
9246
# Figure out "hidden" library dependencies from verbose
 
9247
# compiler output when linking a shared library.
 
9248
# Parse the compiler output and extract the necessary
 
9249
# objects, libraries and library flags.
 
9250
AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
 
9251
dnl we can't use the lt_simple_compile_test_code here,
 
9252
dnl because it contains code intended for an executable,
 
9253
dnl not a library.  It's possible we should let each
 
9254
dnl tag define a new lt_????_link_test_code variable,
 
9255
dnl but it's only used here...
 
9256
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
 
9257
int a;
 
9258
void foo (void) { a = 0; }
 
9259
EOF
 
9260
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
 
9261
class Foo
 
9262
{
 
9263
public:
 
9264
  Foo (void) { a = 0; }
 
9265
private:
 
9266
  int a;
 
9267
};
 
9268
EOF
 
9269
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
 
9270
      subroutine foo
 
9271
      implicit none
 
9272
      integer*4 a
 
9273
      a=0
 
9274
      return
 
9275
      end
 
9276
EOF
 
9277
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
 
9278
public class foo {
 
9279
  private int a;
 
9280
  public void bar (void) {
 
9281
    a = 0;
 
9282
  }
 
9283
};
 
9284
EOF
 
9285
])
 
9286
dnl Parse the compiler output and extract the necessary
 
9287
dnl objects, libraries and library flags.
 
9288
if AC_TRY_EVAL(ac_compile); then
 
9289
  # Parse the compiler output and extract the necessary
 
9290
  # objects, libraries and library flags.
 
9291
 
 
9292
  # Sentinel used to keep track of whether or not we are before
 
9293
  # the conftest object file.
 
9294
  pre_test_object_deps_done=no
 
9295
 
 
9296
  # The `*' in the case matches for architectures that use `case' in
 
9297
  # $output_verbose_cmd can trigger glob expansion during the loop
 
9298
  # eval without this substitution.
 
9299
  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
 
9300
 
 
9301
  for p in `eval $output_verbose_link_cmd`; do
 
9302
    case $p in
 
9303
 
 
9304
    -L* | -R* | -l*)
 
9305
       # Some compilers place space between "-{L,R}" and the path.
 
9306
       # Remove the space.
 
9307
       if test $p = "-L" \
 
9308
          || test $p = "-R"; then
 
9309
         prev=$p
 
9310
         continue
 
9311
       else
 
9312
         prev=
 
9313
       fi
 
9314
 
 
9315
       if test "$pre_test_object_deps_done" = no; then
 
9316
         case $p in
 
9317
         -L* | -R*)
 
9318
           # Internal compiler library paths should come after those
 
9319
           # provided the user.  The postdeps already come after the
 
9320
           # user supplied libs so there is no need to process them.
 
9321
           if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
 
9322
             _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
 
9323
           else
 
9324
             _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
 
9325
           fi
 
9326
           ;;
 
9327
         # The "-l" case would never come before the object being
 
9328
         # linked, so don't bother handling this case.
 
9329
         esac
 
9330
       else
 
9331
         if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
 
9332
           _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
 
9333
         else
 
9334
           _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
 
9335
         fi
 
9336
       fi
 
9337
       ;;
 
9338
 
 
9339
    *.$objext|*.$libext)
 
9340
       # This assumes that the test object file only shows up
 
9341
       # once in the compiler output.
 
9342
       if test "$p" = "conftest.$objext"; then
 
9343
         pre_test_object_deps_done=yes
 
9344
         continue
 
9345
       fi
 
9346
 
 
9347
       if test "$pre_test_object_deps_done" = no; then
 
9348
         if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
 
9349
           _LT_AC_TAGVAR(predep_objects, $1)="$p"
 
9350
         else
 
9351
           _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
 
9352
         fi
 
9353
       else
 
9354
         if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
 
9355
           _LT_AC_TAGVAR(postdep_objects, $1)="$p"
 
9356
         else
 
9357
           _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
 
9358
         fi
 
9359
       fi
 
9360
       ;;
 
9361
 
 
9362
    *) ;; # Ignore the rest.
 
9363
 
 
9364
    esac
 
9365
  done
 
9366
 
 
9367
  # Clean up.
 
9368
  rm -f a.out a.exe
 
9369
else
 
9370
  echo "libtool.m4: error: problem compiling $1 test program"
 
9371
fi
 
9372
 
 
9373
$rm -f confest.$objext
 
9374
 
 
9375
case " $_LT_AC_TAGVAR(postdeps, $1) " in
 
9376
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 
9377
esac
 
9378
])# AC_LIBTOOL_POSTDEP_PREDEP
 
9379
 
 
9380
# AC_LIBTOOL_LANG_F77_CONFIG
 
9381
# ------------------------
 
9382
# Ensure that the configuration vars for the C compiler are
 
9383
# suitably defined.  Those variables are subsequently used by
 
9384
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
9385
AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
 
9386
AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
 
9387
[AC_REQUIRE([AC_PROG_F77])
 
9388
AC_LANG_PUSH(Fortran 77)
 
9389
 
 
9390
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
9391
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
9392
_LT_AC_TAGVAR(always_export_symbols, $1)=no
 
9393
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
9394
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
9395
_LT_AC_TAGVAR(hardcode_direct, $1)=no
 
9396
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
9397
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
9398
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
9399
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
9400
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
9401
_LT_AC_TAGVAR(module_cmds, $1)=
 
9402
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
 
9403
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
9404
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
9405
_LT_AC_TAGVAR(no_undefined_flag, $1)=
 
9406
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
9407
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
9408
 
 
9409
# Source file extension for f77 test sources.
 
9410
ac_ext=f
 
9411
 
 
9412
# Object file extension for compiled f77 test sources.
 
9413
objext=o
 
9414
_LT_AC_TAGVAR(objext, $1)=$objext
 
9415
 
 
9416
# Code to be used in simple compile tests
 
9417
lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
 
9418
 
 
9419
# Code to be used in simple link tests
 
9420
lt_simple_link_test_code="      program t\n      end\n"
 
9421
 
 
9422
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9423
_LT_AC_SYS_COMPILER
 
9424
 
 
9425
# Allow CC to be a program name with arguments.
 
9426
lt_save_CC="$CC"
 
9427
CC=${F77-"f77"}
 
9428
compiler=$CC
 
9429
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9430
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
9431
 
 
9432
AC_MSG_CHECKING([if libtool supports shared libraries])
 
9433
AC_MSG_RESULT([$can_build_shared])
 
9434
 
 
9435
AC_MSG_CHECKING([whether to build shared libraries])
 
9436
test "$can_build_shared" = "no" && enable_shared=no
 
9437
 
 
9438
# On AIX, shared libraries and static libraries use the same namespace, and
 
9439
# are all built from PIC.
 
9440
case "$host_os" in
 
9441
aix3*)
 
9442
  test "$enable_shared" = yes && enable_static=no
 
9443
  if test -n "$RANLIB"; then
 
9444
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
 
9445
    postinstall_cmds='$RANLIB $lib'
 
9446
  fi
 
9447
  ;;
 
9448
aix4*)
 
9449
  test "$enable_shared" = yes && enable_static=no
 
9450
  ;;
 
9451
esac
 
9452
AC_MSG_RESULT([$enable_shared])
 
9453
 
 
9454
AC_MSG_CHECKING([whether to build static libraries])
 
9455
# Make sure either enable_shared or enable_static is yes.
 
9456
test "$enable_shared" = yes || enable_static=yes
 
9457
AC_MSG_RESULT([$enable_static])
 
9458
 
 
9459
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
9460
 
 
9461
_LT_AC_TAGVAR(GCC, $1)="$G77"
 
9462
_LT_AC_TAGVAR(LD, $1)="$LD"
 
9463
 
 
9464
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
9465
AC_LIBTOOL_PROG_CC_C_O($1)
 
9466
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
9467
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
9468
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
9469
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
9470
AC_LIBTOOL_SYS_LIB_STRIP
 
9471
 
 
9472
 
 
9473
AC_LIBTOOL_CONFIG($1)
 
9474
 
 
9475
AC_LANG_POP
 
9476
CC="$lt_save_CC"
 
9477
])# AC_LIBTOOL_LANG_F77_CONFIG
 
9478
 
 
9479
 
 
9480
# AC_LIBTOOL_LANG_GCJ_CONFIG
 
9481
# --------------------------
 
9482
# Ensure that the configuration vars for the C compiler are
 
9483
# suitably defined.  Those variables are subsequently used by
 
9484
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
9485
AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
 
9486
AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
 
9487
[AC_LANG_SAVE
 
9488
 
 
9489
# Source file extension for Java test sources.
 
9490
ac_ext=java
 
9491
 
 
9492
# Object file extension for compiled Java test sources.
 
9493
objext=o
 
9494
_LT_AC_TAGVAR(objext, $1)=$objext
 
9495
 
 
9496
# Code to be used in simple compile tests
 
9497
lt_simple_compile_test_code="class foo {}\n"
 
9498
 
 
9499
# Code to be used in simple link tests
 
9500
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
9501
 
 
9502
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9503
_LT_AC_SYS_COMPILER
 
9504
 
 
9505
# Allow CC to be a program name with arguments.
 
9506
lt_save_CC="$CC"
 
9507
CC=${GCJ-"gcj"}
 
9508
compiler=$CC
 
9509
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9510
 
 
9511
# GCJ did not exist at the time GCC didn't implicitly link libc in.
 
9512
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
9513
 
 
9514
## CAVEAT EMPTOR:
 
9515
## There is no encapsulation within the following macros, do not change
 
9516
## the running order or otherwise move them around unless you know exactly
 
9517
## what you are doing...
 
9518
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 
9519
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
9520
AC_LIBTOOL_PROG_CC_C_O($1)
 
9521
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
9522
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
9523
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
9524
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
9525
AC_LIBTOOL_SYS_LIB_STRIP
 
9526
AC_LIBTOOL_DLOPEN_SELF($1)
 
9527
 
 
9528
AC_LIBTOOL_CONFIG($1)
 
9529
 
 
9530
AC_LANG_RESTORE
 
9531
CC="$lt_save_CC"
 
9532
])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
9533
 
 
9534
 
 
9535
# AC_LIBTOOL_LANG_RC_CONFIG
 
9536
# --------------------------
 
9537
# Ensure that the configuration vars for the Windows resource compiler are
 
9538
# suitably defined.  Those variables are subsequently used by
 
9539
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
9540
AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
 
9541
AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
 
9542
[AC_LANG_SAVE
 
9543
 
 
9544
# Source file extension for RC test sources.
 
9545
ac_ext=rc
 
9546
 
 
9547
# Object file extension for compiled RC test sources.
 
9548
objext=o
 
9549
_LT_AC_TAGVAR(objext, $1)=$objext
 
9550
 
 
9551
# Code to be used in simple compile tests
 
9552
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
9553
 
 
9554
# Code to be used in simple link tests
 
9555
lt_simple_link_test_code="$lt_simple_compile_test_code"
 
9556
 
 
9557
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9558
_LT_AC_SYS_COMPILER
 
9559
 
 
9560
# Allow CC to be a program name with arguments.
 
9561
lt_save_CC="$CC"
 
9562
CC=${RC-"windres"}
 
9563
compiler=$CC
 
9564
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9565
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
9566
 
 
9567
AC_LIBTOOL_CONFIG($1)
 
9568
 
 
9569
AC_LANG_RESTORE
 
9570
CC="$lt_save_CC"
 
9571
])# AC_LIBTOOL_LANG_RC_CONFIG
 
9572
 
 
9573
 
 
9574
# AC_LIBTOOL_CONFIG([TAGNAME])
 
9575
# ----------------------------
 
9576
# If TAGNAME is not passed, then create an initial libtool script
 
9577
# with a default configuration from the untagged config vars.  Otherwise
 
9578
# add code to config.status for appending the configuration named by
 
9579
# TAGNAME from the matching tagged config vars.
 
9580
AC_DEFUN([AC_LIBTOOL_CONFIG],
 
9581
[# The else clause should only fire when bootstrapping the
 
9582
# libtool distribution, otherwise you forgot to ship ltmain.sh
 
9583
# with your package, and you will get complaints that there are
 
9584
# no rules to generate ltmain.sh.
 
9585
if test -f "$ltmain"; then
 
9586
  # See if we are running on zsh, and set the options which allow our commands through
 
9587
  # without removal of \ escapes.
 
9588
  if test -n "${ZSH_VERSION+set}" ; then
 
9589
    setopt NO_GLOB_SUBST
 
9590
  fi  
 
9591
  # Now quote all the things that may contain metacharacters while being
 
9592
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
 
9593
  # variables and quote the copies for generation of the libtool script.
 
9594
  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
 
9595
    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
 
9596
    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
 
9597
    deplibs_check_method reload_flag reload_cmds need_locks \
 
9598
    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
 
9599
    lt_cv_sys_global_symbol_to_c_name_address \
 
9600
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
 
9601
    old_postinstall_cmds old_postuninstall_cmds \
 
9602
    _LT_AC_TAGVAR(compiler, $1) \
 
9603
    _LT_AC_TAGVAR(CC, $1) \
 
9604
    _LT_AC_TAGVAR(LD, $1) \
 
9605
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
 
9606
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
 
9607
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
 
9608
    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
 
9609
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
 
9610
    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
 
9611
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
 
9612
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
 
9613
    _LT_AC_TAGVAR(old_archive_cmds, $1) \
 
9614
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
 
9615
    _LT_AC_TAGVAR(predep_objects, $1) \
 
9616
    _LT_AC_TAGVAR(postdep_objects, $1) \
 
9617
    _LT_AC_TAGVAR(predeps, $1) \
 
9618
    _LT_AC_TAGVAR(postdeps, $1) \
 
9619
    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
 
9620
    _LT_AC_TAGVAR(archive_cmds, $1) \
 
9621
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
 
9622
    _LT_AC_TAGVAR(postinstall_cmds, $1) \
 
9623
    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
 
9624
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
 
9625
    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
 
9626
    _LT_AC_TAGVAR(no_undefined_flag, $1) \
 
9627
    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
 
9628
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
 
9629
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
 
9630
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
 
9631
    _LT_AC_TAGVAR(hardcode_automatic, $1) \
 
9632
    _LT_AC_TAGVAR(module_cmds, $1) \
 
9633
    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
 
9634
    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
 
9635
    _LT_AC_TAGVAR(exclude_expsyms, $1) \
 
9636
    _LT_AC_TAGVAR(include_expsyms, $1); do
 
9637
 
 
9638
    case $var in
 
9639
    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
 
9640
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
 
9641
    _LT_AC_TAGVAR(archive_cmds, $1) | \
 
9642
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
 
9643
    _LT_AC_TAGVAR(module_cmds, $1) | \
 
9644
    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
 
9645
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
 
9646
    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
 
9647
    extract_expsyms_cmds | reload_cmds | finish_cmds | \
 
9648
    postinstall_cmds | postuninstall_cmds | \
 
9649
    old_postinstall_cmds | old_postuninstall_cmds | \
 
9650
    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
 
9651
      # Double-quote double-evaled strings.
 
9652
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
 
9653
      ;;
 
9654
    *)
 
9655
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
 
9656
      ;;
 
9657
    esac
 
9658
  done
 
9659
 
 
9660
  case $lt_echo in
 
9661
  *'\[$]0 --fallback-echo"')
 
9662
    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
 
9663
    ;;
 
9664
  esac
 
9665
 
 
9666
ifelse([$1], [],
 
9667
  [cfgfile="${ofile}T"
 
9668
  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
 
9669
  $rm -f "$cfgfile"
 
9670
  AC_MSG_NOTICE([creating $ofile])],
 
9671
  [cfgfile="$ofile"])
 
9672
 
 
9673
  cat <<__EOF__ >> "$cfgfile"
 
9674
ifelse([$1], [],
 
9675
[#! $SHELL
 
9676
 
 
9677
# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
 
9678
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
 
9679
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
 
9680
#
 
9681
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
 
9682
# Free Software Foundation, Inc.
 
9683
#
 
9684
# This file is part of GNU Libtool:
 
9685
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
9686
#
 
9687
# This program is free software; you can redistribute it and/or modify
 
9688
# it under the terms of the GNU General Public License as published by
 
9689
# the Free Software Foundation; either version 2 of the License, or
 
9690
# (at your option) any later version.
 
9691
#
 
9692
# This program is distributed in the hope that it will be useful, but
 
9693
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
9694
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9695
# General Public License for more details.
 
9696
#
 
9697
# You should have received a copy of the GNU General Public License
 
9698
# along with this program; if not, write to the Free Software
 
9699
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
9700
#
 
9701
# As a special exception to the GNU General Public License, if you
 
9702
# distribute this file as part of a program that contains a
 
9703
# configuration script generated by Autoconf, you may include it under
 
9704
# the same distribution terms that you use for the rest of that program.
 
9705
 
 
9706
# A sed program that does not truncate output.
 
9707
SED=$lt_SED
 
9708
 
 
9709
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
 
9710
Xsed="$SED -e s/^X//"
 
9711
 
 
9712
# The HP-UX ksh and POSIX shell print the target directory to stdout
 
9713
# if CDPATH is set.
 
9714
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
 
9715
 
 
9716
# The names of the tagged configurations supported by this script.
 
9717
available_tags=
 
9718
 
 
9719
# ### BEGIN LIBTOOL CONFIG],
 
9720
[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
 
9721
 
 
9722
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
9723
 
 
9724
# Shell to use when invoking shell scripts.
 
9725
SHELL=$lt_SHELL
 
9726
 
 
9727
# Whether or not to build shared libraries.
 
9728
build_libtool_libs=$enable_shared
 
9729
 
 
9730
# Whether or not to build static libraries.
 
9731
build_old_libs=$enable_static
 
9732
 
 
9733
# Whether or not to add -lc for building shared libraries.
 
9734
build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
 
9735
 
 
9736
# Whether or not to disallow shared libs when runtime libs are static
 
9737
allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
 
9738
 
 
9739
# Whether or not to optimize for fast installation.
 
9740
fast_install=$enable_fast_install
 
9741
 
 
9742
# The host system.
 
9743
host_alias=$host_alias
 
9744
host=$host
 
9745
 
 
9746
# An echo program that does not interpret backslashes.
 
9747
echo=$lt_echo
 
9748
 
 
9749
# The archiver.
 
9750
AR=$lt_AR
 
9751
AR_FLAGS=$lt_AR_FLAGS
 
9752
 
 
9753
# A C compiler.
 
9754
LTCC=$lt_LTCC
 
9755
 
 
9756
# A language-specific compiler.
 
9757
CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
9758
 
 
9759
# Is the compiler the GNU C compiler?
 
9760
with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
9761
 
 
9762
# An ERE matcher.
 
9763
EGREP=$lt_EGREP
 
9764
 
 
9765
# The linker used to build libraries.
 
9766
LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
 
9767
 
 
9768
# Whether we need hard or soft links.
 
9769
LN_S=$lt_LN_S
 
9770
 
 
9771
# A BSD-compatible nm program.
 
9772
NM=$lt_NM
 
9773
 
 
9774
# A symbol stripping program
 
9775
STRIP=$STRIP
 
9776
 
 
9777
# Used to examine libraries when file_magic_cmd begins "file"
 
9778
MAGIC_CMD=$MAGIC_CMD
 
9779
 
 
9780
# Used on cygwin: DLL creation program.
 
9781
DLLTOOL="$DLLTOOL"
 
9782
 
 
9783
# Used on cygwin: object dumper.
 
9784
OBJDUMP="$OBJDUMP"
 
9785
 
 
9786
# Used on cygwin: assembler.
 
9787
AS="$AS"
 
9788
 
 
9789
# The name of the directory that contains temporary libtool files.
 
9790
objdir=$objdir
 
9791
 
 
9792
# How to create reloadable object files.
 
9793
reload_flag=$lt_reload_flag
 
9794
reload_cmds=$lt_reload_cmds
 
9795
 
 
9796
# How to pass a linker flag through the compiler.
 
9797
wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
9798
 
 
9799
# Object file suffix (normally "o").
 
9800
objext="$ac_objext"
 
9801
 
 
9802
# Old archive suffix (normally "a").
 
9803
libext="$libext"
 
9804
 
 
9805
# Shared library suffix (normally ".so").
 
9806
shrext='$shrext'
 
9807
 
 
9808
# Executable file suffix (normally "").
 
9809
exeext="$exeext"
 
9810
 
 
9811
# Additional compiler flags for building library objects.
 
9812
pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
 
9813
pic_mode=$pic_mode
 
9814
 
 
9815
# What is the maximum length of a command?
 
9816
max_cmd_len=$lt_cv_sys_max_cmd_len
 
9817
 
 
9818
# Does compiler simultaneously support -c and -o options?
 
9819
compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
9820
 
 
9821
# Must we lock files when doing compilation ?
 
9822
need_locks=$lt_need_locks
 
9823
 
 
9824
# Do we need the lib prefix for modules?
 
9825
need_lib_prefix=$need_lib_prefix
 
9826
 
 
9827
# Do we need a version for libraries?
 
9828
need_version=$need_version
 
9829
 
 
9830
# Whether dlopen is supported.
 
9831
dlopen_support=$enable_dlopen
 
9832
 
 
9833
# Whether dlopen of programs is supported.
 
9834
dlopen_self=$enable_dlopen_self
 
9835
 
 
9836
# Whether dlopen of statically linked programs is supported.
 
9837
dlopen_self_static=$enable_dlopen_self_static
 
9838
 
 
9839
# Compiler flag to prevent dynamic linking.
 
9840
link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
 
9841
 
 
9842
# Compiler flag to turn off builtin functions.
 
9843
no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
 
9844
 
 
9845
# Compiler flag to allow reflexive dlopens.
 
9846
export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
 
9847
 
 
9848
# Compiler flag to generate shared objects directly from archives.
 
9849
whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
 
9850
 
 
9851
# Compiler flag to generate thread-safe objects.
 
9852
thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
 
9853
 
 
9854
# Library versioning type.
 
9855
version_type=$version_type
 
9856
 
 
9857
# Format of library name prefix.
 
9858
libname_spec=$lt_libname_spec
 
9859
 
 
9860
# List of archive names.  First name is the real one, the rest are links.
 
9861
# The last name is the one that the linker finds with -lNAME.
 
9862
library_names_spec=$lt_library_names_spec
 
9863
 
 
9864
# The coded name of the library, if different from the real name.
 
9865
soname_spec=$lt_soname_spec
 
9866
 
 
9867
# Commands used to build and install an old-style archive.
 
9868
RANLIB=$lt_RANLIB
 
9869
old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
 
9870
old_postinstall_cmds=$lt_old_postinstall_cmds
 
9871
old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
9872
 
 
9873
# Create an old-style archive from a shared archive.
 
9874
old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
 
9875
 
 
9876
# Create a temporary old-style archive to link instead of a shared archive.
 
9877
old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
 
9878
 
 
9879
# Commands used to build and install a shared archive.
 
9880
archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
 
9881
archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
 
9882
postinstall_cmds=$lt_postinstall_cmds
 
9883
postuninstall_cmds=$lt_postuninstall_cmds
 
9884
 
 
9885
# Commands used to build a loadable module (assumed same as above if empty)
 
9886
module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
 
9887
module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
 
9888
 
 
9889
# Commands to strip libraries.
 
9890
old_striplib=$lt_old_striplib
 
9891
striplib=$lt_striplib
 
9892
 
 
9893
# Dependencies to place before the objects being linked to create a
 
9894
# shared library.
 
9895
predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
 
9896
 
 
9897
# Dependencies to place after the objects being linked to create a
 
9898
# shared library.
 
9899
postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
 
9900
 
 
9901
# Dependencies to place before the objects being linked to create a
 
9902
# shared library.
 
9903
predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
 
9904
 
 
9905
# Dependencies to place after the objects being linked to create a
 
9906
# shared library.
 
9907
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
9908
 
 
9909
# The library search path used internally by the compiler when linking
 
9910
# a shared library.
 
9911
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
 
9912
 
 
9913
# Method to check whether dependent libraries are shared objects.
 
9914
deplibs_check_method=$lt_deplibs_check_method
 
9915
 
 
9916
# Command to use when deplibs_check_method == file_magic.
 
9917
file_magic_cmd=$lt_file_magic_cmd
 
9918
 
 
9919
# Flag that allows shared libraries with undefined symbols to be built.
 
9920
allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
 
9921
 
 
9922
# Flag that forces no undefined symbols.
 
9923
no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
 
9924
 
 
9925
# Commands used to finish a libtool library installation in a directory.
 
9926
finish_cmds=$lt_finish_cmds
 
9927
 
 
9928
# Same as above, but a single script fragment to be evaled but not shown.
 
9929
finish_eval=$lt_finish_eval
 
9930
 
 
9931
# Take the output of nm and produce a listing of raw symbols and C names.
 
9932
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
9933
 
 
9934
# Transform the output of nm in a proper C declaration
 
9935
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
9936
 
 
9937
# Transform the output of nm in a C name address pair
 
9938
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
9939
 
 
9940
# This is the shared library runtime path variable.
 
9941
runpath_var=$runpath_var
 
9942
 
 
9943
# This is the shared library path variable.
 
9944
shlibpath_var=$shlibpath_var
 
9945
 
 
9946
# Is shlibpath searched before the hard-coded library search path?
 
9947
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
9948
 
 
9949
# How to hardcode a shared library path into an executable.
 
9950
hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
 
9951
 
 
9952
# Whether we should hardcode library paths into libraries.
 
9953
hardcode_into_libs=$hardcode_into_libs
 
9954
 
 
9955
# Flag to hardcode \$libdir into a binary during linking.
 
9956
# This must work even if \$libdir does not exist.
 
9957
hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
 
9958
 
 
9959
# If ld is used when linking, flag to hardcode \$libdir into
 
9960
# a binary during linking. This must work even if \$libdir does
 
9961
# not exist.
 
9962
hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
 
9963
 
 
9964
# Whether we need a single -rpath flag with a separated argument.
 
9965
hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
 
9966
 
 
9967
# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
 
9968
# resulting binary.
 
9969
hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
 
9970
 
 
9971
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
 
9972
# resulting binary.
 
9973
hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
 
9974
 
 
9975
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
 
9976
# the resulting binary.
 
9977
hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
 
9978
 
 
9979
# Set to yes if building a shared library automatically hardcodes DIR into the library
 
9980
# and all subsequent libraries and executables linked against it.
 
9981
hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
 
9982
 
 
9983
# Variables whose values should be saved in libtool wrapper scripts and
 
9984
# restored at relink time.
 
9985
variables_saved_for_relink="$variables_saved_for_relink"
 
9986
 
 
9987
# Whether libtool must link a program against all its dependency libraries.
 
9988
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
 
9989
 
 
9990
# Compile-time system search path for libraries
 
9991
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
9992
 
 
9993
# Run-time system search path for libraries
 
9994
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
9995
 
 
9996
# Fix the shell variable \$srcfile for the compiler.
 
9997
fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
 
9998
 
 
9999
# Set to yes if exported symbols are required.
 
10000
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
 
10001
 
 
10002
# The commands to list exported symbols.
 
10003
export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
 
10004
 
 
10005
# The commands to extract the exported symbol list from a shared archive.
 
10006
extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
10007
 
 
10008
# Symbols that should not be listed in the preloaded symbols.
 
10009
exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
 
10010
 
 
10011
# Symbols that must always be exported.
 
10012
include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
 
10013
 
 
10014
ifelse([$1],[],
 
10015
[# ### END LIBTOOL CONFIG],
 
10016
[# ### END LIBTOOL TAG CONFIG: $tagname])
 
10017
 
 
10018
__EOF__
 
10019
 
 
10020
ifelse([$1],[], [
 
10021
  case $host_os in
 
10022
  aix3*)
 
10023
    cat <<\EOF >> "$cfgfile"
 
10024
 
 
10025
# AIX sometimes has problems with the GCC collect2 program.  For some
 
10026
# reason, if we set the COLLECT_NAMES environment variable, the problems
 
10027
# vanish in a puff of smoke.
 
10028
if test "X${COLLECT_NAMES+set}" != Xset; then
 
10029
  COLLECT_NAMES=
 
10030
  export COLLECT_NAMES
 
10031
fi
 
10032
EOF
 
10033
    ;;
 
10034
  esac
 
10035
 
 
10036
  # We use sed instead of cat because bash on DJGPP gets confused if
 
10037
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
 
10038
  # text mode, it properly converts lines to CR/LF.  This bash problem
 
10039
  # is reportedly fixed, but why not run on old versions too?
 
10040
  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
 
10041
 
 
10042
  mv -f "$cfgfile" "$ofile" || \
 
10043
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
 
10044
  chmod +x "$ofile"
 
10045
])
 
10046
else
 
10047
  # If there is no Makefile yet, we rely on a make rule to execute
 
10048
  # `config.status --recheck' to rerun these tests and create the
 
10049
  # libtool script then.
 
10050
  test -f Makefile && make "$ltmain"
 
10051
fi
 
10052
])# AC_LIBTOOL_CONFIG
 
10053
 
 
10054
 
 
10055
# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
 
10056
# -------------------------------------------
 
10057
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
 
10058
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
10059
 
 
10060
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
10061
 
 
10062
if test "$GCC" = yes; then
 
10063
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
10064
 
 
10065
  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
 
10066
    lt_cv_prog_compiler_rtti_exceptions,
 
10067
    [-fno-rtti -fno-exceptions], [],
 
10068
    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
 
10069
fi
 
10070
])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
 
10071
 
 
10072
 
 
10073
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
10074
# ---------------------------------
 
10075
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
 
10076
[AC_REQUIRE([AC_CANONICAL_HOST])
 
10077
AC_REQUIRE([AC_PROG_NM])
 
10078
AC_REQUIRE([AC_OBJEXT])
 
10079
# Check for command to grab the raw symbol name followed by C symbol from nm.
 
10080
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
 
10081
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
 
10082
[
 
10083
# These are sane defaults that work on at least a few old systems.
 
10084
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
10085
 
 
10086
# Character class describing NM global symbol codes.
 
10087
symcode='[[BCDEGRST]]'
 
10088
 
 
10089
# Regexp to match symbols that can be accessed directly from C.
 
10090
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
10091
 
 
10092
# Transform the above into a raw symbol and a C symbol.
 
10093
symxfrm='\1 \2\3 \3'
 
10094
 
 
10095
# Transform an extracted symbol line into a proper C declaration
 
10096
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
10097
 
 
10098
# Transform an extracted symbol line into symbol name and symbol address
 
10099
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
10100
 
 
10101
# Define system-specific variables.
 
10102
case $host_os in
 
10103
aix*)
 
10104
  symcode='[[BCDT]]'
 
10105
  ;;
 
10106
cygwin* | mingw* | pw32*)
 
10107
  symcode='[[ABCDGISTW]]'
 
10108
  ;;
 
10109
hpux*) # Its linker distinguishes data from code symbols
 
10110
  if test "$host_cpu" = ia64; then
 
10111
    symcode='[[ABCDEGRST]]'
 
10112
  fi
 
10113
  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
10114
  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
10115
  ;;
 
10116
irix* | nonstopux*)
 
10117
  symcode='[[BCDEGRST]]'
 
10118
  ;;
 
10119
osf*)
 
10120
  symcode='[[BCDEGQRST]]'
 
10121
  ;;
 
10122
solaris* | sysv5*)
 
10123
  symcode='[[BDT]]'
 
10124
  ;;
 
10125
sysv4)
 
10126
  symcode='[[DFNSTU]]'
 
10127
  ;;
 
10128
esac
 
10129
 
 
10130
# Handle CRLF in mingw tool chain
 
10131
opt_cr=
 
10132
case $build_os in
 
10133
mingw*)
 
10134
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
 
10135
  ;;
 
10136
esac
 
10137
 
 
10138
# If we're using GNU nm, then use its standard symbol codes.
 
10139
case `$NM -V 2>&1` in
 
10140
*GNU* | *'with BFD'*)
 
10141
  symcode='[[ABCDGISTW]]' ;;
 
10142
esac
 
10143
 
 
10144
# Try without a prefix undercore, then with it.
 
10145
for ac_symprfx in "" "_"; do
 
10146
 
 
10147
  # Write the raw and C identifiers.
 
10148
  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
 
10149
 
 
10150
  # Check to see that the pipe works correctly.
 
10151
  pipe_works=no
 
10152
 
 
10153
  rm -f conftest*
 
10154
  cat > conftest.$ac_ext <<EOF
 
10155
#ifdef __cplusplus
 
10156
extern "C" {
 
10157
#endif
 
10158
char nm_test_var;
 
10159
void nm_test_func(){}
 
10160
#ifdef __cplusplus
 
10161
}
 
10162
#endif
 
10163
int main(){nm_test_var='a';nm_test_func();return(0);}
 
10164
EOF
 
10165
 
 
10166
  if AC_TRY_EVAL(ac_compile); then
 
10167
    # Now try to grab the symbols.
 
10168
    nlist=conftest.nm
 
10169
    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
 
10170
      # Try sorting and uniquifying the output.
 
10171
      if sort "$nlist" | uniq > "$nlist"T; then
 
10172
        mv -f "$nlist"T "$nlist"
 
10173
      else
 
10174
        rm -f "$nlist"T
 
10175
      fi
 
10176
 
 
10177
      # Make sure that we snagged all the symbols we need.
 
10178
      if grep ' nm_test_var$' "$nlist" >/dev/null; then
 
10179
        if grep ' nm_test_func$' "$nlist" >/dev/null; then
 
10180
          cat <<EOF > conftest.$ac_ext
 
10181
#ifdef __cplusplus
 
10182
extern "C" {
 
10183
#endif
 
10184
 
 
10185
EOF
 
10186
          # Now generate the symbol file.
 
10187
          eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
10188
 
 
10189
          cat <<EOF >> conftest.$ac_ext
 
10190
#if defined (__STDC__) && __STDC__
 
10191
# define lt_ptr_t void *
 
10192
#else
 
10193
# define lt_ptr_t char *
 
10194
# define const
 
10195
#endif
 
10196
 
 
10197
/* The mapping between symbol names and symbols. */
 
10198
const struct {
 
10199
  const char *name;
 
10200
  lt_ptr_t address;
 
10201
}
 
10202
lt_preloaded_symbols[[]] =
 
10203
{
 
10204
EOF
 
10205
          $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
 
10206
          cat <<\EOF >> conftest.$ac_ext
 
10207
  {0, (lt_ptr_t) 0}
 
10208
};
 
10209
 
 
10210
#ifdef __cplusplus
 
10211
}
 
10212
#endif
 
10213
EOF
 
10214
          # Now try linking the two files.
 
10215
          mv conftest.$ac_objext conftstm.$ac_objext
 
10216
          lt_save_LIBS="$LIBS"
 
10217
          lt_save_CFLAGS="$CFLAGS"
 
10218
          LIBS="conftstm.$ac_objext"
 
10219
          CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
 
10220
          if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 
10221
            pipe_works=yes
 
10222
          fi
 
10223
          LIBS="$lt_save_LIBS"
 
10224
          CFLAGS="$lt_save_CFLAGS"
 
10225
        else
 
10226
          echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
 
10227
        fi
 
10228
      else
 
10229
        echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
 
10230
      fi
 
10231
    else
 
10232
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
 
10233
    fi
 
10234
  else
 
10235
    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
 
10236
    cat conftest.$ac_ext >&5
 
10237
  fi
 
10238
  rm -f conftest* conftst*
 
10239
 
 
10240
  # Do not use the global_symbol_pipe unless it works.
 
10241
  if test "$pipe_works" = yes; then
 
10242
    break
 
10243
  else
 
10244
    lt_cv_sys_global_symbol_pipe=
 
10245
  fi
 
10246
done
 
10247
])
 
10248
if test -z "$lt_cv_sys_global_symbol_pipe"; then
 
10249
  lt_cv_sys_global_symbol_to_cdecl=
 
10250
fi
 
10251
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
 
10252
  AC_MSG_RESULT(failed)
 
10253
else
 
10254
  AC_MSG_RESULT(ok)
 
10255
fi
 
10256
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
10257
 
 
10258
 
 
10259
# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
 
10260
# ---------------------------------------
 
10261
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
 
10262
[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
 
10263
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10264
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
 
10265
 
 
10266
AC_MSG_CHECKING([for $compiler option to produce PIC])
 
10267
 ifelse([$1],[CXX],[
 
10268
  # C++ specific cases for pic, static, wl, etc.
 
10269
  if test "$GXX" = yes; then
 
10270
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10271
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10272
 
 
10273
    case $host_os in
 
10274
    aix*)
 
10275
      # All AIX code is PIC.
 
10276
      if test "$host_cpu" = ia64; then
 
10277
        # AIX 5 now supports IA64 processor
 
10278
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10279
      fi
 
10280
      ;;
 
10281
    amigaos*)
 
10282
      # FIXME: we need at least 68020 code to build shared libraries, but
 
10283
      # adding the `-m68020' flag to GCC prevents building anything better,
 
10284
      # like `-m68040'.
 
10285
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
 
10286
      ;;
 
10287
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
 
10288
      # PIC is the default for these OSes.
 
10289
      ;;
 
10290
    mingw* | os2* | pw32*)
 
10291
      # This hack is so that the source file can tell whether it is being
 
10292
      # built for inclusion in a dll (and should export symbols for example).
 
10293
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
10294
      ;;
 
10295
    darwin* | rhapsody*)
 
10296
      # PIC is the default on this platform
 
10297
      # Common symbols not allowed in MH_DYLIB files
 
10298
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
 
10299
      ;;
 
10300
    *djgpp*)
 
10301
      # DJGPP does not support shared libraries at all
 
10302
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10303
      ;;
 
10304
    sysv4*MP*)
 
10305
      if test -d /usr/nec; then
 
10306
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
 
10307
      fi
 
10308
      ;;
 
10309
    hpux*)
 
10310
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
10311
      # not for PA HP-UX.
 
10312
      case "$host_cpu" in
 
10313
      hppa*64*|ia64*)
 
10314
        ;;
 
10315
      *)
 
10316
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10317
        ;;
 
10318
      esac
 
10319
      ;;
 
10320
    *)
 
10321
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10322
      ;;
 
10323
    esac
 
10324
  else
 
10325
    case $host_os in
 
10326
      aix4* | aix5*)
 
10327
        # All AIX code is PIC.
 
10328
        if test "$host_cpu" = ia64; then
 
10329
          # AIX 5 now supports IA64 processor
 
10330
          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10331
        else
 
10332
          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
 
10333
        fi
 
10334
        ;;
 
10335
      chorus*)
 
10336
        case $cc_basename in
 
10337
        cxch68)
 
10338
          # Green Hills C++ Compiler
 
10339
          # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 
10340
          ;;
 
10341
        esac
 
10342
        ;;
 
10343
      dgux*)
 
10344
        case $cc_basename in
 
10345
          ec++)
 
10346
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10347
            ;;
 
10348
          ghcx)
 
10349
            # Green Hills C++ Compiler
 
10350
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10351
            ;;
 
10352
          *)
 
10353
            ;;
 
10354
        esac
 
10355
        ;;
 
10356
      freebsd*)
 
10357
        # FreeBSD uses GNU C++
 
10358
        ;;
 
10359
      hpux9* | hpux10* | hpux11*)
 
10360
        case $cc_basename in
 
10361
          CC)
 
10362
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10363
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
 
10364
            if test "$host_cpu" != ia64; then
 
10365
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
10366
            fi
 
10367
            ;;
 
10368
          aCC)
 
10369
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10370
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
 
10371
            case "$host_cpu" in
 
10372
            hppa*64*|ia64*)
 
10373
              # +Z the default
 
10374
              ;;
 
10375
            *)
 
10376
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
10377
              ;;
 
10378
            esac
 
10379
            ;;
 
10380
          *)
 
10381
            ;;
 
10382
        esac
 
10383
        ;;
 
10384
      irix5* | irix6* | nonstopux*)
 
10385
        case $cc_basename in
 
10386
          CC)
 
10387
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10388
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10389
            # CC pic flag -KPIC is the default.
 
10390
            ;;
 
10391
          *)
 
10392
            ;;
 
10393
        esac
 
10394
        ;;
 
10395
      linux*)
 
10396
        case $cc_basename in
 
10397
          KCC)
 
10398
            # KAI C++ Compiler
 
10399
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 
10400
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10401
            ;;
 
10402
          icpc)
 
10403
            # Intel C++
 
10404
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10405
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10406
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10407
            ;; 
 
10408
          cxx)
 
10409
            # Compaq C++
 
10410
            # Make sure the PIC flag is empty.  It appears that all Alpha
 
10411
            # Linux and Compaq Tru64 Unix objects are PIC.
 
10412
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10413
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10414
            ;;
 
10415
          *)
 
10416
            ;;
 
10417
        esac
 
10418
        ;;
 
10419
      lynxos*)
 
10420
        ;;
 
10421
      m88k*)
 
10422
        ;;
 
10423
      mvs*)
 
10424
        case $cc_basename in
 
10425
          cxx)
 
10426
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
 
10427
            ;;
 
10428
          *)
 
10429
            ;;
 
10430
        esac
 
10431
        ;;
 
10432
      netbsd*)
 
10433
        ;;
 
10434
      osf3* | osf4* | osf5*)
 
10435
        case $cc_basename in
 
10436
          KCC)
 
10437
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 
10438
            ;;
 
10439
          RCC)
 
10440
            # Rational C++ 2.4.1
 
10441
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10442
            ;;
 
10443
          cxx)
 
10444
            # Digital/Compaq C++
 
10445
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10446
            # Make sure the PIC flag is empty.  It appears that all Alpha
 
10447
            # Linux and Compaq Tru64 Unix objects are PIC.
 
10448
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10449
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10450
            ;;
 
10451
          *)
 
10452
            ;;
 
10453
        esac
 
10454
        ;;
 
10455
      psos*)
 
10456
        ;;
 
10457
      sco*)
 
10458
        case $cc_basename in
 
10459
          CC)
 
10460
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10461
            ;;
 
10462
          *)
 
10463
            ;;
 
10464
        esac
 
10465
        ;;
 
10466
      solaris*)
 
10467
        case $cc_basename in
 
10468
          CC)
 
10469
            # Sun C++ 4.2, 5.x and Centerline C++
 
10470
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10471
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10472
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 
10473
            ;;
 
10474
          gcx)
 
10475
            # Green Hills C++ Compiler
 
10476
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 
10477
            ;;
 
10478
          *)
 
10479
            ;;
 
10480
        esac
 
10481
        ;;
 
10482
      sunos4*)
 
10483
        case $cc_basename in
 
10484
          CC)
 
10485
            # Sun C++ 4.x
 
10486
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10487
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10488
            ;;
 
10489
          lcc)
 
10490
            # Lucid
 
10491
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10492
            ;;
 
10493
          *)
 
10494
            ;;
 
10495
        esac
 
10496
        ;;
 
10497
      tandem*)
 
10498
        case $cc_basename in
 
10499
          NCC)
 
10500
            # NonStop-UX NCC 3.20
 
10501
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10502
            ;;
 
10503
          *)
 
10504
            ;;
 
10505
        esac
 
10506
        ;;
 
10507
      unixware*)
 
10508
        ;;
 
10509
      vxworks*)
 
10510
        ;;
 
10511
      *)
 
10512
        _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10513
        ;;
 
10514
    esac
 
10515
  fi
 
10516
],
 
10517
[
 
10518
  if test "$GCC" = yes; then
 
10519
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10520
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10521
 
 
10522
    case $host_os in
 
10523
      aix*)
 
10524
      # All AIX code is PIC.
 
10525
      if test "$host_cpu" = ia64; then
 
10526
        # AIX 5 now supports IA64 processor
 
10527
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10528
      fi
 
10529
      ;;
 
10530
 
 
10531
    amigaos*)
 
10532
      # FIXME: we need at least 68020 code to build shared libraries, but
 
10533
      # adding the `-m68020' flag to GCC prevents building anything better,
 
10534
      # like `-m68040'.
 
10535
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
 
10536
      ;;
 
10537
 
 
10538
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
 
10539
      # PIC is the default for these OSes.
 
10540
      ;;
 
10541
 
 
10542
    mingw* | pw32* | os2*)
 
10543
      # This hack is so that the source file can tell whether it is being
 
10544
      # built for inclusion in a dll (and should export symbols for example).
 
10545
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
10546
      ;;
 
10547
 
 
10548
    darwin* | rhapsody*)
 
10549
      # PIC is the default on this platform
 
10550
      # Common symbols not allowed in MH_DYLIB files
 
10551
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
 
10552
      ;;
 
10553
 
 
10554
    msdosdjgpp*)
 
10555
      # Just because we use GCC doesn't mean we suddenly get shared libraries
 
10556
      # on systems that don't support them.
 
10557
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10558
      enable_shared=no
 
10559
      ;;
 
10560
 
 
10561
    sysv4*MP*)
 
10562
      if test -d /usr/nec; then
 
10563
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
 
10564
      fi
 
10565
      ;;
 
10566
 
 
10567
    hpux*)
 
10568
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
10569
      # not for PA HP-UX.
 
10570
      case "$host_cpu" in
 
10571
      hppa*64*|ia64*)
 
10572
        # +Z the default
 
10573
        ;;
 
10574
      *)
 
10575
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10576
        ;;
 
10577
      esac
 
10578
      ;;
 
10579
 
 
10580
    *)
 
10581
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10582
      ;;
 
10583
    esac
 
10584
  else
 
10585
    # PORTME Check for flag to pass linker flags through the system compiler.
 
10586
    case $host_os in
 
10587
    aix*)
 
10588
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10589
      if test "$host_cpu" = ia64; then
 
10590
        # AIX 5 now supports IA64 processor
 
10591
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10592
      else
 
10593
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
 
10594
      fi
 
10595
      ;;
 
10596
 
 
10597
    mingw* | pw32* | os2*)
 
10598
      # This hack is so that the source file can tell whether it is being
 
10599
      # built for inclusion in a dll (and should export symbols for example).
 
10600
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
10601
      ;;
 
10602
 
 
10603
    hpux9* | hpux10* | hpux11*)
 
10604
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10605
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
10606
      # not for PA HP-UX.
 
10607
      case "$host_cpu" in
 
10608
      hppa*64*|ia64*)
 
10609
        # +Z the default
 
10610
        ;;
 
10611
      *)
 
10612
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
10613
        ;;
 
10614
      esac
 
10615
      # Is there a better lt_prog_compiler_static that works with the bundled CC?
 
10616
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 
10617
      ;;
 
10618
 
 
10619
    irix5* | irix6* | nonstopux*)
 
10620
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10621
      # PIC (with -KPIC) is the default.
 
10622
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10623
      ;;
 
10624
 
 
10625
    newsos6)
 
10626
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10627
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10628
      ;;
 
10629
 
 
10630
    linux*)
 
10631
      case $CC in
 
10632
      icc* | ecc*)
 
10633
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10634
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10635
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10636
        ;;
 
10637
      ccc*)
 
10638
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10639
        # All Alpha code is PIC.
 
10640
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10641
        ;;
 
10642
      esac
 
10643
      ;;
 
10644
 
 
10645
    osf3* | osf4* | osf5*)
 
10646
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10647
      # All OSF/1 code is PIC.
 
10648
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10649
      ;;
 
10650
 
 
10651
    sco3.2v5*)
 
10652
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
 
10653
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
 
10654
      ;;
 
10655
 
 
10656
    solaris*)
 
10657
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10658
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10659
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10660
      ;;
 
10661
 
 
10662
    sunos4*)
 
10663
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 
10664
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 
10665
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10666
      ;;
 
10667
 
 
10668
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
10669
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10670
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10671
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10672
      ;;
 
10673
 
 
10674
    sysv4*MP*)
 
10675
      if test -d /usr/nec ;then
 
10676
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 
10677
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10678
      fi
 
10679
      ;;
 
10680
 
 
10681
    uts4*)
 
10682
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10683
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10684
      ;;
 
10685
 
 
10686
    *)
 
10687
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10688
      ;;
 
10689
    esac
 
10690
  fi
 
10691
])
 
10692
AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
 
10693
 
 
10694
#
 
10695
# Check to make sure the PIC flag actually works.
 
10696
#
 
10697
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
 
10698
  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
 
10699
    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
 
10700
    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
 
10701
    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
 
10702
     "" | " "*) ;;
 
10703
     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
 
10704
     esac],
 
10705
    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10706
     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 
10707
fi
 
10708
case "$host_os" in
 
10709
  # For platforms which do not support PIC, -DPIC is meaningless:
 
10710
  *djgpp*)
 
10711
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10712
    ;;
 
10713
  *)
 
10714
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
 
10715
    ;;
 
10716
esac
 
10717
])
 
10718
 
 
10719
 
 
10720
# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
 
10721
# ------------------------------------
 
10722
# See if the linker supports building shared libraries.
 
10723
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
 
10724
[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 
10725
ifelse([$1],[CXX],[
 
10726
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10727
  case $host_os in
 
10728
  aix4* | aix5*)
 
10729
    # If we're using GNU nm, then we don't want the "-C" option.
 
10730
    # -C means demangle to AIX nm, but means don't demangle with GNU nm
 
10731
    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 
10732
      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
 
10733
    else
 
10734
      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
 
10735
    fi
 
10736
    ;;
 
10737
  pw32*)
 
10738
    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
 
10739
  ;;
 
10740
  cygwin* | mingw*)
 
10741
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
10742
  ;;
 
10743
  *)
 
10744
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10745
  ;;
 
10746
  esac
 
10747
],[
 
10748
  runpath_var=
 
10749
  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
10750
  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
10751
  _LT_AC_TAGVAR(archive_cmds, $1)=
 
10752
  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
10753
  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
 
10754
  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
 
10755
  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
10756
  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
10757
  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
 
10758
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
10759
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
10760
  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
10761
  _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10762
  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
10763
  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
10764
  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
10765
  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
10766
  _LT_AC_TAGVAR(module_cmds, $1)=
 
10767
  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
 
10768
  _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
10769
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10770
  # include_expsyms should be a list of space-separated symbols to be *always*
 
10771
  # included in the symbol list
 
10772
  _LT_AC_TAGVAR(include_expsyms, $1)=
 
10773
  # exclude_expsyms can be an extended regexp of symbols to exclude
 
10774
  # it will be wrapped by ` (' and `)$', so one must not match beginning or
 
10775
  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
 
10776
  # as well as any symbol that contains `d'.
 
10777
  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
 
10778
  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
 
10779
  # platforms (ab)use it in PIC code, but their linkers get confused if
 
10780
  # the symbol is explicitly referenced.  Since portable code cannot
 
10781
  # rely on this symbol name, it's probably fine to never include it in
 
10782
  # preloaded symbol tables.
 
10783
  extract_expsyms_cmds=
 
10784
 
 
10785
  case $host_os in
 
10786
  cygwin* | mingw* | pw32*)
 
10787
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
 
10788
    # When not using gcc, we currently assume that we are using
 
10789
    # Microsoft Visual C++.
 
10790
    if test "$GCC" != yes; then
 
10791
      with_gnu_ld=no
 
10792
    fi
 
10793
    ;;
 
10794
  openbsd*)
 
10795
    with_gnu_ld=no
 
10796
    ;;
 
10797
  esac
 
10798
 
 
10799
  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
10800
  if test "$with_gnu_ld" = yes; then
 
10801
    # If archive_cmds runs LD, not CC, wlarc should be empty
 
10802
    wlarc='${wl}'
 
10803
 
 
10804
    # See if GNU ld supports shared libraries.
 
10805
    case $host_os in
 
10806
    aix3* | aix4* | aix5*)
 
10807
      # On AIX/PPC, the GNU linker is very broken
 
10808
      if test "$host_cpu" != ia64; then
 
10809
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10810
        cat <<EOF 1>&2
 
10811
 
 
10812
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
 
10813
*** to be unable to reliably create shared libraries on AIX.
 
10814
*** Therefore, libtool is disabling shared libraries support.  If you
 
10815
*** really care for shared libraries, you may want to modify your PATH
 
10816
*** so that a non-GNU linker is found, and then restart.
 
10817
 
 
10818
EOF
 
10819
      fi
 
10820
      ;;
 
10821
 
 
10822
    amigaos*)
 
10823
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
 
10824
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10825
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10826
 
 
10827
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
 
10828
      # that the semantics of dynamic libraries on AmigaOS, at least up
 
10829
      # to version 4, is to share data among multiple programs linked
 
10830
      # with the same dynamic library.  Since this doesn't match the
 
10831
      # behavior of shared libraries on other platforms, we can't use
 
10832
      # them.
 
10833
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10834
      ;;
 
10835
 
 
10836
    beos*)
 
10837
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10838
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10839
        # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 
10840
        # support --undefined.  This deserves some investigation.  FIXME
 
10841
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
 
10842
      else
 
10843
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10844
      fi
 
10845
      ;;
 
10846
 
 
10847
    cygwin* | mingw* | pw32*)
 
10848
      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 
10849
      # as there is no search path for DLLs.
 
10850
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10851
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
 
10852
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
10853
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
10854
      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
10855
 
 
10856
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
 
10857
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
10858
        # If the export-symbols file already is a .def file (1st line
 
10859
        # is EXPORTS), use it as is; otherwise, prepend...
 
10860
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
 
10861
          cp $export_symbols $output_objdir/$soname.def;
 
10862
        else
 
10863
          echo EXPORTS > $output_objdir/$soname.def;
 
10864
          cat $export_symbols >> $output_objdir/$soname.def;
 
10865
        fi~
 
10866
        $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
 
10867
      else
 
10868
        ld_shlibs=no
 
10869
      fi
 
10870
      ;;
 
10871
 
 
10872
    netbsd*)
 
10873
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
10874
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 
10875
        wlarc=
 
10876
      else
 
10877
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
 
10878
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10879
      fi
 
10880
      ;;
 
10881
 
 
10882
    solaris* | sysv5*)
 
10883
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 
10884
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10885
        cat <<EOF 1>&2
 
10886
 
 
10887
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
 
10888
*** create shared libraries on Solaris systems.  Therefore, libtool
 
10889
*** is disabling shared libraries support.  We urge you to upgrade GNU
 
10890
*** binutils to release 2.9.1 or newer.  Another option is to modify
 
10891
*** your PATH or compiler configuration so that the native linker is
 
10892
*** used, and then restart.
 
10893
 
 
10894
EOF
 
10895
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10896
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
 
10897
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10898
      else
 
10899
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10900
      fi
 
10901
      ;;
 
10902
 
 
10903
    sunos4*)
 
10904
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
10905
      wlarc=
 
10906
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10907
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10908
      ;;
 
10909
 
 
10910
    *)
 
10911
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10912
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
 
10913
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10914
      else
 
10915
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10916
      fi
 
10917
      ;;
 
10918
    esac
 
10919
 
 
10920
    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
 
10921
      runpath_var=LD_RUN_PATH
 
10922
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 
10923
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
10924
      # ancient GNU ld didn't support --whole-archive et. al.
 
10925
      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
 
10926
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 
10927
      else
 
10928
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
10929
      fi
 
10930
    fi
 
10931
  else
 
10932
    # PORTME fill in a description of your system's linker (not GNU ld)
 
10933
    case $host_os in
 
10934
    aix3*)
 
10935
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10936
      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
10937
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
 
10938
      # Note: this linker hardcodes the directories in LIBPATH if there
 
10939
      # are no directories specified by -L.
 
10940
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10941
      if test "$GCC" = yes && test -z "$link_static_flag"; then
 
10942
        # Neither direct hardcoding nor static linking is supported with a
 
10943
        # broken collect2.
 
10944
        _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
10945
      fi
 
10946
      ;;
 
10947
 
 
10948
    aix4* | aix5*)
 
10949
      if test "$host_cpu" = ia64; then
 
10950
        # On IA64, the linker does run time linking by default, so we don't
 
10951
        # have to do anything special.
 
10952
        aix_use_runtimelinking=no
 
10953
        exp_sym_flag='-Bexport'
 
10954
        no_entry_flag=""
 
10955
      else
 
10956
        # If we're using GNU nm, then we don't want the "-C" option.
 
10957
        # -C means demangle to AIX nm, but means don't demangle with GNU nm
 
10958
        if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 
10959
          _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
 
10960
        else
 
10961
          _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
 
10962
        fi
 
10963
 
 
10964
        # KDE requires run time linking.  Make it the default.
 
10965
        aix_use_runtimelinking=yes
 
10966
        exp_sym_flag='-bexport'
 
10967
        no_entry_flag='-bnoentry'
 
10968
      fi
 
10969
 
 
10970
      # When large executables or shared objects are built, AIX ld can
 
10971
      # have problems creating the table of contents.  If linking a library
 
10972
      # or program results in "error TOC overflow" add -mminimal-toc to
 
10973
      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
 
10974
      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
10975
 
 
10976
      _LT_AC_TAGVAR(archive_cmds, $1)=''
 
10977
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10978
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
 
10979
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
10980
 
 
10981
      if test "$GCC" = yes; then
 
10982
        case $host_os in aix4.[012]|aix4.[012].*)
 
10983
        # We only want to do this on AIX 4.2 and lower, the check
 
10984
        # below for broken collect2 doesn't work under 4.3+
 
10985
          collect2name=`${CC} -print-prog-name=collect2`
 
10986
          if test -f "$collect2name" && \
 
10987
           strings "$collect2name" | grep resolve_lib_name >/dev/null
 
10988
          then
 
10989
          # We have reworked collect2
 
10990
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10991
          else
 
10992
          # We have old collect2
 
10993
          _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
10994
          # It fails to find uninstalled libraries when the uninstalled
 
10995
          # path is not listed in the libpath.  Setting hardcode_minus_L
 
10996
          # to unsupported forces relinking
 
10997
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10998
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10999
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
11000
          fi
 
11001
        esac
 
11002
        shared_flag='-shared'
 
11003
      else
 
11004
        # not using gcc
 
11005
        if test "$host_cpu" = ia64; then
 
11006
        # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 
11007
        # chokes on -Wl,-G. The following line is correct:
 
11008
          shared_flag='-G'
 
11009
        else
 
11010
        if test "$aix_use_runtimelinking" = yes; then
 
11011
            shared_flag='-qmkshrobj ${wl}-G'
 
11012
          else
 
11013
            shared_flag='-qmkshrobj'
 
11014
        fi
 
11015
        fi
 
11016
      fi
 
11017
 
 
11018
      # Let the compiler handle the export list.
 
11019
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
11020
      if test "$aix_use_runtimelinking" = yes; then
 
11021
        # Warning - without using the other runtime loading flags (-brtl),
 
11022
        # -berok will link without error, but may produce a broken library.
 
11023
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
 
11024
       # Determine the default libpath from the value encoded in an empty executable.
 
11025
        _LT_AC_SYS_LIBPATH_AIX
 
11026
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
11027
        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
 
11028
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
 
11029
       else
 
11030
        if test "$host_cpu" = ia64; then
 
11031
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 
11032
          _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
 
11033
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
 
11034
        else
 
11035
         # Determine the default libpath from the value encoded in an empty executable.
 
11036
         _LT_AC_SYS_LIBPATH_AIX
 
11037
         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
11038
          # Warning - without using the other run time loading flags,
 
11039
          # -berok will link without error, but may produce a broken library.
 
11040
          _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 
11041
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
 
11042
          # -bexpall does not export symbols beginning with underscore (_)
 
11043
          _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
11044
          # Exported symbols can be pulled into shared objects from archives
 
11045
          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 
11046
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
11047
          # This is similar to how AIX traditionally builds it's shared libraries.
 
11048
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 
11049
        fi
 
11050
      fi
 
11051
      ;;
 
11052
 
 
11053
    amigaos*)
 
11054
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
 
11055
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11056
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11057
      # see comment about different semantics on the GNU ld section
 
11058
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
11059
      ;;
 
11060
 
 
11061
    bsdi4*)
 
11062
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
 
11063
      ;;
 
11064
 
 
11065
    cygwin* | mingw* | pw32*)
 
11066
      # When not using gcc, we currently assume that we are using
 
11067
      # Microsoft Visual C++.
 
11068
      # hardcode_libdir_flag_spec is actually meaningless, as there is
 
11069
      # no search path for DLLs.
 
11070
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
 
11071
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
 
11072
      # Tell ltmain to make .lib files, not .a files.
 
11073
      libext=lib
 
11074
      # Tell ltmain to make .dll files, not .so files.
 
11075
      shrext=".dll"
 
11076
      # FIXME: Setting linknames here is a bad hack.
 
11077
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
 
11078
      # The linker will automatically build a .lib file if we build a DLL.
 
11079
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
 
11080
      # FIXME: Should let the user specify the lib program.
 
11081
      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
 
11082
      fix_srcfile_path='`cygpath -w "$srcfile"`'
 
11083
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
11084
      ;;
 
11085
 
 
11086
    darwin* | rhapsody*)
 
11087
    if test "$GXX" = yes ; then
 
11088
      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
11089
      case "$host_os" in
 
11090
      rhapsody* | darwin1.[[012]])
 
11091
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
 
11092
        ;;
 
11093
      *) # Darwin 1.3 on
 
11094
        if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
 
11095
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
11096
        else
 
11097
          case ${MACOSX_DEPLOYMENT_TARGET} in
 
11098
            10.[012])
 
11099
              _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
 
11100
              ;;
 
11101
            10.*)
 
11102
              _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
 
11103
              ;;
 
11104
          esac
 
11105
        fi
 
11106
        ;;
 
11107
      esac
 
11108
        lt_int_apple_cc_single_mod=no
 
11109
        output_verbose_link_cmd='echo'
 
11110
        if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
 
11111
          lt_int_apple_cc_single_mod=yes
 
11112
        fi
 
11113
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
11114
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
 
11115
        else
 
11116
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
 
11117
      fi
 
11118
      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
 
11119
      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
11120
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
11121
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
11122
        else
 
11123
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
11124
        fi
 
11125
          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
11126
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
11127
      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
11128
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
11129
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
11130
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
11131
    else  
 
11132
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
11133
    fi  
 
11134
      ;;
 
11135
 
 
11136
    dgux*)
 
11137
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11138
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11139
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11140
      ;;
 
11141
 
 
11142
    freebsd1*)
 
11143
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
11144
      ;;
 
11145
 
 
11146
    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
 
11147
    # support.  Future versions do this automatically, but an explicit c++rt0.o
 
11148
    # does not break anything, and helps significantly (at the cost of a little
 
11149
    # extra space).
 
11150
    freebsd2.2*)
 
11151
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
 
11152
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
11153
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11154
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11155
      ;;
 
11156
 
 
11157
    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
 
11158
    freebsd2*)
 
11159
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
11160
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11161
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11162
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11163
      ;;
 
11164
 
 
11165
    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
 
11166
    freebsd*)
 
11167
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
 
11168
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
11169
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11170
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11171
      ;;
 
11172
 
 
11173
    hpux9*)
 
11174
      if test "$GCC" = yes; then
 
11175
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
11176
      else
 
11177
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
11178
      fi
 
11179
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
11180
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11181
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11182
 
 
11183
      # hardcode_minus_L: Not really in the search PATH,
 
11184
      # but as the default location of the library.
 
11185
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11186
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
11187
      ;;
 
11188
 
 
11189
    hpux10* | hpux11*)
 
11190
      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
 
11191
        case "$host_cpu" in
 
11192
        hppa*64*|ia64*)
 
11193
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
 
11194
          ;;
 
11195
        *)
 
11196
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
 
11197
          ;;
 
11198
        esac
 
11199
      else
 
11200
        case "$host_cpu" in
 
11201
        hppa*64*|ia64*)
 
11202
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11203
          ;;
 
11204
        *)
 
11205
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 
11206
          ;;
 
11207
        esac
 
11208
      fi
 
11209
      if test "$with_gnu_ld" = no; then
 
11210
        case "$host_cpu" in
 
11211
        hppa*64*)
 
11212
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
11213
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 
11214
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11215
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
11216
          _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11217
          ;;
 
11218
        ia64*)
 
11219
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11220
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
11221
          _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11222
 
 
11223
          # hardcode_minus_L: Not really in the search PATH,
 
11224
          # but as the default location of the library.
 
11225
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11226
          ;;
 
11227
        *)
 
11228
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
11229
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11230
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11231
          _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
11232
 
 
11233
          # hardcode_minus_L: Not really in the search PATH,
 
11234
          # but as the default location of the library.
 
11235
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11236
          ;;
 
11237
        esac
 
11238
      fi
 
11239
      ;;
 
11240
 
 
11241
    irix5* | irix6* | nonstopux*)
 
11242
      if test "$GCC" = yes; then
 
11243
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
11244
      else
 
11245
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
11246
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
 
11247
      fi
 
11248
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
11249
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11250
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
11251
      ;;
 
11252
 
 
11253
    netbsd*)
 
11254
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
11255
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
 
11256
      else
 
11257
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
 
11258
      fi
 
11259
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
11260
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11261
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11262
      ;;
 
11263
 
 
11264
    newsos6)
 
11265
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11266
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11267
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
11268
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11269
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11270
      ;;
 
11271
 
 
11272
    openbsd*)
 
11273
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11274
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11275
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
11276
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
 
11277
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
11278
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
11279
      else
 
11280
       case $host_os in
 
11281
         openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
 
11282
           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
11283
           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
11284
           ;;
 
11285
         *)
 
11286
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
 
11287
           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
11288
           ;;
 
11289
       esac
 
11290
      fi
 
11291
      ;;
 
11292
 
 
11293
    os2*)
 
11294
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11295
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11296
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
11297
      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
 
11298
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
 
11299
      ;;
 
11300
 
 
11301
    osf3*)
 
11302
      if test "$GCC" = yes; then
 
11303
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
11304
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
11305
      else
 
11306
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
11307
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
11308
      fi
 
11309
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
11310
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11311
      ;;
 
11312
 
 
11313
    osf4* | osf5*)      # as osf3* with the addition of -msym flag
 
11314
      if test "$GCC" = yes; then
 
11315
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
11316
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
11317
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
11318
      else
 
11319
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
11320
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
11321
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
 
11322
        $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
 
11323
 
 
11324
        # Both c and cxx compiler support -rpath directly
 
11325
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
11326
      fi
 
11327
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
11328
      ;;
 
11329
 
 
11330
    sco3.2v5*)
 
11331
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11332
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11333
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
 
11334
      runpath_var=LD_RUN_PATH
 
11335
      hardcode_runpath_var=yes
 
11336
      ;;
 
11337
 
 
11338
    solaris*)
 
11339
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
 
11340
      if test "$GCC" = yes; then
 
11341
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
 
11342
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
11343
          $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
 
11344
      else
 
11345
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11346
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
11347
        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
 
11348
      fi
 
11349
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
11350
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11351
      case $host_os in
 
11352
      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 
11353
      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
 
11354
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
 
11355
      esac
 
11356
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
11357
      ;;
 
11358
 
 
11359
    sunos4*)
 
11360
      if test "x$host_vendor" = xsequent; then
 
11361
        # Use $CC to link under sequent, because it throws in some extra .o
 
11362
        # files that make .init and .fini sections work.
 
11363
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
 
11364
      else
 
11365
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
 
11366
      fi
 
11367
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11368
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11369
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
11370
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11371
      ;;
 
11372
 
 
11373
    sysv4)
 
11374
      case $host_vendor in
 
11375
        sni)
 
11376
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11377
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
 
11378
        ;;
 
11379
        siemens)
 
11380
          ## LD is ld it makes a PLAMLIB
 
11381
          ## CC just makes a GrossModule.
 
11382
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
 
11383
          _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
 
11384
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
11385
        ;;
 
11386
        motorola)
 
11387
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11388
          _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
 
11389
        ;;
 
11390
      esac
 
11391
      runpath_var='LD_RUN_PATH'
 
11392
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11393
      ;;
 
11394
 
 
11395
    sysv4.3*)
 
11396
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11397
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11398
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
 
11399
      ;;
 
11400
 
 
11401
    sysv4*MP*)
 
11402
      if test -d /usr/nec; then
 
11403
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11404
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11405
        runpath_var=LD_RUN_PATH
 
11406
        hardcode_runpath_var=yes
 
11407
        _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
11408
      fi
 
11409
      ;;
 
11410
 
 
11411
    sysv4.2uw2*)
 
11412
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
 
11413
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
11414
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
11415
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11416
      hardcode_runpath_var=yes
 
11417
      runpath_var=LD_RUN_PATH
 
11418
      ;;
 
11419
 
 
11420
   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
 
11421
      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
 
11422
      if test "$GCC" = yes; then
 
11423
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
 
11424
      else
 
11425
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
 
11426
      fi
 
11427
      runpath_var='LD_RUN_PATH'
 
11428
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11429
      ;;
 
11430
 
 
11431
    sysv5*)
 
11432
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
 
11433
      # $CC -shared without GNU ld will not create a library from C++
 
11434
      # object files and a static libstdc++, better avoid it by now
 
11435
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11436
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
11437
                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
 
11438
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
11439
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11440
      runpath_var='LD_RUN_PATH'
 
11441
      ;;
 
11442
 
 
11443
    uts4*)
 
11444
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11445
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11446
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11447
      ;;
 
11448
 
 
11449
    *)
 
11450
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
11451
      ;;
 
11452
    esac
 
11453
  fi
 
11454
])
 
11455
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 
11456
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
11457
 
 
11458
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
 
11459
if test "$GCC" = yes; then
 
11460
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 
11461
fi
 
11462
 
 
11463
#
 
11464
# Do we need to explicitly link libc?
 
11465
#
 
11466
case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
 
11467
x|xyes)
 
11468
  # Assume -lc should be added
 
11469
  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
11470
 
 
11471
  if test "$enable_shared" = yes && test "$GCC" = yes; then
 
11472
    case $_LT_AC_TAGVAR(archive_cmds, $1) in
 
11473
    *'~'*)
 
11474
      # FIXME: we may have to deal with multi-command sequences.
 
11475
      ;;
 
11476
    '$CC '*)
 
11477
      # Test whether the compiler implicitly links with -lc since on some
 
11478
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
 
11479
      # to ld, don't add -lc before -lgcc.
 
11480
      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
 
11481
      $rm conftest*
 
11482
      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
11483
  
 
11484
      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
 
11485
        soname=conftest
 
11486
        lib=conftest
 
11487
        libobjs=conftest.$ac_objext
 
11488
        deplibs=
 
11489
        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
11490
        compiler_flags=-v
 
11491
        linker_flags=-v
 
11492
        verstring=
 
11493
        output_objdir=.
 
11494
        libname=conftest
 
11495
        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
 
11496
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
11497
        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
 
11498
        then
 
11499
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
11500
        else
 
11501
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
11502
        fi
 
11503
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
 
11504
      else
 
11505
        cat conftest.err 1>&5
 
11506
      fi
 
11507
      $rm conftest*
 
11508
      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
 
11509
      ;;
 
11510
    esac
 
11511
  fi
 
11512
  ;;
 
11513
esac
 
11514
])# AC_LIBTOOL_PROG_LD_SHLIBS
 
11515
 
 
11516
 
 
11517
# _LT_AC_FILE_LTDLL_C
 
11518
# -------------------
 
11519
# Be careful that the start marker always follows a newline.
 
11520
AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
 
11521
# /* ltdll.c starts here */
 
11522
# #define WIN32_LEAN_AND_MEAN
 
11523
# #include <windows.h>
 
11524
# #undef WIN32_LEAN_AND_MEAN
 
11525
# #include <stdio.h>
 
11526
#
 
11527
# #ifndef __CYGWIN__
 
11528
# #  ifdef __CYGWIN32__
 
11529
# #    define __CYGWIN__ __CYGWIN32__
 
11530
# #  endif
 
11531
# #endif
 
11532
#
 
11533
# #ifdef __cplusplus
 
11534
# extern "C" {
 
11535
# #endif
 
11536
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
 
11537
# #ifdef __cplusplus
 
11538
# }
 
11539
# #endif
 
11540
#
 
11541
# #ifdef __CYGWIN__
 
11542
# #include <cygwin/cygwin_dll.h>
 
11543
# DECLARE_CYGWIN_DLL( DllMain );
 
11544
# #endif
 
11545
# HINSTANCE __hDllInstance_base;
 
11546
#
 
11547
# BOOL APIENTRY
 
11548
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
 
11549
# {
 
11550
#   __hDllInstance_base = hInst;
 
11551
#   return TRUE;
 
11552
# }
 
11553
# /* ltdll.c ends here */
 
11554
])# _LT_AC_FILE_LTDLL_C
 
11555
 
 
11556
 
 
11557
# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
 
11558
# ---------------------------------
 
11559
AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
 
11560
 
 
11561
 
 
11562
# old names
 
11563
AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
 
11564
AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
 
11565
AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
 
11566
AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
 
11567
AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
 
11568
AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
 
11569
AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
 
11570
 
 
11571
# This is just to silence aclocal about the macro not being used
 
11572
ifelse([AC_DISABLE_FAST_INSTALL])
 
11573
 
 
11574
AC_DEFUN([LT_AC_PROG_GCJ],
 
11575
[AC_CHECK_TOOL(GCJ, gcj, no)
 
11576
  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
 
11577
  AC_SUBST(GCJFLAGS)
 
11578
])
 
11579
 
 
11580
AC_DEFUN([LT_AC_PROG_RC],
 
11581
[AC_CHECK_TOOL(RC, windres, no)
 
11582
])
 
11583
 
 
11584
############################################################
 
11585
# NOTE: This macro has been submitted for inclusion into   #
 
11586
#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
 
11587
#  a released version of Autoconf we should remove this    #
 
11588
#  macro and use it instead.                               #
 
11589
############################################################
 
11590
# LT_AC_PROG_SED
 
11591
# --------------
 
11592
# Check for a fully-functional sed program, that truncates
 
11593
# as few characters as possible.  Prefer GNU sed if found.
 
11594
AC_DEFUN([LT_AC_PROG_SED],
 
11595
[AC_MSG_CHECKING([for a sed that does not truncate output])
 
11596
AC_CACHE_VAL(lt_cv_path_SED,
 
11597
[# Loop through the user's path and test for sed and gsed.
 
11598
# Then use that list of sed's as ones to test for truncation.
 
11599
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
11600
for as_dir in $PATH
 
11601
do
 
11602
  IFS=$as_save_IFS
 
11603
  test -z "$as_dir" && as_dir=.
 
11604
  for lt_ac_prog in sed gsed; do
 
11605
    for ac_exec_ext in '' $ac_executable_extensions; do
 
11606
      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
 
11607
        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
 
11608
      fi
 
11609
    done
 
11610
  done
 
11611
done
 
11612
lt_ac_max=0
 
11613
lt_ac_count=0
 
11614
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
 
11615
# along with /bin/sed that truncates output.
 
11616
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
 
11617
  test ! -f $lt_ac_sed && break
 
11618
  cat /dev/null > conftest.in
 
11619
  lt_ac_count=0
 
11620
  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
 
11621
  # Check for GNU sed and select it if it is found.
 
11622
  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
 
11623
    lt_cv_path_SED=$lt_ac_sed
 
11624
    break
 
11625
  fi
 
11626
  while true; do
 
11627
    cat conftest.in conftest.in >conftest.tmp
 
11628
    mv conftest.tmp conftest.in
 
11629
    cp conftest.in conftest.nl
 
11630
    echo >>conftest.nl
 
11631
    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
 
11632
    cmp -s conftest.out conftest.nl || break
 
11633
    # 10000 chars as input seems more than enough
 
11634
    test $lt_ac_count -gt 10 && break
 
11635
    lt_ac_count=`expr $lt_ac_count + 1`
 
11636
    if test $lt_ac_count -gt $lt_ac_max; then
 
11637
      lt_ac_max=$lt_ac_count
 
11638
      lt_cv_path_SED=$lt_ac_sed
 
11639
    fi
 
11640
  done
 
11641
done
 
11642
])
 
11643
SED=$lt_cv_path_SED
 
11644
AC_MSG_RESULT([$SED])
 
11645
])
 
11646
 
 
11647
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 
11648
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
 
11649
dnl also defines GSTUFF_PKG_ERRORS on error
 
11650
AC_DEFUN([PKG_CHECK_MODULES], [
 
11651
  succeeded=no
 
11652
 
 
11653
  if test -z "$PKG_CONFIG"; then
 
11654
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
11655
  fi
 
11656
 
 
11657
  if test "$PKG_CONFIG" = "no" ; then
 
11658
     echo "*** The pkg-config script could not be found. Make sure it is"
 
11659
     echo "*** in your path, or set the PKG_CONFIG environment variable"
 
11660
     echo "*** to the full path to pkg-config."
 
11661
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
 
11662
  else
 
11663
     PKG_CONFIG_MIN_VERSION=0.9.0
 
11664
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 
11665
        AC_MSG_CHECKING(for $2)
 
11666
 
 
11667
        if $PKG_CONFIG --exists "$2" ; then
 
11668
            AC_MSG_RESULT(yes)
 
11669
            succeeded=yes
 
11670
 
 
11671
            AC_MSG_CHECKING($1_CFLAGS)
 
11672
            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
 
11673
            AC_MSG_RESULT($$1_CFLAGS)
 
11674
 
 
11675
            AC_MSG_CHECKING($1_LIBS)
 
11676
            $1_LIBS=`$PKG_CONFIG --libs "$2"`
 
11677
            AC_MSG_RESULT($$1_LIBS)
 
11678
        else
 
11679
            $1_CFLAGS=""
 
11680
            $1_LIBS=""
 
11681
            ## If we have a custom action on failure, don't print errors, but 
 
11682
            ## do set a variable so people can do so.
 
11683
            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
11684
            ifelse([$4], ,echo $$1_PKG_ERRORS,)
 
11685
        fi
 
11686
 
 
11687
        AC_SUBST($1_CFLAGS)
 
11688
        AC_SUBST($1_LIBS)
 
11689
     else
 
11690
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 
11691
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 
11692
     fi
 
11693
  fi
 
11694
 
 
11695
  if test $succeeded = yes; then
 
11696
     ifelse([$3], , :, [$3])
 
11697
  else
 
11698
     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
 
11699
  fi
 
11700
])
 
11701
 
 
11702