~ubuntu-branches/ubuntu/trusty/knemo/trusty

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-10 10:41:43 UTC
  • Revision ID: james.westby@ubuntu.com-20050310104143-jxxhltqsodat1iqs
Tags: upstream-0.3.1
ImportĀ upstreamĀ versionĀ 0.3.1

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(, [${x_direct_test_function}()],
 
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(programm-name, variable-name, list of directories,
 
177
dnl     if-not-found, test-parameter)
 
178
AC_DEFUN([KDE_FIND_PATH],
 
179
[
 
180
   AC_MSG_CHECKING([for $1])
 
181
   if test -n "$$2"; then
 
182
        kde_cv_path="$$2";
 
183
   else
 
184
        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
 
185
 
 
186
        AC_CACHE_VAL(kde_cv_path_$kde_cache,
 
187
        [
 
188
        kde_cv_path="NONE"
 
189
        dirs="$3"
 
190
        kde_save_IFS=$IFS
 
191
        IFS=':'
 
192
        for dir in $PATH; do
 
193
          dirs="$dirs $dir"
 
194
        done
 
195
        IFS=$kde_save_IFS
 
196
 
 
197
        for dir in $dirs; do
 
198
          if test -x "$dir/$1"; then
 
199
            if test -n "$5"
 
200
            then
 
201
              evalstr="$dir/$1 $5 2>&1 "
 
202
              if eval $evalstr; then
 
203
                kde_cv_path="$dir/$1"
 
204
                break
 
205
              fi
 
206
            else
 
207
                kde_cv_path="$dir/$1"
 
208
                break
 
209
            fi
 
210
          fi
 
211
        done
 
212
 
 
213
        eval "kde_cv_path_$kde_cache=$kde_cv_path"
 
214
 
 
215
        ])
 
216
 
 
217
      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
 
218
 
 
219
   fi
 
220
 
 
221
   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
 
222
      AC_MSG_RESULT(not found)
 
223
      $4
 
224
   else
 
225
      AC_MSG_RESULT($kde_cv_path)
 
226
      $2=$kde_cv_path
 
227
 
 
228
   fi
 
229
])
 
230
 
 
231
AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
 
232
[
 
233
    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
 
234
Please check whether you installed Qt correctly.
 
235
You need to have a running moc binary.
 
236
configure tried to run $ac_cv_path_moc and the test didn't
 
237
succeed. If configure shouldn't have tried this one, set
 
238
the environment variable MOC to the right one before running
 
239
configure.
 
240
])
 
241
])
 
242
 
 
243
AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
 
244
[
 
245
    AC_MSG_WARN([No Qt ui compiler (uic) found!
 
246
Please check whether you installed Qt correctly.
 
247
You need to have a running uic binary.
 
248
configure tried to run $ac_cv_path_uic and the test didn't
 
249
succeed. If configure shouldn't have tried this one, set
 
250
the environment variable UIC to the right one before running
 
251
configure.
 
252
])
 
253
])
 
254
 
 
255
 
 
256
AC_DEFUN([KDE_CHECK_UIC_FLAG],
 
257
[
 
258
    AC_MSG_CHECKING([whether uic supports -$1 ])
 
259
    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
 
260
    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
 
261
    [
 
262
        cat >conftest.ui <<EOT
 
263
        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
 
264
EOT
 
265
        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
 
266
        if AC_TRY_EVAL(ac_uic_testrun); then
 
267
            eval "kde_cv_prog_uic_$kde_cache=yes"
 
268
        else
 
269
            eval "kde_cv_prog_uic_$kde_cache=no"
 
270
        fi
 
271
        rm -f conftest*
 
272
    ])
 
273
 
 
274
    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
 
275
        AC_MSG_RESULT([yes])
 
276
        :
 
277
        $3
 
278
    else
 
279
        AC_MSG_RESULT([no])
 
280
        :
 
281
        $4
 
282
    fi
 
283
])
 
284
 
 
285
 
 
286
dnl ------------------------------------------------------------------------
 
287
dnl Find the meta object compiler and the ui compiler in the PATH,
 
288
dnl in $QTDIR/bin, and some more usual places
 
289
dnl ------------------------------------------------------------------------
 
290
dnl
 
291
AC_DEFUN([AC_PATH_QT_MOC_UIC],
 
292
[
 
293
   AC_REQUIRE([KDE_CHECK_PERL])
 
294
   qt_bindirs=""
 
295
   for dir in $kde_qt_dirs; do
 
296
      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
 
297
   done
 
298
   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
 
299
   if test ! "$ac_qt_bindir" = "NO"; then
 
300
      qt_bindirs="$ac_qt_bindir $qt_bindirs"
 
301
   fi
 
302
 
 
303
   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
 
304
   if test -z "$UIC_NOT_NEEDED"; then
 
305
     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
 
306
     if test -z "$UIC_PATH" ; then
 
307
       KDE_UIC_ERROR_MESSAGE
 
308
       exit 1
 
309
     else
 
310
       UIC=$UIC_PATH
 
311
 
 
312
       if test $kde_qtver = 3; then
 
313
         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
 
314
         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
 
315
 
 
316
         if test x$ac_uic_supports_libpath = xyes; then
 
317
             UIC="$UIC -L \$(kde_widgetdir)"
 
318
         fi
 
319
         if test x$ac_uic_supports_nounload = xyes; then
 
320
             UIC="$UIC -nounload"
 
321
         fi
 
322
       fi
 
323
     fi
 
324
   else
 
325
     UIC="echo uic not available: "
 
326
   fi
 
327
 
 
328
   AC_SUBST(MOC)
 
329
   AC_SUBST(UIC)
 
330
 
 
331
   UIC_TR="i18n"
 
332
   if test $kde_qtver = 3; then
 
333
     UIC_TR="tr2i18n"
 
334
   fi
 
335
 
 
336
   AC_SUBST(UIC_TR)
 
337
])
 
338
 
 
339
AC_DEFUN([KDE_1_CHECK_PATHS],
 
340
[
 
341
  KDE_1_CHECK_PATH_HEADERS
 
342
 
 
343
  KDE_TEST_RPATH=
 
344
 
 
345
  if test -n "$USE_RPATH"; then
 
346
 
 
347
     if test -n "$kde_libraries"; then
 
348
       KDE_TEST_RPATH="-R $kde_libraries"
 
349
     fi
 
350
 
 
351
     if test -n "$qt_libraries"; then
 
352
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
 
353
     fi
 
354
 
 
355
     if test -n "$x_libraries"; then
 
356
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
 
357
     fi
 
358
 
 
359
     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
 
360
  fi
 
361
 
 
362
AC_MSG_CHECKING([for KDE libraries installed])
 
363
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'
 
364
 
 
365
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
366
  AC_MSG_RESULT(yes)
 
367
else
 
368
  AC_MSG_ERROR([your system fails at linking a small KDE application!
 
369
Check, if your compiler is installed correctly and if you have used the
 
370
same compiler to compile Qt and kdelibs as you did use now.
 
371
For more details about this problem, look at the end of config.log.])
 
372
fi
 
373
 
 
374
if eval `KDEDIR= ./conftest 2>&5`; then
 
375
  kde_result=done
 
376
else
 
377
  kde_result=problems
 
378
fi
 
379
 
 
380
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
 
381
kde_have_all_paths=yes
 
382
 
 
383
KDE_SET_PATHS($kde_result)
 
384
 
 
385
])
 
386
 
 
387
AC_DEFUN([KDE_SET_PATHS],
 
388
[
 
389
  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
 
390
        kde_htmldir=\"$kde_htmldir\" \
 
391
        kde_appsdir=\"$kde_appsdir\" \
 
392
        kde_icondir=\"$kde_icondir\" \
 
393
        kde_sounddir=\"$kde_sounddir\" \
 
394
        kde_datadir=\"$kde_datadir\" \
 
395
        kde_locale=\"$kde_locale\" \
 
396
        kde_cgidir=\"$kde_cgidir\" \
 
397
        kde_confdir=\"$kde_confdir\" \
 
398
        kde_kcfgdir=\"$kde_kcfgdir\" \
 
399
        kde_mimedir=\"$kde_mimedir\" \
 
400
        kde_toolbardir=\"$kde_toolbardir\" \
 
401
        kde_wallpaperdir=\"$kde_wallpaperdir\" \
 
402
        kde_templatesdir=\"$kde_templatesdir\" \
 
403
        kde_bindir=\"$kde_bindir\" \
 
404
        kde_servicesdir=\"$kde_servicesdir\" \
 
405
        kde_servicetypesdir=\"$kde_servicetypesdir\" \
 
406
        kde_moduledir=\"$kde_moduledir\" \
 
407
        kde_styledir=\"$kde_styledir\" \
 
408
        kde_widgetdir=\"$kde_widgetdir\" \
 
409
        xdg_appsdir=\"$xdg_appsdir\" \
 
410
        xdg_menudir=\"$xdg_menudir\" \
 
411
        xdg_directorydir=\"$xdg_directorydir\" \
 
412
        kde_result=$1"
 
413
])
 
414
 
 
415
AC_DEFUN([KDE_SET_DEFAULT_PATHS],
 
416
[
 
417
if test "$1" = "default"; then
 
418
 
 
419
  if test -z "$kde_htmldir"; then
 
420
    kde_htmldir='\${datadir}/doc/HTML'
 
421
  fi
 
422
  if test -z "$kde_appsdir"; then
 
423
    kde_appsdir='\${datadir}/applnk'
 
424
  fi
 
425
  if test -z "$kde_icondir"; then
 
426
    kde_icondir='\${datadir}/icons'
 
427
  fi
 
428
  if test -z "$kde_sounddir"; then
 
429
    kde_sounddir='\${datadir}/sounds'
 
430
  fi
 
431
  if test -z "$kde_datadir"; then
 
432
    kde_datadir='\${datadir}/apps'
 
433
  fi
 
434
  if test -z "$kde_locale"; then
 
435
    kde_locale='\${datadir}/locale'
 
436
  fi
 
437
  if test -z "$kde_cgidir"; then
 
438
    kde_cgidir='\${exec_prefix}/cgi-bin'
 
439
  fi
 
440
  if test -z "$kde_confdir"; then
 
441
    kde_confdir='\${datadir}/config'
 
442
  fi
 
443
  if test -z "$kde_kcfgdir"; then
 
444
    kde_kcfgdir='\${datadir}/config.kcfg'
 
445
  fi
 
446
  if test -z "$kde_mimedir"; then
 
447
    kde_mimedir='\${datadir}/mimelnk'
 
448
  fi
 
449
  if test -z "$kde_toolbardir"; then
 
450
    kde_toolbardir='\${datadir}/toolbar'
 
451
  fi
 
452
  if test -z "$kde_wallpaperdir"; then
 
453
    kde_wallpaperdir='\${datadir}/wallpapers'
 
454
  fi
 
455
  if test -z "$kde_templatesdir"; then
 
456
    kde_templatesdir='\${datadir}/templates'
 
457
  fi
 
458
  if test -z "$kde_bindir"; then
 
459
    kde_bindir='\${exec_prefix}/bin'
 
460
  fi
 
461
  if test -z "$kde_servicesdir"; then
 
462
    kde_servicesdir='\${datadir}/services'
 
463
  fi
 
464
  if test -z "$kde_servicetypesdir"; then
 
465
    kde_servicetypesdir='\${datadir}/servicetypes'
 
466
  fi
 
467
  if test -z "$kde_moduledir"; then
 
468
    if test "$kde_qtver" = "2"; then
 
469
      kde_moduledir='\${libdir}/kde2'
 
470
    else
 
471
      kde_moduledir='\${libdir}/kde3'
 
472
    fi
 
473
  fi
 
474
  if test -z "$kde_styledir"; then
 
475
    kde_styledir='\${libdir}/kde3/plugins/styles'
 
476
  fi
 
477
  if test -z "$kde_widgetdir"; then
 
478
    kde_widgetdir='\${libdir}/kde3/plugins/designer'
 
479
  fi
 
480
  if test -z "$xdg_appsdir"; then
 
481
    xdg_appsdir='\${datadir}/applications/kde'
 
482
  fi
 
483
  if test -z "$xdg_menudir"; then
 
484
    xdg_menudir='\${sysconfdir}/xdg/menus'
 
485
  fi
 
486
  if test -z "$xdg_directorydir"; then
 
487
    xdg_directorydir='\${datadir}/desktop-directories'
 
488
  fi
 
489
 
 
490
  KDE_SET_PATHS(defaults)
 
491
 
 
492
else
 
493
 
 
494
  if test $kde_qtver = 1; then
 
495
     AC_MSG_RESULT([compiling])
 
496
     KDE_1_CHECK_PATHS
 
497
  else
 
498
     AC_MSG_ERROR([path checking not yet supported for KDE 2])
 
499
  fi
 
500
 
 
501
fi
 
502
])
 
503
 
 
504
AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
 
505
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
 
506
   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
 
507
   test -z "$kde_datadir" || test -z "$kde_locale"  ||
 
508
   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
 
509
   test -z "$kde_kcfgdir" ||
 
510
   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
 
511
   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
 
512
   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
 
513
   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
 
514
   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
 
515
   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
 
516
   test "x$kde_have_all_paths" != "xyes"; then
 
517
     kde_have_all_paths=no
 
518
  fi
 
519
])
 
520
 
 
521
AC_DEFUN([KDE_MISSING_PROG_ERROR],
 
522
[
 
523
    AC_MSG_ERROR([The important program $1 was not found!
 
524
Please check whether you installed KDE correctly.
 
525
])
 
526
])
 
527
 
 
528
AC_DEFUN([KDE_MISSING_ARTS_ERROR],
 
529
[
 
530
    AC_MSG_ERROR([The important program $1 was not found!
 
531
Please check whether you installed aRts correctly or use
 
532
--without-arts to compile without aRts support (this will remove functionality).
 
533
])
 
534
])
 
535
 
 
536
AC_DEFUN([KDE_SUBST_PROGRAMS],
 
537
[
 
538
    AC_ARG_WITH(arts,
 
539
        [  --without-arts          build without aRts [default=yes] ],
 
540
        [build_arts=$withval],
 
541
        [build_arts=yes]
 
542
    )
 
543
    AM_CONDITIONAL(include_ARTS, test "$build_arts" != "no")
 
544
 
 
545
        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"
 
546
        test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
 
547
        if test -n "$KDEDIRS"; then
 
548
           kde_save_IFS=$IFS
 
549
           IFS=:
 
550
           for dir in $KDEDIRS; do
 
551
                kde_default_bindirs="$dir/bin $kde_default_bindirs "
 
552
           done
 
553
           IFS=$kde_save_IFS
 
554
        fi
 
555
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
 
556
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
 
557
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
 
558
        if test "$build_arts" != "no"; then
 
559
          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
 
560
          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
 
561
        fi
 
562
        KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
 
563
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
 
564
 
 
565
        kde32ornewer=1
 
566
        if test "$kde_qtver" -lt 3; then
 
567
            kde32ornewer=
 
568
        else
 
569
            if test "$kde_qtver" = "3" && test "$kde_qtsubver" -le 1; then
 
570
                kde32ornewer=
 
571
            fi
 
572
        fi
 
573
 
 
574
        if test -n "$kde32ornewer"; then
 
575
            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
 
576
            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
 
577
        fi
 
578
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [XMLLINT=""])
 
579
 
 
580
        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
 
581
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
 
582
            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
 
583
            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
 
584
            if test "$KDE_XSL_STYLESHEET" = "NO"; then
 
585
                KDE_XSL_STYLESHEET=""
 
586
            else
 
587
                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
 
588
            fi
 
589
        fi
 
590
 
 
591
        DCOP_DEPENDENCIES='$(DCOPIDL)'
 
592
        if test -n "$kde32ornewer"; then
 
593
            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
 
594
            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
 
595
            AC_SUBST(KCONFIG_COMPILER)
 
596
            AC_SUBST(KCFG_DEPENDENCIES)
 
597
            AC_SUBST(DCOPIDLNG)
 
598
        fi
 
599
        AC_SUBST(DCOPIDL)
 
600
        AC_SUBST(DCOPIDL2CPP)
 
601
        AC_SUBST(DCOP_DEPENDENCIES)
 
602
        AC_SUBST(MCOPIDL)
 
603
        AC_SUBST(ARTSCCONFIG)
 
604
        AC_SUBST(KDECONFIG)
 
605
        AC_SUBST(MEINPROC)
 
606
        AC_SUBST(KDE_XSL_STYLESHEET)
 
607
        AC_SUBST(XMLLINT)
 
608
 
 
609
        if test -x "$KDECONFIG"; then # it can be "compiled"
 
610
          kde_libs_prefix=`$KDECONFIG --prefix`
 
611
          if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
 
612
               AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
 
613
                          This means it has been moved since you installed it.
 
614
                          This won't work. Please recompile kdelibs for the new prefix.
 
615
                          ])
 
616
           fi
 
617
           kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
 
618
        else
 
619
           kde_libs_prefix='$(prefix)'
 
620
           kde_libs_htmldir='$(kde_htmldir)'
 
621
        fi
 
622
        AC_SUBST(kde_libs_prefix)
 
623
        AC_SUBST(kde_libs_htmldir)
 
624
])dnl
 
625
 
 
626
AC_DEFUN([AC_CREATE_KFSSTND],
 
627
[
 
628
AC_REQUIRE([AC_CHECK_RPATH])
 
629
 
 
630
AC_MSG_CHECKING([for KDE paths])
 
631
kde_result=""
 
632
kde_cached_paths=yes
 
633
AC_CACHE_VAL(kde_cv_all_paths,
 
634
[
 
635
  KDE_SET_DEFAULT_PATHS($1)
 
636
  kde_cached_paths=no
 
637
])
 
638
eval "$kde_cv_all_paths"
 
639
KDE_CHECK_PATHS_FOR_COMPLETENESS
 
640
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
 
641
  # wrong values were cached, may be, we can set better ones
 
642
  kde_result=
 
643
  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
 
644
  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
 
645
  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
 
646
  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
 
647
  kde_have_all_paths=
 
648
  kde_styledir=
 
649
  kde_widgetdir=
 
650
  xdg_appsdir = xdg_menudir= xdg_directorydir= 
 
651
  KDE_SET_DEFAULT_PATHS($1)
 
652
  eval "$kde_cv_all_paths"
 
653
  KDE_CHECK_PATHS_FOR_COMPLETENESS
 
654
  kde_result="$kde_result (cache overridden)"
 
655
fi
 
656
if test "$kde_have_all_paths" = "no"; then
 
657
  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
 
658
Since it had compiled and linked before, it must be a strange problem on your system.
 
659
Look at config.log for details. If you are not able to fix this, look at
 
660
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
 
661
(If you're using an egcs version on Linux, you may update binutils!)
 
662
])
 
663
else
 
664
  rm -f conftest*
 
665
  AC_MSG_RESULT($kde_result)
 
666
fi
 
667
 
 
668
bindir=$kde_bindir
 
669
 
 
670
KDE_SUBST_PROGRAMS
 
671
 
 
672
])
 
673
 
 
674
AC_DEFUN([AC_SUBST_KFSSTND],
 
675
[
 
676
AC_SUBST(kde_htmldir)
 
677
AC_SUBST(kde_appsdir)
 
678
AC_SUBST(kde_icondir)
 
679
AC_SUBST(kde_sounddir)
 
680
AC_SUBST(kde_datadir)
 
681
AC_SUBST(kde_locale)
 
682
AC_SUBST(kde_confdir)
 
683
AC_SUBST(kde_kcfgdir)
 
684
AC_SUBST(kde_mimedir)
 
685
AC_SUBST(kde_wallpaperdir)
 
686
AC_SUBST(kde_bindir)
 
687
dnl X Desktop Group standards
 
688
AC_SUBST(xdg_appsdir)
 
689
AC_SUBST(xdg_menudir)
 
690
AC_SUBST(xdg_directorydir)
 
691
dnl for KDE 2
 
692
AC_SUBST(kde_templatesdir)
 
693
AC_SUBST(kde_servicesdir)
 
694
AC_SUBST(kde_servicetypesdir)
 
695
AC_SUBST(kde_moduledir)
 
696
AC_SUBST(kdeinitdir, '$(kde_moduledir)')
 
697
AC_SUBST(kde_styledir)
 
698
AC_SUBST(kde_widgetdir)
 
699
if test "$kde_qtver" = 1; then
 
700
  kde_minidir="$kde_icondir/mini"
 
701
else
 
702
# for KDE 1 - this breaks KDE2 apps using minidir, but
 
703
# that's the plan ;-/
 
704
  kde_minidir="/dev/null"
 
705
fi
 
706
dnl AC_SUBST(kde_minidir)
 
707
dnl AC_SUBST(kde_cgidir)
 
708
dnl AC_SUBST(kde_toolbardir)
 
709
])
 
710
 
 
711
AC_DEFUN([KDE_MISC_TESTS],
 
712
[
 
713
   dnl Checks for libraries.
 
714
   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
 
715
   AC_SUBST(LIBUTIL)
 
716
   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
 
717
   AC_SUBST(LIBCOMPAT)
 
718
   kde_have_crypt=
 
719
   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
 
720
      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
 
721
        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
 
722
You should install libcrypt from another source or configure with PAM
 
723
support])
 
724
        kde_have_crypt=no
 
725
      ]))
 
726
   AC_SUBST(LIBCRYPT)
 
727
   if test $kde_have_crypt = yes; then
 
728
      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
 
729
   fi
 
730
   AC_CHECK_SOCKLEN_T
 
731
   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
 
732
   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
 
733
      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
 
734
        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
 
735
   fi
 
736
   AC_CHECK_FUNC(inet_ntoa)
 
737
   if test $ac_cv_func_inet_ntoa = no; then
 
738
     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
 
739
   fi
 
740
   AC_CHECK_FUNC(connect)
 
741
   if test $ac_cv_func_connect = no; then
 
742
      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
 
743
        $X_EXTRA_LIBS)
 
744
   fi
 
745
 
 
746
   AC_CHECK_FUNC(remove)
 
747
   if test $ac_cv_func_remove = no; then
 
748
      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
 
749
   fi
 
750
 
 
751
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
 
752
   AC_CHECK_FUNC(shmat, ,
 
753
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
 
754
   
 
755
   # more headers that need to be explicitly included on darwin
 
756
   AC_CHECK_HEADERS(sys/types.h stdint.h)
 
757
 
 
758
   # darwin requires a poll emulation library
 
759
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
 
760
 
 
761
   # CoreAudio framework
 
762
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
 
763
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
 
764
     FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
 
765
   ])
 
766
 
 
767
   AC_CHECK_RES_INIT
 
768
   AC_SUBST(LIB_POLL)
 
769
   AC_SUBST(FRAMEWORK_COREAUDIO)
 
770
   LIBSOCKET="$X_EXTRA_LIBS"
 
771
   AC_SUBST(LIBSOCKET)
 
772
   AC_SUBST(X_EXTRA_LIBS)
 
773
   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
 
774
   AC_SUBST(LIBUCB)
 
775
 
 
776
   case $host in  dnl this *is* LynxOS specific
 
777
   *-*-lynxos* )
 
778
        AC_MSG_CHECKING([LynxOS header file wrappers])
 
779
        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
 
780
        AC_MSG_RESULT(disabled)
 
781
        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
 
782
         ;;
 
783
    esac
 
784
 
 
785
   KDE_CHECK_TYPES
 
786
   KDE_CHECK_LIBDL
 
787
   KDE_CHECK_STRLCPY
 
788
 
 
789
# darwin needs this to initialize the environment
 
790
AC_CHECK_HEADERS(crt_externs.h)
 
791
AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
 
792
 
 
793
AH_VERBATIM(_DARWIN_ENVIRON,
 
794
[
 
795
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
 
796
# include <sys/time.h>
 
797
# include <crt_externs.h>
 
798
# define environ (*_NSGetEnviron())
 
799
#endif
 
800
])
 
801
 
 
802
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
 
803
[
 
804
/*
 
805
 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
 
806
 * that defines bzero.
 
807
 */
 
808
 
 
809
#if defined(_AIX)
 
810
#include <strings.h>
 
811
#endif
 
812
])
 
813
 
 
814
AC_CHECK_FUNCS([vsnprintf snprintf])
 
815
 
 
816
AH_VERBATIM(_TRU64,[
 
817
/*
 
818
 * On HP-UX, the declaration of vsnprintf() is needed every time !
 
819
 */
 
820
 
 
821
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
 
822
#if __STDC__
 
823
#include <stdarg.h>
 
824
#include <stdlib.h>
 
825
#else
 
826
#include <varargs.h>
 
827
#endif
 
828
#ifdef __cplusplus
 
829
extern "C"
 
830
#endif
 
831
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
 
832
#ifdef __cplusplus
 
833
extern "C"
 
834
#endif
 
835
int snprintf(char *str, size_t n, char const *fmt, ...);
 
836
#endif
 
837
])
 
838
 
 
839
])
 
840
 
 
841
dnl ------------------------------------------------------------------------
 
842
dnl Find the header files and libraries for X-Windows. Extended the
 
843
dnl macro AC_PATH_X
 
844
dnl ------------------------------------------------------------------------
 
845
dnl
 
846
AC_DEFUN([K_PATH_X],
 
847
[
 
848
AC_REQUIRE([KDE_MISC_TESTS])dnl
 
849
AC_REQUIRE([KDE_CHECK_LIB64])
 
850
 
 
851
AC_ARG_ENABLE(
 
852
  embedded,
 
853
  [  --enable-embedded       link to Qt-embedded, don't use X],
 
854
  kde_use_qt_emb=$enableval,
 
855
  kde_use_qt_emb=no
 
856
)
 
857
 
 
858
AC_ARG_ENABLE(
 
859
  qtopia,
 
860
  [  --enable-qtopia         link to Qt-embedded, link to the Qtopia Environment],
 
861
  kde_use_qt_emb_palm=$enableval,
 
862
  kde_use_qt_emb_palm=no
 
863
)
 
864
 
 
865
AC_ARG_ENABLE(
 
866
  mac,
 
867
  [  --enable-mac            link to Qt/Mac (don't use X)],
 
868
  kde_use_qt_mac=$enableval,
 
869
  kde_use_qt_mac=no
 
870
)
 
871
 
 
872
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
 
873
 
 
874
AC_MSG_CHECKING(for X)
 
875
 
 
876
AC_CACHE_VAL(kde_cv_have_x,
 
877
[# One or both of the vars are not set, and there is no cached value.
 
878
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
 
879
   kde_x_includes=NO
 
880
else
 
881
   kde_x_includes=$x_includes
 
882
fi
 
883
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
 
884
   kde_x_libraries=NO
 
885
else
 
886
   kde_x_libraries=$x_libraries
 
887
fi
 
888
 
 
889
# below we use the standard autoconf calls
 
890
ac_x_libraries=$kde_x_libraries
 
891
ac_x_includes=$kde_x_includes
 
892
 
 
893
KDE_PATH_X_DIRECT
 
894
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
 
895
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
 
896
dnl location. The correct location is /usr/lib32 or an undefined value
 
897
dnl (the linker is smart enough to pick the correct default library).
 
898
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
 
899
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
 
900
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
 
901
dnl x_includes should be left alone.
 
902
case "$host" in
 
903
mips-sgi-irix6*)
 
904
  ;;
 
905
*-*-solaris*)
 
906
  ;;
 
907
*)
 
908
  _AC_PATH_X_XMKMF
 
909
  if test -z "$ac_x_includes"; then
 
910
    ac_x_includes="."
 
911
  fi
 
912
  if test -z "$ac_x_libraries"; then
 
913
    ac_x_libraries="/usr/lib${kdelibsuff}"
 
914
  fi
 
915
esac
 
916
#from now on we use our own again
 
917
 
 
918
# when the user already gave --x-includes, we ignore
 
919
# what the standard autoconf macros told us.
 
920
if test "$kde_x_includes" = NO; then
 
921
  kde_x_includes=$ac_x_includes
 
922
fi
 
923
 
 
924
# for --x-libraries too
 
925
if test "$kde_x_libraries" = NO; then
 
926
  kde_x_libraries=$ac_x_libraries
 
927
fi
 
928
 
 
929
if test "$kde_x_includes" = NO; then
 
930
  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
 
931
fi
 
932
 
 
933
if test "$kde_x_libraries" = NO; then
 
934
  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
 
935
fi
 
936
 
 
937
# Record where we found X for the cache.
 
938
kde_cv_have_x="have_x=yes \
 
939
         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
 
940
])dnl
 
941
 
 
942
eval "$kde_cv_have_x"
 
943
 
 
944
if test "$have_x" != yes; then
 
945
  AC_MSG_RESULT($have_x)
 
946
  no_x=yes
 
947
else
 
948
  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
 
949
fi
 
950
 
 
951
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
 
952
  X_INCLUDES=""
 
953
  x_includes="."; dnl better than nothing :-
 
954
 else
 
955
  x_includes=$kde_x_includes
 
956
  X_INCLUDES="-I$x_includes"
 
957
fi
 
958
 
 
959
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
 
960
  X_LDFLAGS=""
 
961
  x_libraries="/usr/lib"; dnl better than nothing :-
 
962
 else
 
963
  x_libraries=$kde_x_libraries
 
964
  X_LDFLAGS="-L$x_libraries"
 
965
fi
 
966
all_includes="$X_INCLUDES"
 
967
all_libraries="$X_LDFLAGS"
 
968
 
 
969
# Check for libraries that X11R6 Xt/Xaw programs need.
 
970
ac_save_LDFLAGS="$LDFLAGS"
 
971
LDFLAGS="$LDFLAGS $X_LDFLAGS"
 
972
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
 
973
# check for ICE first), but we must link in the order -lSM -lICE or
 
974
# we get undefined symbols.  So assume we have SM if we have ICE.
 
975
# These have to be linked with before -lX11, unlike the other
 
976
# libraries we check for below, so use a different variable.
 
977
#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
 
978
AC_CHECK_LIB(ICE, IceConnectionNumber,
 
979
  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
 
980
LDFLAGS="$ac_save_LDFLAGS"
 
981
 
 
982
LIB_X11='-lX11 $(LIBSOCKET)'
 
983
 
 
984
AC_MSG_CHECKING(for libXext)
 
985
AC_CACHE_VAL(kde_cv_have_libXext,
 
986
[
 
987
kde_ldflags_safe="$LDFLAGS"
 
988
kde_libs_safe="$LIBS"
 
989
 
 
990
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
 
991
LIBS="-lXext -lX11 $LIBSOCKET"
 
992
 
 
993
AC_TRY_LINK([
 
994
#include <stdio.h>
 
995
#ifdef STDC_HEADERS
 
996
# include <stdlib.h>
 
997
#endif
 
998
],
 
999
[
 
1000
printf("hello Xext\n");
 
1001
],
 
1002
kde_cv_have_libXext=yes,
 
1003
kde_cv_have_libXext=no
 
1004
)
 
1005
 
 
1006
LDFLAGS=$kde_ldflags_safe
 
1007
LIBS=$kde_libs_safe
 
1008
])
 
1009
 
 
1010
AC_MSG_RESULT($kde_cv_have_libXext)
 
1011
 
 
1012
if test "$kde_cv_have_libXext" = "no"; then
 
1013
  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
 
1014
can't find it itself, we stop here assuming that make wouldn't find
 
1015
them either.])
 
1016
fi
 
1017
 
 
1018
LIB_XEXT="-lXext"
 
1019
QTE_NORTTI=""
 
1020
 
 
1021
elif test "$kde_use_qt_emb" = "yes"; then
 
1022
  dnl We're using QT Embedded
 
1023
  CPPFLAGS=-DQWS
 
1024
  CXXFLAGS="$CXXFLAGS -fno-rtti"
 
1025
  QTE_NORTTI="-fno-rtti -DQWS"
 
1026
  X_PRE_LIBS=""
 
1027
  LIB_X11=""
 
1028
  LIB_XEXT=""
 
1029
  LIB_XRENDER=""
 
1030
  LIBSM=""
 
1031
  X_INCLUDES=""
 
1032
  X_LDFLAGS=""
 
1033
  x_includes=""
 
1034
  x_libraries=""
 
1035
elif test "$kde_use_qt_mac" = "yes"; then
 
1036
  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
 
1037
  dnl be included to get the information) --Sam
 
1038
  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
 
1039
  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
 
1040
  X_PRE_LIBS=""
 
1041
  LIB_X11=""
 
1042
  LIB_XEXT=""
 
1043
  LIB_XRENDER=""
 
1044
  LIBSM=""
 
1045
  X_INCLUDES=""
 
1046
  X_LDFLAGS=""
 
1047
  x_includes=""
 
1048
  x_libraries=""
 
1049
fi
 
1050
AC_SUBST(X_PRE_LIBS)
 
1051
AC_SUBST(LIB_X11)
 
1052
AC_SUBST(LIB_XRENDER)
 
1053
AC_SUBST(LIBSM)
 
1054
AC_SUBST(X_INCLUDES)
 
1055
AC_SUBST(X_LDFLAGS)
 
1056
AC_SUBST(x_includes)
 
1057
AC_SUBST(x_libraries)
 
1058
AC_SUBST(QTE_NORTTI)
 
1059
AC_SUBST(LIB_XEXT)
 
1060
 
 
1061
])
 
1062
 
 
1063
AC_DEFUN([KDE_PRINT_QT_PROGRAM],
 
1064
[
 
1065
AC_REQUIRE([KDE_USE_QT])
 
1066
cat > conftest.$ac_ext <<EOF
 
1067
#include "confdefs.h"
 
1068
#include <qglobal.h>
 
1069
#include <qapplication.h>
 
1070
EOF
 
1071
if test "$kde_qtver" = "2"; then
 
1072
cat >> conftest.$ac_ext <<EOF
 
1073
#include <qevent.h>
 
1074
#include <qstring.h>
 
1075
#include <qstyle.h>
 
1076
EOF
 
1077
 
 
1078
if test $kde_qtsubver -gt 0; then
 
1079
cat >> conftest.$ac_ext <<EOF
 
1080
#if QT_VERSION < 210
 
1081
#error 1
 
1082
#endif
 
1083
EOF
 
1084
fi
 
1085
fi
 
1086
 
 
1087
if test "$kde_qtver" = "3"; then
 
1088
cat >> conftest.$ac_ext <<EOF
 
1089
#include <qcursor.h>
 
1090
#include <qstylefactory.h>
 
1091
#include <private/qucomextra_p.h>
 
1092
EOF
 
1093
fi
 
1094
 
 
1095
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
 
1096
cat >> conftest.$ac_ext <<EOF
 
1097
#error 1
 
1098
#endif
 
1099
 
 
1100
int main() {
 
1101
EOF
 
1102
if test "$kde_qtver" = "2"; then
 
1103
cat >> conftest.$ac_ext <<EOF
 
1104
    QStringList *t = new QStringList();
 
1105
    Q_UNUSED(t);
 
1106
EOF
 
1107
if test $kde_qtsubver -gt 0; then
 
1108
cat >> conftest.$ac_ext <<EOF
 
1109
    QString s;
 
1110
    s.setLatin1("Elvis is alive", 14);
 
1111
EOF
 
1112
fi
 
1113
fi
 
1114
if test "$kde_qtver" = "3"; then
 
1115
cat >> conftest.$ac_ext <<EOF
 
1116
    (void)QStyleFactory::create(QString::null);
 
1117
    QCursor c(Qt::WhatsThisCursor);
 
1118
EOF
 
1119
fi
 
1120
cat >> conftest.$ac_ext <<EOF
 
1121
    return 0;
 
1122
}
 
1123
EOF
 
1124
])
 
1125
 
 
1126
AC_DEFUN([KDE_USE_QT],
 
1127
[
 
1128
if test -z "$1"; then
 
1129
  # Current default Qt version: 3.2
 
1130
  kde_qtver=3
 
1131
  kde_qtsubver=2
 
1132
else
 
1133
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
 
1134
  # following is the check if subversion isnt found in passed argument
 
1135
  if test "$kde_qtsubver" = "$1"; then
 
1136
    kde_qtsubver=1
 
1137
  fi
 
1138
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
 
1139
  if test "$kde_qtver" = "1"; then
 
1140
    kde_qtsubver=42
 
1141
  fi
 
1142
fi
 
1143
 
 
1144
if test -z "$2"; then
 
1145
  if test "$kde_qtver" = "2"; then
 
1146
    if test $kde_qtsubver -gt 0; then
 
1147
      kde_qt_minversion=">= Qt 2.2.2"
 
1148
    else
 
1149
      kde_qt_minversion=">= Qt 2.0.2"
 
1150
    fi
 
1151
  fi
 
1152
  if test "$kde_qtver" = "3"; then
 
1153
    if test $kde_qtsubver -gt 0; then
 
1154
         if test $kde_qtsubver -gt 1; then
 
1155
            kde_qt_minversion=">= Qt 3.2"
 
1156
         else
 
1157
            kde_qt_minversion=">= Qt 3.1 (20021021)"
 
1158
         fi
 
1159
    else
 
1160
      kde_qt_minversion=">= Qt 3.0"
 
1161
    fi
 
1162
  fi
 
1163
  if test "$kde_qtver" = "1"; then
 
1164
    kde_qt_minversion=">= 1.42 and < 2.0"
 
1165
  fi
 
1166
else
 
1167
   kde_qt_minversion=$2
 
1168
fi
 
1169
 
 
1170
if test -z "$3"; then
 
1171
   if test $kde_qtver = 3; then
 
1172
     if test $kde_qtsubver -gt 0; then
 
1173
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
 
1174
       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
 
1175
       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
 
1176
     else
 
1177
       kde_qt_verstring="QT_VERSION >= 300"
 
1178
     fi
 
1179
   fi
 
1180
   if test $kde_qtver = 2; then
 
1181
     if test $kde_qtsubver -gt 0; then
 
1182
       kde_qt_verstring="QT_VERSION >= 222"
 
1183
     else
 
1184
       kde_qt_verstring="QT_VERSION >= 200"
 
1185
     fi
 
1186
   fi
 
1187
   if test $kde_qtver = 1; then
 
1188
    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
 
1189
   fi
 
1190
else
 
1191
   kde_qt_verstring=$3
 
1192
fi
 
1193
 
 
1194
if test $kde_qtver = 3; then
 
1195
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
 
1196
fi
 
1197
if test $kde_qtver = 2; then
 
1198
   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
 
1199
fi
 
1200
if test $kde_qtver = 1; then
 
1201
   kde_qt_dirs="$QTDIR /usr/lib/qt"
 
1202
fi
 
1203
])
 
1204
 
 
1205
AC_DEFUN([KDE_CHECK_QT_DIRECT],
 
1206
[
 
1207
AC_REQUIRE([KDE_USE_QT])
 
1208
AC_MSG_CHECKING([if Qt compiles without flags])
 
1209
AC_CACHE_VAL(kde_cv_qt_direct,
 
1210
[
 
1211
AC_LANG_SAVE
 
1212
AC_LANG_CPLUSPLUS
 
1213
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
 
1214
ac_LIBRARY_PATH="$LIBRARY_PATH"
 
1215
ac_cxxflags_safe="$CXXFLAGS"
 
1216
ac_ldflags_safe="$LDFLAGS"
 
1217
ac_libs_safe="$LIBS"
 
1218
 
 
1219
CXXFLAGS="$CXXFLAGS -I$qt_includes"
 
1220
LDFLAGS="$LDFLAGS $X_LDFLAGS"
 
1221
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1222
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
 
1223
else
 
1224
LIBS="$LIBQT $LIBSOCKET"
 
1225
fi
 
1226
LD_LIBRARY_PATH=
 
1227
export LD_LIBRARY_PATH
 
1228
LIBRARY_PATH=
 
1229
export LIBRARY_PATH
 
1230
 
 
1231
KDE_PRINT_QT_PROGRAM
 
1232
 
 
1233
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
1234
  kde_cv_qt_direct="yes"
 
1235
else
 
1236
  kde_cv_qt_direct="no"
 
1237
  echo "configure: failed program was:" >&AC_FD_CC
 
1238
  cat conftest.$ac_ext >&AC_FD_CC
 
1239
fi
 
1240
 
 
1241
rm -f conftest*
 
1242
CXXFLAGS="$ac_cxxflags_safe"
 
1243
LDFLAGS="$ac_ldflags_safe"
 
1244
LIBS="$ac_libs_safe"
 
1245
 
 
1246
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
 
1247
export LD_LIBRARY_PATH
 
1248
LIBRARY_PATH="$ac_LIBRARY_PATH"
 
1249
export LIBRARY_PATH
 
1250
AC_LANG_RESTORE
 
1251
])
 
1252
 
 
1253
if test "$kde_cv_qt_direct" = "yes"; then
 
1254
  AC_MSG_RESULT(yes)
 
1255
  $1
 
1256
else
 
1257
  AC_MSG_RESULT(no)
 
1258
  $2
 
1259
fi
 
1260
])
 
1261
 
 
1262
dnl ------------------------------------------------------------------------
 
1263
dnl Try to find the Qt headers and libraries.
 
1264
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
 
1265
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
 
1266
dnl ------------------------------------------------------------------------
 
1267
dnl
 
1268
AC_DEFUN([AC_PATH_QT_1_3],
 
1269
[
 
1270
AC_REQUIRE([K_PATH_X])
 
1271
AC_REQUIRE([KDE_USE_QT])
 
1272
AC_REQUIRE([KDE_CHECK_LIB64])
 
1273
 
 
1274
dnl ------------------------------------------------------------------------
 
1275
dnl Add configure flag to enable linking to MT version of Qt library.
 
1276
dnl ------------------------------------------------------------------------
 
1277
 
 
1278
AC_ARG_ENABLE(
 
1279
  mt,
 
1280
  [  --disable-mt            link to non-threaded Qt (deprecated)],
 
1281
  kde_use_qt_mt=$enableval,
 
1282
  [
 
1283
    if test $kde_qtver = 3; then
 
1284
      kde_use_qt_mt=yes
 
1285
    else
 
1286
      kde_use_qt_mt=no
 
1287
    fi
 
1288
  ]
 
1289
)
 
1290
 
 
1291
USING_QT_MT=""
 
1292
 
 
1293
dnl ------------------------------------------------------------------------
 
1294
dnl If we not get --disable-qt-mt then adjust some vars for the host.
 
1295
dnl ------------------------------------------------------------------------
 
1296
 
 
1297
KDE_MT_LDFLAGS=
 
1298
KDE_MT_LIBS=
 
1299
if test "x$kde_use_qt_mt" = "xyes"; then
 
1300
  KDE_CHECK_THREADING
 
1301
  if test "x$kde_use_threading" = "xyes"; then
 
1302
    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
 
1303
    KDE_MT_LDFLAGS="$USE_THREADS"
 
1304
    KDE_MT_LIBS="$LIBPTHREAD"
 
1305
  else
 
1306
    kde_use_qt_mt=no
 
1307
  fi
 
1308
fi
 
1309
AC_SUBST(KDE_MT_LDFLAGS)
 
1310
AC_SUBST(KDE_MT_LIBS)
 
1311
 
 
1312
kde_qt_was_given=yes
 
1313
 
 
1314
dnl ------------------------------------------------------------------------
 
1315
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
 
1316
dnl ------------------------------------------------------------------------
 
1317
if test -z "$LIBQT_GLOB"; then
 
1318
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1319
    LIBQT_GLOB="libqte.*"
 
1320
  else
 
1321
    LIBQT_GLOB="libqt.*"
 
1322
  fi
 
1323
fi
 
1324
 
 
1325
if test -z "$LIBQT"; then
 
1326
dnl ------------------------------------------------------------
 
1327
dnl If we got --enable-embedded then adjust the Qt library name.
 
1328
dnl ------------------------------------------------------------
 
1329
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1330
    qtlib="qte"
 
1331
  else
 
1332
    qtlib="qt"
 
1333
  fi
 
1334
 
 
1335
  kde_int_qt="-l$qtlib"
 
1336
else
 
1337
  kde_int_qt="$LIBQT"
 
1338
  kde_lib_qt_set=yes
 
1339
fi
 
1340
 
 
1341
if test -z "$LIBQPE"; then
 
1342
dnl ------------------------------------------------------------
 
1343
dnl If we got --enable-palmtop then add -lqpe to the link line
 
1344
dnl ------------------------------------------------------------
 
1345
  if test "x$kde_use_qt_emb" = "xyes"; then
 
1346
    if test "x$kde_use_qt_emb_palm" = "xyes"; then
 
1347
      LIB_QPE="-lqpe"
 
1348
    else
 
1349
      LIB_QPE=""
 
1350
    fi
 
1351
  else
 
1352
    LIB_QPE=""
 
1353
  fi
 
1354
fi
 
1355
 
 
1356
dnl ------------------------------------------------------------------------
 
1357
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
 
1358
dnl ------------------------------------------------------------------------
 
1359
 
 
1360
if test "x$kde_use_qt_mt" = "xyes"; then
 
1361
  if test -z "$LIBQT"; then
 
1362
    LIBQT="-l$qtlib-mt"
 
1363
    kde_int_qt="-l$qtlib-mt"
 
1364
  else
 
1365
    LIBQT="$qtlib-mt"
 
1366
    kde_int_qt="$qtlib-mt"
 
1367
  fi
 
1368
  LIBQT_GLOB="lib$qtlib-mt.*"
 
1369
  USING_QT_MT="using -mt"
 
1370
else
 
1371
  LIBQT="-l$qtlib"
 
1372
fi
 
1373
 
 
1374
if test $kde_qtver != 1; then
 
1375
 
 
1376
  AC_REQUIRE([AC_FIND_PNG])
 
1377
  AC_REQUIRE([AC_FIND_JPEG])
 
1378
  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
 
1379
fi
 
1380
 
 
1381
if test $kde_qtver = 3; then
 
1382
  AC_REQUIRE([KDE_CHECK_LIBDL])
 
1383
  LIBQT="$LIBQT $LIBDL"
 
1384
fi
 
1385
 
 
1386
AC_MSG_CHECKING([for Qt])
 
1387
 
 
1388
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1389
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
 
1390
fi
 
1391
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
 
1392
qt_libraries=""
 
1393
qt_includes=""
 
1394
AC_ARG_WITH(qt-dir,
 
1395
    [  --with-qt-dir=DIR       where the root of Qt is installed ],
 
1396
    [  ac_qt_includes="$withval"/include
 
1397
       ac_qt_libraries="$withval"/lib${kdelibsuff}
 
1398
       ac_qt_bindir="$withval"/bin
 
1399
    ])
 
1400
 
 
1401
AC_ARG_WITH(qt-includes,
 
1402
    [  --with-qt-includes=DIR  where the Qt includes are. ],
 
1403
    [
 
1404
       ac_qt_includes="$withval"
 
1405
    ])
 
1406
 
 
1407
kde_qt_libs_given=no
 
1408
 
 
1409
AC_ARG_WITH(qt-libraries,
 
1410
    [  --with-qt-libraries=DIR where the Qt library is installed.],
 
1411
    [  ac_qt_libraries="$withval"
 
1412
       kde_qt_libs_given=yes
 
1413
    ])
 
1414
 
 
1415
AC_CACHE_VAL(ac_cv_have_qt,
 
1416
[#try to guess Qt locations
 
1417
 
 
1418
qt_incdirs=""
 
1419
for dir in $kde_qt_dirs; do
 
1420
   qt_incdirs="$qt_incdirs $dir/include $dir"
 
1421
done
 
1422
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"
 
1423
if test ! "$ac_qt_includes" = "NO"; then
 
1424
   qt_incdirs="$ac_qt_includes $qt_incdirs"
 
1425
fi
 
1426
 
 
1427
if test "$kde_qtver" != "1"; then
 
1428
  kde_qt_header=qstyle.h
 
1429
else
 
1430
  kde_qt_header=qglobal.h
 
1431
fi
 
1432
 
 
1433
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
 
1434
ac_qt_includes="$qt_incdir"
 
1435
 
 
1436
qt_libdirs=""
 
1437
for dir in $kde_qt_dirs; do
 
1438
   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
 
1439
done
 
1440
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
 
1441
if test ! "$ac_qt_libraries" = "NO"; then
 
1442
  qt_libdir=$ac_qt_libraries
 
1443
else
 
1444
  qt_libdirs="$ac_qt_libraries $qt_libdirs"
 
1445
  # if the Qt was given, the chance is too big that libqt.* doesn't exist
 
1446
  qt_libdir=NONE
 
1447
  for dir in $qt_libdirs; do
 
1448
    try="ls -1 $dir/${LIBQT_GLOB}"
 
1449
    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
1450
  done
 
1451
fi
 
1452
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
 
1453
  if test -e "$a"; then
 
1454
    LIBQT="$LIBQT ${kde_int_qt}_incremental"
 
1455
    break
 
1456
  fi
 
1457
done
 
1458
 
 
1459
ac_qt_libraries="$qt_libdir"
 
1460
 
 
1461
AC_LANG_SAVE
 
1462
AC_LANG_CPLUSPLUS
 
1463
 
 
1464
ac_cxxflags_safe="$CXXFLAGS"
 
1465
ac_ldflags_safe="$LDFLAGS"
 
1466
ac_libs_safe="$LIBS"
 
1467
 
 
1468
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
 
1469
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
 
1470
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
 
1471
 
 
1472
KDE_PRINT_QT_PROGRAM
 
1473
 
 
1474
if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
1475
  rm -f conftest*
 
1476
else
 
1477
  echo "configure: failed program was:" >&AC_FD_CC
 
1478
  cat conftest.$ac_ext >&AC_FD_CC
 
1479
  ac_qt_libraries="NO"
 
1480
fi
 
1481
rm -f conftest*
 
1482
CXXFLAGS="$ac_cxxflags_safe"
 
1483
LDFLAGS="$ac_ldflags_safe"
 
1484
LIBS="$ac_libs_safe"
 
1485
 
 
1486
AC_LANG_RESTORE
 
1487
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
 
1488
  ac_cv_have_qt="have_qt=no"
 
1489
  ac_qt_notfound=""
 
1490
  missing_qt_mt=""
 
1491
  if test "$ac_qt_includes" = NO; then
 
1492
    if test "$ac_qt_libraries" = NO; then
 
1493
      ac_qt_notfound="(headers and libraries)";
 
1494
    else
 
1495
      ac_qt_notfound="(headers)";
 
1496
    fi
 
1497
  else
 
1498
    if test "x$kde_use_qt_mt" = "xyes"; then
 
1499
       missing_qt_mt="
 
1500
Make sure that you have compiled Qt with thread support!"
 
1501
       ac_qt_notfound="(library $qtlib-mt)";
 
1502
    else
 
1503
       ac_qt_notfound="(library $qtlib)";
 
1504
    fi
 
1505
  fi
 
1506
 
 
1507
  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
 
1508
For more details about this problem, look at the end of config.log.$missing_qt_mt])
 
1509
else
 
1510
  have_qt="yes"
 
1511
fi
 
1512
])
 
1513
 
 
1514
eval "$ac_cv_have_qt"
 
1515
 
 
1516
if test "$have_qt" != yes; then
 
1517
  AC_MSG_RESULT([$have_qt]);
 
1518
else
 
1519
  ac_cv_have_qt="have_qt=yes \
 
1520
    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
 
1521
  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
 
1522
 
 
1523
  qt_libraries="$ac_qt_libraries"
 
1524
  qt_includes="$ac_qt_includes"
 
1525
fi
 
1526
 
 
1527
if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
 
1528
     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
 
1529
fi
 
1530
 
 
1531
AC_SUBST(qt_libraries)
 
1532
AC_SUBST(qt_includes)
 
1533
 
 
1534
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
 
1535
 QT_INCLUDES=""
 
1536
else
 
1537
 QT_INCLUDES="-I$qt_includes"
 
1538
 all_includes="$QT_INCLUDES $all_includes"
 
1539
fi
 
1540
 
 
1541
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
 
1542
 QT_LDFLAGS=""
 
1543
else
 
1544
 QT_LDFLAGS="-L$qt_libraries"
 
1545
 all_libraries="$all_libraries $QT_LDFLAGS"
 
1546
fi
 
1547
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
 
1548
 
 
1549
AC_SUBST(QT_INCLUDES)
 
1550
AC_SUBST(QT_LDFLAGS)
 
1551
AC_PATH_QT_MOC_UIC
 
1552
 
 
1553
KDE_CHECK_QT_JPEG
 
1554
 
 
1555
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
1556
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
 
1557
else
 
1558
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
 
1559
fi
 
1560
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
 
1561
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
 
1562
  if test -e "$a"; then
 
1563
     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
 
1564
     break
 
1565
  fi
 
1566
done
 
1567
 
 
1568
AC_SUBST(LIB_QT)
 
1569
AC_SUBST(LIB_QPE)
 
1570
 
 
1571
AC_SUBST(kde_qtver)
 
1572
])
 
1573
 
 
1574
AC_DEFUN([AC_PATH_QT],
 
1575
[
 
1576
AC_PATH_QT_1_3
 
1577
])
 
1578
 
 
1579
AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
 
1580
[
 
1581
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
 
1582
 
 
1583
if test x$ac_uic_supports_libpath = xyes; then
 
1584
 
 
1585
AC_MSG_CHECKING([if UIC has KDE plugins available])
 
1586
AC_CACHE_VAL(kde_cv_uic_plugins,
 
1587
[
 
1588
cat > actest.ui << EOF
 
1589
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
 
1590
<class>NewConnectionDialog</class>
 
1591
<widget class="QDialog">
 
1592
   <widget class="KLineEdit">
 
1593
        <property name="name">
 
1594
           <cstring>testInput</cstring>
 
1595
        </property>
 
1596
   </widget>
 
1597
</widget>
 
1598
</UI>
 
1599
EOF
 
1600
       
 
1601
 
 
1602
 
 
1603
kde_cv_uic_plugins=no
 
1604
kde_line="$UIC_PATH -L $kde_widgetdir"
 
1605
if test x$ac_uic_supports_nounload = xyes; then
 
1606
   kde_line="$kde_line -nounload"
 
1607
fi
 
1608
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
 
1609
if AC_TRY_EVAL(kde_line); then
 
1610
        # if you're trying to debug this check and think it's incorrect,
 
1611
        # better check your installation. The check _is_ correct - your
 
1612
        # installation is not.
 
1613
        if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
 
1614
                kde_cv_uic_plugins=yes
 
1615
        fi
 
1616
fi
 
1617
rm -f actest.ui actest.cpp
 
1618
])
 
1619
 
 
1620
AC_MSG_RESULT([$kde_cv_uic_plugins])
 
1621
if test "$kde_cv_uic_plugins" != yes; then
 
1622
        AC_MSG_ERROR([you need to install kdelibs first.])
 
1623
fi
 
1624
fi
 
1625
])
 
1626
 
 
1627
AC_DEFUN([KDE_CHECK_FINAL],
 
1628
[
 
1629
  AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
 
1630
        kde_use_final=$enableval, kde_use_final=no)
 
1631
 
 
1632
  if test "x$kde_use_final" = "xyes"; then
 
1633
      KDE_USE_FINAL_TRUE=""
 
1634
      KDE_USE_FINAL_FALSE="#"
 
1635
   else
 
1636
      KDE_USE_FINAL_TRUE="#"
 
1637
      KDE_USE_FINAL_FALSE=""
 
1638
  fi
 
1639
  AC_SUBST(KDE_USE_FINAL_TRUE)
 
1640
  AC_SUBST(KDE_USE_FINAL_FALSE)
 
1641
])
 
1642
 
 
1643
AC_DEFUN([KDE_CHECK_CLOSURE],
 
1644
[
 
1645
  AC_ARG_ENABLE(closure, [  --enable-closure        delay template instantiation],
 
1646
        kde_use_closure=$enableval, kde_use_closure=no)
 
1647
 
 
1648
  KDE_NO_UNDEFINED=""
 
1649
  if test "x$kde_use_closure" = "xyes"; then
 
1650
       KDE_USE_CLOSURE_TRUE=""
 
1651
       KDE_USE_CLOSURE_FALSE="#"
 
1652
#       CXXFLAGS="$CXXFLAGS $REPO"
 
1653
  else
 
1654
       KDE_USE_CLOSURE_TRUE="#"
 
1655
       KDE_USE_CLOSURE_FALSE=""
 
1656
       KDE_NO_UNDEFINED=""
 
1657
       case $host in 
 
1658
         *-*-linux-gnu)
 
1659
           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
 
1660
                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
 
1661
                [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
 
1662
                [KDE_NO_UNDEFINED=""])],
 
1663
            [KDE_NO_UNDEFINED=""])
 
1664
           ;;
 
1665
       esac
 
1666
  fi
 
1667
  AC_SUBST(KDE_USE_CLOSURE_TRUE)
 
1668
  AC_SUBST(KDE_USE_CLOSURE_FALSE)
 
1669
  AC_SUBST(KDE_NO_UNDEFINED)
 
1670
])
 
1671
 
 
1672
AC_DEFUN([KDE_CHECK_NMCHECK],
 
1673
[
 
1674
  AC_ARG_ENABLE(nmcheck, [  --enable-nmcheck        enable automatic namespace cleanness check],
 
1675
        kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
 
1676
 
 
1677
  if test "$kde_use_nmcheck" = "yes"; then
 
1678
      KDE_USE_NMCHECK_TRUE=""
 
1679
      KDE_USE_NMCHECK_FALSE="#"
 
1680
   else
 
1681
      KDE_USE_NMCHECK_TRUE="#"
 
1682
      KDE_USE_NMCHECK_FALSE=""
 
1683
  fi
 
1684
  AC_SUBST(KDE_USE_NMCHECK_TRUE)
 
1685
  AC_SUBST(KDE_USE_NMCHECK_FALSE)
 
1686
])
 
1687
 
 
1688
AC_DEFUN([KDE_EXPAND_MAKEVAR], [
 
1689
savex=$exec_prefix
 
1690
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
1691
tmp=$$2
 
1692
while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
 
1693
exec_prefix=$savex
 
1694
])
 
1695
 
 
1696
dnl ------------------------------------------------------------------------
 
1697
dnl Now, the same with KDE
 
1698
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
 
1699
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
 
1700
dnl ------------------------------------------------------------------------
 
1701
dnl
 
1702
AC_DEFUN([AC_BASE_PATH_KDE],
 
1703
[
 
1704
AC_REQUIRE([KDE_CHECK_STL])
 
1705
AC_REQUIRE([AC_PATH_QT])dnl
 
1706
AC_REQUIRE([KDE_CHECK_LIB64])
 
1707
 
 
1708
AC_CHECK_RPATH
 
1709
AC_MSG_CHECKING([for KDE])
 
1710
 
 
1711
if test "${prefix}" != NONE; then
 
1712
  kde_includes=${includedir}
 
1713
  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
 
1714
 
 
1715
  kde_libraries=${libdir}
 
1716
  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
 
1717
 
 
1718
else
 
1719
  ac_kde_includes=
 
1720
  ac_kde_libraries=
 
1721
  kde_libraries=""
 
1722
  kde_includes=""
 
1723
fi
 
1724
 
 
1725
AC_CACHE_VAL(ac_cv_have_kde,
 
1726
[#try to guess kde locations
 
1727
 
 
1728
if test "$kde_qtver" = 1; then
 
1729
  kde_check_header="ksock.h"
 
1730
  kde_check_lib="libkdecore.la"
 
1731
else
 
1732
  kde_check_header="ksharedptr.h"
 
1733
  kde_check_lib="libkio.la"
 
1734
fi
 
1735
 
 
1736
if test -z "$1"; then
 
1737
 
 
1738
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
 
1739
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
 
1740
kde_incdirs="$ac_kde_includes $kde_incdirs"
 
1741
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
 
1742
ac_kde_includes="$kde_incdir"
 
1743
 
 
1744
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
 
1745
  AC_MSG_ERROR([
 
1746
in the prefix, you've chosen, are no KDE headers installed. This will fail.
 
1747
So, check this please and use another prefix!])
 
1748
fi
 
1749
 
 
1750
kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
 
1751
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
 
1752
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
 
1753
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
 
1754
ac_kde_libraries="$kde_libdir"
 
1755
 
 
1756
kde_widgetdir=NO
 
1757
dnl this might be somewhere else
 
1758
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
 
1759
 
 
1760
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
 
1761
AC_MSG_ERROR([
 
1762
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
 
1763
So, check this please and use another prefix!])
 
1764
fi
 
1765
 
 
1766
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
 
1767
AC_MSG_ERROR([
 
1768
I can't find the designer plugins. These are required and should have been installed
 
1769
by kdelibs])
 
1770
fi
 
1771
 
 
1772
if test -n "$kde_widgetdir"; then
 
1773
    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
 
1774
fi
 
1775
 
 
1776
 
 
1777
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
 
1778
  ac_cv_have_kde="have_kde=no"
 
1779
else
 
1780
  ac_cv_have_kde="have_kde=yes \
 
1781
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
 
1782
fi
 
1783
 
 
1784
else dnl test -z $1
 
1785
 
 
1786
  ac_cv_have_kde="have_kde=no"
 
1787
 
 
1788
fi
 
1789
])dnl
 
1790
 
 
1791
eval "$ac_cv_have_kde"
 
1792
 
 
1793
if test "$have_kde" != "yes"; then
 
1794
 if test "${prefix}" = NONE; then
 
1795
  ac_kde_prefix="$ac_default_prefix"
 
1796
 else
 
1797
  ac_kde_prefix="$prefix"
 
1798
 fi
 
1799
 if test "$exec_prefix" = NONE; then
 
1800
  ac_kde_exec_prefix="$ac_kde_prefix"
 
1801
  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
 
1802
 else
 
1803
  ac_kde_exec_prefix="$exec_prefix"
 
1804
  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
 
1805
 fi
 
1806
 
 
1807
 kde_libraries="${libdir}"
 
1808
 kde_includes="${includedir}"
 
1809
 
 
1810
else
 
1811
  ac_cv_have_kde="have_kde=yes \
 
1812
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
 
1813
  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
 
1814
 
 
1815
  kde_libraries="$ac_kde_libraries"
 
1816
  kde_includes="$ac_kde_includes"
 
1817
fi
 
1818
AC_SUBST(kde_libraries)
 
1819
AC_SUBST(kde_includes)
 
1820
 
 
1821
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
 
1822
 KDE_INCLUDES=""
 
1823
else
 
1824
 KDE_INCLUDES="-I$kde_includes"
 
1825
 all_includes="$KDE_INCLUDES $all_includes"
 
1826
fi
 
1827
 
 
1828
KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
 
1829
 
 
1830
KDE_LDFLAGS="-L$kde_libraries"
 
1831
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
 
1832
 all_libraries="$all_libraries $KDE_LDFLAGS"
 
1833
fi
 
1834
 
 
1835
AC_SUBST(KDE_LDFLAGS)
 
1836
AC_SUBST(KDE_INCLUDES)
 
1837
 
 
1838
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
1839
 
 
1840
all_libraries="$all_libraries $USER_LDFLAGS"
 
1841
all_includes="$all_includes $USER_INCLUDES"
 
1842
AC_SUBST(all_includes)
 
1843
AC_SUBST(all_libraries)
 
1844
 
 
1845
if test -z "$1"; then
 
1846
KDE_CHECK_UIC_PLUGINS
 
1847
fi
 
1848
 
 
1849
ac_kde_libraries="$kde_libdir"
 
1850
 
 
1851
AC_SUBST(AUTODIRS)
 
1852
 
 
1853
 
 
1854
])
 
1855
 
 
1856
AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
 
1857
[
 
1858
AC_MSG_CHECKING(for extra includes)
 
1859
AC_ARG_WITH(extra-includes, [  --with-extra-includes=DIR
 
1860
                          adds non standard include paths],
 
1861
  kde_use_extra_includes="$withval",
 
1862
  kde_use_extra_includes=NONE
 
1863
)
 
1864
kde_extra_includes=
 
1865
if test -n "$kde_use_extra_includes" && \
 
1866
   test "$kde_use_extra_includes" != "NONE"; then
 
1867
 
 
1868
   ac_save_ifs=$IFS
 
1869
   IFS=':'
 
1870
   for dir in $kde_use_extra_includes; do
 
1871
     kde_extra_includes="$kde_extra_includes $dir"
 
1872
     USER_INCLUDES="$USER_INCLUDES -I$dir"
 
1873
   done
 
1874
   IFS=$ac_save_ifs
 
1875
   kde_use_extra_includes="added"
 
1876
else
 
1877
   kde_use_extra_includes="no"
 
1878
fi
 
1879
AC_SUBST(USER_INCLUDES)
 
1880
 
 
1881
AC_MSG_RESULT($kde_use_extra_includes)
 
1882
 
 
1883
kde_extra_libs=
 
1884
AC_MSG_CHECKING(for extra libs)
 
1885
AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
 
1886
  kde_use_extra_libs=$withval,
 
1887
  kde_use_extra_libs=NONE
 
1888
)
 
1889
if test -n "$kde_use_extra_libs" && \
 
1890
   test "$kde_use_extra_libs" != "NONE"; then
 
1891
 
 
1892
   ac_save_ifs=$IFS
 
1893
   IFS=':'
 
1894
   for dir in $kde_use_extra_libs; do
 
1895
     kde_extra_libs="$kde_extra_libs $dir"
 
1896
     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
 
1897
     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
 
1898
   done
 
1899
   IFS=$ac_save_ifs
 
1900
   kde_use_extra_libs="added"
 
1901
else
 
1902
   kde_use_extra_libs="no"
 
1903
fi
 
1904
 
 
1905
AC_SUBST(USER_LDFLAGS)
 
1906
 
 
1907
AC_MSG_RESULT($kde_use_extra_libs)
 
1908
 
 
1909
])
 
1910
 
 
1911
AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
 
1912
[
 
1913
    AC_MSG_CHECKING([for KDE headers installed])
 
1914
    AC_LANG_SAVE
 
1915
    AC_LANG_CPLUSPLUS
 
1916
cat > conftest.$ac_ext <<EOF
 
1917
#ifdef STDC_HEADERS
 
1918
# include <stdlib.h>
 
1919
#endif
 
1920
#include <stdio.h>
 
1921
#include "confdefs.h"
 
1922
#include <kapp.h>
 
1923
 
 
1924
int main() {
 
1925
    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
 
1926
    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
 
1927
    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
 
1928
    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
 
1929
    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
 
1930
    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
 
1931
    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
 
1932
    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
 
1933
    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
 
1934
    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
 
1935
    printf("kde_wallpaperdir=\\"%s\\"\n",
 
1936
        KApplication::kde_wallpaperdir().data());
 
1937
    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
 
1938
    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
 
1939
    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
 
1940
    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
 
1941
    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
 
1942
    printf("kde_styledir=\\"/tmp/dummy\\"\n");
 
1943
    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
 
1944
    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
 
1945
    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
 
1946
    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
 
1947
    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
 
1948
    return 0;
 
1949
    }
 
1950
EOF
 
1951
 
 
1952
 ac_save_CPPFLAGS=$CPPFLAGS
 
1953
 CPPFLAGS="$all_includes $CPPFLAGS"
 
1954
 if AC_TRY_EVAL(ac_compile); then
 
1955
   AC_MSG_RESULT(yes)
 
1956
 else
 
1957
   AC_MSG_ERROR([your system is not able to compile a small KDE application!
 
1958
Check, if you installed the KDE header files correctly.
 
1959
For more details about this problem, look at the end of config.log.])
 
1960
  fi
 
1961
  CPPFLAGS=$ac_save_CPPFLAGS
 
1962
 
 
1963
  AC_LANG_RESTORE
 
1964
])
 
1965
 
 
1966
AC_DEFUN([KDE_CHECK_KDEQTADDON],
 
1967
[
 
1968
AC_MSG_CHECKING(for kde-qt-addon)
 
1969
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
 
1970
[
 
1971
 kde_ldflags_safe="$LDFLAGS"
 
1972
 kde_libs_safe="$LIBS"
 
1973
 kde_cxxflags_safe="$CXXFLAGS"
 
1974
 
 
1975
 LIBS="-lkde-qt-addon $LIBQT $LIBS"
 
1976
 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
 
1977
 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
 
1978
 
 
1979
 AC_TRY_LINK([
 
1980
   #include <qdom.h>
 
1981
 ],
 
1982
 [
 
1983
   QDomDocument doc;
 
1984
 ],
 
1985
  kde_cv_have_kdeqtaddon=yes,
 
1986
  kde_cv_have_kdeqtaddon=no
 
1987
 )
 
1988
 
 
1989
 LDFLAGS=$kde_ldflags_safe
 
1990
 LIBS=$kde_libs_safe
 
1991
 CXXFLAGS=$kde_cxxflags_safe
 
1992
])
 
1993
 
 
1994
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
 
1995
 
 
1996
if test "$kde_cv_have_kdeqtaddon" = "no"; then
 
1997
  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
 
1998
It is a separate package (and CVS module) named kde-qt-addon.])
 
1999
fi
 
2000
])
 
2001
 
 
2002
AC_DEFUN([KDE_CHECK_KIMGIO],
 
2003
[
 
2004
   AC_REQUIRE([AC_BASE_PATH_KDE])
 
2005
   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2006
   AC_REQUIRE([AC_FIND_TIFF])
 
2007
   AC_REQUIRE([AC_FIND_JPEG])
 
2008
   AC_REQUIRE([AC_FIND_PNG])
 
2009
   AC_REQUIRE([AC_FIND_JASPER])
 
2010
   AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
 
2011
 
 
2012
   if test "$1" = "existence"; then
 
2013
     AC_LANG_SAVE
 
2014
     AC_LANG_CPLUSPLUS
 
2015
     kde_save_LIBS="$LIBS"
 
2016
     LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
 
2017
     AC_CHECK_LIB(kimgio, kimgioRegister, [
 
2018
      LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
 
2019
     LIBS="$kde_save_LIBS"
 
2020
     AC_LANG_RESTORE
 
2021
   else
 
2022
     LIBKIMGIO_EXISTS=yes
 
2023
   fi
 
2024
 
 
2025
   if test "$LIBKIMGIO_EXISTS" = "yes"; then
 
2026
     LIB_KIMGIO='-lkimgio'
 
2027
   else
 
2028
     LIB_KIMGIO=''
 
2029
   fi
 
2030
   AC_SUBST(LIB_KIMGIO)
 
2031
])
 
2032
 
 
2033
AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
 
2034
[
 
2035
   AC_REQUIRE([KDE_MISC_TESTS])
 
2036
   AC_REQUIRE([KDE_CHECK_LIBDL])
 
2037
   AC_REQUIRE([K_PATH_X])
 
2038
 
 
2039
if test $kde_qtver = 3; then
 
2040
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
2041
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
2042
   AC_SUBST(LIB_KIO, "-lkio")
 
2043
   AC_SUBST(LIB_SMB, "-lsmb")
 
2044
   AC_SUBST(LIB_KAB, "-lkab")
 
2045
   AC_SUBST(LIB_KABC, "-lkabc")
 
2046
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
2047
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
2048
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
2049
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
 
2050
   AC_SUBST(LIB_KUTILS, "-lkutils")
 
2051
   AC_SUBST(LIB_KDEPIM, "-lkdepim")
 
2052
# these are for backward compatibility
 
2053
   AC_SUBST(LIB_KSYCOCA, "-lkio")
 
2054
   AC_SUBST(LIB_KFILE, "-lkio")
 
2055
elif test $kde_qtver = 2; then
 
2056
   AC_SUBST(LIB_KDECORE, "-lkdecore")
 
2057
   AC_SUBST(LIB_KDEUI, "-lkdeui")
 
2058
   AC_SUBST(LIB_KIO, "-lkio")
 
2059
   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
 
2060
   AC_SUBST(LIB_SMB, "-lsmb")
 
2061
   AC_SUBST(LIB_KFILE, "-lkfile")
 
2062
   AC_SUBST(LIB_KAB, "-lkab")
 
2063
   AC_SUBST(LIB_KHTML, "-lkhtml")
 
2064
   AC_SUBST(LIB_KSPELL, "-lkspell")
 
2065
   AC_SUBST(LIB_KPARTS, "-lkparts")
 
2066
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
 
2067
else
 
2068
   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
 
2069
   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
 
2070
   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
 
2071
   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
 
2072
   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
 
2073
fi
 
2074
])
 
2075
 
 
2076
AC_DEFUN([AC_PATH_KDE],
 
2077
[
 
2078
  AC_BASE_PATH_KDE
 
2079
  AC_ARG_ENABLE(path-check, [  --disable-path-check    don't try to find out, where to install],
 
2080
  [
 
2081
  if test "$enableval" = "no";
 
2082
    then ac_use_path_checking="default"
 
2083
    else ac_use_path_checking=""
 
2084
  fi
 
2085
  ],
 
2086
  [
 
2087
  if test "$kde_qtver" = 1;
 
2088
    then ac_use_path_checking=""
 
2089
    else ac_use_path_checking="default"
 
2090
  fi
 
2091
  ]
 
2092
  )
 
2093
 
 
2094
  AC_CREATE_KFSSTND($ac_use_path_checking)
 
2095
 
 
2096
  AC_SUBST_KFSSTND
 
2097
  KDE_CREATE_LIBS_ALIASES
 
2098
])
 
2099
 
 
2100
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
 
2101
AC_DEFUN([KDE_CHECK_FUNC_EXT],
 
2102
[
 
2103
AC_MSG_CHECKING(for $1)
 
2104
AC_CACHE_VAL(kde_cv_func_$1,
 
2105
[
 
2106
AC_LANG_SAVE
 
2107
AC_LANG_CPLUSPLUS
 
2108
save_CXXFLAGS="$CXXFLAGS"
 
2109
kde_safe_LIBS="$LIBS"
 
2110
LIBS="$LIBS $X_EXTRA_LIBS"
 
2111
if test "$GXX" = "yes"; then
 
2112
CXXFLAGS="$CXXFLAGS -pedantic-errors"
 
2113
fi
 
2114
AC_TRY_COMPILE([
 
2115
$2
 
2116
],
 
2117
[
 
2118
$3
 
2119
],
 
2120
kde_cv_func_$1=yes,
 
2121
kde_cv_func_$1=no)
 
2122
CXXFLAGS="$save_CXXFLAGS"
 
2123
LIBS="$kde_safe_LIBS"
 
2124
AC_LANG_RESTORE
 
2125
])
 
2126
 
 
2127
AC_MSG_RESULT($kde_cv_func_$1)
 
2128
 
 
2129
AC_MSG_CHECKING([if $1 needs custom prototype])
 
2130
AC_CACHE_VAL(kde_cv_proto_$1,
 
2131
[
 
2132
if test "x$kde_cv_func_$1" = xyes; then
 
2133
  kde_cv_proto_$1=no
 
2134
else
 
2135
  case "$1" in
 
2136
        setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
 
2137
                kde_cv_proto_$1="yes - in libkdefakes"
 
2138
                ;;
 
2139
        *)
 
2140
                kde_cv_proto_$1=unknown
 
2141
                ;;
 
2142
  esac
 
2143
fi
 
2144
 
 
2145
if test "x$kde_cv_proto_$1" = xunknown; then
 
2146
 
 
2147
AC_LANG_SAVE
 
2148
AC_LANG_CPLUSPLUS
 
2149
  kde_safe_libs=$LIBS
 
2150
  LIBS="$LIBS $X_EXTRA_LIBS"
 
2151
  AC_TRY_LINK([
 
2152
$2
 
2153
 
 
2154
extern "C" $4;
 
2155
],
 
2156
[
 
2157
$3
 
2158
],
 
2159
[ kde_cv_func_$1=yes
 
2160
  kde_cv_proto_$1=yes ],
 
2161
  [kde_cv_proto_$1="$1 unavailable"]
 
2162
)
 
2163
LIBS=$kde_safe_libs
 
2164
AC_LANG_RESTORE
 
2165
fi
 
2166
])
 
2167
AC_MSG_RESULT($kde_cv_proto_$1)
 
2168
 
 
2169
if test "x$kde_cv_func_$1" = xyes; then
 
2170
  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
 
2171
  $6
 
2172
fi
 
2173
if test "x$kde_cv_proto_$1" = xno; then
 
2174
  AC_DEFINE(HAVE_$5_PROTO, 1,
 
2175
  [Define if you have the $1 prototype])
 
2176
fi
 
2177
 
 
2178
AH_VERBATIM([_HAVE_$5_PROTO],
 
2179
[
 
2180
#if !defined(HAVE_$5_PROTO)
 
2181
#ifdef __cplusplus
 
2182
extern "C" {
 
2183
#endif
 
2184
$4;
 
2185
#ifdef __cplusplus
 
2186
}
 
2187
#endif
 
2188
#endif
 
2189
])
 
2190
])
 
2191
 
 
2192
AC_DEFUN([AC_CHECK_SETENV],
 
2193
[
 
2194
        KDE_CHECK_FUNC_EXT(setenv, [
 
2195
#include <stdlib.h>
 
2196
], 
 
2197
                [setenv("VAR", "VALUE", 1);],
 
2198
                [int setenv (const char *, const char *, int)],
 
2199
                [SETENV])
 
2200
])
 
2201
 
 
2202
AC_DEFUN([AC_CHECK_UNSETENV],
 
2203
[
 
2204
        KDE_CHECK_FUNC_EXT(unsetenv, [
 
2205
#include <stdlib.h>
 
2206
], 
 
2207
                [unsetenv("VAR");],
 
2208
                [void unsetenv (const char *)],
 
2209
                [UNSETENV])
 
2210
])
 
2211
 
 
2212
AC_DEFUN([AC_CHECK_GETDOMAINNAME],
 
2213
[
 
2214
        KDE_CHECK_FUNC_EXT(getdomainname, [
 
2215
#include <stdlib.h>
 
2216
#include <unistd.h>
 
2217
#include <netdb.h>
 
2218
], 
 
2219
                [
 
2220
char buffer[200];
 
2221
getdomainname(buffer, 200);
 
2222
],      
 
2223
                [#include <sys/types.h>
 
2224
                int getdomainname (char *, size_t)],
 
2225
                [GETDOMAINNAME])
 
2226
])
 
2227
 
 
2228
AC_DEFUN([AC_CHECK_GETHOSTNAME],
 
2229
[
 
2230
        KDE_CHECK_FUNC_EXT(gethostname, [
 
2231
#include <stdlib.h>
 
2232
#include <unistd.h>
 
2233
], 
 
2234
                [
 
2235
char buffer[200];
 
2236
gethostname(buffer, 200);
 
2237
],      
 
2238
                [int gethostname (char *, unsigned int)],
 
2239
                [GETHOSTNAME])
 
2240
])
 
2241
 
 
2242
AC_DEFUN([AC_CHECK_USLEEP],
 
2243
[
 
2244
        KDE_CHECK_FUNC_EXT(usleep, [
 
2245
#include <unistd.h>
 
2246
], 
 
2247
                [
 
2248
usleep(200);
 
2249
],      
 
2250
                [int usleep (unsigned int)],
 
2251
                [USLEEP])
 
2252
])
 
2253
 
 
2254
 
 
2255
AC_DEFUN([AC_CHECK_RANDOM],
 
2256
[
 
2257
        KDE_CHECK_FUNC_EXT(random, [
 
2258
#include <stdlib.h>
 
2259
], 
 
2260
                [
 
2261
random();
 
2262
],      
 
2263
                [long int random(void)],
 
2264
                [RANDOM])
 
2265
 
 
2266
        KDE_CHECK_FUNC_EXT(srandom, [
 
2267
#include <stdlib.h>
 
2268
], 
 
2269
                [
 
2270
srandom(27);
 
2271
],      
 
2272
                [void srandom(unsigned int)],
 
2273
                [SRANDOM])
 
2274
 
 
2275
])
 
2276
 
 
2277
AC_DEFUN([AC_CHECK_INITGROUPS],
 
2278
[
 
2279
        KDE_CHECK_FUNC_EXT(initgroups, [
 
2280
#include <sys/types.h>
 
2281
#include <unistd.h>
 
2282
#include <grp.h>
 
2283
],
 
2284
        [
 
2285
char buffer[200];
 
2286
initgroups(buffer, 27);
 
2287
],
 
2288
        [int initgroups(const char *, gid_t)],
 
2289
        [INITGROUPS])
 
2290
])
 
2291
 
 
2292
AC_DEFUN([AC_CHECK_MKSTEMPS],
 
2293
[
 
2294
        KDE_CHECK_FUNC_EXT(mkstemps, [
 
2295
#include <stdlib.h>
 
2296
#include <unistd.h>
 
2297
],
 
2298
        [
 
2299
mkstemps("/tmp/aaaXXXXXX", 6);
 
2300
],
 
2301
        [int mkstemps(char *, int)],
 
2302
        [MKSTEMPS])
 
2303
])
 
2304
 
 
2305
AC_DEFUN([AC_CHECK_MKDTEMP],
 
2306
[
 
2307
        KDE_CHECK_FUNC_EXT(mkdtemp, [
 
2308
#include <stdlib.h>
 
2309
#include <unistd.h>
 
2310
],
 
2311
        [
 
2312
mkdtemp("/tmp/aaaXXXXXX");
 
2313
],
 
2314
        [char *mkdtemp(char *)],
 
2315
        [MKDTEMP])
 
2316
])
 
2317
 
 
2318
 
 
2319
AC_DEFUN([AC_CHECK_RES_INIT],
 
2320
[
 
2321
  AC_MSG_CHECKING([if res_init needs -lresolv])
 
2322
  kde_libs_safe="$LIBS"
 
2323
  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
 
2324
  AC_TRY_LINK(
 
2325
    [
 
2326
#include <sys/types.h>
 
2327
#include <netinet/in.h>
 
2328
#include <arpa/nameser.h>
 
2329
#include <resolv.h>
 
2330
    ],
 
2331
    [
 
2332
      res_init(); 
 
2333
    ],
 
2334
    [
 
2335
      LIBRESOLV="-lresolv"
 
2336
      AC_MSG_RESULT(yes)
 
2337
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
 
2338
    ],
 
2339
    [ AC_MSG_RESULT(no) ]
 
2340
  )
 
2341
  LIBS=$kde_libs_safe
 
2342
  AC_SUBST(LIBRESOLV)
 
2343
 
 
2344
  AC_MSG_CHECKING([if res_init is available])
 
2345
  AC_TRY_COMPILE(
 
2346
    [
 
2347
#include <sys/types.h>
 
2348
#include <netinet/in.h>
 
2349
#include <arpa/nameser.h>
 
2350
#include <resolv.h>
 
2351
    ],
 
2352
    [
 
2353
      res_init();
 
2354
    ],
 
2355
    [
 
2356
      AC_MSG_RESULT(yes)
 
2357
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
 
2358
    ],
 
2359
    [ AC_MSG_RESULT(no) ]
 
2360
  )
 
2361
])
 
2362
 
 
2363
AC_DEFUN([AC_CHECK_STRLCPY],
 
2364
[
 
2365
        KDE_CHECK_FUNC_EXT(strlcpy, [
 
2366
#include <string.h>
 
2367
],
 
2368
[ char buf[20];
 
2369
  strlcpy(buf, "KDE function test", sizeof(buf));
 
2370
],
 
2371
        [unsigned long strlcpy(char*, const char*, unsigned long)],
 
2372
        [STRLCPY])
 
2373
])
 
2374
 
 
2375
AC_DEFUN([AC_CHECK_STRLCAT],
 
2376
[
 
2377
        KDE_CHECK_FUNC_EXT(strlcat, [
 
2378
#include <string.h>
 
2379
],
 
2380
[ char buf[20];
 
2381
  buf[0]='\0';
 
2382
  strlcat(buf, "KDE function test", sizeof(buf));
 
2383
],
 
2384
        [unsigned long strlcat(char*, const char*, unsigned long)],
 
2385
        [STRLCAT])
 
2386
])
 
2387
 
 
2388
AC_DEFUN([AC_FIND_GIF],
 
2389
   [AC_MSG_CHECKING([for giflib])
 
2390
AC_CACHE_VAL(ac_cv_lib_gif,
 
2391
[ac_save_LIBS="$LIBS"
 
2392
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2393
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
 
2394
else
 
2395
LIBS="$all_libraries -lgif"
 
2396
fi
 
2397
AC_TRY_LINK(dnl
 
2398
[
 
2399
#ifdef __cplusplus
 
2400
extern "C" {
 
2401
#endif
 
2402
int GifLastError(void);
 
2403
#ifdef __cplusplus
 
2404
}
 
2405
#endif
 
2406
/* We use char because int might match the return type of a gcc2
 
2407
    builtin and then its argument prototype would still apply.  */
 
2408
],
 
2409
            [return GifLastError();],
 
2410
            eval "ac_cv_lib_gif=yes",
 
2411
            eval "ac_cv_lib_gif=no")
 
2412
LIBS="$ac_save_LIBS"
 
2413
])dnl
 
2414
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
 
2415
  AC_MSG_RESULT(yes)
 
2416
  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
 
2417
else
 
2418
  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
 
2419
fi
 
2420
])
 
2421
 
 
2422
AC_DEFUN([KDE_FIND_JPEG_HELPER],
 
2423
[
 
2424
AC_MSG_CHECKING([for libjpeg$2])
 
2425
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
 
2426
[
 
2427
ac_save_LIBS="$LIBS"
 
2428
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
 
2429
ac_save_CFLAGS="$CFLAGS"
 
2430
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2431
AC_TRY_LINK(
 
2432
[/* Override any gcc2 internal prototype to avoid an error.  */
 
2433
struct jpeg_decompress_struct;
 
2434
typedef struct jpeg_decompress_struct * j_decompress_ptr;
 
2435
typedef int size_t;
 
2436
#ifdef __cplusplus
 
2437
extern "C" {
 
2438
#endif
 
2439
    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
 
2440
                                    int version, size_t structsize);
 
2441
#ifdef __cplusplus
 
2442
}
 
2443
#endif
 
2444
/* We use char because int might match the return type of a gcc2
 
2445
    builtin and then its argument prototype would still apply.  */
 
2446
],
 
2447
            [jpeg_CreateDecompress(0L, 0, 0);],
 
2448
            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
 
2449
            eval "ac_cv_lib_jpeg_$1=no")
 
2450
LIBS="$ac_save_LIBS"
 
2451
CFLAGS="$ac_save_CFLAGS"
 
2452
])
 
2453
 
 
2454
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
 
2455
  LIBJPEG="$ac_cv_lib_jpeg_$1"
 
2456
  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
 
2457
else
 
2458
  AC_MSG_RESULT(no)
 
2459
  $3
 
2460
fi
 
2461
 
 
2462
])
 
2463
 
 
2464
AC_DEFUN([AC_FIND_JPEG],
 
2465
[
 
2466
dnl first look for libraries
 
2467
KDE_FIND_JPEG_HELPER(6b, 6b,
 
2468
   KDE_FIND_JPEG_HELPER(normal, [],
 
2469
    [
 
2470
       LIBJPEG=
 
2471
    ]
 
2472
   )
 
2473
)
 
2474
 
 
2475
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
 
2476
dnl requires system dependent includes loaded before it)
 
2477
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
 
2478
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
 
2479
test "x$jpeg_incdir" = xNO && jpeg_incdir=
 
2480
 
 
2481
dnl if headers _and_ libraries are missing, this is no error, and we
 
2482
dnl continue with a warning (the user will get no jpeg support in khtml)
 
2483
dnl if only one is missing, it means a configuration error, but we still
 
2484
dnl only warn
 
2485
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
 
2486
  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
 
2487
else
 
2488
  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
 
2489
    AC_MSG_WARN([
 
2490
There is an installation error in jpeg support. You seem to have only one
 
2491
of either the headers _or_ the libraries installed. You may need to either
 
2492
provide correct --with-extra-... options, or the development package of
 
2493
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
 
2494
Disabling JPEG support.
 
2495
])
 
2496
  else
 
2497
    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
 
2498
  fi
 
2499
  jpeg_incdir=
 
2500
  LIBJPEG=
 
2501
fi
 
2502
 
 
2503
AC_SUBST(LIBJPEG)
 
2504
AH_VERBATIM(_AC_CHECK_JPEG,
 
2505
[/*
 
2506
 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
 
2507
 * headers and I'm too lazy to write a configure test as long as only
 
2508
 * unixware is related
 
2509
 */
 
2510
#ifdef _UNIXWARE
 
2511
#define HAVE_BOOLEAN
 
2512
#endif
 
2513
])
 
2514
])
 
2515
 
 
2516
AC_DEFUN([KDE_CHECK_QT_JPEG],
 
2517
[
 
2518
if test -n "$LIBJPEG"; then
 
2519
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
 
2520
AC_CACHE_VAL(kde_cv_qt_jpeg,
 
2521
[
 
2522
AC_LANG_SAVE
 
2523
AC_LANG_CPLUSPLUS
 
2524
ac_save_LIBS="$LIBS"
 
2525
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
 
2526
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
 
2527
ac_save_CXXFLAGS="$CXXFLAGS"
 
2528
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
2529
AC_TRY_LINK(
 
2530
[#include <qapplication.h>],
 
2531
            [
 
2532
            int argc;
 
2533
            char** argv;
 
2534
            QApplication app(argc, argv);],
 
2535
            eval "kde_cv_qt_jpeg=no",
 
2536
            eval "kde_cv_qt_jpeg=yes")
 
2537
LIBS="$ac_save_LIBS"
 
2538
CXXFLAGS="$ac_save_CXXFLAGS"
 
2539
AC_LANG_RESTORE
 
2540
fi
 
2541
])
 
2542
 
 
2543
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
 
2544
  AC_MSG_RESULT(yes)
 
2545
  LIBJPEG_QT='$(LIBJPEG)'
 
2546
else
 
2547
  AC_MSG_RESULT(no)
 
2548
  LIBJPEG_QT=
 
2549
fi
 
2550
 
 
2551
])
 
2552
 
 
2553
AC_DEFUN([AC_FIND_ZLIB],
 
2554
[
 
2555
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2556
AC_MSG_CHECKING([for libz])
 
2557
AC_CACHE_VAL(ac_cv_lib_z,
 
2558
[
 
2559
kde_save_LIBS="$LIBS"
 
2560
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
 
2561
kde_save_CFLAGS="$CFLAGS"
 
2562
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2563
AC_TRY_LINK(dnl
 
2564
[
 
2565
#include<zlib.h>
 
2566
],
 
2567
[
 
2568
  char buf[42];
 
2569
  gzFile f = (gzFile) 0;
 
2570
  /* this would segfault.. but we only link, don't run */
 
2571
  (void) gzgets(f, buf, sizeof(buf));
 
2572
 
 
2573
  return (zlibVersion() == ZLIB_VERSION); 
 
2574
],
 
2575
            eval "ac_cv_lib_z='-lz'",
 
2576
            eval "ac_cv_lib_z=no")
 
2577
LIBS="$kde_save_LIBS"
 
2578
CFLAGS="$kde_save_CFLAGS"
 
2579
])dnl
 
2580
if test ! "$ac_cv_lib_z" = no; then
 
2581
  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
 
2582
  LIBZ="$ac_cv_lib_z"
 
2583
  AC_MSG_RESULT($ac_cv_lib_z)
 
2584
else
 
2585
  AC_MSG_ERROR(not found. 
 
2586
          Possibly configure picks up an outdated version
 
2587
          installed by XFree86. Remove it from your system.
 
2588
 
 
2589
          Check your installation and look into config.log)
 
2590
  LIBZ=""
 
2591
fi
 
2592
AC_SUBST(LIBZ)
 
2593
])
 
2594
 
 
2595
AC_DEFUN([KDE_TRY_TIFFLIB],
 
2596
[
 
2597
AC_MSG_CHECKING([for libtiff $1])
 
2598
 
 
2599
AC_CACHE_VAL(kde_cv_libtiff_$1,
 
2600
[
 
2601
AC_LANG_SAVE
 
2602
AC_LANG_CPLUSPLUS
 
2603
kde_save_LIBS="$LIBS"
 
2604
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2605
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
 
2606
else
 
2607
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
 
2608
fi
 
2609
kde_save_CXXFLAGS="$CXXFLAGS"
 
2610
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
2611
 
 
2612
AC_TRY_LINK(dnl
 
2613
[
 
2614
#include<tiffio.h>
 
2615
],
 
2616
    [return (TIFFOpen( "", "r") == 0); ],
 
2617
[
 
2618
    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
 
2619
], [
 
2620
    kde_cv_libtiff_$1=no
 
2621
])
 
2622
 
 
2623
LIBS="$kde_save_LIBS"
 
2624
CXXFLAGS="$kde_save_CXXFLAGS"
 
2625
AC_LANG_RESTORE
 
2626
])
 
2627
 
 
2628
if test "$kde_cv_libtiff_$1" = "no"; then
 
2629
    AC_MSG_RESULT(no)
 
2630
    LIBTIFF=""
 
2631
    $3
 
2632
else
 
2633
    LIBTIFF="$kde_cv_libtiff_$1"
 
2634
    AC_MSG_RESULT(yes)
 
2635
    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
 
2636
    $2
 
2637
fi
 
2638
 
 
2639
])
 
2640
 
 
2641
AC_DEFUN([AC_FIND_TIFF],
 
2642
[
 
2643
AC_REQUIRE([K_PATH_X])
 
2644
AC_REQUIRE([AC_FIND_ZLIB])
 
2645
AC_REQUIRE([AC_FIND_JPEG])
 
2646
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2647
 
 
2648
KDE_TRY_TIFFLIB(tiff, [],
 
2649
   KDE_TRY_TIFFLIB(tiff34))
 
2650
 
 
2651
AC_SUBST(LIBTIFF)
 
2652
])
 
2653
 
 
2654
 
 
2655
AC_DEFUN([AC_FIND_PNG],
 
2656
[
 
2657
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2658
AC_REQUIRE([AC_FIND_ZLIB])
 
2659
AC_MSG_CHECKING([for libpng])
 
2660
AC_CACHE_VAL(ac_cv_lib_png,
 
2661
[
 
2662
kde_save_LIBS="$LIBS"
 
2663
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
2664
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
 
2665
else
 
2666
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
 
2667
fi
 
2668
kde_save_CFLAGS="$CFLAGS"
 
2669
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2670
 
 
2671
AC_TRY_LINK(dnl
 
2672
    [
 
2673
    #include<png.h>
 
2674
    ],
 
2675
    [
 
2676
    png_structp png_ptr = png_create_read_struct(  /* image ptr */
 
2677
                PNG_LIBPNG_VER_STRING, 0, 0, 0 );
 
2678
    return( png_ptr != 0 );
 
2679
    ],
 
2680
    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
 
2681
    eval "ac_cv_lib_png=no"
 
2682
)
 
2683
LIBS="$kde_save_LIBS"
 
2684
CFLAGS="$kde_save_CFLAGS"
 
2685
])dnl
 
2686
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
 
2687
  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
 
2688
  LIBPNG="$ac_cv_lib_png"
 
2689
  AC_SUBST(LIBPNG)
 
2690
  AC_MSG_RESULT($ac_cv_lib_png)
 
2691
else
 
2692
  AC_MSG_RESULT(no)
 
2693
  LIBPNG=""
 
2694
  AC_SUBST(LIBPNG)
 
2695
fi
 
2696
])
 
2697
 
 
2698
 
 
2699
AC_DEFUN([AC_FIND_JASPER],
 
2700
[
 
2701
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
2702
AC_REQUIRE([AC_FIND_JPEG])
 
2703
AC_MSG_CHECKING([for jasper])
 
2704
AC_CACHE_VAL(ac_cv_jasper,
 
2705
[
 
2706
kde_save_LIBS="$LIBS"
 
2707
LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
 
2708
kde_save_CFLAGS="$CFLAGS"
 
2709
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
 
2710
 
 
2711
AC_TRY_LINK(dnl
 
2712
    [
 
2713
    #include<jasper/jasper.h>
 
2714
    ],
 
2715
    [
 
2716
    return( jas_init() );
 
2717
    ],
 
2718
    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
 
2719
    eval "ac_cv_jasper=no"
 
2720
)
 
2721
LIBS="$kde_save_LIBS"
 
2722
CFLAGS="$kde_save_CFLAGS"
 
2723
])dnl
 
2724
if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
 
2725
  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
 
2726
  LIB_JASPER="$ac_cv_jasper"
 
2727
  AC_MSG_RESULT($ac_cv_jasper)
 
2728
else
 
2729
  AC_MSG_RESULT(no)
 
2730
  LIB_JASPER=""
 
2731
fi
 
2732
AC_SUBST(LIB_JASPER)
 
2733
])
 
2734
 
 
2735
AC_DEFUN([AC_CHECK_BOOL],
 
2736
[
 
2737
  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
 
2738
])
 
2739
 
 
2740
AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
 
2741
[
 
2742
AC_MSG_CHECKING(if you need GNU extensions)
 
2743
AC_CACHE_VAL(ac_cv_gnu_extensions,
 
2744
[
 
2745
cat > conftest.c << EOF
 
2746
#include <features.h>
 
2747
 
 
2748
#ifdef __GNU_LIBRARY__
 
2749
yes
 
2750
#endif
 
2751
EOF
 
2752
 
 
2753
if (eval "$ac_cpp conftest.c") 2>&5 |
 
2754
  egrep "yes" >/dev/null 2>&1; then
 
2755
  rm -rf conftest*
 
2756
  ac_cv_gnu_extensions=yes
 
2757
else
 
2758
  ac_cv_gnu_extensions=no
 
2759
fi
 
2760
])
 
2761
 
 
2762
AC_MSG_RESULT($ac_cv_gnu_extensions)
 
2763
if test "$ac_cv_gnu_extensions" = "yes"; then
 
2764
  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
 
2765
fi
 
2766
])
 
2767
 
 
2768
AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
 
2769
[
 
2770
AC_MSG_CHECKING([whether $CXX supports -$1])
 
2771
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
 
2772
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
 
2773
[
 
2774
  AC_LANG_SAVE
 
2775
  AC_LANG_CPLUSPLUS
 
2776
  save_CXXFLAGS="$CXXFLAGS"
 
2777
  CXXFLAGS="$CXXFLAGS -$1"
 
2778
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
 
2779
  CXXFLAGS="$save_CXXFLAGS"
 
2780
  AC_LANG_RESTORE
 
2781
])
 
2782
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
 
2783
 AC_MSG_RESULT(yes)
 
2784
 :
 
2785
 $2
 
2786
else
 
2787
 AC_MSG_RESULT(no)
 
2788
 :
 
2789
 $3
 
2790
fi
 
2791
])
 
2792
 
 
2793
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
 
2794
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
 
2795
dnl it's all white-space separated
 
2796
AC_DEFUN([AC_REMOVE_FORBIDDEN],
 
2797
[ __val=$$1
 
2798
  __forbid=" $2 "
 
2799
  if test -n "$__val"; then
 
2800
    __new=""
 
2801
    ac_save_IFS=$IFS
 
2802
    IFS="       "
 
2803
    for i in $__val; do
 
2804
      case "$__forbid" in
 
2805
        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
 
2806
        *) # Careful to not add spaces, where there were none, because otherwise
 
2807
           # libtool gets confused, if we change e.g. CXX
 
2808
           if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
 
2809
      esac
 
2810
    done
 
2811
    IFS=$ac_save_IFS
 
2812
    $1=$__new
 
2813
  fi
 
2814
])
 
2815
 
 
2816
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
 
2817
AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
 
2818
[dnl
 
2819
if test "x$kde_use_qt_emb" != "xyes"; then
 
2820
 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
 
2821
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
 
2822
else
 
2823
 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
 
2824
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
 
2825
fi
 
2826
])
 
2827
 
 
2828
AC_DEFUN([AC_CHECK_COMPILERS],
 
2829
[
 
2830
  AC_ARG_ENABLE(debug,[  --enable-debug[=ARG]      enables debug symbols (yes|no|full) [default=no]],
 
2831
  [
 
2832
    case $enableval in
 
2833
      yes)
 
2834
        kde_use_debug_code="yes"
 
2835
        kde_use_debug_define=no
 
2836
        ;;
 
2837
      full)
 
2838
        kde_use_debug_code="full"
 
2839
        kde_use_debug_define=no
 
2840
        ;;
 
2841
      *)
 
2842
        kde_use_debug_code="no"
 
2843
        kde_use_debug_define=yes
 
2844
        ;;
 
2845
    esac
 
2846
  ], 
 
2847
    [kde_use_debug_code="no"
 
2848
      kde_use_debug_define=no
 
2849
  ])
 
2850
 
 
2851
  dnl Just for configure --help
 
2852
  AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
 
2853
 
 
2854
  AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
 
2855
   [
 
2856
    if test $enableval = "no"; then
 
2857
         kde_use_strict_options="no"
 
2858
       else
 
2859
         kde_use_strict_options="yes"
 
2860
    fi
 
2861
   ], [kde_use_strict_options="no"])
 
2862
 
 
2863
  AC_ARG_ENABLE(warnings,[  --disable-warnings      disables compilation with -Wall and similiar],
 
2864
   [
 
2865
    if test $enableval = "no"; then
 
2866
         kde_use_warnings="no"
 
2867
       else
 
2868
         kde_use_warnings="yes"
 
2869
    fi
 
2870
   ], [kde_use_warnings="yes"])
 
2871
 
 
2872
  dnl enable warnings for debug build
 
2873
  if test "$kde_use_debug_code" != "no"; then
 
2874
    kde_use_warnings=yes
 
2875
  fi
 
2876
 
 
2877
  AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
 
2878
    [kde_use_profiling=$enableval],
 
2879
    [kde_use_profiling="no"]
 
2880
  )
 
2881
 
 
2882
  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
 
2883
  CFLAGS=" $CFLAGS"
 
2884
 
 
2885
  AC_PROG_CC 
 
2886
 
 
2887
  AC_PROG_CPP
 
2888
 
 
2889
  if test "$GCC" = "yes"; then
 
2890
    if test "$kde_use_debug_code" != "no"; then
 
2891
      if test $kde_use_debug_code = "full"; then
 
2892
        CFLAGS="-g3 -fno-inline $CFLAGS"
 
2893
      else
 
2894
        CFLAGS="-g -O2 $CFLAGS"
 
2895
      fi
 
2896
    else
 
2897
      CFLAGS="-O2 $CFLAGS"
 
2898
    fi
 
2899
  fi
 
2900
 
 
2901
  if test "$kde_use_debug_define" = "yes"; then
 
2902
    CFLAGS="-DNDEBUG $CFLAGS"
 
2903
  fi
 
2904
 
 
2905
 
 
2906
  case "$host" in
 
2907
  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
 
2908
  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
 
2909
  esac
 
2910
 
 
2911
  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
 
2912
     LDFLAGS=""
 
2913
  fi
 
2914
 
 
2915
  CXXFLAGS=" $CXXFLAGS"
 
2916
 
 
2917
  AC_PROG_CXX
 
2918
 
 
2919
  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
 
2920
    if test "$kde_use_debug_code" != "no"; then
 
2921
      if test "$CXX" = "KCC"; then
 
2922
        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
 
2923
      else
 
2924
        if test "$kde_use_debug_code" = "full"; then
 
2925
          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
 
2926
        else
 
2927
          CXXFLAGS="-g -O2 $CXXFLAGS"
 
2928
        fi
 
2929
      fi
 
2930
      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
 
2931
 
 
2932
      dnl convenience compiler flags
 
2933
      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
 
2934
      AC_SUBST(WOVERLOADED_VIRTUAL)
 
2935
    else
 
2936
      if test "$CXX" = "KCC"; then
 
2937
        CXXFLAGS="+K3 $CXXFLAGS"
 
2938
      else
 
2939
        CXXFLAGS="-O2 $CXXFLAGS"
 
2940
      fi  
 
2941
    fi
 
2942
  fi
 
2943
 
 
2944
  if test "$kde_use_debug_define" = "yes"; then
 
2945
    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
 
2946
  fi  
 
2947
 
 
2948
  if test "$kde_use_profiling" = "yes"; then
 
2949
    KDE_CHECK_COMPILER_FLAG(pg,
 
2950
    [
 
2951
      CFLAGS="-pg $CFLAGS"
 
2952
      CXXFLAGS="-pg $CXXFLAGS"
 
2953
    ])
 
2954
  fi
 
2955
 
 
2956
  if test "$kde_use_warnings" = "yes"; then
 
2957
      if test "$GCC" = "yes"; then
 
2958
        case $host in
 
2959
          *-*-linux-gnu)        
 
2960
            CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
 
2961
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
 
2962
            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"; CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
 
2963
          ;;
 
2964
        esac
 
2965
        CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
 
2966
        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
 
2967
        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
 
2968
        KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
 
2969
     fi
 
2970
  fi
 
2971
 
 
2972
  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
 
2973
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
 
2974
  fi
 
2975
    
 
2976
  if test "$GXX" = "yes"; then
 
2977
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
 
2978
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
 
2979
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
 
2980
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
 
2981
  fi
 
2982
  if test "$CXX" = "KCC"; then
 
2983
    dnl unfortunately we currently cannot disable exception support in KCC
 
2984
    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
 
2985
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
 
2986
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
 
2987
 
 
2988
    AC_ARG_ENABLE(pch,[  --enable-pch            enables precompiled header support (currently only KCC) [default=no]],
 
2989
    [
 
2990
      kde_use_pch=$enableval
 
2991
    ],[kde_use_pch=no])
 
2992
 
 
2993
    if test "$kde_use_pch" = "yes"; then
 
2994
      dnl TODO: support --pch-dir!
 
2995
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
 
2996
      dnl the below works (but the dir must exist), but it's
 
2997
      dnl useless for a whole package.
 
2998
      dnl The are precompiled headers for each source file, so when compiling
 
2999
      dnl from scratch, it doesn't make a difference, and they take up
 
3000
      dnl around ~5Mb _per_ sourcefile.
 
3001
      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
 
3002
      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
 
3003
    fi
 
3004
    dnl this flag controls inlining. by default KCC inlines in optimisation mode
 
3005
    dnl all implementations that are defined inside the class {} declaration. 
 
3006
    dnl because of templates-compatibility with broken gcc compilers, this
 
3007
    dnl can cause excessive inlining. This flag limits it to a sane level
 
3008
    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
 
3009
    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
 
3010
    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
 
3011
    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
 
3012
    dnl Some source files are shared between multiple executables
 
3013
    dnl (or libraries) and some of those need template instantiations.
 
3014
    dnl In that case KCC needs to compile those sources with
 
3015
    dnl --one_instantiation_per_object.  To make it easy for us we compile
 
3016
    dnl _all_ objects with that flag (--one_per is a shorthand).
 
3017
    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
 
3018
  fi
 
3019
  AC_SUBST(USE_EXCEPTIONS)
 
3020
  dnl obsolete macro - provided to keep things going
 
3021
  USE_RTTI=
 
3022
  AC_SUBST(USE_RTTI)
 
3023
 
 
3024
  case "$host" in
 
3025
      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
 
3026
      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
 
3027
      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
 
3028
      *-*-solaris*) 
 
3029
        if test "$GXX" = yes; then
 
3030
          libstdcpp=`$CXX -print-file-name=libstdc++.so`
 
3031
          if test ! -f $libstdcpp; then
 
3032
             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])
 
3033
          fi
 
3034
        fi
 
3035
        ;;
 
3036
  esac
 
3037
 
 
3038
  AC_VALIDIFY_CXXFLAGS
 
3039
 
 
3040
  AC_PROG_CXXCPP
 
3041
 
 
3042
  if test "$GCC" = yes; then
 
3043
     NOOPT_CFLAGS=-O0
 
3044
  fi
 
3045
  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
 
3046
 
 
3047
  AC_SUBST(NOOPT_CXXFLAGS)
 
3048
  AC_SUBST(NOOPT_CFLAGS)
 
3049
 
 
3050
  KDE_CHECK_FINAL
 
3051
  KDE_CHECK_CLOSURE
 
3052
  KDE_CHECK_NMCHECK
 
3053
 
 
3054
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
 
3055
])
 
3056
 
 
3057
AC_DEFUN([KDE_ADD_DEPENDENCIES],
 
3058
[
 
3059
   [A]M_DEPENDENCIES(CC)
 
3060
   [A]M_DEPENDENCIES(CXX)
 
3061
])
 
3062
 
 
3063
dnl just a wrapper to clean up configure.in
 
3064
AC_DEFUN([KDE_PROG_LIBTOOL],
 
3065
[
 
3066
AC_REQUIRE([AC_CHECK_COMPILERS])
 
3067
AC_REQUIRE([AC_ENABLE_SHARED])
 
3068
AC_REQUIRE([AC_ENABLE_STATIC])
 
3069
 
 
3070
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
 
3071
AC_REQUIRE([KDE_CHECK_LIB64])
 
3072
 
 
3073
AC_OBJEXT
 
3074
AC_EXEEXT
 
3075
 
 
3076
AM_PROG_LIBTOOL
 
3077
AC_LIBTOOL_CXX
 
3078
 
 
3079
LIBTOOL_SHELL="/bin/sh ./libtool"
 
3080
#  LIBTOOL="$LIBTOOL --silent"
 
3081
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
 
3082
AC_SUBST(KDE_PLUGIN)
 
3083
 
 
3084
# we patch configure quite some so we better keep that consistent for incremental runs 
 
3085
AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
 
3086
])
 
3087
 
 
3088
AC_DEFUN([KDE_CHECK_LIB64],
 
3089
[
 
3090
    kdelibsuff=no
 
3091
    AC_ARG_ENABLE(libsuffix,
 
3092
        AC_HELP_STRING([--enable-libsuffix],
 
3093
            [/lib directory suffix (64,32,none[=default])]),
 
3094
            kdelibsuff=$enableval)
 
3095
    # TODO: add an auto case that compiles a little C app to check
 
3096
    # where the glibc is
 
3097
    if test "$kdelibsuff" = "no"; then
 
3098
       kdelibsuff=
 
3099
    fi
 
3100
    if test -z "$kdelibsuff"; then
 
3101
        AC_MSG_RESULT([not using lib directory suffix])
 
3102
        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
 
3103
    else
 
3104
        if test "$libdir" = '${exec_prefix}/lib'; then
 
3105
            libdir="$libdir${kdelibsuff}"
 
3106
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
 
3107
        fi
 
3108
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
 
3109
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
 
3110
    fi
 
3111
])
 
3112
 
 
3113
AC_DEFUN([KDE_CHECK_TYPES],
 
3114
[  AC_CHECK_SIZEOF(int, 4)dnl
 
3115
   AC_CHECK_SIZEOF(short)dnl
 
3116
  AC_CHECK_SIZEOF(long, 4)dnl
 
3117
  AC_CHECK_SIZEOF(char *, 4)dnl
 
3118
])dnl
 
3119
 
 
3120
AC_DEFUN([KDE_DO_IT_ALL],
 
3121
[
 
3122
AC_CANONICAL_SYSTEM
 
3123
AC_ARG_PROGRAM
 
3124
AM_INIT_AUTOMAKE($1, $2)
 
3125
AM_DISABLE_LIBRARIES
 
3126
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
 
3127
AC_CHECK_COMPILERS
 
3128
KDE_PROG_LIBTOOL
 
3129
AM_KDE_WITH_NLS
 
3130
AC_PATH_KDE
 
3131
])
 
3132
 
 
3133
AC_DEFUN([AC_CHECK_RPATH],
 
3134
[
 
3135
AC_MSG_CHECKING(for rpath)
 
3136
AC_ARG_ENABLE(rpath,
 
3137
      [  --disable-rpath         do not use the rpath feature of ld],
 
3138
      USE_RPATH=$enableval, USE_RPATH=yes)
 
3139
 
 
3140
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
 
3141
 
 
3142
  KDE_RPATH="-R \$(kde_libraries)"
 
3143
 
 
3144
  if test -n "$qt_libraries"; then
 
3145
    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
 
3146
  fi
 
3147
  dnl $x_libraries is set to /usr/lib in case
 
3148
  if test -n "$X_LDFLAGS"; then
 
3149
    X_RPATH="-R \$(x_libraries)"
 
3150
    KDE_RPATH="$KDE_RPATH $X_RPATH"
 
3151
  fi
 
3152
  if test -n "$KDE_EXTRA_RPATH"; then
 
3153
    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
 
3154
  fi
 
3155
fi
 
3156
AC_SUBST(KDE_EXTRA_RPATH)
 
3157
AC_SUBST(KDE_RPATH)
 
3158
AC_SUBST(X_RPATH)
 
3159
AC_MSG_RESULT($USE_RPATH)
 
3160
])
 
3161
 
 
3162
dnl Check for the type of the third argument of getsockname
 
3163
AC_DEFUN([AC_CHECK_SOCKLEN_T], [
 
3164
  AC_MSG_CHECKING(for socklen_t)
 
3165
  AC_CACHE_VAL(ac_cv_socklen_t, [
 
3166
    AC_LANG_SAVE
 
3167
    AC_LANG_CPLUSPLUS
 
3168
    AC_TRY_COMPILE([
 
3169
#include <sys/types.h>
 
3170
#include <sys/socket.h>
 
3171
      ],[
 
3172
socklen_t a=0;
 
3173
getsockname(0,(struct sockaddr*)0, &a);
 
3174
      ],
 
3175
      ac_cv_socklen_t=socklen_t,
 
3176
      AC_TRY_COMPILE([
 
3177
#include <sys/types.h>
 
3178
#include <sys/socket.h>
 
3179
        ],[
 
3180
int a=0;
 
3181
getsockname(0,(struct sockaddr*)0, &a);
 
3182
        ],
 
3183
        ac_cv_socklen_t=int,
 
3184
        ac_cv_socklen_t=size_t
 
3185
      )
 
3186
    )
 
3187
    AC_LANG_RESTORE
 
3188
  ])
 
3189
 
 
3190
  AC_MSG_RESULT($ac_cv_socklen_t)
 
3191
  if test "$ac_cv_socklen_t" != "socklen_t"; then
 
3192
    AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
 
3193
        [Define the real type of socklen_t])
 
3194
  fi
 
3195
  AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
 
3196
 
 
3197
])
 
3198
 
 
3199
dnl This is a merge of some macros out of the gettext aclocal.m4
 
3200
dnl since we don't need anything, I took the things we need
 
3201
dnl the copyright for them is:
 
3202
dnl >
 
3203
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
3204
dnl This Makefile.in is free software; the Free Software Foundation
 
3205
dnl gives unlimited permission to copy and/or distribute it,
 
3206
dnl with or without modifications, as long as this notice is preserved.
 
3207
 
 
3208
dnl This program is distributed in the hope that it will be useful,
 
3209
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
3210
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
3211
dnl PARTICULAR PURPOSE.
 
3212
dnl >
 
3213
dnl for this file it is relicensed under LGPL
 
3214
 
 
3215
AC_DEFUN([AM_KDE_WITH_NLS],
 
3216
  [
 
3217
    dnl If we use NLS figure out what method
 
3218
 
 
3219
    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
 
3220
        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
 
3221
    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
3222
 
 
3223
     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
 
3224
        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
 
3225
        GMSGFMT=":"
 
3226
      fi
 
3227
      MSGFMT=$GMSGFMT
 
3228
      AC_SUBST(GMSGFMT)
 
3229
      AC_SUBST(MSGFMT)
 
3230
 
 
3231
      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
 
3232
        [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
3233
 
 
3234
      dnl Test whether we really found GNU xgettext.
 
3235
      if test "$XGETTEXT" != ":"; then
 
3236
        dnl If it is no GNU xgettext we define it as : so that the
 
3237
        dnl Makefiles still can work.
 
3238
        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
3239
          : ;
 
3240
        else
 
3241
          AC_MSG_RESULT(
 
3242
            [found xgettext programs is not GNU xgettext; ignore it])
 
3243
          XGETTEXT=":"
 
3244
        fi
 
3245
      fi
 
3246
     AC_SUBST(XGETTEXT)
 
3247
 
 
3248
  ])
 
3249
 
 
3250
# Search path for a program which passes the given test.
 
3251
# Ulrich Drepper <drepper@cygnus.com>, 1996.
 
3252
 
 
3253
# serial 1
 
3254
# Stephan Kulow: I appended a _KDE against name conflicts
 
3255
 
 
3256
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
 
3257
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
3258
AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
 
3259
[# Extract the first word of "$2", so it can be a program name with args.
 
3260
set dummy $2; ac_word=[$]2
 
3261
AC_MSG_CHECKING([for $ac_word])
 
3262
AC_CACHE_VAL(ac_cv_path_$1,
 
3263
[case "[$]$1" in
 
3264
  /*)
 
3265
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
3266
  ;;
 
3267
  *)
 
3268
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
3269
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
3270
    test -z "$ac_dir" && ac_dir=.
 
3271
    if test -f $ac_dir/$ac_word; then
 
3272
      if [$3]; then
 
3273
        ac_cv_path_$1="$ac_dir/$ac_word"
 
3274
        break
 
3275
      fi
 
3276
    fi
 
3277
  done
 
3278
  IFS="$ac_save_ifs"
 
3279
dnl If no 4th arg is given, leave the cache variable unset,
 
3280
dnl so AC_PATH_PROGS will keep looking.
 
3281
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
3282
])dnl
 
3283
  ;;
 
3284
esac])dnl
 
3285
$1="$ac_cv_path_$1"
 
3286
if test -n "[$]$1"; then
 
3287
  AC_MSG_RESULT([$]$1)
 
3288
else
 
3289
  AC_MSG_RESULT(no)
 
3290
fi
 
3291
AC_SUBST($1)dnl
 
3292
])
 
3293
 
 
3294
 
 
3295
# Check whether LC_MESSAGES is available in <locale.h>.
 
3296
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
3297
 
 
3298
# serial 1
 
3299
 
 
3300
AC_DEFUN([AM_LC_MESSAGES],
 
3301
  [if test $ac_cv_header_locale_h = yes; then
 
3302
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
3303
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
3304
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
3305
    if test $am_cv_val_LC_MESSAGES = yes; then
 
3306
      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
 
3307
    fi
 
3308
  fi])
 
3309
 
 
3310
dnl From Jim Meyering.
 
3311
dnl FIXME: migrate into libit.
 
3312
 
 
3313
AC_DEFUN([AM_FUNC_OBSTACK],
 
3314
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
 
3315
 [AC_TRY_LINK([#include "obstack.h"],
 
3316
              [struct obstack *mem;obstack_free(mem,(char *) 0)],
 
3317
              am_cv_func_obstack=yes,
 
3318
              am_cv_func_obstack=no)])
 
3319
 if test $am_cv_func_obstack = yes; then
 
3320
   AC_DEFINE(HAVE_OBSTACK)
 
3321
 else
 
3322
   LIBOBJS="$LIBOBJS obstack.o"
 
3323
 fi
 
3324
])
 
3325
 
 
3326
dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
 
3327
dnl FIXME: Migrate into libit
 
3328
 
 
3329
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
 
3330
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
 
3331
 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
 
3332
              am_cv_lib_error_at_line=yes,
 
3333
              am_cv_lib_error_at_line=no)])
 
3334
 if test $am_cv_lib_error_at_line = no; then
 
3335
   LIBOBJS="$LIBOBJS error.o"
 
3336
 fi
 
3337
 AC_SUBST(LIBOBJS)dnl
 
3338
])
 
3339
 
 
3340
# Macro to add for using GNU gettext.
 
3341
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
3342
 
 
3343
# serial 1
 
3344
# Stephan Kulow: I put a KDE in it to avoid name conflicts
 
3345
 
 
3346
AC_DEFUN([AM_KDE_GNU_GETTEXT],
 
3347
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
3348
   AC_REQUIRE([AC_PROG_RANLIB])dnl
 
3349
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
3350
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
3351
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
3352
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
3353
   AC_REQUIRE([AC_FUNC_MMAP])dnl
 
3354
   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
 
3355
   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
 
3356
   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
 
3357
__argz_count __argz_stringify __argz_next])
 
3358
 
 
3359
   AC_MSG_CHECKING(for stpcpy)
 
3360
   AC_CACHE_VAL(kde_cv_func_stpcpy,
 
3361
   [
 
3362
   kde_safe_cxxflags=$CXXFLAGS
 
3363
   CXXFLAGS="-Werror"
 
3364
   AC_LANG_SAVE
 
3365
   AC_LANG_CPLUSPLUS
 
3366
   AC_TRY_COMPILE([
 
3367
   #include <string.h>
 
3368
   ],
 
3369
   [
 
3370
   char buffer[200];
 
3371
   stpcpy(buffer, buffer);
 
3372
   ],
 
3373
   kde_cv_func_stpcpy=yes,
 
3374
   kde_cv_func_stpcpy=no)
 
3375
   AC_LANG_RESTORE
 
3376
   CXXFLAGS=$kde_safe_cxxflags
 
3377
   ])
 
3378
   AC_MSG_RESULT($kde_cv_func_stpcpy)
 
3379
   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
 
3380
     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
 
3381
   fi
 
3382
 
 
3383
   AM_LC_MESSAGES
 
3384
 
 
3385
   if test "x$CATOBJEXT" != "x"; then
 
3386
     if test "x$ALL_LINGUAS" = "x"; then
 
3387
       LINGUAS=
 
3388
     else
 
3389
       AC_MSG_CHECKING(for catalogs to be installed)
 
3390
       NEW_LINGUAS=
 
3391
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
 
3392
         case "$ALL_LINGUAS" in
 
3393
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
 
3394
         esac
 
3395
       done
 
3396
       LINGUAS=$NEW_LINGUAS
 
3397
       AC_MSG_RESULT($LINGUAS)
 
3398
     fi
 
3399
 
 
3400
     dnl Construct list of names of catalog files to be constructed.
 
3401
     if test -n "$LINGUAS"; then
 
3402
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
3403
     fi
 
3404
   fi
 
3405
 
 
3406
  ])
 
3407
 
 
3408
AC_DEFUN([AC_HAVE_XPM],
 
3409
 [AC_REQUIRE_CPP()dnl
 
3410
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3411
 
 
3412
 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
 
3413
 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
 
3414
 
 
3415
 AC_ARG_WITH(xpm, [  --without-xpm           disable color pixmap XPM tests],
 
3416
        xpm_test=$withval, xpm_test="yes")
 
3417
 if test "x$xpm_test" = xno; then
 
3418
   ac_cv_have_xpm=no
 
3419
 else
 
3420
   AC_MSG_CHECKING(for XPM)
 
3421
   AC_CACHE_VAL(ac_cv_have_xpm,
 
3422
   [
 
3423
    ac_save_ldflags="$LDFLAGS"
 
3424
    ac_save_cflags="$CFLAGS"
 
3425
    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 
3426
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
 
3427
    else
 
3428
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
 
3429
    fi
 
3430
    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
 
3431
    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
 
3432
    AC_TRY_LINK([#include <X11/xpm.h>],[],
 
3433
        ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
 
3434
    LDFLAGS="$ac_save_ldflags"
 
3435
    CFLAGS="$ac_save_cflags"
 
3436
   ])dnl
 
3437
 
 
3438
  if test "$ac_cv_have_xpm" = no; then
 
3439
    AC_MSG_RESULT(no)
 
3440
    XPM_LDFLAGS=""
 
3441
    XPMINC=""
 
3442
    $2
 
3443
  else
 
3444
    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
 
3445
    if test "$XPM_LDFLAGS" = ""; then
 
3446
       XPMLIB='-lXpm $(LIB_X11)'
 
3447
    else
 
3448
       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
 
3449
    fi
 
3450
    if test "$XPM_INCLUDE" = ""; then
 
3451
       XPMINC=""
 
3452
    else
 
3453
       XPMINC="-I$XPM_INCLUDE"
 
3454
    fi
 
3455
    AC_MSG_RESULT(yes)
 
3456
    $1
 
3457
  fi
 
3458
 fi
 
3459
 AC_SUBST(XPMINC)
 
3460
 AC_SUBST(XPMLIB)
 
3461
])
 
3462
 
 
3463
AC_DEFUN([AC_HAVE_DPMS],
 
3464
 [AC_REQUIRE_CPP()dnl
 
3465
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3466
 
 
3467
 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
 
3468
 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
 
3469
 DPMS_LIB=
 
3470
 
 
3471
 AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS power saving],
 
3472
        dpms_test=$withval, dpms_test="yes")
 
3473
 if test "x$dpms_test" = xno; then
 
3474
   ac_cv_have_dpms=no
 
3475
 else
 
3476
   AC_MSG_CHECKING(for DPMS)
 
3477
   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
 
3478
   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
 
3479
   AC_CACHE_VAL(ac_cv_have_dpms,
 
3480
   [
 
3481
    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
 
3482
      AC_MSG_RESULT(no)
 
3483
      ac_cv_have_dpms="no"
 
3484
    else
 
3485
      ac_save_ldflags="$LDFLAGS"
 
3486
      ac_save_cflags="$CFLAGS"
 
3487
      ac_save_libs="$LIBS"
 
3488
      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
 
3489
      CFLAGS="$CFLAGS $X_INCLUDES"
 
3490
      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3491
      AC_TRY_LINK([
 
3492
          #include <X11/Xproto.h>
 
3493
          #include <X11/X.h>
 
3494
          #include <X11/Xlib.h>
 
3495
          #include <X11/extensions/dpms.h>
 
3496
          int foo_test_dpms()
 
3497
          { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
 
3498
          ac_cv_have_dpms="yes", [
 
3499
              LDFLAGS="$ac_save_ldflags"
 
3500
              CFLAGS="$ac_save_cflags"
 
3501
              LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
 
3502
              LIBS="$LIBS -lXdpms"
 
3503
              CFLAGS="$CFLAGS $X_INCLUDES"
 
3504
              test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3505
              AC_TRY_LINK([
 
3506
                  #include <X11/Xproto.h>
 
3507
                  #include <X11/X.h>
 
3508
                  #include <X11/Xlib.h>
 
3509
                  #include <X11/extensions/dpms.h>
 
3510
                  int foo_test_dpms()
 
3511
                  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
 
3512
                  [
 
3513
                  ac_cv_have_dpms="-lXdpms"
 
3514
                  ],ac_cv_have_dpms="no")
 
3515
              ])
 
3516
      LDFLAGS="$ac_save_ldflags"
 
3517
      CFLAGS="$ac_save_cflags"
 
3518
      LIBS="$ac_save_libs"
 
3519
    fi
 
3520
   ])dnl
 
3521
 
 
3522
  if test "$ac_cv_have_dpms" = no; then
 
3523
    AC_MSG_RESULT(no)
 
3524
    DPMS_LDFLAGS=""
 
3525
    DPMSINC=""
 
3526
    $2
 
3527
  else
 
3528
    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
 
3529
    if test "$ac_cv_have_dpms" = "-lXdpms"; then
 
3530
       DPMS_LIB="-lXdpms"
 
3531
    fi
 
3532
    if test "$DPMS_LDFLAGS" = ""; then
 
3533
       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
 
3534
    else
 
3535
       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
 
3536
    fi
 
3537
    if test "$DPMS_INCLUDE" = ""; then
 
3538
       DPMSINC=""
 
3539
    else
 
3540
       DPMSINC="-I$DPMS_INCLUDE"
 
3541
    fi
 
3542
    AC_MSG_RESULT(yes)
 
3543
    $1
 
3544
  fi
 
3545
 fi
 
3546
 ac_save_cflags="$CFLAGS"
 
3547
 CFLAGS="$CFLAGS $X_INCLUDES"
 
3548
 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
 
3549
 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
 
3550
   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
 
3551
 AC_CHECK_DECL(DPMSCapable,
 
3552
   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
 
3553
   [#include <X11/extensions/dpms.h>])
 
3554
 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
 
3555
   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
 
3556
 AC_CHECK_DECL(DPMSInfo,
 
3557
   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
 
3558
   [#include <X11/extensions/dpms.h>])
 
3559
 CFLAGS="$ac_save_cflags"
 
3560
 AC_SUBST(DPMSINC)
 
3561
 AC_SUBST(DPMSLIB)
 
3562
])
 
3563
 
 
3564
AC_DEFUN([AC_HAVE_GL],
 
3565
 [AC_REQUIRE_CPP()dnl
 
3566
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
3567
 
 
3568
 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
 
3569
 test -z "$GL_INCLUDE" && GL_INCLUDE=
 
3570
 
 
3571
 AC_ARG_WITH(gl, [  --without-gl            disable 3D GL modes],
 
3572
        gl_test=$withval, gl_test="yes")
 
3573
 if test "x$kde_use_qt_emb" = "xyes"; then
 
3574
   # GL and Qt Embedded is a no-go for now.
 
3575
   ac_cv_have_gl=no
 
3576
 elif test "x$gl_test" = xno; then
 
3577
   ac_cv_have_gl=no
 
3578
 else
 
3579
   AC_MSG_CHECKING(for GL)
 
3580
   AC_CACHE_VAL(ac_cv_have_gl,
 
3581
   [
 
3582
    AC_LANG_SAVE
 
3583
    AC_LANG_CPLUSPLUS
 
3584
    ac_save_ldflags="$LDFLAGS"
 
3585
    ac_save_cxxflags="$CXXFLAGS"
 
3586
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
 
3587
    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
 
3588
    LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
 
3589
    CXXFLAGS="$CFLAGS $X_INCLUDES"
 
3590
    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
 
3591
    AC_TRY_LINK([#include <GL/gl.h>
 
3592
#include <GL/glu.h>
 
3593
], [],
 
3594
        ac_cv_have_gl="mesa", ac_cv_have_gl="no")
 
3595
    if test "x$ac_cv_have_gl" = "xno"; then
 
3596
      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
 
3597
      test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
 
3598
      LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
 
3599
      CXXFLAGS="$ac_save_cflags $X_INCLUDES"
 
3600
      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
 
3601
      AC_TRY_LINK([#include <GL/gl.h>
 
3602
#include <GL/glu.h>
 
3603
], [],
 
3604
          ac_cv_have_gl="yes", ac_cv_have_gl="no")
 
3605
    fi
 
3606
    AC_LANG_RESTORE
 
3607
    LDFLAGS="$ac_save_ldflags"
 
3608
    CXXFLAGS="$ac_save_cxxflags"
 
3609
   ])dnl
 
3610
 
 
3611
  if test "$ac_cv_have_gl" = "no"; then
 
3612
    AC_MSG_RESULT(no)
 
3613
    GL_LDFLAGS=""
 
3614
    GLINC=""
 
3615
    $2
 
3616
  else
 
3617
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
 
3618
    if test "$GL_LDFLAGS" = ""; then
 
3619
       if test "$ac_cv_have_gl" = "mesa"; then
 
3620
          GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
 
3621
       else
 
3622
          GLLIB='-lGLU -lGL $(LIB_X11)'
 
3623
       fi
 
3624
    else
 
3625
       if test "$ac_cv_have_gl" = "mesa"; then
 
3626
          GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
 
3627
       else
 
3628
          GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
 
3629
       fi
 
3630
    fi
 
3631
    if test "$GL_INCLUDE" = ""; then
 
3632
       GLINC=""
 
3633
    else
 
3634
       GLINC="-I$GL_INCLUDE"
 
3635
    fi
 
3636
    AC_MSG_RESULT($ac_cv_have_gl)
 
3637
    $1
 
3638
  fi
 
3639
 fi
 
3640
 AC_SUBST(GLINC)
 
3641
 AC_SUBST(GLLIB)
 
3642
])
 
3643
 
 
3644
 
 
3645
 dnl shadow password and PAM magic - maintained by ossi@kde.org
 
3646
 
 
3647
AC_DEFUN([KDE_PAM], [
 
3648
  AC_REQUIRE([KDE_CHECK_LIBDL])
 
3649
 
 
3650
  want_pam=
 
3651
  AC_ARG_WITH(pam,
 
3652
    [  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
 
3653
    [ if test "x$withval" = "xyes"; then
 
3654
        want_pam=yes
 
3655
        pam_service=kde
 
3656
      elif test "x$withval" = "xno"; then
 
3657
        want_pam=no
 
3658
      else
 
3659
        want_pam=yes
 
3660
        pam_service=$withval
 
3661
      fi
 
3662
    ], [ pam_service=kde ])
 
3663
 
 
3664
  use_pam=
 
3665
  PAMLIBS=
 
3666
  if test "x$want_pam" != xno; then
 
3667
    AC_CHECK_LIB(pam, pam_start, [
 
3668
      AC_CHECK_HEADER(security/pam_appl.h,
 
3669
        [ pam_header=security/pam_appl.h ],
 
3670
        [ AC_CHECK_HEADER(pam/pam_appl.h,
 
3671
            [ pam_header=pam/pam_appl.h ],
 
3672
            [
 
3673
    AC_MSG_WARN([PAM detected, but no headers found!
 
3674
Make sure you have the necessary development packages installed.])
 
3675
            ]
 
3676
          )
 
3677
        ]
 
3678
      )
 
3679
    ], , $LIBDL)
 
3680
    if test -z "$pam_header"; then
 
3681
      if test "x$want_pam" = xyes; then
 
3682
        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
 
3683
      fi
 
3684
    else
 
3685
      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
 
3686
      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
 
3687
      use_pam=yes
 
3688
 
 
3689
      dnl darwin claims to be something special
 
3690
      if test "$pam_header" = "pam/pam_appl.h"; then
 
3691
        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
 
3692
      fi
 
3693
 
 
3694
      dnl test whether struct pam_message is const (Linux) or not (Sun)
 
3695
      AC_MSG_CHECKING(for const pam_message)
 
3696
      AC_EGREP_HEADER([struct pam_message], $pam_header,
 
3697
        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
 
3698
                          [AC_MSG_RESULT([const: Linux-type PAM])],
 
3699
                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
 
3700
                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
 
3701
                          )],
 
3702
        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
 
3703
    fi
 
3704
  fi
 
3705
 
 
3706
  AC_SUBST(PAMLIBS)
 
3707
])
 
3708
 
 
3709
dnl DEF_PAM_SERVICE(arg name, full name, define name)
 
3710
AC_DEFUN([DEF_PAM_SERVICE], [
 
3711
  AC_ARG_WITH($1-pam,
 
3712
    [  --with-$1-pam=[val]    override PAM service from --with-pam for $2],
 
3713
    [ if test "x$use_pam" = xyes; then
 
3714
        $3_PAM_SERVICE=$withval
 
3715
      else
 
3716
        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
 
3717
You may want to enforce it by using --with-pam.])
 
3718
      fi
 
3719
    ], 
 
3720
    [ if test "x$use_pam" = xyes; then
 
3721
        $3_PAM_SERVICE="$pam_service"
 
3722
      fi
 
3723
    ])
 
3724
    if test -n "$$3_PAM_SERVICE"; then
 
3725
      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
 
3726
      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
 
3727
    fi
 
3728
    AC_SUBST($3_PAM_SERVICE)
 
3729
])
 
3730
 
 
3731
AC_DEFUN([KDE_SHADOWPASSWD], [
 
3732
  AC_REQUIRE([KDE_PAM])
 
3733
 
 
3734
  AC_CHECK_LIB(shadow, getspent,
 
3735
    [ LIBSHADOW="-lshadow"
 
3736
      ac_use_shadow=yes
 
3737
    ],
 
3738
    [ dnl for UnixWare
 
3739
      AC_CHECK_LIB(gen, getspent, 
 
3740
        [ LIBGEN="-lgen"
 
3741
          ac_use_shadow=yes
 
3742
        ], 
 
3743
        [ AC_CHECK_FUNC(getspent, 
 
3744
            [ ac_use_shadow=yes ],
 
3745
            [ ac_use_shadow=no ])
 
3746
        ])
 
3747
    ])
 
3748
  AC_SUBST(LIBSHADOW)
 
3749
  AC_SUBST(LIBGEN)
 
3750
  
 
3751
  AC_MSG_CHECKING([for shadow passwords])
 
3752
 
 
3753
  AC_ARG_WITH(shadow,
 
3754
    [  --with-shadow              If you want shadow password support ],
 
3755
    [ if test "x$withval" != "xno"; then
 
3756
        use_shadow=yes
 
3757
      else
 
3758
        use_shadow=no
 
3759
      fi
 
3760
    ], [
 
3761
      use_shadow="$ac_use_shadow"
 
3762
    ])
 
3763
 
 
3764
  if test "x$use_shadow" = xyes; then
 
3765
    AC_MSG_RESULT(yes)
 
3766
    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
 
3767
  else
 
3768
    AC_MSG_RESULT(no)
 
3769
    LIBSHADOW=
 
3770
    LIBGEN=
 
3771
  fi
 
3772
 
 
3773
  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
 
3774
  dnl this still applies, if we could use it indirectly through pam.
 
3775
  if test "x$use_shadow" = xyes || 
 
3776
     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
 
3777
      case $host in
 
3778
      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
 
3779
        SETUIDFLAGS="-m 4755 -o root";;
 
3780
      *)
 
3781
        SETUIDFLAGS="-m 4755";;
 
3782
      esac
 
3783
  fi
 
3784
  AC_SUBST(SETUIDFLAGS)
 
3785
 
 
3786
])
 
3787
 
 
3788
AC_DEFUN([KDE_PASSWDLIBS], [
 
3789
  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
 
3790
  AC_REQUIRE([KDE_PAM])
 
3791
  AC_REQUIRE([KDE_SHADOWPASSWD])
 
3792
 
 
3793
  if test "x$use_pam" = "xyes"; then 
 
3794
    PASSWDLIBS="$PAMLIBS"
 
3795
  else
 
3796
    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
 
3797
  fi
 
3798
 
 
3799
  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
 
3800
  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
 
3801
  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
 
3802
  dnl may need to read /etc/master.passwd).
 
3803
  case $host in
 
3804
  *-*-freebsd*)
 
3805
    SETUIDFLAGS="-m 4755 -o root"
 
3806
    ;;
 
3807
  *)
 
3808
    ;;
 
3809
  esac
 
3810
 
 
3811
  AC_SUBST(PASSWDLIBS)
 
3812
])
 
3813
 
 
3814
AC_DEFUN([KDE_CHECK_LIBDL],
 
3815
[
 
3816
AC_CHECK_LIB(dl, dlopen, [
 
3817
LIBDL="-ldl"
 
3818
ac_cv_have_dlfcn=yes
 
3819
])
 
3820
 
 
3821
AC_CHECK_LIB(dld, shl_unload, [
 
3822
LIBDL="-ldld"
 
3823
ac_cv_have_shload=yes
 
3824
])
 
3825
 
 
3826
AC_SUBST(LIBDL)
 
3827
])
 
3828
 
 
3829
AC_DEFUN([KDE_CHECK_DLOPEN],
 
3830
[
 
3831
KDE_CHECK_LIBDL
 
3832
AC_CHECK_HEADERS(dlfcn.h dl.h)
 
3833
if test "$ac_cv_header_dlfcn_h" = "no"; then
 
3834
  ac_cv_have_dlfcn=no
 
3835
fi
 
3836
 
 
3837
if test "$ac_cv_header_dl_h" = "no"; then
 
3838
  ac_cv_have_shload=no
 
3839
fi
 
3840
 
 
3841
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
 
3842
dnl (MM)
 
3843
AC_ARG_ENABLE(dlopen,
 
3844
[  --disable-dlopen        link statically [default=no]] ,
 
3845
enable_dlopen=$enableval,
 
3846
enable_dlopen=yes)
 
3847
 
 
3848
# override the user's opinion, if we know it better ;)
 
3849
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
 
3850
  enable_dlopen=no
 
3851
fi
 
3852
 
 
3853
if test "$ac_cv_have_dlfcn" = "yes"; then
 
3854
  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
 
3855
fi
 
3856
 
 
3857
if test "$ac_cv_have_shload" = "yes"; then
 
3858
  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
 
3859
fi
 
3860
 
 
3861
if test "$enable_dlopen" = no ; then
 
3862
  test -n "$1" && eval $1
 
3863
else
 
3864
  test -n "$2" && eval $2
 
3865
fi
 
3866
 
 
3867
])
 
3868
 
 
3869
AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
 
3870
[
 
3871
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
 
3872
KDE_PROG_LIBTOOL
 
3873
AC_MSG_CHECKING([dynamic loading])
 
3874
eval "`egrep '^build_libtool_libs=' libtool`"
 
3875
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
 
3876
  dynamic_loading=yes
 
3877
  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
 
3878
else
 
3879
  dynamic_loading=no
 
3880
fi
 
3881
AC_MSG_RESULT($dynamic_loading)
 
3882
if test "$dynamic_loading" = "yes"; then
 
3883
  $1
 
3884
else
 
3885
  $2
 
3886
fi
 
3887
])
 
3888
 
 
3889
AC_DEFUN([KDE_ADD_INCLUDES],
 
3890
[
 
3891
if test -z "$1"; then
 
3892
  test_include="Pix.h"
 
3893
else
 
3894
  test_include="$1"
 
3895
fi
 
3896
 
 
3897
AC_MSG_CHECKING([for libg++ ($test_include)])
 
3898
 
 
3899
AC_CACHE_VAL(kde_cv_libgpp_includes,
 
3900
[
 
3901
kde_cv_libgpp_includes=no
 
3902
 
 
3903
   for ac_dir in               \
 
3904
                               \
 
3905
     /usr/include/g++          \
 
3906
     /usr/include              \
 
3907
     /usr/unsupported/include  \
 
3908
     /opt/include              \
 
3909
     $extra_include            \
 
3910
     ; \
 
3911
   do
 
3912
     if test -r "$ac_dir/$test_include"; then
 
3913
       kde_cv_libgpp_includes=$ac_dir
 
3914
       break
 
3915
     fi
 
3916
   done
 
3917
])
 
3918
 
 
3919
AC_MSG_RESULT($kde_cv_libgpp_includes)
 
3920
if test "$kde_cv_libgpp_includes" != "no"; then
 
3921
  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
 
3922
fi
 
3923
])
 
3924
])
 
3925
 
 
3926
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
 
3927
[
 
3928
  LIBPTHREAD=""
 
3929
 
 
3930
  if test -n "$PTHREAD_LIBS"; then
 
3931
    PTHREAD_LIBS_save="$PTHREAD_LIBS"
 
3932
    PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
 
3933
    KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [LIBPTHREAD="$PTHREAD_LIBS_save"] )
 
3934
    PTHREAD_LIBS="$PTHREAD_LIBS_save"
 
3935
  fi
 
3936
 
 
3937
  if test -z "$LIBPTHREAD"; then
 
3938
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
 
3939
  fi
 
3940
 
 
3941
  AC_SUBST(LIBPTHREAD)
 
3942
])
 
3943
 
 
3944
AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
 
3945
[
 
3946
      USE_THREADS=""
 
3947
      if test -z "$LIBPTHREAD"; then
 
3948
        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
 
3949
      fi
 
3950
 
 
3951
    AH_VERBATIM(__svr_define, [
 
3952
#if defined(__SVR4) && !defined(__svr4__)
 
3953
#define __svr4__ 1
 
3954
#endif
 
3955
])
 
3956
    case $host_os in
 
3957
        solaris*)
 
3958
                KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
 
3959
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
 
3960
                ;;
 
3961
        freebsd*)
 
3962
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
 
3963
                ;;
 
3964
        aix*)
 
3965
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
 
3966
                LIBPTHREAD="$LIBPTHREAD -lc_r"
 
3967
                ;;
 
3968
        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
3969
                if test "$CXX" = "KCC"; then
 
3970
                  CXXFLAGS="$CXXFLAGS --thread_safe"
 
3971
                  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
 
3972
                fi
 
3973
                ;;
 
3974
        *)
 
3975
                ;;
 
3976
    esac
 
3977
    AC_SUBST(USE_THREADS)
 
3978
    AC_SUBST(LIBPTHREAD)
 
3979
])
 
3980
 
 
3981
AC_DEFUN([KDE_CHECK_THREADING],
 
3982
[
 
3983
  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
 
3984
  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
 
3985
  dnl default is yes if libpthread is found and no if no libpthread is available
 
3986
  if test -z "$LIBPTHREAD"; then
 
3987
    if test -z "$USE_THREADS"; then
 
3988
      kde_check_threading_default=no
 
3989
    else
 
3990
      kde_check_threading_default=yes
 
3991
    fi
 
3992
  else
 
3993
    kde_check_threading_default=yes
 
3994
  fi
 
3995
  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
 
3996
   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
 
3997
  if test "x$kde_use_threading" = "xyes"; then
 
3998
    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
 
3999
  fi
 
4000
])
 
4001
 
 
4002
AC_DEFUN([KDE_TRY_LINK_PYTHON],
 
4003
[
 
4004
if test "$kde_python_link_found" = no; then
 
4005
 
 
4006
if test "$1" = normal; then
 
4007
  AC_MSG_CHECKING(if a Python application links)
 
4008
else
 
4009
  AC_MSG_CHECKING(if Python depends on $2)
 
4010
fi
 
4011
 
 
4012
AC_CACHE_VAL(kde_cv_try_link_python_$1,
 
4013
[
 
4014
kde_save_cflags="$CFLAGS"
 
4015
CFLAGS="$CFLAGS $PYTHONINC"
 
4016
kde_save_libs="$LIBS"
 
4017
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
 
4018
kde_save_ldflags="$LDFLAGS"
 
4019
LDFLAGS="$LDFLAGS $PYTHONLIB"
 
4020
 
 
4021
AC_TRY_LINK(
 
4022
[
 
4023
#include <Python.h>
 
4024
],[
 
4025
        PySys_SetArgv(1, 0);
 
4026
],
 
4027
        [kde_cv_try_link_python_$1=yes],
 
4028
        [kde_cv_try_link_python_$1=no]
 
4029
)
 
4030
CFLAGS="$kde_save_cflags"
 
4031
LIBS="$kde_save_libs"
 
4032
LDFLAGS="$kde_save_ldflags"
 
4033
])
 
4034
 
 
4035
if test "$kde_cv_try_link_python_$1" = "yes"; then
 
4036
  AC_MSG_RESULT(yes)
 
4037
  kde_python_link_found=yes
 
4038
  if test ! "$1" = normal; then
 
4039
    LIBPYTHON="$LIBPYTHON $2"
 
4040
  fi
 
4041
  $3
 
4042
else
 
4043
  AC_MSG_RESULT(no)
 
4044
  $4
 
4045
fi
 
4046
 
 
4047
fi
 
4048
 
 
4049
])
 
4050
 
 
4051
AC_DEFUN([KDE_CHECK_PYTHON_DIR],
 
4052
[
 
4053
AC_MSG_CHECKING([for Python directory])
 
4054
 
 
4055
AC_CACHE_VAL(kde_cv_pythondir,
 
4056
[
 
4057
  if test -z "$PYTHONDIR"; then
 
4058
    kde_cv_pythondir=/usr/local
 
4059
  else
 
4060
    kde_cv_pythondir="$PYTHONDIR"
 
4061
  fi
 
4062
])
 
4063
 
 
4064
AC_ARG_WITH(pythondir,
 
4065
[  --with-pythondir=pythondir   use python installed in pythondir ],
 
4066
[
 
4067
  ac_python_dir=$withval
 
4068
], ac_python_dir=$kde_cv_pythondir
 
4069
)
 
4070
 
 
4071
AC_MSG_RESULT($ac_python_dir)
 
4072
])
 
4073
 
 
4074
AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
 
4075
[
 
4076
AC_REQUIRE([KDE_CHECK_LIBDL])
 
4077
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
 
4078
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
 
4079
 
 
4080
if test -z "$1"; then
 
4081
  version="1.5"
 
4082
else
 
4083
  version="$1"
 
4084
fi
 
4085
 
 
4086
AC_MSG_CHECKING([for Python$version])
 
4087
 
 
4088
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
 
4089
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
 
4090
if test ! -r $python_incdir/Python.h; then
 
4091
  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
 
4092
  python_incdir=$python_incdir/python$version
 
4093
  if test ! -r $python_incdir/Python.h; then
 
4094
    python_incdir=no
 
4095
  fi
 
4096
fi
 
4097
 
 
4098
PYTHONINC=-I$python_incdir
 
4099
 
 
4100
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
 
4101
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
 
4102
if test ! -r $python_libdir/libpython$version.so; then
 
4103
  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
 
4104
  if test ! -r $python_libdir/libpython$version.a; then
 
4105
    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
 
4106
    python_libdir=$python_libdir/python$version/config
 
4107
    if test ! -r $python_libdir/libpython$version.a; then
 
4108
      python_libdir=no
 
4109
    fi
 
4110
  fi
 
4111
fi
 
4112
 
 
4113
PYTHONLIB=-L$python_libdir
 
4114
kde_orig_LIBPYTHON=$LIBPYTHON
 
4115
if test -z "$LIBPYTHON"; then
 
4116
  LIBPYTHON=-lpython$version
 
4117
fi
 
4118
 
 
4119
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
 
4120
python_moddir=$python_moddir/python$version
 
4121
if test ! -r $python_moddir/copy.py; then
 
4122
  python_moddir=no
 
4123
fi
 
4124
 
 
4125
PYTHONMODDIR=$python_moddir
 
4126
 
 
4127
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
 
4128
 
 
4129
if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
 
4130
   LIBPYTHON=$kde_orig_LIBPYTHON
 
4131
   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
 
4132
   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
 
4133
   $2
 
4134
else 
 
4135
  dnl Note: this test is very weak
 
4136
  kde_python_link_found=no
 
4137
  KDE_TRY_LINK_PYTHON(normal)
 
4138
  KDE_TRY_LINK_PYTHON(m, -lm)
 
4139
  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
 
4140
  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
 
4141
  KDE_TRY_LINK_PYTHON(db2, -ldb2)
 
4142
  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
 
4143
  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
 
4144
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
 
4145
  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
 
4146
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
 
4147
  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
 
4148
  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
 
4149
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
 
4150
        [AC_MSG_WARN([it seems, Python depends on another library.
 
4151
    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
 
4152
    and contact the authors to let them know about this problem])
 
4153
        ])
 
4154
 
 
4155
  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
 
4156
  AC_SUBST(PYTHONINC)
 
4157
  AC_SUBST(PYTHONLIB)
 
4158
  AC_SUBST(LIBPYTHON)
 
4159
  AC_SUBST(PYTHONMODDIR)
 
4160
  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
 
4161
fi
 
4162
 
 
4163
])
 
4164
 
 
4165
 
 
4166
AC_DEFUN([KDE_CHECK_PYTHON],
 
4167
[
 
4168
  KDE_CHECK_PYTHON_INTERN("2.3", 
 
4169
   [KDE_CHECK_PYTHON_INTERN("2.2", 
 
4170
     [KDE_CHECK_PYTHON_INTERN("2.1", 
 
4171
       [KDE_CHECK_PYTHON_INTERN("2.0", 
 
4172
         [KDE_CHECK_PYTHON_INTERN($1, $2) ])
 
4173
       ])
 
4174
     ])
 
4175
   ])
 
4176
])
 
4177
 
 
4178
AC_DEFUN([KDE_CHECK_STL],
 
4179
[
 
4180
    AC_LANG_SAVE
 
4181
    AC_LANG_CPLUSPLUS
 
4182
    ac_save_CXXFLAGS="$CXXFLAGS"
 
4183
    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
 
4184
 
 
4185
    AC_MSG_CHECKING([if C++ programs can be compiled])
 
4186
    AC_CACHE_VAL(kde_cv_stl_works,
 
4187
    [
 
4188
      AC_TRY_COMPILE([
 
4189
#include <string>
 
4190
using namespace std;
 
4191
],[
 
4192
  string astring="Hallo Welt.";
 
4193
  astring.erase(0, 6); // now astring is "Welt"
 
4194
  return 0;
 
4195
], kde_cv_stl_works=yes,
 
4196
   kde_cv_stl_works=no)
 
4197
])
 
4198
 
 
4199
   AC_MSG_RESULT($kde_cv_stl_works)
 
4200
 
 
4201
   if test "$kde_cv_stl_works" = "yes"; then
 
4202
     # back compatible
 
4203
         AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
 
4204
   else
 
4205
         AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
 
4206
Check config.log for details - if you're using a Linux distribution you might miss
 
4207
a package named similiar to libstd++-dev.])
 
4208
   fi
 
4209
 
 
4210
   CXXFLAGS="$ac_save_CXXFLAGS"
 
4211
   AC_LANG_RESTORE
 
4212
])
 
4213
 
 
4214
AC_DEFUN([AC_FIND_QIMGIO],
 
4215
   [AC_REQUIRE([AC_FIND_JPEG])
 
4216
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
 
4217
AC_MSG_CHECKING([for qimgio])
 
4218
AC_CACHE_VAL(ac_cv_lib_qimgio,
 
4219
[
 
4220
AC_LANG_SAVE
 
4221
AC_LANG_CPLUSPLUS
 
4222
ac_save_LIBS="$LIBS"
 
4223
ac_save_CXXFLAGS="$CXXFLAGS"
 
4224
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
 
4225
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
 
4226
AC_TRY_RUN(dnl
 
4227
[
 
4228
#include <qimageio.h>
 
4229
#include <qstring.h>
 
4230
int main() {
 
4231
                QString t = "hallo";
 
4232
                t.fill('t');
 
4233
                qInitImageIO();
 
4234
}
 
4235
],
 
4236
            ac_cv_lib_qimgio=yes,
 
4237
            ac_cv_lib_qimgio=no,
 
4238
            ac_cv_lib_qimgio=no)
 
4239
LIBS="$ac_save_LIBS"
 
4240
CXXFLAGS="$ac_save_CXXFLAGS"
 
4241
AC_LANG_RESTORE
 
4242
])dnl
 
4243
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
 
4244
  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
 
4245
  AC_MSG_RESULT(yes)
 
4246
  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
 
4247
  AC_SUBST(LIBQIMGIO)
 
4248
else
 
4249
  AC_MSG_RESULT(not found)
 
4250
fi
 
4251
])
 
4252
 
 
4253
AC_DEFUN([AM_DISABLE_LIBRARIES],
 
4254
[
 
4255
    AC_PROVIDE([AM_ENABLE_STATIC])
 
4256
    AC_PROVIDE([AM_ENABLE_SHARED])
 
4257
    enable_static=no
 
4258
    enable_shared=yes
 
4259
])
 
4260
 
 
4261
 
 
4262
AC_DEFUN([AC_CHECK_UTMP_FILE],
 
4263
[
 
4264
    AC_MSG_CHECKING([for utmp file])
 
4265
 
 
4266
    AC_CACHE_VAL(kde_cv_utmp_file,
 
4267
    [
 
4268
    kde_cv_utmp_file=no
 
4269
 
 
4270
    for ac_file in    \
 
4271
                      \
 
4272
        /var/run/utmp \
 
4273
        /var/adm/utmp \
 
4274
        /etc/utmp     \
 
4275
     ; \
 
4276
    do
 
4277
     if test -r "$ac_file"; then
 
4278
       kde_cv_utmp_file=$ac_file
 
4279
       break
 
4280
     fi
 
4281
    done
 
4282
    ])
 
4283
 
 
4284
    if test "$kde_cv_utmp_file" != "no"; then
 
4285
        AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
 
4286
        $1
 
4287
        AC_MSG_RESULT($kde_cv_utmp_file)
 
4288
    else
 
4289
        $2
 
4290
        AC_MSG_RESULT([non found])
 
4291
    fi
 
4292
])
 
4293
 
 
4294
 
 
4295
AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
 
4296
[
 
4297
 
 
4298
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
 
4299
 
 
4300
if test ! -s $srcdir/subdirs; then
 
4301
  dnl Note: Makefile.common creates subdirs, so this is just a fallback
 
4302
  TOPSUBDIRS=""
 
4303
  files=`cd $srcdir && ls -1`
 
4304
  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
 
4305
  for i in $dirs; do
 
4306
    echo $i >> $srcdir/subdirs
 
4307
  done
 
4308
fi
 
4309
 
 
4310
ac_topsubdirs=
 
4311
if test -s $srcdir/inst-apps; then
 
4312
  ac_topsubdirs="`cat $srcdir/inst-apps`"
 
4313
elif test -s $srcdir/subdirs; then
 
4314
  ac_topsubdirs="`cat $srcdir/subdirs`"
 
4315
fi
 
4316
 
 
4317
for i in $ac_topsubdirs; do
 
4318
  AC_MSG_CHECKING([if $i should be compiled])
 
4319
  if test -d $srcdir/$i; then
 
4320
    install_it="yes"
 
4321
    for j in $DO_NOT_COMPILE; do
 
4322
      if test $i = $j; then
 
4323
        install_it="no"
 
4324
      fi
 
4325
    done
 
4326
  else
 
4327
    install_it="no"
 
4328
  fi
 
4329
  AC_MSG_RESULT($install_it)
 
4330
  vari=`echo $i | sed -e 's,[[-+.]],_,g'`
 
4331
  if test $install_it = "yes"; then
 
4332
    TOPSUBDIRS="$TOPSUBDIRS $i"
 
4333
    eval "$vari""_SUBDIR_included=yes"
 
4334
  else
 
4335
    eval "$vari""_SUBDIR_included=no"
 
4336
  fi
 
4337
done
 
4338
 
 
4339
AC_SUBST(TOPSUBDIRS)
 
4340
])
 
4341
 
 
4342
AC_DEFUN([KDE_CHECK_NAMESPACES],
 
4343
[
 
4344
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
 
4345
AC_LANG_SAVE
 
4346
AC_LANG_CPLUSPLUS
 
4347
AC_TRY_COMPILE([
 
4348
],
 
4349
[
 
4350
namespace Foo {
 
4351
  extern int i;
 
4352
  namespace Bar {
 
4353
    extern int i;
 
4354
  }
 
4355
}
 
4356
 
 
4357
int Foo::i = 0;
 
4358
int Foo::Bar::i = 1;
 
4359
],[
 
4360
  AC_MSG_RESULT(yes)
 
4361
  AC_DEFINE(HAVE_NAMESPACES)
 
4362
], [
 
4363
AC_MSG_RESULT(no)
 
4364
])
 
4365
AC_LANG_RESTORE
 
4366
])
 
4367
 
 
4368
dnl ------------------------------------------------------------------------
 
4369
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
 
4370
dnl ------------------------------------------------------------------------
 
4371
dnl
 
4372
AC_DEFUN([AC_CHECK_S_ISSOCK],
 
4373
[
 
4374
AC_MSG_CHECKING(for S_ISSOCK)
 
4375
AC_CACHE_VAL(ac_cv_have_s_issock,
 
4376
[
 
4377
AC_TRY_LINK(
 
4378
[
 
4379
#include <sys/stat.h>
 
4380
],
 
4381
[
 
4382
struct stat buff;
 
4383
int b = S_ISSOCK( buff.st_mode );
 
4384
],
 
4385
ac_cv_have_s_issock=yes,
 
4386
ac_cv_have_s_issock=no)
 
4387
])
 
4388
AC_MSG_RESULT($ac_cv_have_s_issock)
 
4389
if test "$ac_cv_have_s_issock" = "yes"; then
 
4390
  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
 
4391
fi
 
4392
 
 
4393
AH_VERBATIM(_ISSOCK,
 
4394
[
 
4395
#ifndef HAVE_S_ISSOCK
 
4396
#define HAVE_S_ISSOCK
 
4397
#define S_ISSOCK(mode) (1==0)
 
4398
#endif
 
4399
])
 
4400
 
 
4401
])
 
4402
 
 
4403
dnl ------------------------------------------------------------------------
 
4404
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
 
4405
dnl ------------------------------------------------------------------------
 
4406
dnl
 
4407
AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
 
4408
[
 
4409
AC_MSG_CHECKING(for MAXPATHLEN)
 
4410
AC_CACHE_VAL(ac_cv_maxpathlen,
 
4411
[
 
4412
cat > conftest.$ac_ext <<EOF
 
4413
#ifdef STDC_HEADERS
 
4414
# include <stdlib.h>
 
4415
#endif
 
4416
#include <stdio.h>
 
4417
#include <sys/param.h>
 
4418
#ifndef MAXPATHLEN
 
4419
#define MAXPATHLEN 1024
 
4420
#endif
 
4421
 
 
4422
KDE_HELLO MAXPATHLEN
 
4423
 
 
4424
EOF
 
4425
 
 
4426
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
 
4427
 
 
4428
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
 
4429
    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
 
4430
else
 
4431
    ac_cv_maxpathlen=1024
 
4432
fi
 
4433
 
 
4434
rm conftest.*
 
4435
 
 
4436
])
 
4437
AC_MSG_RESULT($ac_cv_maxpathlen)
 
4438
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
 
4439
])
 
4440
 
 
4441
AC_DEFUN([KDE_CHECK_HEADER],
 
4442
[
 
4443
   AC_LANG_SAVE
 
4444
   kde_safe_cppflags=$CPPFLAGS
 
4445
   CPPFLAGS="$CPPFLAGS $all_includes"
 
4446
   AC_LANG_CPLUSPLUS
 
4447
   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
 
4448
   CPPFLAGS=$kde_safe_cppflags
 
4449
   AC_LANG_RESTORE
 
4450
])
 
4451
 
 
4452
AC_DEFUN([KDE_CHECK_HEADERS],
 
4453
[
 
4454
   AH_CHECK_HEADERS([$1])
 
4455
   AC_LANG_SAVE
 
4456
   kde_safe_cppflags=$CPPFLAGS
 
4457
   CPPFLAGS="$CPPFLAGS $all_includes"
 
4458
   AC_LANG_CPLUSPLUS
 
4459
   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
 
4460
   CPPFLAGS=$kde_safe_cppflags
 
4461
   AC_LANG_RESTORE
 
4462
])
 
4463
 
 
4464
AC_DEFUN([KDE_FAST_CONFIGURE],
 
4465
[
 
4466
  dnl makes configure fast (needs perl)
 
4467
  AC_ARG_ENABLE(fast-perl, [  --disable-fast-perl     disable fast Makefile generation (needs perl)],
 
4468
      with_fast_perl=$enableval, with_fast_perl=yes)
 
4469
])
 
4470
 
 
4471
AC_DEFUN([KDE_CONF_FILES],
 
4472
[
 
4473
  val=
 
4474
  if test -f $srcdir/configure.files ; then
 
4475
    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
 
4476
  fi
 
4477
  CONF_FILES=
 
4478
  if test -n "$val" ; then
 
4479
    for i in $val ; do
 
4480
      CONF_FILES="$CONF_FILES $i"
 
4481
    done
 
4482
  fi
 
4483
  AC_SUBST(CONF_FILES)
 
4484
])dnl
 
4485
 
 
4486
AC_DEFUN([KDE_SET_PREFIX],
 
4487
[
 
4488
  unset CDPATH
 
4489
  dnl make $KDEDIR the default for the installation
 
4490
  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
 
4491
 
 
4492
  if test "x$prefix" = "xNONE"; then
 
4493
    prefix=$ac_default_prefix
 
4494
    ac_configure_args="$ac_configure_args --prefix=$prefix"
 
4495
  fi
 
4496
  # And delete superfluous '/' to make compares easier
 
4497
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4498
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4499
  KDE_FAST_CONFIGURE
 
4500
  KDE_CONF_FILES
 
4501
])
 
4502
 
 
4503
pushdef([AC_PROG_INSTALL],
 
4504
[
 
4505
  dnl our own version, testing for a -p flag
 
4506
  popdef([AC_PROG_INSTALL])
 
4507
  dnl as AC_PROG_INSTALL works as it works we first have
 
4508
  dnl to save if the user didn't specify INSTALL, as the
 
4509
  dnl autoconf one overwrites INSTALL and we have no chance to find
 
4510
  dnl out afterwards
 
4511
  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
 
4512
  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
 
4513
  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
 
4514
  AC_PROG_INSTALL
 
4515
 
 
4516
  if test -z "$kde_save_INSTALL_given" ; then
 
4517
    # OK, user hasn't given any INSTALL, autoconf found one for us
 
4518
    # now we test, if it supports the -p flag
 
4519
    AC_MSG_CHECKING(for -p flag to install)
 
4520
    rm -f confinst.$$.* > /dev/null 2>&1
 
4521
    echo "Testtest" > confinst.$$.orig
 
4522
    ac_res=no
 
4523
    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
 
4524
      if test -f confinst.$$.new ; then
 
4525
        # OK, -p seems to do no harm to install
 
4526
        INSTALL="${INSTALL} -p"
 
4527
        ac_res=yes
 
4528
      fi
 
4529
    fi
 
4530
    rm -f confinst.$$.*
 
4531
    AC_MSG_RESULT($ac_res)
 
4532
  fi
 
4533
  dnl the following tries to resolve some signs and wonders coming up
 
4534
  dnl with different autoconf/automake versions
 
4535
  dnl e.g.:
 
4536
  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
 
4537
  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
 
4538
  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
 
4539
  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
 
4540
  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
 
4541
  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
 
4542
  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
 
4543
  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
 
4544
  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
 
4545
  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
 
4546
  dnl   automake (due to broken Makefile.am or whatever) to install programs,
 
4547
  dnl   and so does not see the -s flag in automake > 1.4
 
4548
  dnl to clean up that mess we:
 
4549
  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
 
4550
  dnl   which cleans KDE's program with automake > 1.4;
 
4551
  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
 
4552
  dnl   with automake<=1.4
 
4553
  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
 
4554
  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
 
4555
  dnl
 
4556
  dnl And to all this comes, that I even can't write in comments variable
 
4557
  dnl  names used by automake, because it is so stupid to think I wanted to
 
4558
  dnl  _use_ them, therefor I have written A_M_... instead of AM_
 
4559
  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
 
4560
 
 
4561
  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
 
4562
    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
 
4563
  fi
 
4564
  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
 
4565
    INSTALL_SCRIPT='${INSTALL}'
 
4566
  fi
 
4567
])dnl
 
4568
 
 
4569
AC_DEFUN([KDE_LANG_CPLUSPLUS],
 
4570
[AC_LANG_CPLUSPLUS
 
4571
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
 
4572
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
 
4573
])
 
4574
 
 
4575
pushdef([AC_LANG_CPLUSPLUS],
 
4576
[popdef([AC_LANG_CPLUSPLUS])
 
4577
KDE_LANG_CPLUSPLUS
 
4578
])
 
4579
 
 
4580
AC_DEFUN([KDE_CHECK_LONG_LONG],
 
4581
[
 
4582
AC_MSG_CHECKING(for long long)
 
4583
AC_CACHE_VAL(kde_cv_c_long_long,
 
4584
[
 
4585
  AC_LANG_SAVE
 
4586
  AC_LANG_CPLUSPLUS
 
4587
  AC_TRY_LINK([], [
 
4588
  long long foo = 0;
 
4589
  foo = foo+1;
 
4590
  ],
 
4591
  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
 
4592
  AC_LANG_RESTORE
 
4593
])
 
4594
AC_MSG_RESULT($kde_cv_c_long_long)
 
4595
if test "$kde_cv_c_long_long" = yes; then
 
4596
   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
 
4597
fi
 
4598
])
 
4599
 
 
4600
AC_DEFUN([KDE_CHECK_LIB],
 
4601
[
 
4602
     kde_save_LDFLAGS="$LDFLAGS"
 
4603
     dnl AC_CHECK_LIB modifies LIBS, so save it here
 
4604
     kde_save_LIBS="$LIBS"
 
4605
     LDFLAGS="$LDFLAGS $all_libraries"
 
4606
     case $host_os in
 
4607
      aix*) LDFLAGS="-brtl $LDFLAGS"
 
4608
        test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
 
4609
        ;;
 
4610
     esac
 
4611
     AC_CHECK_LIB($1, $2, $3, $4, $5)
 
4612
     LDFLAGS="$kde_save_LDFLAGS"
 
4613
     LIBS="$kde_save_LIBS"
 
4614
])
 
4615
 
 
4616
AC_DEFUN([KDE_JAVA_PREFIX],
 
4617
[
 
4618
        dir=`dirname "$1"`
 
4619
        base=`basename "$1"`
 
4620
        list=`ls -1 $dir 2> /dev/null`
 
4621
        for entry in $list; do 
 
4622
                if test -d $dir/$entry/bin; then
 
4623
                        case $entry in
 
4624
                           $base)
 
4625
                                javadirs="$javadirs $dir/$entry/bin"
 
4626
                                ;;
 
4627
                        esac
 
4628
                elif test -d $dir/$entry/jre/bin; then
 
4629
                        case $entry in
 
4630
                           $base)
 
4631
                                javadirs="$javadirs $dir/$entry/jre/bin"
 
4632
                                ;;
 
4633
                        esac
 
4634
                fi
 
4635
        done
 
4636
])
 
4637
 
 
4638
dnl KDE_CHEC_JAVA_DIR(onlyjre)
 
4639
AC_DEFUN([KDE_CHECK_JAVA_DIR],
 
4640
[
 
4641
 
 
4642
AC_ARG_WITH(java,
 
4643
[  --with-java=javadir     use java installed in javadir, --without-java disables ],
 
4644
[  ac_java_dir=$withval
 
4645
], ac_java_dir=""
 
4646
)
 
4647
 
 
4648
AC_MSG_CHECKING([for Java])
 
4649
 
 
4650
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
 
4651
if test "x$ac_java_dir" = "xno"; then
 
4652
   kde_java_bindir=no
 
4653
   kde_java_includedir=no
 
4654
   kde_java_libjvmdir=no
 
4655
   kde_java_libgcjdir=no
 
4656
   kde_java_libhpidir=no
 
4657
else
 
4658
  if test "x$ac_java_dir" = "x"; then
 
4659
     
 
4660
     
 
4661
      dnl No option set -> collect list of candidate paths
 
4662
      if test -n "$JAVA_HOME"; then
 
4663
        KDE_JAVA_PREFIX($JAVA_HOME)
 
4664
      fi
 
4665
      KDE_JAVA_PREFIX(/usr/j2se)
 
4666
      KDE_JAVA_PREFIX(/usr/lib/j2se)
 
4667
      KDE_JAVA_PREFIX(/usr/j*dk*)
 
4668
      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
 
4669
      KDE_JAVA_PREFIX(/opt/j*sdk*)
 
4670
      KDE_JAVA_PREFIX(/usr/lib/java*)
 
4671
      KDE_JAVA_PREFIX(/usr/java*)
 
4672
      KDE_JAVA_PREFIX(/usr/java/j*dk*)
 
4673
      KDE_JAVA_PREFIX(/usr/java/j*re*)
 
4674
      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
 
4675
      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
 
4676
      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
 
4677
      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
 
4678
      KDE_JAVA_PREFIX(/opt/java*)
 
4679
 
 
4680
      kde_cv_path="NONE"
 
4681
      kde_save_IFS=$IFS
 
4682
      IFS=':'
 
4683
      for dir in $PATH; do
 
4684
          if test -d "$dir"; then
 
4685
              javadirs="$javadirs $dir"
 
4686
          fi
 
4687
      done
 
4688
      IFS=$kde_save_IFS
 
4689
      jredirs=
 
4690
 
 
4691
      dnl Now javadirs contains a list of paths that exist, all ending with bin/
 
4692
      for dir in $javadirs; do
 
4693
          dnl Check for the java executable
 
4694
          if test -x "$dir/java"; then
 
4695
              dnl And also check for a libjvm.so somewhere under there
 
4696
              dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
 
4697
              if test "$dir" != "/usr/bin"; then
 
4698
                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
4699
                  if test ! -f $libjvmdir/libjvm.so; then continue; fi
 
4700
                  jredirs="$jredirs $dir"
 
4701
              fi
 
4702
          fi
 
4703
      done
 
4704
 
 
4705
      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
 
4706
      JAVAC=
 
4707
      JAVA=
 
4708
      kde_java_bindir=no
 
4709
      for dir in $jredirs; do
 
4710
          JAVA="$dir/java"
 
4711
          kde_java_bindir=$dir
 
4712
          if test -x "$dir/javac"; then
 
4713
                JAVAC="$dir/javac"
 
4714
                break
 
4715
          fi
 
4716
      done
 
4717
 
 
4718
      if test -n "$JAVAC"; then
 
4719
          dnl this substitution might not work - well, we test for jni.h below
 
4720
          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
 
4721
      else
 
4722
          kde_java_includedir=no
 
4723
      fi
 
4724
  else
 
4725
    dnl config option set
 
4726
    kde_java_bindir=$ac_java_dir/bin
 
4727
    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
 
4728
        kde_java_includedir=no
 
4729
    else
 
4730
        kde_java_includedir=$ac_java_dir/include
 
4731
    fi
 
4732
  fi
 
4733
fi
 
4734
 
 
4735
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
 
4736
if test "x$kde_java_bindir" != "xno"; then
 
4737
 
 
4738
  dnl Look for libjvm.so
 
4739
  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
 
4740
  dnl Look for libgcj.so
 
4741
  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
 
4742
  dnl Look for libhpi.so and avoid green threads
 
4743
  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
 
4744
 
 
4745
  dnl Now check everything's fine under there
 
4746
  dnl the include dir is our flag for having the JDK
 
4747
  if test -d "$kde_java_includedir"; then
 
4748
    if test ! -x "$kde_java_bindir/javac"; then
 
4749
      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
 
4750
    fi
 
4751
    if test ! -x "$kde_java_bindir/javah"; then
 
4752
      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4753
    fi
 
4754
    if test ! -x "$kde_java_bindir/jar"; then
 
4755
      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4756
    fi
 
4757
    if test ! -r "$kde_java_includedir/jni.h"; then
 
4758
      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
 
4759
    fi
 
4760
 
 
4761
    jni_includes="-I$kde_java_includedir"
 
4762
    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
 
4763
    dnl and under linux here.. 
 
4764
    
 
4765
    dnl not needed for gcj
 
4766
 
 
4767
    if test "x$kde_java_libgcjdir" = "x"; then 
 
4768
      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
 
4769
      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
 
4770
      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
 
4771
    fi
 
4772
 
 
4773
  else
 
4774
    JAVAC=
 
4775
    jni_includes=
 
4776
  fi
 
4777
 
 
4778
  if test "x$kde_java_libgcjdir" = "x"; then 
 
4779
     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
 
4780
        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
 
4781
     fi 
 
4782
  else
 
4783
     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
 
4784
        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
 
4785
     fi 
 
4786
  fi
 
4787
 
 
4788
  if test ! -x "$kde_java_bindir/java"; then
 
4789
      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
 
4790
  fi
 
4791
 
 
4792
  dnl not needed for gcj compile
 
4793
 
 
4794
  if test "x$kde_java_libgcjdir" = "x"; then 
 
4795
      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
 
4796
        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
 
4797
      fi
 
4798
  fi
 
4799
 
 
4800
  if test -n "$jni_includes"; then
 
4801
    dnl Check for JNI version
 
4802
    AC_LANG_SAVE
 
4803
    AC_LANG_CPLUSPLUS
 
4804
    ac_cxxflags_safe="$CXXFLAGS"
 
4805
    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
 
4806
 
 
4807
    AC_TRY_COMPILE([
 
4808
  #include <jni.h>
 
4809
              ],
 
4810
              [
 
4811
  #ifndef JNI_VERSION_1_2
 
4812
  Syntax Error
 
4813
  #endif
 
4814
              ],[ kde_jni_works=yes ],
 
4815
              [ kde_jni_works=no ])
 
4816
 
 
4817
    if test $kde_jni_works = no; then
 
4818
      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
 
4819
                    You need to have Java Development Kit (JDK) version 1.2. 
 
4820
 
 
4821
                    Use --with-java to specify another location.
 
4822
                    Use --without-java to configure without java support.
 
4823
                    Or download a newer JDK and try again. 
 
4824
                    See e.g. http://java.sun.com/products/jdk/1.2 ])
 
4825
    fi
 
4826
 
 
4827
    CXXFLAGS="$ac_cxxflags_safe"    
 
4828
    AC_LANG_RESTORE
 
4829
 
 
4830
    dnl All tests ok, inform and subst the variables
 
4831
 
 
4832
    JAVAC=$kde_java_bindir/javac
 
4833
    JAVAH=$kde_java_bindir/javah
 
4834
    JAR=$kde_java_bindir/jar
 
4835
    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
4836
    if test "x$kde_java_libgcjdir" = "x"; then 
 
4837
      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
 
4838
    else
 
4839
      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
 
4840
    fi
 
4841
    AC_MSG_RESULT([java JDK in $kde_java_bindir])
 
4842
 
 
4843
  else
 
4844
      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
4845
      AC_MSG_RESULT([java JRE in $kde_java_bindir])
 
4846
  fi
 
4847
elif test -d "/Library/Java/Home"; then
 
4848
  kde_java_bindir="/Library/Java/Home/bin"
 
4849
  jni_includes="-I/Library/Java/Home/include"
 
4850
 
 
4851
  JAVAC=$kde_java_bindir/javac
 
4852
  JAVAH=$kde_java_bindir/javah
 
4853
  JAR=$kde_java_bindir/jar
 
4854
  JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
 
4855
 
 
4856
  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
 
4857
  AC_MSG_RESULT([Apple Java Framework])
 
4858
else
 
4859
  AC_MSG_RESULT([none found])
 
4860
fi
 
4861
 
 
4862
AC_SUBST(JAVAC)
 
4863
AC_SUBST(JAVAH)
 
4864
AC_SUBST(JAR)
 
4865
AC_SUBST(JVMLIBS)
 
4866
AC_SUBST(jni_includes)
 
4867
 
 
4868
# for backward compat
 
4869
kde_cv_java_includedir=$kde_java_includedir
 
4870
kde_cv_java_bindir=$kde_java_bindir
 
4871
])
 
4872
 
 
4873
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
 
4874
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
 
4875
dnl big packages, m4_foreach is dog-slow.  So use our own version of
 
4876
dnl it.  (matz@kde.org)
 
4877
m4_define([mm_foreach],
 
4878
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
 
4879
m4_define([mm_car], [[$1]])
 
4880
m4_define([mm_car2], [[$@]])
 
4881
m4_define([_mm_foreach],
 
4882
[m4_if(m4_quote($2), [], [],
 
4883
       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
 
4884
                                                   mm_car2(m4_shift($2)),
 
4885
                                                   [$3])])])
 
4886
m4_define([AC_FOREACH],
 
4887
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
 
4888
 
 
4889
AC_DEFUN([KDE_NEED_FLEX],
 
4890
[
 
4891
kde_libs_safe=$LIBS
 
4892
LIBS="$LIBS $USER_LDFLAGS"
 
4893
AM_PROG_LEX
 
4894
LIBS=$kde_libs_safe
 
4895
if test -z "$LEXLIB"; then
 
4896
    AC_MSG_ERROR([You need to have flex installed.])
 
4897
fi
 
4898
AC_SUBST(LEXLIB)
 
4899
])
 
4900
 
 
4901
AC_DEFUN([AC_PATH_QTOPIA],
 
4902
[
 
4903
  dnl TODO: use AC_CACHE_VAL
 
4904
 
 
4905
  if test -z "$1"; then
 
4906
    qtopia_minver_maj=1
 
4907
    qtopia_minver_min=5
 
4908
    qtopia_minver_pat=0
 
4909
  else
 
4910
    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
 
4911
    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
 
4912
    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
 
4913
  fi
 
4914
 
 
4915
  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
 
4916
  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
 
4917
 
 
4918
  AC_REQUIRE([AC_PATH_QT])
 
4919
 
 
4920
  AC_MSG_CHECKING([for Qtopia])
 
4921
 
 
4922
  LIB_QTOPIA="-lqpe"
 
4923
  AC_SUBST(LIB_QTOPIA)
 
4924
 
 
4925
  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
 
4926
 
 
4927
  ac_qtopia_incdir=NO
 
4928
 
 
4929
  AC_ARG_WITH(qtopia-dir,
 
4930
              [  --with-qtopia-dir=DIR   where the root of Qtopia is installed ],
 
4931
              [  ac_qtopia_incdir="$withval"/include] ) 
 
4932
  
 
4933
  qtopia_incdirs=""
 
4934
  for dir in $kde_qtopia_dirs; do
 
4935
    qtopia_incdirs="$qtopia_incdirs $dir/include"
 
4936
  done
 
4937
 
 
4938
  if test ! "$ac_qtopia_incdir" = "NO"; then
 
4939
    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
 
4940
  fi
 
4941
 
 
4942
  qtopia_incdir=""
 
4943
  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
 
4944
  ac_qtopia_incdir="$qtopia_incdir"
 
4945
 
 
4946
  if test -z "$qtopia_incdir"; then
 
4947
    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
 
4948
  fi
 
4949
 
 
4950
  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
 
4951
  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
 
4952
  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
 
4953
 
 
4954
  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
 
4955
  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
 
4956
  if test "$qtopia_ver" -lt "$qtopia_minver"; then
 
4957
    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
 
4958
is required.])
 
4959
  fi
 
4960
 
 
4961
  AC_LANG_SAVE
 
4962
  AC_LANG_CPLUSPLUS
 
4963
 
 
4964
  ac_cxxflags_safe="$CXXFLAGS"
 
4965
  ac_ldflags_safe="$LDFLAGS"
 
4966
  ac_libs_safe="$LIBS"
 
4967
 
 
4968
  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
 
4969
  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
 
4970
  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
 
4971
 
 
4972
  cat > conftest.$ac_ext <<EOF
 
4973
#include "confdefs.h"
 
4974
#include <qpe/qpeapplication.h>
 
4975
#include <qpe/version.h>
 
4976
 
 
4977
int main( int argc, char **argv )
 
4978
{
 
4979
    QPEApplication app( argc, argv );
 
4980
    return 0;
 
4981
}
 
4982
EOF
 
4983
 
 
4984
  if AC_TRY_EVAL(ac_link) && test -s conftest; then
 
4985
    rm -f conftest*
 
4986
  else
 
4987
    rm -f conftest*
 
4988
    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
 
4989
the end of config.log])
 
4990
  fi
 
4991
 
 
4992
  CXXFLAGS="$ac_cxxflags_safe"
 
4993
  LDFLAGS="$ac_ldflags_safe"
 
4994
  LIBS="$ac_libs_safe"
 
4995
 
 
4996
  AC_LANG_RESTORE
 
4997
 
 
4998
  QTOPIA_INCLUDES="-I$qtopia_incdir"
 
4999
  AC_SUBST(QTOPIA_INCLUDES)
 
5000
 
 
5001
  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
 
5002
])
 
5003
 
 
5004
 
 
5005
AC_DEFUN([KDE_INIT_DOXYGEN],
 
5006
[
 
5007
AC_MSG_CHECKING([for Qt docs])
 
5008
kde_qtdir=
 
5009
if test "${with_qt_dir+set}" = set; then
 
5010
  kde_qtdir="$with_qt_dir"
 
5011
fi
 
5012
 
 
5013
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)
 
5014
AC_MSG_RESULT($QTDOCDIR)
 
5015
 
 
5016
AC_SUBST(QTDOCDIR)
 
5017
 
 
5018
KDE_FIND_PATH(dot, DOT, [], [])
 
5019
if test -n "$DOT"; then
 
5020
  KDE_HAVE_DOT="YES"
 
5021
else
 
5022
  KDE_HAVE_DOT="NO"
 
5023
fi
 
5024
AC_SUBST(KDE_HAVE_DOT)
 
5025
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
 
5026
AC_SUBST(DOXYGEN)
 
5027
 
 
5028
DOXYGEN_PROJECT_NAME="$1"
 
5029
DOXYGEN_PROJECT_NUMBER="$2"
 
5030
AC_SUBST(DOXYGEN_PROJECT_NAME)
 
5031
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
 
5032
 
 
5033
KDE_HAS_DOXYGEN=no
 
5034
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
 
5035
  KDE_HAS_DOXYGEN=yes
 
5036
fi
 
5037
AC_SUBST(KDE_HAS_DOXYGEN)
 
5038
 
 
5039
])
 
5040
 
 
5041
 
 
5042
AC_DEFUN([AC_FIND_BZIP2],
 
5043
[
 
5044
AC_MSG_CHECKING([for bzDecompress in libbz2])
 
5045
AC_CACHE_VAL(ac_cv_lib_bzip2,
 
5046
[
 
5047
AC_LANG_SAVE
 
5048
AC_LANG_CPLUSPLUS
 
5049
kde_save_LIBS="$LIBS"
 
5050
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
 
5051
kde_save_CXXFLAGS="$CXXFLAGS"
 
5052
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
 
5053
AC_TRY_LINK(dnl
 
5054
[
 
5055
#define BZ_NO_STDIO
 
5056
#include<bzlib.h>
 
5057
],
 
5058
            [ bz_stream s; (void) bzDecompress(&s); ],
 
5059
            eval "ac_cv_lib_bzip2='-lbz2'",
 
5060
            eval "ac_cv_lib_bzip2=no")
 
5061
LIBS="$kde_save_LIBS"
 
5062
CXXFLAGS="$kde_save_CXXFLAGS"
 
5063
AC_LANG_RESTORE
 
5064
])dnl
 
5065
AC_MSG_RESULT($ac_cv_lib_bzip2)
 
5066
 
 
5067
if test ! "$ac_cv_lib_bzip2" = no; then
 
5068
  BZIP2DIR=bzip2
 
5069
 
 
5070
  LIBBZ2="$ac_cv_lib_bzip2"
 
5071
  AC_SUBST(LIBBZ2)
 
5072
 
 
5073
else
 
5074
 
 
5075
   cxx_shared_flag=
 
5076
   ld_shared_flag=
 
5077
   KDE_CHECK_COMPILER_FLAG(shared, [
 
5078
        ld_shared_flag="-shared"
 
5079
   ])
 
5080
   KDE_CHECK_COMPILER_FLAG(fPIC, [
 
5081
        cxx_shared_flag="-fPIC"
 
5082
   ])
 
5083
 
 
5084
   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
 
5085
   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
 
5086
   [
 
5087
   AC_LANG_SAVE
 
5088
   AC_LANG_CPLUSPLUS
 
5089
   kde_save_LIBS="$LIBS"
 
5090
   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
 
5091
   kde_save_CXXFLAGS="$CXXFLAGS"
 
5092
   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
 
5093
 
 
5094
   AC_TRY_LINK(dnl
 
5095
   [
 
5096
   #define BZ_NO_STDIO
 
5097
   #include<bzlib.h>
 
5098
   ],
 
5099
               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
 
5100
               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
 
5101
               eval "ac_cv_lib_bzip2_prefix=no")
 
5102
   LIBS="$kde_save_LIBS"
 
5103
   CXXFLAGS="$kde_save_CXXFLAGS"
 
5104
   AC_LANG_RESTORE
 
5105
   ])dnl
 
5106
 
 
5107
   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
 
5108
   
 
5109
   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
 
5110
     BZIP2DIR=bzip2
 
5111
    
 
5112
     LIBBZ2="$ac_cv_lib_bzip2_prefix"
 
5113
     AC_SUBST(LIBBZ2)
 
5114
 
 
5115
     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
 
5116
   dnl else, we just ignore this
 
5117
   fi
 
5118
 
 
5119
fi
 
5120
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
 
5121
])
 
5122
 
 
5123
dnl ------------------------------------------------------------------------
 
5124
dnl Try to find the SSL headers and libraries.
 
5125
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
 
5126
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
 
5127
dnl ------------------------------------------------------------------------
 
5128
dnl
 
5129
AC_DEFUN([KDE_CHECK_SSL],
 
5130
[
 
5131
LIBSSL="-lssl -lcrypto"
 
5132
AC_REQUIRE([KDE_CHECK_LIB64])
 
5133
 
 
5134
ac_ssl_includes=NO ac_ssl_libraries=NO
 
5135
ssl_libraries=""
 
5136
ssl_includes=""
 
5137
AC_ARG_WITH(ssl-dir,
 
5138
    [  --with-ssl-dir=DIR      where the root of OpenSSL is installed],
 
5139
    [  ac_ssl_includes="$withval"/include
 
5140
       ac_ssl_libraries="$withval"/lib$kdelibsuff
 
5141
    ])
 
5142
 
 
5143
want_ssl=yes
 
5144
AC_ARG_WITH(ssl,
 
5145
    [  --without-ssl           disable SSL checks],
 
5146
    [want_ssl=$withval])
 
5147
 
 
5148
if test $want_ssl = yes; then
 
5149
 
 
5150
AC_MSG_CHECKING(for OpenSSL)
 
5151
 
 
5152
AC_CACHE_VAL(ac_cv_have_ssl,
 
5153
[#try to guess OpenSSL locations
 
5154
  
 
5155
  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
 
5156
  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
 
5157
  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
 
5158
  ac_ssl_includes="$ssl_incdir"
 
5159
 
 
5160
  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"
 
5161
  if test ! "$ac_ssl_libraries" = "NO"; then
 
5162
    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
 
5163
  fi
 
5164
 
 
5165
  test=NONE
 
5166
  ssl_libdir=NONE
 
5167
  for dir in $ssl_libdirs; do
 
5168
    try="ls -1 $dir/libssl*"
 
5169
    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
5170
  done
 
5171
 
 
5172
  ac_ssl_libraries="$ssl_libdir"
 
5173
 
 
5174
  ac_ldflags_safe="$LDFLAGS"
 
5175
  ac_libs_safe="$LIBS"
 
5176
 
 
5177
  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
 
5178
  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
 
5179
 
 
5180
  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
 
5181
  ac_ssl_rsaref="yes"
 
5182
  ,
 
5183
  ac_ssl_rsaref="no"
 
5184
  )
 
5185
 
 
5186
  LDFLAGS="$ac_ldflags_safe"
 
5187
  LIBS="$ac_libs_safe"
 
5188
 
 
5189
  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
 
5190
    have_ssl=no
 
5191
  else
 
5192
    have_ssl=yes;
 
5193
  fi
 
5194
 
 
5195
  ])
 
5196
 
 
5197
  eval "$ac_cv_have_ssl"
 
5198
 
 
5199
  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
 
5200
 
 
5201
  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
 
5202
  AC_MSG_RESULT($ac_ssl_rsaref)
 
5203
 
 
5204
  AC_MSG_CHECKING([for easter eggs])
 
5205
  AC_MSG_RESULT([none found])
 
5206
 
 
5207
else
 
5208
  have_ssl=no
 
5209
fi
 
5210
 
 
5211
if test "$have_ssl" = yes; then
 
5212
  AC_MSG_CHECKING(for OpenSSL version)
 
5213
  dnl Check for SSL version
 
5214
  AC_CACHE_VAL(ac_cv_ssl_version,
 
5215
  [
 
5216
 
 
5217
    cat >conftest.$ac_ext <<EOF
 
5218
#include <openssl/opensslv.h>
 
5219
#include <stdio.h>
 
5220
    int main() {
 
5221
 
 
5222
#ifndef OPENSSL_VERSION_NUMBER
 
5223
      printf("ssl_version=\\"error\\"\n");
 
5224
#else
 
5225
      if (OPENSSL_VERSION_NUMBER < 0x00906000)
 
5226
        printf("ssl_version=\\"old\\"\n");
 
5227
      else
 
5228
        printf("ssl_version=\\"ok\\"\n");
 
5229
#endif
 
5230
     return (0);
 
5231
    }
 
5232
EOF
 
5233
 
 
5234
    ac_save_CPPFLAGS=$CPPFLAGS
 
5235
    if test "$ac_ssl_includes" != "/usr/include"; then
 
5236
        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
 
5237
    fi
 
5238
 
 
5239
    if AC_TRY_EVAL(ac_link); then 
 
5240
 
 
5241
      if eval `./conftest 2>&5`; then
 
5242
        if test $ssl_version = error; then
 
5243
          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
 
5244
        else
 
5245
          if test $ssl_version = old; then
 
5246
            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
 
5247
            have_ssl=no
 
5248
          fi
 
5249
        fi
 
5250
        ac_cv_ssl_version="ssl_version=$ssl_version"
 
5251
      else
 
5252
        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
 
5253
        Check config.log, and if you can't figure it out, send a mail to 
 
5254
        David Faure <faure@kde.org>, attaching your config.log])
 
5255
      fi
 
5256
 
 
5257
    else
 
5258
      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
 
5259
      Check config.log, and if you can't figure it out, send a mail to 
 
5260
      David Faure <faure@kde.org>, attaching your config.log])
 
5261
    fi 
 
5262
    CPPFLAGS=$ac_save_CPPFLAGS
 
5263
 
 
5264
  ])
 
5265
 
 
5266
  eval "$ac_cv_ssl_version"
 
5267
  AC_MSG_RESULT($ssl_version)
 
5268
fi
 
5269
 
 
5270
if test "$have_ssl" != yes; then
 
5271
  LIBSSL="";
 
5272
else
 
5273
  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
 
5274
  ac_cv_have_ssl="have_ssl=yes \
 
5275
    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
 
5276
  
 
5277
  
 
5278
  ssl_libraries="$ac_ssl_libraries"
 
5279
  ssl_includes="$ac_ssl_includes"
 
5280
 
 
5281
  if test "$ac_ssl_rsaref" = yes; then
 
5282
    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
 
5283
  fi
 
5284
 
 
5285
  if test $ssl_version = "old"; then
 
5286
    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
 
5287
  fi
 
5288
fi
 
5289
 
 
5290
SSL_INCLUDES=
 
5291
 
 
5292
if test "$ssl_includes" = "/usr/include"; then
 
5293
  if test -f /usr/kerberos/include/krb5.h; then
 
5294
        SSL_INCLUDES="-I/usr/kerberos/include"
 
5295
  fi
 
5296
elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
 
5297
  SSL_INCLUDES="-I$ssl_includes"
 
5298
fi
 
5299
 
 
5300
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
 
5301
 SSL_LDFLAGS=""
 
5302
else
 
5303
 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
 
5304
fi
 
5305
 
 
5306
AC_SUBST(SSL_INCLUDES)
 
5307
AC_SUBST(SSL_LDFLAGS)
 
5308
AC_SUBST(LIBSSL)
 
5309
])
 
5310
 
 
5311
AC_DEFUN([KDE_CHECK_STRLCPY],
 
5312
[
 
5313
  AC_REQUIRE([AC_CHECK_STRLCAT])
 
5314
  AC_REQUIRE([AC_CHECK_STRLCPY])
 
5315
  AC_CHECK_SIZEOF(size_t)
 
5316
  AC_CHECK_SIZEOF(unsigned long)
 
5317
 
 
5318
  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
 
5319
  AC_TRY_COMPILE(,[
 
5320
    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
 
5321
       choke me
 
5322
    #endif
 
5323
    ],AC_MSG_RESULT([yes]),[
 
5324
      AC_MSG_RESULT(no)
 
5325
      AC_MSG_ERROR([
 
5326
       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
 
5327
       does not apply. Please mail kde-devel@kde.org with a description of your system!
 
5328
      ])
 
5329
  ])
 
5330
])
 
5331
 
 
5332
AC_DEFUN([KDE_CHECK_BINUTILS],
 
5333
[
 
5334
  AC_MSG_CHECKING([if ld supports unversioned version maps])
 
5335
 
 
5336
  kde_save_LDFLAGS="$LDFLAGS"
 
5337
  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
 
5338
  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
 
5339
  AC_TRY_LINK([int foo;],
 
5340
[
 
5341
#ifdef __INTEL_COMPILER
 
5342
icc apparently does not support libtools version-info and version-script
 
5343
at the same time. Dunno where the bug is, but until somebody figured out,
 
5344
better disable the optional version scripts.
 
5345
#endif
 
5346
 
 
5347
  foo = 42;
 
5348
], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
 
5349
  LDFLAGS="$kde_save_LDFLAGS"
 
5350
  rm -f conftest.map
 
5351
  AM_CONDITIONAL(include_VERSION_SCRIPT, 
 
5352
    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
 
5353
 
 
5354
  AC_MSG_RESULT($kde_supports_versionmaps)
 
5355
])
 
5356
 
 
5357
AC_DEFUN([AM_PROG_OBJC],[
 
5358
AC_CHECK_PROGS(OBJC, gcc, gcc)
 
5359
test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
 
5360
if test "x${OBJCFLAGS-unset}" = xunset; then
 
5361
   OBJCFLAGS="-g -O2"
 
5362
fi
 
5363
AC_SUBST(OBJCFLAGS)
 
5364
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
 
5365
])
 
5366
 
 
5367
AC_DEFUN([KDE_CHECK_PERL],
 
5368
[
 
5369
        KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
 
5370
                    AC_MSG_ERROR([No Perl found in your $PATH.
 
5371
We need perl to generate some code.])
 
5372
        ])
 
5373
    AC_SUBST(PERL)
 
5374
])
 
5375
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
5376
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
 
5377
## Free Software Foundation, Inc.
 
5378
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
5379
##
 
5380
## This program is free software; you can redistribute it and/or modify
 
5381
## it under the terms of the GNU General Public License as published by
 
5382
## the Free Software Foundation; either version 2 of the License, or
 
5383
## (at your option) any later version.
 
5384
##
 
5385
## This program is distributed in the hope that it will be useful, but
 
5386
## WITHOUT ANY WARRANTY; without even the implied warranty of
 
5387
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
5388
## General Public License for more details.
 
5389
##
 
5390
## You should have received a copy of the GNU General Public License
 
5391
## along with this program; if not, write to the Free Software
 
5392
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
5393
##
 
5394
## As a special exception to the GNU General Public License, if you
 
5395
## distribute this file as part of a program that contains a
 
5396
## configuration script generated by Autoconf, you may include it under
 
5397
## the same distribution terms that you use for the rest of that program.
 
5398
 
 
5399
# serial 47 AC_PROG_LIBTOOL
 
5400
 
 
5401
 
 
5402
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
 
5403
# -----------------------------------------------------------
 
5404
# If this macro is not defined by Autoconf, define it here.
 
5405
m4_ifdef([AC_PROVIDE_IFELSE],
 
5406
         [],
 
5407
         [m4_define([AC_PROVIDE_IFELSE],
 
5408
                 [m4_ifdef([AC_PROVIDE_$1],
 
5409
                           [$2], [$3])])])
 
5410
 
 
5411
 
 
5412
# AC_PROG_LIBTOOL
 
5413
# ---------------
 
5414
AC_DEFUN([AC_PROG_LIBTOOL],
 
5415
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
 
5416
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
 
5417
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
 
5418
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
 
5419
    [AC_LIBTOOL_CXX],
 
5420
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
 
5421
  ])])
 
5422
dnl And a similar setup for Fortran 77 support
 
5423
  AC_PROVIDE_IFELSE([AC_PROG_F77],
 
5424
    [AC_LIBTOOL_F77],
 
5425
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
 
5426
])])
 
5427
 
 
5428
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
 
5429
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
 
5430
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
 
5431
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
 
5432
    [AC_LIBTOOL_GCJ],
 
5433
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
 
5434
      [AC_LIBTOOL_GCJ],
 
5435
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
 
5436
        [AC_LIBTOOL_GCJ],
 
5437
      [ifdef([AC_PROG_GCJ],
 
5438
             [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
 
5439
       ifdef([A][M_PROG_GCJ],
 
5440
             [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
 
5441
       ifdef([LT_AC_PROG_GCJ],
 
5442
             [define([LT_AC_PROG_GCJ],
 
5443
                defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
 
5444
])])# AC_PROG_LIBTOOL
 
5445
 
 
5446
 
 
5447
# _AC_PROG_LIBTOOL
 
5448
# ----------------
 
5449
AC_DEFUN([_AC_PROG_LIBTOOL],
 
5450
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 
5451
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
 
5452
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
 
5453
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
 
5454
 
 
5455
# This can be used to rebuild libtool when needed
 
5456
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
5457
 
 
5458
# Always use our own libtool.
 
5459
LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
 
5460
AC_SUBST(LIBTOOL)dnl
 
5461
 
 
5462
# Prevent multiple expansion
 
5463
define([AC_PROG_LIBTOOL], [])
 
5464
])# _AC_PROG_LIBTOOL
 
5465
 
 
5466
 
 
5467
# AC_LIBTOOL_SETUP
 
5468
# ----------------
 
5469
AC_DEFUN([AC_LIBTOOL_SETUP],
 
5470
[AC_PREREQ(2.50)dnl
 
5471
AC_REQUIRE([AC_ENABLE_SHARED])dnl
 
5472
AC_REQUIRE([AC_ENABLE_STATIC])dnl
 
5473
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
 
5474
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
5475
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
5476
AC_REQUIRE([AC_PROG_CC])dnl
 
5477
AC_REQUIRE([AC_PROG_LD])dnl
 
5478
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
 
5479
AC_REQUIRE([AC_PROG_NM])dnl
 
5480
 
 
5481
AC_REQUIRE([AC_PROG_LN_S])dnl
 
5482
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
 
5483
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
5484
AC_REQUIRE([AC_OBJEXT])dnl
 
5485
AC_REQUIRE([AC_EXEEXT])dnl
 
5486
dnl
 
5487
 
 
5488
AC_LIBTOOL_SYS_MAX_CMD_LEN
 
5489
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
5490
AC_LIBTOOL_OBJDIR
 
5491
 
 
5492
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
5493
_LT_AC_PROG_ECHO_BACKSLASH
 
5494
 
 
5495
case $host_os in
 
5496
aix3*)
 
5497
  # AIX sometimes has problems with the GCC collect2 program.  For some
 
5498
  # reason, if we set the COLLECT_NAMES environment variable, the problems
 
5499
  # vanish in a puff of smoke.
 
5500
  if test "X${COLLECT_NAMES+set}" != Xset; then
 
5501
    COLLECT_NAMES=
 
5502
    export COLLECT_NAMES
 
5503
  fi
 
5504
  ;;
 
5505
esac
 
5506
 
 
5507
# Sed substitution that helps us do robust quoting.  It backslashifies
 
5508
# metacharacters that are still active within double-quoted strings.
 
5509
Xsed='sed -e s/^X//'
 
5510
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
5511
 
 
5512
# Same as above, but do not quote variable references.
 
5513
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
 
5514
 
 
5515
# Sed substitution to delay expansion of an escaped shell variable in a
 
5516
# double_quote_subst'ed string.
 
5517
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
5518
 
 
5519
# Sed substitution to avoid accidental globbing in evaled expressions
 
5520
no_glob_subst='s/\*/\\\*/g'
 
5521
 
 
5522
# Constants:
 
5523
rm="rm -f"
 
5524
 
 
5525
# Global variables:
 
5526
default_ofile=libtool
 
5527
can_build_shared=yes
 
5528
 
 
5529
# All known linkers require a `.a' archive for static linking (except M$VC,
 
5530
# which needs '.lib').
 
5531
libext=a
 
5532
ltmain="$ac_aux_dir/ltmain.sh"
 
5533
ofile="$default_ofile"
 
5534
with_gnu_ld="$lt_cv_prog_gnu_ld"
 
5535
 
 
5536
AC_CHECK_TOOL(AR, ar, false)
 
5537
AC_CHECK_TOOL(RANLIB, ranlib, :)
 
5538
AC_CHECK_TOOL(STRIP, strip, :)
 
5539
 
 
5540
old_CC="$CC"
 
5541
old_CFLAGS="$CFLAGS"
 
5542
 
 
5543
# Set sane defaults for various variables
 
5544
test -z "$AR" && AR=ar
 
5545
test -z "$AR_FLAGS" && AR_FLAGS=cru
 
5546
test -z "$AS" && AS=as
 
5547
test -z "$CC" && CC=cc
 
5548
test -z "$LTCC" && LTCC=$CC
 
5549
test -z "$DLLTOOL" && DLLTOOL=dlltool
 
5550
test -z "$LD" && LD=ld
 
5551
test -z "$LN_S" && LN_S="ln -s"
 
5552
test -z "$MAGIC_CMD" && MAGIC_CMD=file
 
5553
test -z "$NM" && NM=nm
 
5554
test -z "$SED" && SED=sed
 
5555
test -z "$OBJDUMP" && OBJDUMP=objdump
 
5556
test -z "$RANLIB" && RANLIB=:
 
5557
test -z "$STRIP" && STRIP=:
 
5558
test -z "$ac_objext" && ac_objext=o
 
5559
 
 
5560
# Determine commands to create old-style static archives.
 
5561
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
 
5562
old_postinstall_cmds='chmod 644 $oldlib'
 
5563
old_postuninstall_cmds=
 
5564
 
 
5565
if test -n "$RANLIB"; then
 
5566
  case $host_os in
 
5567
  openbsd*)
 
5568
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
 
5569
    ;;
 
5570
  *)
 
5571
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
 
5572
    ;;
 
5573
  esac
 
5574
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 
5575
fi
 
5576
 
 
5577
# Only perform the check for file, if the check method requires it
 
5578
case $deplibs_check_method in
 
5579
file_magic*)
 
5580
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
 
5581
    AC_PATH_MAGIC
 
5582
  fi
 
5583
  ;;
 
5584
esac
 
5585
 
 
5586
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
 
5587
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 
5588
enable_win32_dll=yes, enable_win32_dll=no)
 
5589
 
 
5590
AC_ARG_ENABLE([libtool-lock],
 
5591
    [AC_HELP_STRING([--disable-libtool-lock],
 
5592
        [avoid locking (might break parallel builds)])])
 
5593
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
5594
 
 
5595
AC_ARG_WITH([pic],
 
5596
    [AC_HELP_STRING([--with-pic],
 
5597
        [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
 
5598
    [pic_mode="$withval"],
 
5599
    [pic_mode=default])
 
5600
test -z "$pic_mode" && pic_mode=default
 
5601
 
 
5602
# Use C for the default configuration in the libtool script
 
5603
tagname=
 
5604
AC_LIBTOOL_LANG_C_CONFIG
 
5605
_LT_AC_TAGCONFIG
 
5606
])# AC_LIBTOOL_SETUP
 
5607
 
 
5608
 
 
5609
# _LT_AC_SYS_COMPILER
 
5610
# -------------------
 
5611
AC_DEFUN([_LT_AC_SYS_COMPILER],
 
5612
[AC_REQUIRE([AC_PROG_CC])dnl
 
5613
 
 
5614
# If no C compiler was specified, use CC.
 
5615
LTCC=${LTCC-"$CC"}
 
5616
 
 
5617
# Allow CC to be a program name with arguments.
 
5618
compiler=$CC
 
5619
])# _LT_AC_SYS_COMPILER
 
5620
 
 
5621
 
 
5622
# _LT_AC_SYS_LIBPATH_AIX
 
5623
# ----------------------
 
5624
# Links a minimal program and checks the executable
 
5625
# for the system default hardcoded library path. In most cases,
 
5626
# this is /usr/lib:/lib, but when the MPI compilers are used
 
5627
# the location of the communication and MPI libs are included too.
 
5628
# If we don't find anything, use the default library path according
 
5629
# to the aix ld manual.
 
5630
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
 
5631
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
 
5632
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
 
5633
}'`
 
5634
# Check for a 64-bit object if we didn't find anything.
 
5635
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; }
 
5636
}'`; fi],[])
 
5637
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
5638
])# _LT_AC_SYS_LIBPATH_AIX
 
5639
 
 
5640
 
 
5641
# _LT_AC_SHELL_INIT(ARG)
 
5642
# ----------------------
 
5643
AC_DEFUN([_LT_AC_SHELL_INIT],
 
5644
[ifdef([AC_DIVERSION_NOTICE],
 
5645
             [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
 
5646
         [AC_DIVERT_PUSH(NOTICE)])
 
5647
$1
 
5648
AC_DIVERT_POP
 
5649
])# _LT_AC_SHELL_INIT
 
5650
 
 
5651
 
 
5652
# _LT_AC_PROG_ECHO_BACKSLASH
 
5653
# --------------------------
 
5654
# Add some code to the start of the generated configure script which
 
5655
# will find an echo command which doesn't interpret backslashes.
 
5656
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
 
5657
[_LT_AC_SHELL_INIT([
 
5658
# Check that we are running under the correct shell.
 
5659
SHELL=${CONFIG_SHELL-/bin/sh}
 
5660
 
 
5661
case X$ECHO in
 
5662
X*--fallback-echo)
 
5663
  # Remove one level of quotation (which was required for Make).
 
5664
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
 
5665
  ;;
 
5666
esac
 
5667
 
 
5668
echo=${ECHO-echo}
 
5669
if test "X[$]1" = X--no-reexec; then
 
5670
  # Discard the --no-reexec flag, and continue.
 
5671
  shift
 
5672
elif test "X[$]1" = X--fallback-echo; then
 
5673
  # Avoid inline document here, it may be left over
 
5674
  :
 
5675
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
 
5676
  # Yippee, $echo works!
 
5677
  :
 
5678
else
 
5679
  # Restart under the correct shell.
 
5680
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
 
5681
fi
 
5682
 
 
5683
if test "X[$]1" = X--fallback-echo; then
 
5684
  # used as fallback echo
 
5685
  shift
 
5686
  cat <<EOF
 
5687
[$]*
 
5688
EOF
 
5689
  exit 0
 
5690
fi
 
5691
 
 
5692
# The HP-UX ksh and POSIX shell print the target directory to stdout
 
5693
# if CDPATH is set.
 
5694
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
 
5695
 
 
5696
if test -z "$ECHO"; then
 
5697
if test "X${echo_test_string+set}" != Xset; then
 
5698
# find a string as large as possible, as long as the shell can cope with it
 
5699
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
 
5700
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
 
5701
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
 
5702
       echo_test_string="`eval $cmd`" &&
 
5703
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
 
5704
    then
 
5705
      break
 
5706
    fi
 
5707
  done
 
5708
fi
 
5709
 
 
5710
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
 
5711
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
 
5712
   test "X$echo_testing_string" = "X$echo_test_string"; then
 
5713
  :
 
5714
else
 
5715
  # The Solaris, AIX, and Digital Unix default echo programs unquote
 
5716
  # backslashes.  This makes it impossible to quote backslashes using
 
5717
  #   echo "$something" | sed 's/\\/\\\\/g'
 
5718
  #
 
5719
  # So, first we look for a working echo in the user's PATH.
 
5720
 
 
5721
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
5722
  for dir in $PATH /usr/ucb; do
 
5723
    IFS="$lt_save_ifs"
 
5724
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
 
5725
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
 
5726
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
 
5727
       test "X$echo_testing_string" = "X$echo_test_string"; then
 
5728
      echo="$dir/echo"
 
5729
      break
 
5730
    fi
 
5731
  done
 
5732
  IFS="$lt_save_ifs"
 
5733
 
 
5734
  if test "X$echo" = Xecho; then
 
5735
    # We didn't find a better echo, so look for alternatives.
 
5736
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
 
5737
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
 
5738
       test "X$echo_testing_string" = "X$echo_test_string"; then
 
5739
      # This shell has a builtin print -r that does the trick.
 
5740
      echo='print -r'
 
5741
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
 
5742
         test "X$CONFIG_SHELL" != X/bin/ksh; then
 
5743
      # If we have ksh, try running configure again with it.
 
5744
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 
5745
      export ORIGINAL_CONFIG_SHELL
 
5746
      CONFIG_SHELL=/bin/ksh
 
5747
      export CONFIG_SHELL
 
5748
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
 
5749
    else
 
5750
      # Try using printf.
 
5751
      echo='printf %s\n'
 
5752
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
 
5753
         echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
 
5754
         test "X$echo_testing_string" = "X$echo_test_string"; then
 
5755
        # Cool, printf works
 
5756
        :
 
5757
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
 
5758
           test "X$echo_testing_string" = 'X\t' &&
 
5759
           echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
 
5760
           test "X$echo_testing_string" = "X$echo_test_string"; then
 
5761
        CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
 
5762
        export CONFIG_SHELL
 
5763
        SHELL="$CONFIG_SHELL"
 
5764
        export SHELL
 
5765
        echo="$CONFIG_SHELL [$]0 --fallback-echo"
 
5766
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
 
5767
           test "X$echo_testing_string" = 'X\t' &&
 
5768
           echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
 
5769
           test "X$echo_testing_string" = "X$echo_test_string"; then
 
5770
        echo="$CONFIG_SHELL [$]0 --fallback-echo"
 
5771
      else
 
5772
        # maybe with a smaller string...
 
5773
        prev=:
 
5774
 
 
5775
        for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
 
5776
          if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
 
5777
          then
 
5778
            break
 
5779
          fi
 
5780
          prev="$cmd"
 
5781
        done
 
5782
 
 
5783
        if test "$prev" != 'sed 50q "[$]0"'; then
 
5784
          echo_test_string=`eval $prev`
 
5785
          export echo_test_string
 
5786
          exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
 
5787
        else
 
5788
          # Oops.  We lost completely, so just stick with echo.
 
5789
          echo=echo
 
5790
        fi
 
5791
      fi
 
5792
    fi
 
5793
  fi
 
5794
fi
 
5795
fi
 
5796
 
 
5797
# Copy echo and quote the copy suitably for passing to libtool from
 
5798
# the Makefile, instead of quoting the original, which is used later.
 
5799
ECHO=$echo
 
5800
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
 
5801
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
 
5802
fi
 
5803
 
 
5804
AC_SUBST(ECHO)
 
5805
])])# _LT_AC_PROG_ECHO_BACKSLASH
 
5806
 
 
5807
 
 
5808
# _LT_AC_LOCK
 
5809
# -----------
 
5810
AC_DEFUN([_LT_AC_LOCK],
 
5811
[AC_ARG_ENABLE([libtool-lock],
 
5812
    [AC_HELP_STRING([--disable-libtool-lock],
 
5813
        [avoid locking (might break parallel builds)])])
 
5814
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
5815
 
 
5816
# Some flags need to be propagated to the compiler or linker for good
 
5817
# libtool support.
 
5818
case $host in
 
5819
ia64-*-hpux*)
 
5820
  # Find out which ABI we are using.
 
5821
  echo 'int i;' > conftest.$ac_ext
 
5822
  if AC_TRY_EVAL(ac_compile); then
 
5823
    case `/usr/bin/file conftest.$ac_objext` in
 
5824
    *ELF-32*)
 
5825
      HPUX_IA64_MODE="32"
 
5826
      ;;
 
5827
    *ELF-64*)
 
5828
      HPUX_IA64_MODE="64"
 
5829
      ;;
 
5830
    esac
 
5831
  fi
 
5832
  rm -rf conftest*
 
5833
  ;;
 
5834
*-*-irix6*)
 
5835
  # Find out which ABI we are using.
 
5836
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
 
5837
  if AC_TRY_EVAL(ac_compile); then
 
5838
   if test "$lt_cv_prog_gnu_ld" = yes; then
 
5839
    case `/usr/bin/file conftest.$ac_objext` in
 
5840
    *32-bit*)
 
5841
      LD="${LD-ld} -melf32bsmip"
 
5842
      ;;
 
5843
    *N32*)
 
5844
      LD="${LD-ld} -melf32bmipn32"
 
5845
      ;;
 
5846
    *64-bit*)
 
5847
      LD="${LD-ld} -melf64bmip"
 
5848
      ;;
 
5849
    esac
 
5850
   else
 
5851
    case `/usr/bin/file conftest.$ac_objext` in
 
5852
    *32-bit*)
 
5853
      LD="${LD-ld} -32"
 
5854
      ;;
 
5855
    *N32*)
 
5856
      LD="${LD-ld} -n32"
 
5857
      ;;
 
5858
    *64-bit*)
 
5859
      LD="${LD-ld} -64"
 
5860
      ;;
 
5861
    esac
 
5862
   fi
 
5863
  fi
 
5864
  rm -rf conftest*
 
5865
  ;;
 
5866
 
 
5867
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
 
5868
  # Find out which ABI we are using.
 
5869
  echo 'int i;' > conftest.$ac_ext
 
5870
  if AC_TRY_EVAL(ac_compile); then
 
5871
    case "`/usr/bin/file conftest.o`" in
 
5872
    *32-bit*)
 
5873
      LINUX_64_MODE="32"
 
5874
      case $host in
 
5875
        x86_64-*linux*)
 
5876
          LD="${LD-ld} -m elf_i386"
 
5877
          ;;
 
5878
        ppc64-*linux*)
 
5879
          LD="${LD-ld} -m elf32ppclinux"
 
5880
          ;;
 
5881
        s390x-*linux*)
 
5882
          LD="${LD-ld} -m elf_s390"
 
5883
          ;;
 
5884
        sparc64-*linux*)
 
5885
          LD="${LD-ld} -m elf32_sparc"
 
5886
          ;;
 
5887
      esac
 
5888
      ;;
 
5889
    *64-bit*)
 
5890
      LINUX_64_MODE="64"
 
5891
      case $host in
 
5892
        x86_64-*linux*)
 
5893
          LD="${LD-ld} -m elf_x86_64"
 
5894
          ;;
 
5895
        ppc*-*linux*|powerpc*-*linux*)
 
5896
          LD="${LD-ld} -m elf64ppc"
 
5897
          ;;
 
5898
        s390*-*linux*)
 
5899
          LD="${LD-ld} -m elf64_s390"
 
5900
          ;;
 
5901
        sparc*-*linux*)
 
5902
          LD="${LD-ld} -m elf64_sparc"
 
5903
          ;;
 
5904
      esac
 
5905
      ;;
 
5906
    esac
 
5907
  fi
 
5908
  rm -rf conftest*
 
5909
  ;;
 
5910
 
 
5911
*-*-sco3.2v5*)
 
5912
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
 
5913
  SAVE_CFLAGS="$CFLAGS"
 
5914
  CFLAGS="$CFLAGS -belf"
 
5915
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
 
5916
    [AC_LANG_PUSH(C)
 
5917
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
 
5918
     AC_LANG_POP])
 
5919
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
 
5920
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
 
5921
    CFLAGS="$SAVE_CFLAGS"
 
5922
  fi
 
5923
  ;;
 
5924
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 
5925
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
 
5926
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
 
5927
  AC_CHECK_TOOL(AS, as, false)
 
5928
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
 
5929
  ;;
 
5930
  ])
 
5931
esac
 
5932
 
 
5933
need_locks="$enable_libtool_lock"
 
5934
 
 
5935
])# _LT_AC_LOCK
 
5936
 
 
5937
 
 
5938
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
 
5939
#               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
 
5940
# ----------------------------------------------------------------
 
5941
# Check whether the given compiler option works
 
5942
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
 
5943
[AC_REQUIRE([LT_AC_PROG_SED])
 
5944
AC_CACHE_CHECK([$1], [$2],
 
5945
  [$2=no
 
5946
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
 
5947
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
5948
   lt_compiler_flag="$3"
 
5949
   # Insert the option either (1) after the last *FLAGS variable, or
 
5950
   # (2) before a word containing "conftest.", or (3) at the end.
 
5951
   # Note that $ac_compile itself does not contain backslashes and begins
 
5952
   # with a dollar sign (not a hyphen), so the echo should work correctly.
 
5953
   # The option is referenced via a variable to avoid confusing sed.
 
5954
   lt_compile=`echo "$ac_compile" | $SED \
 
5955
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
 
5956
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
 
5957
   -e 's:$: $lt_compiler_flag:'`
 
5958
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
 
5959
   (eval "$lt_compile" 2>conftest.err)
 
5960
   ac_status=$?
 
5961
   cat conftest.err >&AS_MESSAGE_LOG_FD
 
5962
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
5963
   if (exit $ac_status) && test -s "$ac_outfile"; then
 
5964
     # The compiler can only warn and ignore the option if not recognized
 
5965
     # So say no if there are warnings
 
5966
     if test ! -s conftest.err; then
 
5967
       $2=yes
 
5968
     fi
 
5969
   fi
 
5970
   $rm conftest*
 
5971
])
 
5972
 
 
5973
if test x"[$]$2" = xyes; then
 
5974
    ifelse([$5], , :, [$5])
 
5975
else
 
5976
    ifelse([$6], , :, [$6])
 
5977
fi
 
5978
])# AC_LIBTOOL_COMPILER_OPTION
 
5979
 
 
5980
 
 
5981
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
 
5982
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
 
5983
# ------------------------------------------------------------
 
5984
# Check whether the given compiler option works
 
5985
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
 
5986
[AC_CACHE_CHECK([$1], [$2],
 
5987
  [$2=no
 
5988
   save_LDFLAGS="$LDFLAGS"
 
5989
   LDFLAGS="$LDFLAGS $3"
 
5990
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
 
5991
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
 
5992
     # The compiler can only warn and ignore the option if not recognized
 
5993
     # So say no if there are warnings
 
5994
     if test -s conftest.err; then
 
5995
       # Append any errors to the config.log.
 
5996
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
 
5997
     else
 
5998
       $2=yes
 
5999
     fi
 
6000
   fi
 
6001
   $rm conftest*
 
6002
   LDFLAGS="$save_LDFLAGS"
 
6003
])
 
6004
 
 
6005
if test x"[$]$2" = xyes; then
 
6006
    ifelse([$4], , :, [$4])
 
6007
else
 
6008
    ifelse([$5], , :, [$5])
 
6009
fi
 
6010
])# AC_LIBTOOL_LINKER_OPTION
 
6011
 
 
6012
 
 
6013
# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
6014
# --------------------------
 
6015
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
 
6016
[# find the maximum length of command line arguments
 
6017
AC_MSG_CHECKING([the maximum length of command line arguments])
 
6018
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
 
6019
  i=0
 
6020
  testring="ABCD"
 
6021
 
 
6022
  case $build_os in
 
6023
  msdosdjgpp*)
 
6024
    # On DJGPP, this test can blow up pretty badly due to problems in libc
 
6025
    # (any single argument exceeding 2000 bytes causes a buffer overrun
 
6026
    # during glob expansion).  Even if it were fixed, the result of this
 
6027
    # check would be larger than it should be.
 
6028
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
 
6029
    ;;
 
6030
 
 
6031
  gnu*)
 
6032
    # Under GNU Hurd, this test is not required because there is
 
6033
    # no limit to the length of command line arguments.
 
6034
    # Libtool will interpret -1 as no limit whatsoever
 
6035
    lt_cv_sys_max_cmd_len=-1;
 
6036
    ;;
 
6037
 
 
6038
  cygwin* | mingw*)
 
6039
    # On Win9x/ME, this test blows up -- it succeeds, but takes
 
6040
    # about 5 minutes as the teststring grows exponentially.
 
6041
    # Worse, since 9x/ME are not pre-emptively multitasking,
 
6042
    # you end up with a "frozen" computer, even though with patience
 
6043
    # the test eventually succeeds (with a max line length of 256k).
 
6044
    # Instead, let's just punt: use the minimum linelength reported by
 
6045
    # all of the supported platforms: 8192 (on NT/2K/XP).
 
6046
    lt_cv_sys_max_cmd_len=8192;
 
6047
    ;;
 
6048
 
 
6049
 *)
 
6050
    # If test is not a shell built-in, we'll probably end up computing a
 
6051
    # maximum length that is only half of the actual maximum length, but
 
6052
    # we can't tell.
 
6053
    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
 
6054
               = "XX$testring") >/dev/null 2>&1 &&
 
6055
            new_result=`expr "X$testring" : ".*" 2>&1` &&
 
6056
            lt_cv_sys_max_cmd_len=$new_result &&
 
6057
            test $i != 17 # 1/2 MB should be enough
 
6058
    do
 
6059
      i=`expr $i + 1`
 
6060
      testring=$testring$testring
 
6061
    done
 
6062
    testring=
 
6063
    # Add a significant safety factor because C++ compilers can tack on massive
 
6064
    # amounts of additional arguments before passing them to the linker.
 
6065
    # It appears as though 1/2 is a usable value.
 
6066
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
 
6067
    ;;
 
6068
  esac
 
6069
])
 
6070
if test -n $lt_cv_sys_max_cmd_len ; then
 
6071
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 
6072
else
 
6073
  AC_MSG_RESULT(none)
 
6074
fi
 
6075
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
6076
 
 
6077
 
 
6078
# _LT_AC_CHECK_DLFCN
 
6079
# --------------------
 
6080
AC_DEFUN([_LT_AC_CHECK_DLFCN],
 
6081
[AC_CHECK_HEADERS(dlfcn.h)dnl
 
6082
])# _LT_AC_CHECK_DLFCN
 
6083
 
 
6084
 
 
6085
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
 
6086
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
 
6087
# ------------------------------------------------------------------
 
6088
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
 
6089
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 
6090
if test "$cross_compiling" = yes; then :
 
6091
  [$4]
 
6092
else
 
6093
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
 
6094
  lt_status=$lt_dlunknown
 
6095
  cat > conftest.$ac_ext <<EOF
 
6096
[#line __oline__ "configure"
 
6097
#include "confdefs.h"
 
6098
 
 
6099
#if HAVE_DLFCN_H
 
6100
#include <dlfcn.h>
 
6101
#endif
 
6102
 
 
6103
#include <stdio.h>
 
6104
 
 
6105
#ifdef RTLD_GLOBAL
 
6106
#  define LT_DLGLOBAL           RTLD_GLOBAL
 
6107
#else
 
6108
#  ifdef DL_GLOBAL
 
6109
#    define LT_DLGLOBAL         DL_GLOBAL
 
6110
#  else
 
6111
#    define LT_DLGLOBAL         0
 
6112
#  endif
 
6113
#endif
 
6114
 
 
6115
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
 
6116
   find out it does not work in some platform. */
 
6117
#ifndef LT_DLLAZY_OR_NOW
 
6118
#  ifdef RTLD_LAZY
 
6119
#    define LT_DLLAZY_OR_NOW            RTLD_LAZY
 
6120
#  else
 
6121
#    ifdef DL_LAZY
 
6122
#      define LT_DLLAZY_OR_NOW          DL_LAZY
 
6123
#    else
 
6124
#      ifdef RTLD_NOW
 
6125
#        define LT_DLLAZY_OR_NOW        RTLD_NOW
 
6126
#      else
 
6127
#        ifdef DL_NOW
 
6128
#          define LT_DLLAZY_OR_NOW      DL_NOW
 
6129
#        else
 
6130
#          define LT_DLLAZY_OR_NOW      0
 
6131
#        endif
 
6132
#      endif
 
6133
#    endif
 
6134
#  endif
 
6135
#endif
 
6136
 
 
6137
#ifdef __cplusplus
 
6138
extern "C" void exit (int);
 
6139
#endif
 
6140
 
 
6141
void fnord() { int i=42;}
 
6142
int main ()
 
6143
{
 
6144
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
 
6145
  int status = $lt_dlunknown;
 
6146
 
 
6147
  if (self)
 
6148
    {
 
6149
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
 
6150
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
 
6151
      /* dlclose (self); */
 
6152
    }
 
6153
 
 
6154
    exit (status);
 
6155
}]
 
6156
EOF
 
6157
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
 
6158
    (./conftest; exit; ) 2>/dev/null
 
6159
    lt_status=$?
 
6160
    case x$lt_status in
 
6161
      x$lt_dlno_uscore) $1 ;;
 
6162
      x$lt_dlneed_uscore) $2 ;;
 
6163
      x$lt_unknown|x*) $3 ;;
 
6164
    esac
 
6165
  else :
 
6166
    # compilation failed
 
6167
    $3
 
6168
  fi
 
6169
fi
 
6170
rm -fr conftest*
 
6171
])# _LT_AC_TRY_DLOPEN_SELF
 
6172
 
 
6173
 
 
6174
# AC_LIBTOOL_DLOPEN_SELF
 
6175
# -------------------
 
6176
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
 
6177
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 
6178
if test "x$enable_dlopen" != xyes; then
 
6179
  enable_dlopen=unknown
 
6180
  enable_dlopen_self=unknown
 
6181
  enable_dlopen_self_static=unknown
 
6182
else
 
6183
  lt_cv_dlopen=no
 
6184
  lt_cv_dlopen_libs=
 
6185
 
 
6186
  case $host_os in
 
6187
  beos*)
 
6188
    lt_cv_dlopen="load_add_on"
 
6189
    lt_cv_dlopen_libs=
 
6190
    lt_cv_dlopen_self=yes
 
6191
    ;;
 
6192
 
 
6193
  mingw* | pw32*)
 
6194
    lt_cv_dlopen="LoadLibrary"
 
6195
    lt_cv_dlopen_libs=
 
6196
   ;;
 
6197
 
 
6198
  cygwin*)
 
6199
    lt_cv_dlopen="dlopen"
 
6200
    lt_cv_dlopen_libs=
 
6201
   ;;
 
6202
 
 
6203
  darwin*)
 
6204
  # if libdl is installed we need to link against it
 
6205
    AC_CHECK_LIB([dl], [dlopen],
 
6206
                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
 
6207
    lt_cv_dlopen="dyld"
 
6208
    lt_cv_dlopen_libs=
 
6209
    lt_cv_dlopen_self=yes
 
6210
    ])
 
6211
   ;;
 
6212
    
 
6213
  *)
 
6214
    AC_CHECK_FUNC([shl_load],
 
6215
          [lt_cv_dlopen="shl_load"],
 
6216
      [AC_CHECK_LIB([dld], [shl_load],
 
6217
            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
 
6218
        [AC_CHECK_FUNC([dlopen],
 
6219
              [lt_cv_dlopen="dlopen"],
 
6220
          [AC_CHECK_LIB([dl], [dlopen],
 
6221
                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
 
6222
            [AC_CHECK_LIB([svld], [dlopen],
 
6223
                  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
 
6224
              [AC_CHECK_LIB([dld], [dld_link],
 
6225
                    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
 
6226
              ])
 
6227
            ])
 
6228
          ])
 
6229
        ])
 
6230
      ])
 
6231
    ;;
 
6232
  esac
 
6233
 
 
6234
  if test "x$lt_cv_dlopen" != xno; then
 
6235
    enable_dlopen=yes
 
6236
  else
 
6237
    enable_dlopen=no
 
6238
  fi
 
6239
 
 
6240
  case $lt_cv_dlopen in
 
6241
  dlopen)
 
6242
    save_CPPFLAGS="$CPPFLAGS"
 
6243
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
6244
 
 
6245
    save_LDFLAGS="$LDFLAGS"
 
6246
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
6247
 
 
6248
    save_LIBS="$LIBS"
 
6249
    LIBS="$lt_cv_dlopen_libs $LIBS"
 
6250
 
 
6251
    AC_CACHE_CHECK([whether a program can dlopen itself],
 
6252
          lt_cv_dlopen_self, [dnl
 
6253
          _LT_AC_TRY_DLOPEN_SELF(
 
6254
            lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
 
6255
            lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
 
6256
    ])
 
6257
 
 
6258
    if test "x$lt_cv_dlopen_self" = xyes; then
 
6259
      LDFLAGS="$LDFLAGS $link_static_flag"
 
6260
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 
6261
          lt_cv_dlopen_self_static, [dnl
 
6262
          _LT_AC_TRY_DLOPEN_SELF(
 
6263
            lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
 
6264
            lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
 
6265
      ])
 
6266
    fi
 
6267
 
 
6268
    CPPFLAGS="$save_CPPFLAGS"
 
6269
    LDFLAGS="$save_LDFLAGS"
 
6270
    LIBS="$save_LIBS"
 
6271
    ;;
 
6272
  esac
 
6273
 
 
6274
  case $lt_cv_dlopen_self in
 
6275
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
 
6276
  *) enable_dlopen_self=unknown ;;
 
6277
  esac
 
6278
 
 
6279
  case $lt_cv_dlopen_self_static in
 
6280
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
 
6281
  *) enable_dlopen_self_static=unknown ;;
 
6282
  esac
 
6283
fi
 
6284
])# AC_LIBTOOL_DLOPEN_SELF
 
6285
 
 
6286
 
 
6287
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
 
6288
# ---------------------------------
 
6289
# Check to see if options -c and -o are simultaneously supported by compiler
 
6290
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
 
6291
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
6292
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
 
6293
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
 
6294
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
 
6295
   $rm -r conftest 2>/dev/null
 
6296
   mkdir conftest
 
6297
   cd conftest
 
6298
   mkdir out
 
6299
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
6300
 
 
6301
   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
 
6302
   # that will create temporary files in the current directory regardless of
 
6303
   # the output directory.  Thus, making CWD read-only will cause this test
 
6304
   # to fail, enabling locking or at least warning the user not to do parallel
 
6305
   # builds.
 
6306
   chmod -w .
 
6307
 
 
6308
   lt_compiler_flag="-o out/conftest2.$ac_objext"
 
6309
   # Insert the option either (1) after the last *FLAGS variable, or
 
6310
   # (2) before a word containing "conftest.", or (3) at the end.
 
6311
   # Note that $ac_compile itself does not contain backslashes and begins
 
6312
   # with a dollar sign (not a hyphen), so the echo should work correctly.
 
6313
   lt_compile=`echo "$ac_compile" | $SED \
 
6314
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
 
6315
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
 
6316
   -e 's:$: $lt_compiler_flag:'`
 
6317
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
 
6318
   (eval "$lt_compile" 2>out/conftest.err)
 
6319
   ac_status=$?
 
6320
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
 
6321
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
6322
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
 
6323
   then
 
6324
     # The compiler can only warn and ignore the option if not recognized
 
6325
     # So say no if there are warnings
 
6326
     if test ! -s out/conftest.err; then
 
6327
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
6328
     fi
 
6329
   fi
 
6330
   chmod u+w .
 
6331
   $rm conftest* out/*
 
6332
   rmdir out
 
6333
   cd ..
 
6334
   rmdir conftest
 
6335
   $rm conftest*
 
6336
])
 
6337
])# AC_LIBTOOL_PROG_CC_C_O
 
6338
 
 
6339
 
 
6340
# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
 
6341
# -----------------------------------------
 
6342
# Check to see if we can do hard links to lock some files if needed
 
6343
AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
 
6344
[AC_REQUIRE([_LT_AC_LOCK])dnl
 
6345
 
 
6346
hard_links="nottested"
 
6347
if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
 
6348
  # do not overwrite the value of need_locks provided by the user
 
6349
  AC_MSG_CHECKING([if we can lock with hard links])
 
6350
  hard_links=yes
 
6351
  $rm conftest*
 
6352
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 
6353
  touch conftest.a
 
6354
  ln conftest.a conftest.b 2>&5 || hard_links=no
 
6355
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 
6356
  AC_MSG_RESULT([$hard_links])
 
6357
  if test "$hard_links" = no; then
 
6358
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
 
6359
    need_locks=warn
 
6360
  fi
 
6361
else
 
6362
  need_locks=no
 
6363
fi
 
6364
])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
 
6365
 
 
6366
 
 
6367
# AC_LIBTOOL_OBJDIR
 
6368
# -----------------
 
6369
AC_DEFUN([AC_LIBTOOL_OBJDIR],
 
6370
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
 
6371
[rm -f .libs 2>/dev/null
 
6372
mkdir .libs 2>/dev/null
 
6373
if test -d .libs; then
 
6374
  lt_cv_objdir=.libs
 
6375
else
 
6376
  # MS-DOS does not allow filenames that begin with a dot.
 
6377
  lt_cv_objdir=_libs
 
6378
fi
 
6379
rmdir .libs 2>/dev/null])
 
6380
objdir=$lt_cv_objdir
 
6381
])# AC_LIBTOOL_OBJDIR
 
6382
 
 
6383
 
 
6384
# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
 
6385
# ----------------------------------------------
 
6386
# Check hardcoding attributes.
 
6387
AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
 
6388
[AC_MSG_CHECKING([how to hardcode library paths into programs])
 
6389
_LT_AC_TAGVAR(hardcode_action, $1)=
 
6390
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
 
6391
   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
 
6392
   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
 
6393
 
 
6394
  # We can hardcode non-existant directories.
 
6395
  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
 
6396
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
 
6397
     # have to relink, otherwise we might link with an installed library
 
6398
     # when we should be linking with a yet-to-be-installed one
 
6399
     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
 
6400
     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
 
6401
    # Linking always hardcodes the temporary library directory.
 
6402
    _LT_AC_TAGVAR(hardcode_action, $1)=relink
 
6403
  else
 
6404
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
 
6405
    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
 
6406
  fi
 
6407
else
 
6408
  # We cannot hardcode anything, or else we can only hardcode existing
 
6409
  # directories.
 
6410
  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
 
6411
fi
 
6412
AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
 
6413
 
 
6414
if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
 
6415
  # Fast installation is not supported
 
6416
  enable_fast_install=no
 
6417
elif test "$shlibpath_overrides_runpath" = yes ||
 
6418
     test "$enable_shared" = no; then
 
6419
  # Fast installation is not necessary
 
6420
  enable_fast_install=needless
 
6421
fi
 
6422
])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
 
6423
 
 
6424
 
 
6425
# AC_LIBTOOL_SYS_LIB_STRIP
 
6426
# ------------------------
 
6427
AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
 
6428
[striplib=
 
6429
old_striplib=
 
6430
AC_MSG_CHECKING([whether stripping libraries is possible])
 
6431
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
 
6432
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
 
6433
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
 
6434
  AC_MSG_RESULT([yes])
 
6435
else
 
6436
# FIXME - insert some real tests, host_os isn't really good enough
 
6437
  case $host_os in
 
6438
   darwin*)
 
6439
       if test -n "$STRIP" ; then
 
6440
         striplib="$STRIP -x"
 
6441
         AC_MSG_RESULT([yes])
 
6442
       else
 
6443
  AC_MSG_RESULT([no])
 
6444
fi
 
6445
       ;;
 
6446
   *)
 
6447
  AC_MSG_RESULT([no])
 
6448
    ;;
 
6449
  esac  
 
6450
fi
 
6451
])# AC_LIBTOOL_SYS_LIB_STRIP
 
6452
 
 
6453
 
 
6454
# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
6455
# -----------------------------
 
6456
# PORTME Fill in your ld.so characteristics
 
6457
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
 
6458
[AC_MSG_CHECKING([dynamic linker characteristics])
 
6459
library_names_spec=
 
6460
libname_spec='lib$name'
 
6461
soname_spec=
 
6462
shrext=".so"
 
6463
postinstall_cmds=
 
6464
postuninstall_cmds=
 
6465
finish_cmds=
 
6466
finish_eval=
 
6467
shlibpath_var=
 
6468
shlibpath_overrides_runpath=unknown
 
6469
version_type=none
 
6470
dynamic_linker="$host_os ld.so"
 
6471
sys_lib_dlsearch_path_spec="/lib /usr/lib"
 
6472
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 
6473
need_lib_prefix=unknown
 
6474
hardcode_into_libs=no
 
6475
 
 
6476
# when you set need_version to no, make sure it does not cause -set_version
 
6477
# flags to be left without arguments
 
6478
need_version=unknown
 
6479
 
 
6480
case $host_os in
 
6481
aix3*)
 
6482
  version_type=linux
 
6483
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
 
6484
  shlibpath_var=LIBPATH
 
6485
 
 
6486
  # AIX 3 has no versioning support, so we append a major version to the name.
 
6487
  soname_spec='${libname}${release}${shared_ext}$major'
 
6488
  ;;
 
6489
 
 
6490
aix4* | aix5*)
 
6491
  version_type=linux
 
6492
  need_lib_prefix=no
 
6493
  need_version=no
 
6494
  hardcode_into_libs=yes
 
6495
  if test "$host_cpu" = ia64; then
 
6496
    # AIX 5 supports IA64
 
6497
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
 
6498
    shlibpath_var=LD_LIBRARY_PATH
 
6499
  else
 
6500
    # With GCC up to 2.95.x, collect2 would create an import file
 
6501
    # for dependence libraries.  The import file would start with
 
6502
    # the line `#! .'.  This would cause the generated library to
 
6503
    # depend on `.', always an invalid library.  This was fixed in
 
6504
    # development snapshots of GCC prior to 3.0.
 
6505
    case $host_os in
 
6506
      aix4 | aix4.[[01]] | aix4.[[01]].*)
 
6507
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 
6508
           echo ' yes '
 
6509
           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
 
6510
        :
 
6511
      else
 
6512
        can_build_shared=no
 
6513
      fi
 
6514
      ;;
 
6515
    esac
 
6516
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
 
6517
    # soname into executable. Probably we can add versioning support to
 
6518
    # collect2, so additional links can be useful in future.
 
6519
    if test "$aix_use_runtimelinking" = yes; then
 
6520
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
 
6521
      # instead of lib<name>.a to let people know that these are not
 
6522
      # typical AIX shared libraries.
 
6523
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6524
    else
 
6525
      # We preserve .a as extension for shared libraries through AIX4.2
 
6526
      # and later when we are not doing run time linking.
 
6527
      library_names_spec='${libname}${release}.a $libname.a'
 
6528
      soname_spec='${libname}${release}${shared_ext}$major'
 
6529
    fi
 
6530
    shlibpath_var=LIBPATH
 
6531
  fi
 
6532
  ;;
 
6533
 
 
6534
amigaos*)
 
6535
  library_names_spec='$libname.ixlibrary $libname.a'
 
6536
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
 
6537
  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'
 
6538
  ;;
 
6539
 
 
6540
beos*)
 
6541
  library_names_spec='${libname}${shared_ext}'
 
6542
  dynamic_linker="$host_os ld.so"
 
6543
  shlibpath_var=LIBRARY_PATH
 
6544
  ;;
 
6545
 
 
6546
bsdi4*)
 
6547
  version_type=linux
 
6548
  need_version=no
 
6549
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6550
  soname_spec='${libname}${release}${shared_ext}$major'
 
6551
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
 
6552
  shlibpath_var=LD_LIBRARY_PATH
 
6553
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
 
6554
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
 
6555
  # the default ld.so.conf also contains /usr/contrib/lib and
 
6556
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
 
6557
  # libtool to hard-code these into programs
 
6558
  ;;
 
6559
 
 
6560
cygwin* | mingw* | pw32*)
 
6561
  version_type=windows
 
6562
  shrext=".dll"
 
6563
  need_version=no
 
6564
  need_lib_prefix=no
 
6565
 
 
6566
  case $GCC,$host_os in
 
6567
  yes,cygwin* | yes,mingw* | yes,pw32*)
 
6568
    library_names_spec='$libname.dll.a'
 
6569
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
 
6570
    postinstall_cmds='base_file=`basename \${file}`~
 
6571
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
 
6572
      dldir=$destdir/`dirname \$dlpath`~
 
6573
      test -d \$dldir || mkdir -p \$dldir~
 
6574
      $install_prog $dir/$dlname \$dldir/$dlname'
 
6575
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
 
6576
      dlpath=$dir/\$dldll~
 
6577
       $rm \$dlpath'
 
6578
    shlibpath_overrides_runpath=yes
 
6579
 
 
6580
    case $host_os in
 
6581
    cygwin*)
 
6582
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
 
6583
      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
 
6584
      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
 
6585
      ;;
 
6586
    mingw*)
 
6587
      # MinGW DLLs use traditional 'lib' prefix
 
6588
      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
 
6589
      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
 
6590
      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
 
6591
        # It is most probably a Windows format PATH printed by
 
6592
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
 
6593
        # path with ; separators, and with drive letters. We can handle the
 
6594
        # drive letters (cygwin fileutils understands them), so leave them,
 
6595
        # especially as we might pass files found there to a mingw objdump,
 
6596
        # which wouldn't understand a cygwinified path. Ahh.
 
6597
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
 
6598
      else
 
6599
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
 
6600
      fi
 
6601
      ;;
 
6602
    pw32*)
 
6603
      # pw32 DLLs use 'pw' prefix rather than 'lib'
 
6604
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
 
6605
      ;;
 
6606
    esac
 
6607
    ;;
 
6608
 
 
6609
  *)
 
6610
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
 
6611
    ;;
 
6612
  esac
 
6613
  dynamic_linker='Win32 ld.exe'
 
6614
  # FIXME: first we should search . and the directory the executable is in
 
6615
  shlibpath_var=PATH
 
6616
  ;;
 
6617
 
 
6618
darwin* | rhapsody*)
 
6619
  dynamic_linker="$host_os dyld"
 
6620
  version_type=darwin
 
6621
  need_lib_prefix=no
 
6622
  need_version=no
 
6623
  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
 
6624
  soname_spec='${libname}${release}${major}$shared_ext'
 
6625
  shlibpath_overrides_runpath=yes
 
6626
  shlibpath_var=DYLD_LIBRARY_PATH
 
6627
  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
 
6628
  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
 
6629
  if test "$GCC" = yes; then
 
6630
    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"`
 
6631
  else
 
6632
    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
 
6633
  fi
 
6634
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
 
6635
  ;;
 
6636
 
 
6637
dgux*)
 
6638
  version_type=linux
 
6639
  need_lib_prefix=no
 
6640
  need_version=no
 
6641
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
 
6642
  soname_spec='${libname}${release}${shared_ext}$major'
 
6643
  shlibpath_var=LD_LIBRARY_PATH
 
6644
  ;;
 
6645
 
 
6646
freebsd1*)
 
6647
  dynamic_linker=no
 
6648
  ;;
 
6649
 
 
6650
freebsd*-gnu*)
 
6651
  version_type=linux
 
6652
  need_lib_prefix=no
 
6653
  need_version=no
 
6654
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
 
6655
  soname_spec='${libname}${release}${shared_ext}$major'
 
6656
  shlibpath_var=LD_LIBRARY_PATH
 
6657
  shlibpath_overrides_runpath=no
 
6658
  hardcode_into_libs=yes
 
6659
  dynamic_linker='GNU ld.so'
 
6660
  ;;
 
6661
 
 
6662
freebsd*)
 
6663
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
 
6664
  version_type=freebsd-$objformat
 
6665
  case $version_type in
 
6666
    freebsd-elf*)
 
6667
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
 
6668
      need_version=no
 
6669
      need_lib_prefix=no
 
6670
      ;;
 
6671
    freebsd-*)
 
6672
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
 
6673
      need_version=yes
 
6674
      ;;
 
6675
  esac
 
6676
  shlibpath_var=LD_LIBRARY_PATH
 
6677
  case $host_os in
 
6678
  freebsd2*)
 
6679
    shlibpath_overrides_runpath=yes
 
6680
    ;;
 
6681
  freebsd3.[01]* | freebsdelf3.[01]*)
 
6682
    shlibpath_overrides_runpath=yes
 
6683
    hardcode_into_libs=yes
 
6684
    ;;
 
6685
  *) # from 3.2 on
 
6686
    shlibpath_overrides_runpath=no
 
6687
    hardcode_into_libs=yes
 
6688
    ;;
 
6689
  esac
 
6690
  ;;
 
6691
 
 
6692
gnu*)
 
6693
  version_type=linux
 
6694
  need_lib_prefix=no
 
6695
  need_version=no
 
6696
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
 
6697
  soname_spec='${libname}${release}${shared_ext}$major'
 
6698
  shlibpath_var=LD_LIBRARY_PATH
 
6699
  hardcode_into_libs=yes
 
6700
  ;;
 
6701
 
 
6702
hpux9* | hpux10* | hpux11*)
 
6703
  # Give a soname corresponding to the major version so that dld.sl refuses to
 
6704
  # link against other versions.
 
6705
  version_type=sunos
 
6706
  need_lib_prefix=no
 
6707
  need_version=no
 
6708
  case "$host_cpu" in
 
6709
  ia64*)
 
6710
    shrext='.so'
 
6711
    hardcode_into_libs=yes
 
6712
    dynamic_linker="$host_os dld.so"
 
6713
    shlibpath_var=LD_LIBRARY_PATH
 
6714
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
 
6715
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6716
    soname_spec='${libname}${release}${shared_ext}$major'
 
6717
    if test "X$HPUX_IA64_MODE" = X32; then
 
6718
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
 
6719
    else
 
6720
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
 
6721
    fi
 
6722
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
 
6723
    ;;
 
6724
   hppa*64*)
 
6725
     shrext='.sl'
 
6726
     hardcode_into_libs=yes
 
6727
     dynamic_linker="$host_os dld.sl"
 
6728
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
 
6729
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
 
6730
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6731
     soname_spec='${libname}${release}${shared_ext}$major'
 
6732
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
 
6733
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
 
6734
     ;;
 
6735
   *)
 
6736
    shrext='.sl'
 
6737
    dynamic_linker="$host_os dld.sl"
 
6738
    shlibpath_var=SHLIB_PATH
 
6739
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
 
6740
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6741
    soname_spec='${libname}${release}${shared_ext}$major'
 
6742
    ;;
 
6743
  esac
 
6744
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
 
6745
  postinstall_cmds='chmod 555 $lib'
 
6746
  ;;
 
6747
 
 
6748
irix5* | irix6* | nonstopux*)
 
6749
  case $host_os in
 
6750
    nonstopux*) version_type=nonstopux ;;
 
6751
    *)
 
6752
        if test "$lt_cv_prog_gnu_ld" = yes; then
 
6753
                version_type=linux
 
6754
        else
 
6755
                version_type=irix
 
6756
        fi ;;
 
6757
  esac
 
6758
  need_lib_prefix=no
 
6759
  need_version=no
 
6760
  soname_spec='${libname}${release}${shared_ext}$major'
 
6761
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
 
6762
  case $host_os in
 
6763
  irix5* | nonstopux*)
 
6764
    libsuff= shlibsuff=
 
6765
    ;;
 
6766
  *)
 
6767
    case $LD in # libtool.m4 will add one of these switches to LD
 
6768
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
 
6769
      libsuff= shlibsuff= libmagic=32-bit;;
 
6770
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
 
6771
      libsuff=32 shlibsuff=N32 libmagic=N32;;
 
6772
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
 
6773
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
 
6774
    *) libsuff= shlibsuff= libmagic=never-match;;
 
6775
    esac
 
6776
    ;;
 
6777
  esac
 
6778
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
 
6779
  shlibpath_overrides_runpath=no
 
6780
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
 
6781
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
 
6782
  hardcode_into_libs=yes
 
6783
  ;;
 
6784
 
 
6785
# No shared lib support for Linux oldld, aout, or coff.
 
6786
linux*oldld* | linux*aout* | linux*coff*)
 
6787
  dynamic_linker=no
 
6788
  ;;
 
6789
 
 
6790
# This must be Linux ELF.
 
6791
linux*)
 
6792
  version_type=linux
 
6793
  need_lib_prefix=no
 
6794
  need_version=no
 
6795
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6796
  soname_spec='${libname}${release}${shared_ext}$major'
 
6797
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
 
6798
  libsuff=
 
6799
  if test "x$LINUX_64_MODE" = x64; then
 
6800
    # Some platforms are per default 64-bit, so there's no /lib64
 
6801
    if test -d /lib64; then
 
6802
      libsuff=64
 
6803
    fi
 
6804
  fi
 
6805
  shlibpath_var=LD_LIBRARY_PATH
 
6806
  shlibpath_overrides_runpath=no
 
6807
  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
 
6808
  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
 
6809
  # This implies no fast_install, which is unacceptable.
 
6810
  # Some rework will be needed to allow for fast_install
 
6811
  # before this can be enabled.
 
6812
  hardcode_into_libs=yes
 
6813
 
 
6814
  # We used to test for /lib/ld.so.1 and disable shared libraries on
 
6815
  # powerpc, because MkLinux only supported shared libraries with the
 
6816
  # GNU dynamic linker.  Since this was broken with cross compilers,
 
6817
  # most powerpc-linux boxes support dynamic linking these days and
 
6818
  # people can always --disable-shared, the test was removed, and we
 
6819
  # assume the GNU/Linux dynamic linker is in use.
 
6820
  dynamic_linker='GNU/Linux ld.so'
 
6821
  ;;
 
6822
 
 
6823
netbsd*)
 
6824
  version_type=sunos
 
6825
  need_lib_prefix=no
 
6826
  need_version=no
 
6827
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
6828
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
6829
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
 
6830
    dynamic_linker='NetBSD (a.out) ld.so'
 
6831
  else
 
6832
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
 
6833
    soname_spec='${libname}${release}${shared_ext}$major'
 
6834
    dynamic_linker='NetBSD ld.elf_so'
 
6835
  fi
 
6836
  shlibpath_var=LD_LIBRARY_PATH
 
6837
  shlibpath_overrides_runpath=yes
 
6838
  hardcode_into_libs=yes
 
6839
  ;;
 
6840
 
 
6841
newsos6)
 
6842
  version_type=linux
 
6843
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6844
  shlibpath_var=LD_LIBRARY_PATH
 
6845
  shlibpath_overrides_runpath=yes
 
6846
  ;;
 
6847
 
 
6848
nto-qnx*)
 
6849
  version_type=linux
 
6850
  need_lib_prefix=no
 
6851
  need_version=no
 
6852
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6853
  soname_spec='${libname}${release}${shared_ext}$major'
 
6854
  shlibpath_var=LD_LIBRARY_PATH
 
6855
  shlibpath_overrides_runpath=yes
 
6856
  ;;
 
6857
 
 
6858
openbsd*)
 
6859
  version_type=sunos
 
6860
  need_lib_prefix=no
 
6861
  need_version=no
 
6862
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
6863
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
 
6864
  shlibpath_var=LD_LIBRARY_PATH
 
6865
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
6866
    case $host_os in
 
6867
      openbsd2.[[89]] | openbsd2.[[89]].*)
 
6868
        shlibpath_overrides_runpath=no
 
6869
        ;;
 
6870
      *)
 
6871
        shlibpath_overrides_runpath=yes
 
6872
        ;;
 
6873
      esac
 
6874
  else
 
6875
    shlibpath_overrides_runpath=yes
 
6876
  fi
 
6877
  ;;
 
6878
 
 
6879
os2*)
 
6880
  libname_spec='$name'
 
6881
  shrext=".dll"
 
6882
  need_lib_prefix=no
 
6883
  library_names_spec='$libname${shared_ext} $libname.a'
 
6884
  dynamic_linker='OS/2 ld.exe'
 
6885
  shlibpath_var=LIBPATH
 
6886
  ;;
 
6887
 
 
6888
osf3* | osf4* | osf5*)
 
6889
  version_type=osf
 
6890
  need_lib_prefix=no
 
6891
  need_version=no
 
6892
  soname_spec='${libname}${release}${shared_ext}$major'
 
6893
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6894
  shlibpath_var=LD_LIBRARY_PATH
 
6895
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
 
6896
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
 
6897
  ;;
 
6898
 
 
6899
sco3.2v5*)
 
6900
  version_type=osf
 
6901
  soname_spec='${libname}${release}${shared_ext}$major'
 
6902
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6903
  shlibpath_var=LD_LIBRARY_PATH
 
6904
  ;;
 
6905
 
 
6906
solaris*)
 
6907
  version_type=linux
 
6908
  need_lib_prefix=no
 
6909
  need_version=no
 
6910
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6911
  soname_spec='${libname}${release}${shared_ext}$major'
 
6912
  shlibpath_var=LD_LIBRARY_PATH
 
6913
  shlibpath_overrides_runpath=yes
 
6914
  hardcode_into_libs=yes
 
6915
  # ldd complains unless libraries are executable
 
6916
  postinstall_cmds='chmod +x $lib'
 
6917
  ;;
 
6918
 
 
6919
sunos4*)
 
6920
  version_type=sunos
 
6921
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
 
6922
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
 
6923
  shlibpath_var=LD_LIBRARY_PATH
 
6924
  shlibpath_overrides_runpath=yes
 
6925
  if test "$with_gnu_ld" = yes; then
 
6926
    need_lib_prefix=no
 
6927
  fi
 
6928
  need_version=yes
 
6929
  ;;
 
6930
 
 
6931
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
6932
  version_type=linux
 
6933
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6934
  soname_spec='${libname}${release}${shared_ext}$major'
 
6935
  shlibpath_var=LD_LIBRARY_PATH
 
6936
  case $host_vendor in
 
6937
    sni)
 
6938
      shlibpath_overrides_runpath=no
 
6939
      need_lib_prefix=no
 
6940
      export_dynamic_flag_spec='${wl}-Blargedynsym'
 
6941
      runpath_var=LD_RUN_PATH
 
6942
      ;;
 
6943
    siemens)
 
6944
      need_lib_prefix=no
 
6945
      ;;
 
6946
    motorola)
 
6947
      need_lib_prefix=no
 
6948
      need_version=no
 
6949
      shlibpath_overrides_runpath=no
 
6950
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
 
6951
      ;;
 
6952
  esac
 
6953
  ;;
 
6954
 
 
6955
sysv4*MP*)
 
6956
  if test -d /usr/nec ;then
 
6957
    version_type=linux
 
6958
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
 
6959
    soname_spec='$libname${shared_ext}.$major'
 
6960
    shlibpath_var=LD_LIBRARY_PATH
 
6961
  fi
 
6962
  ;;
 
6963
 
 
6964
uts4*)
 
6965
  version_type=linux
 
6966
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
 
6967
  soname_spec='${libname}${release}${shared_ext}$major'
 
6968
  shlibpath_var=LD_LIBRARY_PATH
 
6969
  ;;
 
6970
 
 
6971
*)
 
6972
  dynamic_linker=no
 
6973
  ;;
 
6974
esac
 
6975
AC_MSG_RESULT([$dynamic_linker])
 
6976
test "$dynamic_linker" = no && can_build_shared=no
 
6977
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
6978
 
 
6979
 
 
6980
# _LT_AC_TAGCONFIG
 
6981
# ----------------
 
6982
AC_DEFUN([_LT_AC_TAGCONFIG],
 
6983
[AC_ARG_WITH([tags],
 
6984
    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
 
6985
        [include additional configurations @<:@automatic@:>@])],
 
6986
    [tagnames="$withval"])
 
6987
 
 
6988
if test -f "$ltmain" && test -n "$tagnames"; then
 
6989
  if test ! -f "${ofile}"; then
 
6990
    AC_MSG_WARN([output file `$ofile' does not exist])
 
6991
  fi
 
6992
 
 
6993
  if test -z "$LTCC"; then
 
6994
    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
 
6995
    if test -z "$LTCC"; then
 
6996
      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
 
6997
    else
 
6998
      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
 
6999
    fi
 
7000
  fi
 
7001
 
 
7002
  # Extract list of available tagged configurations in $ofile.
 
7003
  # Note that this assumes the entire list is on one line.
 
7004
  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
 
7005
 
 
7006
  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7007
  for tagname in $tagnames; do
 
7008
    IFS="$lt_save_ifs"
 
7009
    # Check whether tagname contains only valid characters
 
7010
    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
 
7011
    "") ;;
 
7012
    *)  AC_MSG_ERROR([invalid tag name: $tagname])
 
7013
        ;;
 
7014
    esac
 
7015
 
 
7016
    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
 
7017
    then
 
7018
      AC_MSG_ERROR([tag name \"$tagname\" already exists])
 
7019
    fi
 
7020
 
 
7021
    # Update the list of available tags.
 
7022
    if test -n "$tagname"; then
 
7023
      echo appending configuration tag \"$tagname\" to $ofile
 
7024
 
 
7025
      case $tagname in
 
7026
      CXX)
 
7027
        if test -n "$CXX" && test "X$CXX" != "Xno"; then
 
7028
          AC_LIBTOOL_LANG_CXX_CONFIG
 
7029
        else
 
7030
          tagname=""
 
7031
        fi
 
7032
        ;;
 
7033
 
 
7034
      F77)
 
7035
        if test -n "$F77" && test "X$F77" != "Xno"; then
 
7036
          AC_LIBTOOL_LANG_F77_CONFIG
 
7037
        else
 
7038
          tagname=""
 
7039
        fi
 
7040
        ;;
 
7041
 
 
7042
      GCJ)
 
7043
        if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
 
7044
          AC_LIBTOOL_LANG_GCJ_CONFIG
 
7045
        else
 
7046
          tagname=""
 
7047
        fi
 
7048
        ;;
 
7049
 
 
7050
      RC)
 
7051
        AC_LIBTOOL_LANG_RC_CONFIG
 
7052
        ;;
 
7053
 
 
7054
      *)
 
7055
        AC_MSG_ERROR([Unsupported tag name: $tagname])
 
7056
        ;;
 
7057
      esac
 
7058
 
 
7059
      # Append the new tag name to the list of available tags.
 
7060
      if test -n "$tagname" ; then
 
7061
      available_tags="$available_tags $tagname"
 
7062
    fi
 
7063
    fi
 
7064
  done
 
7065
  IFS="$lt_save_ifs"
 
7066
 
 
7067
  # Now substitute the updated list of available tags.
 
7068
  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
 
7069
    mv "${ofile}T" "$ofile"
 
7070
    chmod +x "$ofile"
 
7071
  else
 
7072
    rm -f "${ofile}T"
 
7073
    AC_MSG_ERROR([unable to update list of available tagged configurations.])
 
7074
  fi
 
7075
fi
 
7076
])# _LT_AC_TAGCONFIG
 
7077
 
 
7078
 
 
7079
# AC_LIBTOOL_DLOPEN
 
7080
# -----------------
 
7081
# enable checks for dlopen support
 
7082
AC_DEFUN([AC_LIBTOOL_DLOPEN],
 
7083
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
 
7084
])# AC_LIBTOOL_DLOPEN
 
7085
 
 
7086
 
 
7087
# AC_LIBTOOL_WIN32_DLL
 
7088
# --------------------
 
7089
# declare package support for building win32 dll's
 
7090
AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
 
7091
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
 
7092
])# AC_LIBTOOL_WIN32_DLL
 
7093
 
 
7094
 
 
7095
# AC_ENABLE_SHARED([DEFAULT])
 
7096
# ---------------------------
 
7097
# implement the --enable-shared flag
 
7098
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7099
AC_DEFUN([AC_ENABLE_SHARED],
 
7100
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 
7101
AC_ARG_ENABLE([shared],
 
7102
    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
 
7103
        [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
 
7104
    [p=${PACKAGE-default}
 
7105
    case $enableval in
 
7106
    yes) enable_shared=yes ;;
 
7107
    no) enable_shared=no ;;
 
7108
    *)
 
7109
      enable_shared=no
 
7110
      # Look at the argument we got.  We use all the common list separators.
 
7111
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7112
      for pkg in $enableval; do
 
7113
        IFS="$lt_save_ifs"
 
7114
        if test "X$pkg" = "X$p"; then
 
7115
          enable_shared=yes
 
7116
        fi
 
7117
      done
 
7118
      IFS="$lt_save_ifs"
 
7119
      ;;
 
7120
    esac],
 
7121
    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
 
7122
])# AC_ENABLE_SHARED
 
7123
 
 
7124
 
 
7125
# AC_DISABLE_SHARED
 
7126
# -----------------
 
7127
#- set the default shared flag to --disable-shared
 
7128
AC_DEFUN([AC_DISABLE_SHARED],
 
7129
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7130
AC_ENABLE_SHARED(no)
 
7131
])# AC_DISABLE_SHARED
 
7132
 
 
7133
 
 
7134
# AC_ENABLE_STATIC([DEFAULT])
 
7135
# ---------------------------
 
7136
# implement the --enable-static flag
 
7137
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7138
AC_DEFUN([AC_ENABLE_STATIC],
 
7139
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 
7140
AC_ARG_ENABLE([static],
 
7141
    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
 
7142
        [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
 
7143
    [p=${PACKAGE-default}
 
7144
    case $enableval in
 
7145
    yes) enable_static=yes ;;
 
7146
    no) enable_static=no ;;
 
7147
    *)
 
7148
     enable_static=no
 
7149
      # Look at the argument we got.  We use all the common list separators.
 
7150
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7151
      for pkg in $enableval; do
 
7152
        IFS="$lt_save_ifs"
 
7153
        if test "X$pkg" = "X$p"; then
 
7154
          enable_static=yes
 
7155
        fi
 
7156
      done
 
7157
      IFS="$lt_save_ifs"
 
7158
      ;;
 
7159
    esac],
 
7160
    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
 
7161
])# AC_ENABLE_STATIC
 
7162
 
 
7163
 
 
7164
# AC_DISABLE_STATIC
 
7165
# -----------------
 
7166
# set the default static flag to --disable-static
 
7167
AC_DEFUN([AC_DISABLE_STATIC],
 
7168
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7169
AC_ENABLE_STATIC(no)
 
7170
])# AC_DISABLE_STATIC
 
7171
 
 
7172
 
 
7173
# AC_ENABLE_FAST_INSTALL([DEFAULT])
 
7174
# ---------------------------------
 
7175
# implement the --enable-fast-install flag
 
7176
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 
7177
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
 
7178
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
 
7179
AC_ARG_ENABLE([fast-install],
 
7180
    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
 
7181
    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
 
7182
    [p=${PACKAGE-default}
 
7183
    case $enableval in
 
7184
    yes) enable_fast_install=yes ;;
 
7185
    no) enable_fast_install=no ;;
 
7186
    *)
 
7187
      enable_fast_install=no
 
7188
      # Look at the argument we got.  We use all the common list separators.
 
7189
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
 
7190
      for pkg in $enableval; do
 
7191
        IFS="$lt_save_ifs"
 
7192
        if test "X$pkg" = "X$p"; then
 
7193
          enable_fast_install=yes
 
7194
        fi
 
7195
      done
 
7196
      IFS="$lt_save_ifs"
 
7197
      ;;
 
7198
    esac],
 
7199
    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
 
7200
])# AC_ENABLE_FAST_INSTALL
 
7201
 
 
7202
 
 
7203
# AC_DISABLE_FAST_INSTALL
 
7204
# -----------------------
 
7205
# set the default to --disable-fast-install
 
7206
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
 
7207
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7208
AC_ENABLE_FAST_INSTALL(no)
 
7209
])# AC_DISABLE_FAST_INSTALL
 
7210
 
 
7211
 
 
7212
# AC_LIBTOOL_PICMODE([MODE])
 
7213
# --------------------------
 
7214
# implement the --with-pic flag
 
7215
# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 
7216
AC_DEFUN([AC_LIBTOOL_PICMODE],
 
7217
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7218
pic_mode=ifelse($#,1,$1,default)
 
7219
])# AC_LIBTOOL_PICMODE
 
7220
 
 
7221
 
 
7222
# AC_PROG_EGREP
 
7223
# -------------
 
7224
# This is predefined starting with Autoconf 2.54, so this conditional
 
7225
# definition can be removed once we require Autoconf 2.54 or later.
 
7226
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
 
7227
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
 
7228
   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
 
7229
    then ac_cv_prog_egrep='grep -E'
 
7230
    else ac_cv_prog_egrep='egrep'
 
7231
    fi])
 
7232
 EGREP=$ac_cv_prog_egrep
 
7233
 AC_SUBST([EGREP])
 
7234
])])
 
7235
 
 
7236
 
 
7237
# AC_PATH_TOOL_PREFIX
 
7238
# -------------------
 
7239
# find a file program which can recognise shared library
 
7240
AC_DEFUN([AC_PATH_TOOL_PREFIX],
 
7241
[AC_REQUIRE([AC_PROG_EGREP])dnl
 
7242
AC_MSG_CHECKING([for $1])
 
7243
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 
7244
[case $MAGIC_CMD in
 
7245
[[\\/*] |  ?:[\\/]*])
 
7246
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
 
7247
  ;;
 
7248
*)
 
7249
  lt_save_MAGIC_CMD="$MAGIC_CMD"
 
7250
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
7251
dnl $ac_dummy forces splitting on constant user-supplied paths.
 
7252
dnl POSIX.2 word splitting is done only on the output of word expansions,
 
7253
dnl not every word.  This closes a longstanding sh security hole.
 
7254
  ac_dummy="ifelse([$2], , $PATH, [$2])"
 
7255
  for ac_dir in $ac_dummy; do
 
7256
    IFS="$lt_save_ifs"
 
7257
    test -z "$ac_dir" && ac_dir=.
 
7258
    if test -f $ac_dir/$1; then
 
7259
      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
 
7260
      if test -n "$file_magic_test_file"; then
 
7261
        case $deplibs_check_method in
 
7262
        "file_magic "*)
 
7263
          file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
 
7264
          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 
7265
          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 
7266
            $EGREP "$file_magic_regex" > /dev/null; then
 
7267
            :
 
7268
          else
 
7269
            cat <<EOF 1>&2
 
7270
 
 
7271
*** Warning: the command libtool uses to detect shared libraries,
 
7272
*** $file_magic_cmd, produces output that libtool cannot recognize.
 
7273
*** The result is that libtool may fail to recognize shared libraries
 
7274
*** as such.  This will affect the creation of libtool libraries that
 
7275
*** depend on shared libraries, but programs linked with such libtool
 
7276
*** libraries will work regardless of this problem.  Nevertheless, you
 
7277
*** may want to report the problem to your system manager and/or to
 
7278
*** bug-libtool@gnu.org
 
7279
 
 
7280
EOF
 
7281
          fi ;;
 
7282
        esac
 
7283
      fi
 
7284
      break
 
7285
    fi
 
7286
  done
 
7287
  IFS="$lt_save_ifs"
 
7288
  MAGIC_CMD="$lt_save_MAGIC_CMD"
 
7289
  ;;
 
7290
esac])
 
7291
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 
7292
if test -n "$MAGIC_CMD"; then
 
7293
  AC_MSG_RESULT($MAGIC_CMD)
 
7294
else
 
7295
  AC_MSG_RESULT(no)
 
7296
fi
 
7297
])# AC_PATH_TOOL_PREFIX
 
7298
 
 
7299
 
 
7300
# AC_PATH_MAGIC
 
7301
# -------------
 
7302
# find a file program which can recognise a shared library
 
7303
AC_DEFUN([AC_PATH_MAGIC],
 
7304
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 
7305
if test -z "$lt_cv_path_MAGIC_CMD"; then
 
7306
  if test -n "$ac_tool_prefix"; then
 
7307
    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
 
7308
  else
 
7309
    MAGIC_CMD=:
 
7310
  fi
 
7311
fi
 
7312
])# AC_PATH_MAGIC
 
7313
 
 
7314
 
 
7315
# AC_PROG_LD
 
7316
# ----------
 
7317
# find the pathname to the GNU or non-GNU linker
 
7318
AC_DEFUN([AC_PROG_LD],
 
7319
[AC_ARG_WITH([gnu-ld],
 
7320
    [AC_HELP_STRING([--with-gnu-ld],
 
7321
        [assume the C compiler uses GNU ld @<:@default=no@:>@])],
 
7322
    [test "$withval" = no || with_gnu_ld=yes],
 
7323
    [with_gnu_ld=no])
 
7324
AC_REQUIRE([LT_AC_PROG_SED])dnl
 
7325
AC_REQUIRE([AC_PROG_CC])dnl
 
7326
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
7327
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
7328
ac_prog=ld
 
7329
if test "$GCC" = yes; then
 
7330
  # Check if gcc -print-prog-name=ld gives a path.
 
7331
  AC_MSG_CHECKING([for ld used by $CC])
 
7332
  case $host in
 
7333
  *-*-mingw*)
 
7334
    # gcc leaves a trailing carriage return which upsets mingw
 
7335
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
7336
  *)
 
7337
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
7338
  esac
 
7339
  case $ac_prog in
 
7340
    # Accept absolute paths.
 
7341
    [[\\/]]* | ?:[[\\/]]*)
 
7342
      re_direlt='/[[^/]][[^/]]*/\.\./'
 
7343
      # Canonicalize the pathname of ld
 
7344
      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
 
7345
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
7346
        ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
 
7347
      done
 
7348
      test -z "$LD" && LD="$ac_prog"
 
7349
      ;;
 
7350
  "")
 
7351
    # If it fails, then pretend we aren't using GCC.
 
7352
    ac_prog=ld
 
7353
    ;;
 
7354
  *)
 
7355
    # If it is relative, then search for the first ld in PATH.
 
7356
    with_gnu_ld=unknown
 
7357
    ;;
 
7358
  esac
 
7359
elif test "$with_gnu_ld" = yes; then
 
7360
  AC_MSG_CHECKING([for GNU ld])
 
7361
else
 
7362
  AC_MSG_CHECKING([for non-GNU ld])
 
7363
fi
 
7364
AC_CACHE_VAL(lt_cv_path_LD,
 
7365
[if test -z "$LD"; then
 
7366
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
7367
  for ac_dir in $PATH; do
 
7368
    IFS="$lt_save_ifs"
 
7369
    test -z "$ac_dir" && ac_dir=.
 
7370
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
7371
      lt_cv_path_LD="$ac_dir/$ac_prog"
 
7372
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
7373
      # but apparently some GNU ld's only accept -v.
 
7374
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
7375
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
 
7376
      *GNU* | *'with BFD'*)
 
7377
        test "$with_gnu_ld" != no && break
 
7378
        ;;
 
7379
      *)
 
7380
        test "$with_gnu_ld" != yes && break
 
7381
        ;;
 
7382
      esac
 
7383
    fi
 
7384
  done
 
7385
  IFS="$lt_save_ifs"
 
7386
else
 
7387
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 
7388
fi])
 
7389
LD="$lt_cv_path_LD"
 
7390
if test -n "$LD"; then
 
7391
  AC_MSG_RESULT($LD)
 
7392
else
 
7393
  AC_MSG_RESULT(no)
 
7394
fi
 
7395
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
7396
AC_PROG_LD_GNU
 
7397
])# AC_PROG_LD
 
7398
 
 
7399
 
 
7400
# AC_PROG_LD_GNU
 
7401
# --------------
 
7402
AC_DEFUN([AC_PROG_LD_GNU],
 
7403
[AC_REQUIRE([AC_PROG_EGREP])dnl
 
7404
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
 
7405
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
7406
case `$LD -v 2>&1 </dev/null` in
 
7407
*GNU* | *'with BFD'*)
 
7408
  lt_cv_prog_gnu_ld=yes
 
7409
  ;;
 
7410
*)
 
7411
  lt_cv_prog_gnu_ld=no
 
7412
  ;;
 
7413
esac])
 
7414
with_gnu_ld=$lt_cv_prog_gnu_ld
 
7415
])# AC_PROG_LD_GNU
 
7416
 
 
7417
 
 
7418
# AC_PROG_LD_RELOAD_FLAG
 
7419
# ----------------------
 
7420
# find reload flag for linker
 
7421
#   -- PORTME Some linkers may need a different reload flag.
 
7422
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
 
7423
[AC_CACHE_CHECK([for $LD option to reload object files],
 
7424
  lt_cv_ld_reload_flag,
 
7425
  [lt_cv_ld_reload_flag='-r'])
 
7426
reload_flag=$lt_cv_ld_reload_flag
 
7427
case $reload_flag in
 
7428
"" | " "*) ;;
 
7429
*) reload_flag=" $reload_flag" ;;
 
7430
esac
 
7431
reload_cmds='$LD$reload_flag -o $output$reload_objs'
 
7432
])# AC_PROG_LD_RELOAD_FLAG
 
7433
 
 
7434
 
 
7435
# AC_DEPLIBS_CHECK_METHOD
 
7436
# -----------------------
 
7437
# how to check for library dependencies
 
7438
#  -- PORTME fill in with the dynamic library characteristics
 
7439
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
 
7440
[AC_CACHE_CHECK([how to recognise dependent libraries],
 
7441
lt_cv_deplibs_check_method,
 
7442
[lt_cv_file_magic_cmd='$MAGIC_CMD'
 
7443
lt_cv_file_magic_test_file=
 
7444
lt_cv_deplibs_check_method='unknown'
 
7445
# Need to set the preceding variable on all platforms that support
 
7446
# interlibrary dependencies.
 
7447
# 'none' -- dependencies not supported.
 
7448
# `unknown' -- same as none, but documents that we really don't know.
 
7449
# 'pass_all' -- all dependencies passed with no checks.
 
7450
# 'test_compile' -- check by making test program.
 
7451
# 'file_magic [[regex]]' -- check by looking for files in library path
 
7452
# which responds to the $file_magic_cmd with a given extended regex.
 
7453
# If you have `file' or equivalent on your system and you're not sure
 
7454
# whether `pass_all' will *always* work, you probably want this one.
 
7455
 
 
7456
case $host_os in
 
7457
aix4* | aix5*)
 
7458
  lt_cv_deplibs_check_method=pass_all
 
7459
  ;;
 
7460
 
 
7461
beos*)
 
7462
  lt_cv_deplibs_check_method=pass_all
 
7463
  ;;
 
7464
 
 
7465
bsdi4*)
 
7466
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
 
7467
  lt_cv_file_magic_cmd='/usr/bin/file -L'
 
7468
  lt_cv_file_magic_test_file=/shlib/libc.so
 
7469
  ;;
 
7470
 
 
7471
cygwin* | mingw* | pw32*)
 
7472
  # win32_libid is a shell function defined in ltmain.sh
 
7473
  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
 
7474
  lt_cv_file_magic_cmd='win32_libid'
 
7475
  ;;
 
7476
 
 
7477
darwin* | rhapsody*)
 
7478
  # this will be overwritten by pass_all, but leave it in just in case
 
7479
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
 
7480
  lt_cv_file_magic_cmd='/usr/bin/file -L'
 
7481
  case "$host_os" in
 
7482
  rhapsody* | darwin1.[[012]])
 
7483
    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
 
7484
    ;;
 
7485
  *) # Darwin 1.3 on
 
7486
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
 
7487
    ;;
 
7488
  esac
 
7489
  lt_cv_deplibs_check_method=pass_all
 
7490
  ;;
 
7491
 
 
7492
freebsd*)
 
7493
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 
7494
    case $host_cpu in
 
7495
    i*86 )
 
7496
      # Not sure whether the presence of OpenBSD here was a mistake.
 
7497
      # Let's accept both of them until this is cleared up.
 
7498
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
 
7499
      lt_cv_file_magic_cmd=/usr/bin/file
 
7500
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
 
7501
      ;;
 
7502
    esac
 
7503
  else
 
7504
    lt_cv_deplibs_check_method=pass_all
 
7505
  fi
 
7506
  ;;
 
7507
 
 
7508
gnu*)
 
7509
  lt_cv_deplibs_check_method=pass_all
 
7510
  ;;
 
7511
 
 
7512
hpux10.20* | hpux11*)
 
7513
  lt_cv_file_magic_cmd=/usr/bin/file
 
7514
  case "$host_cpu" in
 
7515
  ia64*)
 
7516
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
 
7517
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
 
7518
    ;;
 
7519
  hppa*64*)
 
7520
    [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]']
 
7521
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
 
7522
    ;;
 
7523
  *)
 
7524
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
 
7525
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
 
7526
    ;;
 
7527
  esac
 
7528
  ;;
 
7529
 
 
7530
irix5* | irix6* | nonstopux*)
 
7531
  case $host_os in
 
7532
  irix5* | nonstopux*)
 
7533
    # this will be overridden with pass_all, but let us keep it just in case
 
7534
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
 
7535
    ;;
 
7536
  *)
 
7537
    case $LD in
 
7538
    *-32|*"-32 ") libmagic=32-bit;;
 
7539
    *-n32|*"-n32 ") libmagic=N32;;
 
7540
    *-64|*"-64 ") libmagic=64-bit;;
 
7541
    *) libmagic=never-match;;
 
7542
    esac
 
7543
    # this will be overridden with pass_all, but let us keep it just in case
 
7544
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
 
7545
    ;;
 
7546
  esac
 
7547
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
 
7548
  lt_cv_deplibs_check_method=pass_all
 
7549
  ;;
 
7550
 
 
7551
# This must be Linux ELF.
 
7552
linux*)
 
7553
  case $host_cpu in
 
7554
  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
 
7555
    lt_cv_deplibs_check_method=pass_all ;;
 
7556
  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
 
7557
  arm* )
 
7558
    lt_cv_deplibs_check_method=pass_all ;;
 
7559
  *)
 
7560
    # glibc up to 2.1.1 does not perform some relocations on ARM
 
7561
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
 
7562
  esac
 
7563
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
 
7564
  ;;
 
7565
 
 
7566
netbsd*)
 
7567
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 
7568
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
 
7569
  else
 
7570
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
 
7571
  fi
 
7572
  ;;
 
7573
 
 
7574
newos6*)
 
7575
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
 
7576
  lt_cv_file_magic_cmd=/usr/bin/file
 
7577
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
 
7578
  ;;
 
7579
 
 
7580
nto-qnx*)
 
7581
  lt_cv_deplibs_check_method=unknown
 
7582
  ;;
 
7583
 
 
7584
openbsd*)
 
7585
  lt_cv_file_magic_cmd=/usr/bin/file
 
7586
  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
 
7587
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
7588
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
 
7589
  else
 
7590
    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
 
7591
  fi
 
7592
  ;;
 
7593
 
 
7594
osf3* | osf4* | osf5*)
 
7595
  # this will be overridden with pass_all, but let us keep it just in case
 
7596
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
 
7597
  lt_cv_file_magic_test_file=/shlib/libc.so
 
7598
  lt_cv_deplibs_check_method=pass_all
 
7599
  ;;
 
7600
 
 
7601
sco3.2v5*)
 
7602
  lt_cv_deplibs_check_method=pass_all
 
7603
  ;;
 
7604
 
 
7605
solaris*)
 
7606
  lt_cv_deplibs_check_method=pass_all
 
7607
  lt_cv_file_magic_test_file=/lib/libc.so
 
7608
  ;;
 
7609
 
 
7610
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
7611
  case $host_vendor in
 
7612
  motorola)
 
7613
    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]]'
 
7614
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
 
7615
    ;;
 
7616
  ncr)
 
7617
    lt_cv_deplibs_check_method=pass_all
 
7618
    ;;
 
7619
  sequent)
 
7620
    lt_cv_file_magic_cmd='/bin/file'
 
7621
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
 
7622
    ;;
 
7623
  sni)
 
7624
    lt_cv_file_magic_cmd='/bin/file'
 
7625
    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
 
7626
    lt_cv_file_magic_test_file=/lib/libc.so
 
7627
    ;;
 
7628
  siemens)
 
7629
    lt_cv_deplibs_check_method=pass_all
 
7630
    ;;
 
7631
  esac
 
7632
  ;;
 
7633
 
 
7634
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
 
7635
  lt_cv_deplibs_check_method=pass_all
 
7636
  ;;
 
7637
esac
 
7638
])
 
7639
file_magic_cmd=$lt_cv_file_magic_cmd
 
7640
deplibs_check_method=$lt_cv_deplibs_check_method
 
7641
test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
7642
])# AC_DEPLIBS_CHECK_METHOD
 
7643
 
 
7644
 
 
7645
# AC_PROG_NM
 
7646
# ----------
 
7647
# find the pathname to a BSD-compatible name lister
 
7648
AC_DEFUN([AC_PROG_NM],
 
7649
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
 
7650
[if test -n "$NM"; then
 
7651
  # Let the user override the test.
 
7652
  lt_cv_path_NM="$NM"
 
7653
else
 
7654
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 
7655
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
 
7656
    IFS="$lt_save_ifs"
 
7657
    test -z "$ac_dir" && ac_dir=.
 
7658
    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
 
7659
    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
 
7660
      # Check to see if the nm accepts a BSD-compat flag.
 
7661
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
 
7662
      #   nm: unknown option "B" ignored
 
7663
      # Tru64's nm complains that /dev/null is an invalid object file
 
7664
      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
 
7665
      */dev/null* | *'Invalid file or object type'*)
 
7666
        lt_cv_path_NM="$tmp_nm -B"
 
7667
        break
 
7668
        ;;
 
7669
      *)
 
7670
        case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 
7671
        */dev/null*)
 
7672
          lt_cv_path_NM="$tmp_nm -p"
 
7673
          break
 
7674
          ;;
 
7675
        *)
 
7676
          lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
 
7677
          continue # so that we can try to find one that supports BSD flags
 
7678
          ;;
 
7679
        esac
 
7680
      esac
 
7681
    fi
 
7682
  done
 
7683
  IFS="$lt_save_ifs"
 
7684
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 
7685
fi])
 
7686
NM="$lt_cv_path_NM"
 
7687
])# AC_PROG_NM
 
7688
 
 
7689
 
 
7690
# AC_CHECK_LIBM
 
7691
# -------------
 
7692
# check for math library
 
7693
AC_DEFUN([AC_CHECK_LIBM],
 
7694
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
7695
LIBM=
 
7696
case $host in
 
7697
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
 
7698
  # These system don't have libm, or don't need it
 
7699
  ;;
 
7700
*-ncr-sysv4.3*)
 
7701
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
 
7702
  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
 
7703
  ;;
 
7704
*)
 
7705
  AC_CHECK_LIB(m, cos, LIBM="-lm")
 
7706
  ;;
 
7707
esac
 
7708
])# AC_CHECK_LIBM
 
7709
 
 
7710
 
 
7711
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
 
7712
# -----------------------------------
 
7713
# sets LIBLTDL to the link flags for the libltdl convenience library and
 
7714
# LTDLINCL to the include flags for the libltdl header and adds
 
7715
# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
 
7716
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
 
7717
# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
 
7718
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
 
7719
# '${top_srcdir}/' (note the single quotes!).  If your package is not
 
7720
# flat and you're not using automake, define top_builddir and
 
7721
# top_srcdir appropriately in the Makefiles.
 
7722
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 
7723
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7724
  case $enable_ltdl_convenience in
 
7725
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
 
7726
  "") enable_ltdl_convenience=yes
 
7727
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
 
7728
  esac
 
7729
  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
 
7730
  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
 
7731
  # For backwards non-gettext consistent compatibility...
 
7732
  INCLTDL="$LTDLINCL"
 
7733
])# AC_LIBLTDL_CONVENIENCE
 
7734
 
 
7735
 
 
7736
# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
 
7737
# -----------------------------------
 
7738
# sets LIBLTDL to the link flags for the libltdl installable library and
 
7739
# LTDLINCL to the include flags for the libltdl header and adds
 
7740
# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
 
7741
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
 
7742
# DIRECTORY is not provided and an installed libltdl is not found, it is
 
7743
# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
 
7744
# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
 
7745
# quotes!).  If your package is not flat and you're not using automake,
 
7746
# define top_builddir and top_srcdir appropriately in the Makefiles.
 
7747
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 
7748
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
 
7749
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
7750
  AC_CHECK_LIB(ltdl, lt_dlinit,
 
7751
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
 
7752
  [if test x"$enable_ltdl_install" = xno; then
 
7753
     AC_MSG_WARN([libltdl not installed, but installation disabled])
 
7754
   else
 
7755
     enable_ltdl_install=yes
 
7756
   fi
 
7757
  ])
 
7758
  if test x"$enable_ltdl_install" = x"yes"; then
 
7759
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
 
7760
    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
 
7761
    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
 
7762
  else
 
7763
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
 
7764
    LIBLTDL="-lltdl"
 
7765
    LTDLINCL=
 
7766
  fi
 
7767
  # For backwards non-gettext consistent compatibility...
 
7768
  INCLTDL="$LTDLINCL"
 
7769
])# AC_LIBLTDL_INSTALLABLE
 
7770
 
 
7771
 
 
7772
# AC_LIBTOOL_CXX
 
7773
# --------------
 
7774
# enable support for C++ libraries
 
7775
AC_DEFUN([AC_LIBTOOL_CXX],
 
7776
[AC_REQUIRE([_LT_AC_LANG_CXX])
 
7777
])# AC_LIBTOOL_CXX
 
7778
 
 
7779
 
 
7780
# _LT_AC_LANG_CXX
 
7781
# ---------------
 
7782
AC_DEFUN([_LT_AC_LANG_CXX],
 
7783
[AC_REQUIRE([AC_PROG_CXX])
 
7784
AC_REQUIRE([AC_PROG_CXXCPP])
 
7785
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
 
7786
])# _LT_AC_LANG_CXX
 
7787
 
 
7788
 
 
7789
# AC_LIBTOOL_F77
 
7790
# --------------
 
7791
# enable support for Fortran 77 libraries
 
7792
AC_DEFUN([AC_LIBTOOL_F77],
 
7793
[AC_REQUIRE([_LT_AC_LANG_F77])
 
7794
])# AC_LIBTOOL_F77
 
7795
 
 
7796
 
 
7797
# _LT_AC_LANG_F77
 
7798
# ---------------
 
7799
AC_DEFUN([_LT_AC_LANG_F77],
 
7800
[AC_REQUIRE([AC_PROG_F77])
 
7801
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
 
7802
])# _LT_AC_LANG_F77
 
7803
 
 
7804
 
 
7805
# AC_LIBTOOL_GCJ
 
7806
# --------------
 
7807
# enable support for GCJ libraries
 
7808
AC_DEFUN([AC_LIBTOOL_GCJ],
 
7809
[AC_REQUIRE([_LT_AC_LANG_GCJ])
 
7810
])# AC_LIBTOOL_GCJ
 
7811
 
 
7812
 
 
7813
# _LT_AC_LANG_GCJ
 
7814
# ---------------
 
7815
AC_DEFUN([_LT_AC_LANG_GCJ],
 
7816
[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
 
7817
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
 
7818
    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
 
7819
      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
 
7820
         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
 
7821
           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
 
7822
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
 
7823
])# _LT_AC_LANG_GCJ
 
7824
 
 
7825
 
 
7826
# AC_LIBTOOL_RC
 
7827
# --------------
 
7828
# enable support for Windows resource files
 
7829
AC_DEFUN([AC_LIBTOOL_RC],
 
7830
[AC_REQUIRE([LT_AC_PROG_RC])
 
7831
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
 
7832
])# AC_LIBTOOL_RC
 
7833
 
 
7834
 
 
7835
# AC_LIBTOOL_LANG_C_CONFIG
 
7836
# ------------------------
 
7837
# Ensure that the configuration vars for the C compiler are
 
7838
# suitably defined.  Those variables are subsequently used by
 
7839
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
7840
AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
 
7841
AC_DEFUN([_LT_AC_LANG_C_CONFIG],
 
7842
[lt_save_CC="$CC"
 
7843
AC_LANG_PUSH(C)
 
7844
 
 
7845
# Source file extension for C test sources.
 
7846
ac_ext=c
 
7847
 
 
7848
# Object file extension for compiled C test sources.
 
7849
objext=o
 
7850
_LT_AC_TAGVAR(objext, $1)=$objext
 
7851
 
 
7852
# Code to be used in simple compile tests
 
7853
lt_simple_compile_test_code="int some_variable = 0;\n"
 
7854
 
 
7855
# Code to be used in simple link tests
 
7856
lt_simple_link_test_code='int main(){return(0);}\n'
 
7857
 
 
7858
_LT_AC_SYS_COMPILER
 
7859
 
 
7860
#
 
7861
# Check for any special shared library compilation flags.
 
7862
#
 
7863
_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
 
7864
if test "$GCC" = no; then
 
7865
  case $host_os in
 
7866
  sco3.2v5*)
 
7867
    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
 
7868
    ;;
 
7869
  esac
 
7870
fi
 
7871
if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
 
7872
  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
 
7873
  if echo "$old_CC $old_CFLAGS " | grep "[[     ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
 
7874
  else
 
7875
    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
 
7876
    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
 
7877
  fi
 
7878
fi
 
7879
 
 
7880
 
 
7881
#
 
7882
# Check to make sure the static flag actually works.
 
7883
#
 
7884
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
 
7885
  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
 
7886
  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
 
7887
  [],
 
7888
  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
 
7889
 
 
7890
 
 
7891
## CAVEAT EMPTOR:
 
7892
## There is no encapsulation within the following macros, do not change
 
7893
## the running order or otherwise move them around unless you know exactly
 
7894
## what you are doing...
 
7895
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 
7896
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
7897
AC_LIBTOOL_PROG_CC_C_O($1)
 
7898
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
7899
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
7900
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
7901
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
7902
AC_LIBTOOL_SYS_LIB_STRIP
 
7903
AC_LIBTOOL_DLOPEN_SELF($1)
 
7904
 
 
7905
# Report which librarie types wil actually be built
 
7906
AC_MSG_CHECKING([if libtool supports shared libraries])
 
7907
AC_MSG_RESULT([$can_build_shared])
 
7908
 
 
7909
AC_MSG_CHECKING([whether to build shared libraries])
 
7910
test "$can_build_shared" = "no" && enable_shared=no
 
7911
 
 
7912
# On AIX, shared libraries and static libraries use the same namespace, and
 
7913
# are all built from PIC.
 
7914
case "$host_os" in
 
7915
aix3*)
 
7916
  test "$enable_shared" = yes && enable_static=no
 
7917
  if test -n "$RANLIB"; then
 
7918
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
 
7919
    postinstall_cmds='$RANLIB $lib'
 
7920
  fi
 
7921
  ;;
 
7922
 
 
7923
aix4*)
 
7924
  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
 
7925
    test "$enable_shared" = yes && enable_static=no
 
7926
  fi
 
7927
  ;;
 
7928
  darwin* | rhapsody*)
 
7929
  if test "$GCC" = yes; then
 
7930
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
7931
    case "$host_os" in
 
7932
    rhapsody* | darwin1.[[012]])
 
7933
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
 
7934
      ;;
 
7935
    *) # Darwin 1.3 on
 
7936
      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
 
7937
      ;;
 
7938
    esac
 
7939
    output_verbose_link_cmd='echo'
 
7940
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
 
7941
    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
 
7942
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
7943
    _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 $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
7944
    _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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
7945
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
7946
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
7947
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
7948
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
7949
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
7950
  else
 
7951
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
7952
  fi  
 
7953
    ;;  
 
7954
esac
 
7955
AC_MSG_RESULT([$enable_shared])
 
7956
 
 
7957
AC_MSG_CHECKING([whether to build static libraries])
 
7958
# Make sure either enable_shared or enable_static is yes.
 
7959
test "$enable_shared" = yes || enable_static=yes
 
7960
AC_MSG_RESULT([$enable_static])
 
7961
 
 
7962
AC_LIBTOOL_CONFIG($1)
 
7963
 
 
7964
AC_LANG_POP
 
7965
CC="$lt_save_CC"
 
7966
])# AC_LIBTOOL_LANG_C_CONFIG
 
7967
 
 
7968
 
 
7969
# AC_LIBTOOL_LANG_CXX_CONFIG
 
7970
# --------------------------
 
7971
# Ensure that the configuration vars for the C compiler are
 
7972
# suitably defined.  Those variables are subsequently used by
 
7973
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
7974
AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
 
7975
AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
 
7976
[AC_LANG_PUSH(C++)
 
7977
AC_REQUIRE([AC_PROG_CXX])
 
7978
AC_REQUIRE([AC_PROG_CXXCPP])
 
7979
 
 
7980
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
7981
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
7982
_LT_AC_TAGVAR(always_export_symbols, $1)=no
 
7983
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
7984
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
7985
_LT_AC_TAGVAR(hardcode_direct, $1)=no
 
7986
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
7987
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
7988
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
7989
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
7990
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
7991
_LT_AC_TAGVAR(module_cmds, $1)=
 
7992
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
 
7993
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
7994
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
7995
_LT_AC_TAGVAR(no_undefined_flag, $1)=
 
7996
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
7997
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
7998
 
 
7999
# Dependencies to place before and after the object being linked:
 
8000
_LT_AC_TAGVAR(predep_objects, $1)=
 
8001
_LT_AC_TAGVAR(postdep_objects, $1)=
 
8002
_LT_AC_TAGVAR(predeps, $1)=
 
8003
_LT_AC_TAGVAR(postdeps, $1)=
 
8004
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
8005
 
 
8006
# Source file extension for C++ test sources.
 
8007
ac_ext=cc
 
8008
 
 
8009
# Object file extension for compiled C++ test sources.
 
8010
objext=o
 
8011
_LT_AC_TAGVAR(objext, $1)=$objext
 
8012
 
 
8013
# Code to be used in simple compile tests
 
8014
lt_simple_compile_test_code="int some_variable = 0;\n"
 
8015
 
 
8016
# Code to be used in simple link tests
 
8017
lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
8018
 
 
8019
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
8020
_LT_AC_SYS_COMPILER
 
8021
 
 
8022
# Allow CC to be a program name with arguments.
 
8023
lt_save_CC=$CC
 
8024
lt_save_LD=$LD
 
8025
lt_save_GCC=$GCC
 
8026
GCC=$GXX
 
8027
lt_save_with_gnu_ld=$with_gnu_ld
 
8028
lt_save_path_LD=$lt_cv_path_LD
 
8029
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
 
8030
  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 
8031
else
 
8032
  unset lt_cv_prog_gnu_ld
 
8033
fi
 
8034
if test -n "${lt_cv_path_LDCXX+set}"; then
 
8035
  lt_cv_path_LD=$lt_cv_path_LDCXX
 
8036
else
 
8037
  unset lt_cv_path_LD
 
8038
fi
 
8039
test -z "${LDCXX+set}" || LD=$LDCXX
 
8040
CC=${CXX-"c++"}
 
8041
compiler=$CC
 
8042
_LT_AC_TAGVAR(compiler, $1)=$CC
 
8043
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
8044
 
 
8045
# We don't want -fno-exception wen compiling C++ code, so set the
 
8046
# no_builtin_flag separately
 
8047
if test "$GXX" = yes; then
 
8048
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
8049
else
 
8050
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
8051
fi
 
8052
 
 
8053
if test "$GXX" = yes; then
 
8054
  # Set up default GNU C++ configuration
 
8055
 
 
8056
  AC_PROG_LD
 
8057
 
 
8058
  # Check if GNU C++ uses GNU ld as the underlying linker, since the
 
8059
  # archiving commands below assume that GNU ld is being used.
 
8060
  if test "$with_gnu_ld" = yes; then
 
8061
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
8062
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
8063
 
 
8064
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 
8065
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8066
 
 
8067
    # If archive_cmds runs LD, not CC, wlarc should be empty
 
8068
    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
 
8069
    #     investigate it a little bit more. (MM)
 
8070
    wlarc='${wl}'
 
8071
 
 
8072
    # ancient GNU ld didn't support --whole-archive et. al.
 
8073
    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
 
8074
        grep 'no-whole-archive' > /dev/null; then
 
8075
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 
8076
    else
 
8077
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
8078
    fi
 
8079
  else
 
8080
    with_gnu_ld=no
 
8081
    wlarc=
 
8082
 
 
8083
    # A generic and very simple default shared library creation
 
8084
    # command for GNU C++ for the case where it uses the native
 
8085
    # linker, instead of GNU ld.  If possible, this setting should
 
8086
    # overridden to take advantage of the native linker features on
 
8087
    # the platform it is being used on.
 
8088
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
 
8089
  fi
 
8090
 
 
8091
  # Commands to make compiler produce verbose output that lists
 
8092
  # what "hidden" libraries, object files and flags are used when
 
8093
  # linking a shared library.
 
8094
  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
8095
 
 
8096
else
 
8097
  GXX=no
 
8098
  with_gnu_ld=no
 
8099
  wlarc=
 
8100
fi
 
8101
 
 
8102
# PORTME: fill in a description of your system's C++ link characteristics
 
8103
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 
8104
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
8105
case $host_os in
 
8106
  aix3*)
 
8107
    # FIXME: insert proper C++ library support
 
8108
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8109
    ;;
 
8110
  aix4* | aix5*)
 
8111
    if test "$host_cpu" = ia64; then
 
8112
      # On IA64, the linker does run time linking by default, so we don't
 
8113
      # have to do anything special.
 
8114
      aix_use_runtimelinking=no
 
8115
      exp_sym_flag='-Bexport'
 
8116
      no_entry_flag=""
 
8117
    else
 
8118
      # KDE requires run time linking.  Make it the default.
 
8119
      aix_use_runtimelinking=yes
 
8120
      exp_sym_flag='-bexport'
 
8121
      no_entry_flag='-bnoentry'
 
8122
    fi
 
8123
 
 
8124
    # When large executables or shared objects are built, AIX ld can
 
8125
    # have problems creating the table of contents.  If linking a library
 
8126
    # or program results in "error TOC overflow" add -mminimal-toc to
 
8127
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
 
8128
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
8129
 
 
8130
    _LT_AC_TAGVAR(archive_cmds, $1)=''
 
8131
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8132
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
 
8133
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8134
 
 
8135
    if test "$GXX" = yes; then
 
8136
      case $host_os in aix4.[012]|aix4.[012].*)
 
8137
      # We only want to do this on AIX 4.2 and lower, the check
 
8138
      # below for broken collect2 doesn't work under 4.3+
 
8139
        collect2name=`${CC} -print-prog-name=collect2`
 
8140
        if test -f "$collect2name" && \
 
8141
           strings "$collect2name" | grep resolve_lib_name >/dev/null
 
8142
        then
 
8143
          # We have reworked collect2
 
8144
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8145
        else
 
8146
          # We have old collect2
 
8147
          _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
8148
          # It fails to find uninstalled libraries when the uninstalled
 
8149
          # path is not listed in the libpath.  Setting hardcode_minus_L
 
8150
          # to unsupported forces relinking
 
8151
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
8152
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8153
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
8154
        fi
 
8155
      esac
 
8156
      shared_flag='-shared'
 
8157
    else
 
8158
      # not using gcc
 
8159
      if test "$host_cpu" = ia64; then
 
8160
        # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 
8161
        # chokes on -Wl,-G. The following line is correct:
 
8162
        shared_flag='-G'
 
8163
      else
 
8164
        if test "$aix_use_runtimelinking" = yes; then
 
8165
          shared_flag='-qmkshrobj ${wl}-G'
 
8166
        else
 
8167
          shared_flag='-qmkshrobj'
 
8168
        fi
 
8169
      fi
 
8170
    fi
 
8171
 
 
8172
    # Let the compiler handle the export list.
 
8173
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8174
    if test "$aix_use_runtimelinking" = yes; then
 
8175
      # Warning - without using the other runtime loading flags (-brtl),
 
8176
      # -berok will link without error, but may produce a broken library.
 
8177
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
 
8178
      # Determine the default libpath from the value encoded in an empty executable.
 
8179
      _LT_AC_SYS_LIBPATH_AIX
 
8180
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
8181
 
 
8182
      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
 
8183
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
 
8184
     else
 
8185
      if test "$host_cpu" = ia64; then
 
8186
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 
8187
        _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
 
8188
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
 
8189
      else
 
8190
        # Determine the default libpath from the value encoded in an empty executable.
 
8191
        _LT_AC_SYS_LIBPATH_AIX
 
8192
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
8193
        # Warning - without using the other run time loading flags,
 
8194
        # -berok will link without error, but may produce a broken library.
 
8195
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 
8196
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
 
8197
        # -bexpall does not export symbols beginning with underscore (_)
 
8198
        _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
8199
        # Exported symbols can be pulled into shared objects from archives
 
8200
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 
8201
        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
8202
        # This is similar to how AIX traditionally builds it's shared libraries.
 
8203
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 
8204
      fi
 
8205
    fi
 
8206
    ;;
 
8207
  chorus*)
 
8208
    case $cc_basename in
 
8209
      *)
 
8210
        # FIXME: insert proper C++ library support
 
8211
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8212
        ;;
 
8213
    esac
 
8214
    ;;
 
8215
 
 
8216
  cygwin* | mingw* | pw32*)
 
8217
    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 
8218
    # as there is no search path for DLLs.
 
8219
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8220
    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
8221
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8222
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
8223
 
 
8224
    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
 
8225
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
8226
      # If the export-symbols file already is a .def file (1st line
 
8227
      # is EXPORTS), use it as is; otherwise, prepend...
 
8228
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
 
8229
        cp $export_symbols $output_objdir/$soname.def;
 
8230
      else
 
8231
        echo EXPORTS > $output_objdir/$soname.def;
 
8232
        cat $export_symbols >> $output_objdir/$soname.def;
 
8233
      fi~
 
8234
      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
8235
    else
 
8236
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8237
    fi
 
8238
  ;;
 
8239
 
 
8240
  darwin* | rhapsody*)
 
8241
  if test "$GXX" = yes; then
 
8242
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8243
    case "$host_os" in
 
8244
    rhapsody* | darwin1.[[012]])
 
8245
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
 
8246
      ;;
 
8247
    *) # Darwin 1.3 on
 
8248
      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
 
8249
      ;;
 
8250
    esac
 
8251
    lt_int_apple_cc_single_mod=no
 
8252
    output_verbose_link_cmd='echo'
 
8253
    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
 
8254
      lt_int_apple_cc_single_mod=yes
 
8255
    fi
 
8256
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
8257
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
 
8258
    else
 
8259
      _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 $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
 
8260
    fi
 
8261
    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
 
8262
 
 
8263
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
8264
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
8265
      _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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8266
    else
 
8267
      _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 $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8268
    fi
 
8269
    _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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
8270
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8271
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
8272
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
8273
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
8274
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8275
  else
 
8276
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8277
  fi
 
8278
    ;;
 
8279
 
 
8280
  dgux*)
 
8281
    case $cc_basename in
 
8282
      ec++)
 
8283
        # FIXME: insert proper C++ library support
 
8284
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8285
        ;;
 
8286
      ghcx)
 
8287
        # Green Hills C++ Compiler
 
8288
        # FIXME: insert proper C++ library support
 
8289
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8290
        ;;
 
8291
      *)
 
8292
        # FIXME: insert proper C++ library support
 
8293
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8294
        ;;
 
8295
    esac
 
8296
    ;;
 
8297
  freebsd[12]*)
 
8298
    # C++ shared libraries reported to be fairly broken before switch to ELF
 
8299
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8300
    ;;
 
8301
  freebsd-elf*)
 
8302
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8303
    ;;
 
8304
  freebsd*)
 
8305
    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
 
8306
    # conventions
 
8307
    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
8308
    ;;
 
8309
  gnu*)
 
8310
    ;;
 
8311
  hpux9*)
 
8312
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8313
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8314
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
8315
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8316
    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8317
                                # but as the default
 
8318
                                # location of the library.
 
8319
 
 
8320
    case $cc_basename in
 
8321
    CC)
 
8322
      # FIXME: insert proper C++ library support
 
8323
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8324
      ;;
 
8325
    aCC)
 
8326
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
8327
      # Commands to make compiler produce verbose output that lists
 
8328
      # what "hidden" libraries, object files and flags are used when
 
8329
      # linking a shared library.
 
8330
      #
 
8331
      # There doesn't appear to be a way to prevent this compiler from
 
8332
      # explicitly linking system object files so we need to strip them
 
8333
      # from the output so that they don't get included in the library
 
8334
      # dependencies.
 
8335
      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'
 
8336
      ;;
 
8337
    *)
 
8338
      if test "$GXX" = yes; then
 
8339
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
8340
      else
 
8341
        # FIXME: insert proper C++ library support
 
8342
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8343
      fi
 
8344
      ;;
 
8345
    esac
 
8346
    ;;
 
8347
  hpux10*|hpux11*)
 
8348
    if test $with_gnu_ld = no; then
 
8349
      case "$host_cpu" in
 
8350
      hppa*64*)
 
8351
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8352
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 
8353
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8354
        ;;
 
8355
      ia64*)
 
8356
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
8357
        ;;
 
8358
      *)
 
8359
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
8360
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8361
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
8362
        ;;
 
8363
      esac
 
8364
    fi
 
8365
    case "$host_cpu" in
 
8366
    hppa*64*)
 
8367
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8368
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8369
      ;;
 
8370
    ia64*)
 
8371
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8372
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8373
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8374
                                              # but as the default
 
8375
                                              # location of the library.
 
8376
      ;;
 
8377
    *)
 
8378
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8379
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 
8380
                                              # but as the default
 
8381
                                              # location of the library.
 
8382
      ;;
 
8383
    esac
 
8384
 
 
8385
    case $cc_basename in
 
8386
      CC)
 
8387
        # FIXME: insert proper C++ library support
 
8388
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8389
        ;;
 
8390
      aCC)
 
8391
        case "$host_cpu" in
 
8392
        hppa*64*|ia64*)
 
8393
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 
8394
          ;;
 
8395
        *)
 
8396
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 
8397
          ;;
 
8398
        esac
 
8399
        # Commands to make compiler produce verbose output that lists
 
8400
        # what "hidden" libraries, object files and flags are used when
 
8401
        # linking a shared library.
 
8402
        #
 
8403
        # There doesn't appear to be a way to prevent this compiler from
 
8404
        # explicitly linking system object files so we need to strip them
 
8405
        # from the output so that they don't get included in the library
 
8406
        # dependencies.
 
8407
        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'
 
8408
        ;;
 
8409
      *)
 
8410
        if test "$GXX" = yes; then
 
8411
          if test $with_gnu_ld = no; then
 
8412
            case "$host_cpu" in
 
8413
            ia64*|hppa*64*)
 
8414
              _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 
8415
              ;;
 
8416
            *)
 
8417
              _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 
8418
              ;;
 
8419
            esac
 
8420
          fi
 
8421
        else
 
8422
          # FIXME: insert proper C++ library support
 
8423
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8424
        fi
 
8425
        ;;
 
8426
    esac
 
8427
    ;;
 
8428
  irix5* | irix6*)
 
8429
    case $cc_basename in
 
8430
      CC)
 
8431
        # SGI C++
 
8432
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
8433
 
 
8434
        # Archives containing C++ object files must be created using
 
8435
        # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
 
8436
        # necessary to make sure instantiated templates are included
 
8437
        # in the archive.
 
8438
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 
8439
        ;;
 
8440
      *)
 
8441
        if test "$GXX" = yes; then
 
8442
          if test "$with_gnu_ld" = no; then
 
8443
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
8444
          else
 
8445
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
 
8446
          fi
 
8447
        fi
 
8448
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8449
        ;;
 
8450
    esac
 
8451
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8452
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8453
    ;;
 
8454
  linux*)
 
8455
    case $cc_basename in
 
8456
      KCC)
 
8457
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
8458
 
 
8459
        # KCC will only create a shared library if the output file
 
8460
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
8461
        # to its proper name (with version) after linking.
 
8462
        _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
8463
        _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
 
8464
        # Commands to make compiler produce verbose output that lists
 
8465
        # what "hidden" libraries, object files and flags are used when
 
8466
        # linking a shared library.
 
8467
        #
 
8468
        # There doesn't appear to be a way to prevent this compiler from
 
8469
        # explicitly linking system object files so we need to strip them
 
8470
        # from the output so that they don't get included in the library
 
8471
        # dependencies.
 
8472
        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'
 
8473
 
 
8474
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
 
8475
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8476
 
 
8477
        # Archives containing C++ object files must be created using
 
8478
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
 
8479
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
8480
        ;;
 
8481
      icpc)
 
8482
        # Intel C++
 
8483
        with_gnu_ld=yes
 
8484
        _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8485
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
8486
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
8487
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
8488
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
8489
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 
8490
        ;;
 
8491
      cxx)
 
8492
        # Compaq C++
 
8493
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
8494
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
8495
 
 
8496
        runpath_var=LD_RUN_PATH
 
8497
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
8498
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8499
 
 
8500
        # Commands to make compiler produce verbose output that lists
 
8501
        # what "hidden" libraries, object files and flags are used when
 
8502
        # linking a shared library.
 
8503
        #
 
8504
        # There doesn't appear to be a way to prevent this compiler from
 
8505
        # explicitly linking system object files so we need to strip them
 
8506
        # from the output so that they don't get included in the library
 
8507
        # dependencies.
 
8508
        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'
 
8509
        ;;
 
8510
    esac
 
8511
    ;;
 
8512
  lynxos*)
 
8513
    # FIXME: insert proper C++ library support
 
8514
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8515
    ;;
 
8516
  m88k*)
 
8517
    # FIXME: insert proper C++ library support
 
8518
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8519
    ;;
 
8520
  mvs*)
 
8521
    case $cc_basename in
 
8522
      cxx)
 
8523
        # FIXME: insert proper C++ library support
 
8524
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8525
        ;;
 
8526
      *)
 
8527
        # FIXME: insert proper C++ library support
 
8528
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8529
        ;;
 
8530
    esac
 
8531
    ;;
 
8532
  netbsd*)
 
8533
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
8534
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
 
8535
      wlarc=
 
8536
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
8537
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
8538
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8539
    fi
 
8540
    # Workaround some broken pre-1.5 toolchains
 
8541
    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
 
8542
    ;;
 
8543
  osf3*)
 
8544
    case $cc_basename in
 
8545
      KCC)
 
8546
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
8547
 
 
8548
        # KCC will only create a shared library if the output file
 
8549
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
8550
        # to its proper name (with version) after linking.
 
8551
        _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
8552
 
 
8553
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
8554
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8555
 
 
8556
        # Archives containing C++ object files must be created using
 
8557
        # "CC -Bstatic", where "CC" is the KAI C++ compiler.
 
8558
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
8559
 
 
8560
        ;;
 
8561
      RCC)
 
8562
        # Rational C++ 2.4.1
 
8563
        # FIXME: insert proper C++ library support
 
8564
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8565
        ;;
 
8566
      cxx)
 
8567
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
8568
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
8569
 
 
8570
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8571
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8572
 
 
8573
        # Commands to make compiler produce verbose output that lists
 
8574
        # what "hidden" libraries, object files and flags are used when
 
8575
        # linking a shared library.
 
8576
        #
 
8577
        # There doesn't appear to be a way to prevent this compiler from
 
8578
        # explicitly linking system object files so we need to strip them
 
8579
        # from the output so that they don't get included in the library
 
8580
        # dependencies.
 
8581
        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'
 
8582
        ;;
 
8583
      *)
 
8584
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
8585
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
8586
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
8587
 
 
8588
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8589
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8590
 
 
8591
          # Commands to make compiler produce verbose output that lists
 
8592
          # what "hidden" libraries, object files and flags are used when
 
8593
          # linking a shared library.
 
8594
          output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
8595
 
 
8596
        else
 
8597
          # FIXME: insert proper C++ library support
 
8598
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8599
        fi
 
8600
        ;;
 
8601
    esac
 
8602
    ;;
 
8603
  osf4* | osf5*)
 
8604
    case $cc_basename in
 
8605
      KCC)
 
8606
        # Kuck and Associates, Inc. (KAI) C++ Compiler
 
8607
 
 
8608
        # KCC will only create a shared library if the output file
 
8609
        # ends with ".so" (or ".sl" for HP-UX), so rename the library
 
8610
        # to its proper name (with version) after linking.
 
8611
        _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
8612
 
 
8613
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
8614
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8615
 
 
8616
        # Archives containing C++ object files must be created using
 
8617
        # the KAI C++ compiler.
 
8618
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
 
8619
        ;;
 
8620
      RCC)
 
8621
        # Rational C++ 2.4.1
 
8622
        # FIXME: insert proper C++ library support
 
8623
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8624
        ;;
 
8625
      cxx)
 
8626
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
8627
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
8628
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 
8629
          echo "-hidden">> $lib.exp~
 
8630
          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
 
8631
          $rm $lib.exp'
 
8632
 
 
8633
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
8634
        _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8635
 
 
8636
        # Commands to make compiler produce verbose output that lists
 
8637
        # what "hidden" libraries, object files and flags are used when
 
8638
        # linking a shared library.
 
8639
        #
 
8640
        # There doesn't appear to be a way to prevent this compiler from
 
8641
        # explicitly linking system object files so we need to strip them
 
8642
        # from the output so that they don't get included in the library
 
8643
        # dependencies.
 
8644
        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'
 
8645
        ;;
 
8646
      *)
 
8647
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
8648
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
8649
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
8650
 
 
8651
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
8652
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
8653
 
 
8654
          # Commands to make compiler produce verbose output that lists
 
8655
          # what "hidden" libraries, object files and flags are used when
 
8656
          # linking a shared library.
 
8657
          output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
8658
 
 
8659
        else
 
8660
          # FIXME: insert proper C++ library support
 
8661
          _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8662
        fi
 
8663
        ;;
 
8664
    esac
 
8665
    ;;
 
8666
  psos*)
 
8667
    # FIXME: insert proper C++ library support
 
8668
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8669
    ;;
 
8670
  sco*)
 
8671
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8672
    case $cc_basename in
 
8673
      CC)
 
8674
        # FIXME: insert proper C++ library support
 
8675
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8676
        ;;
 
8677
      *)
 
8678
        # FIXME: insert proper C++ library support
 
8679
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8680
        ;;
 
8681
    esac
 
8682
    ;;
 
8683
  sunos4*)
 
8684
    case $cc_basename in
 
8685
      CC)
 
8686
        # Sun C++ 4.x
 
8687
        # FIXME: insert proper C++ library support
 
8688
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8689
        ;;
 
8690
      lcc)
 
8691
        # Lucid
 
8692
        # FIXME: insert proper C++ library support
 
8693
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8694
        ;;
 
8695
      *)
 
8696
        # FIXME: insert proper C++ library support
 
8697
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8698
        ;;
 
8699
    esac
 
8700
    ;;
 
8701
  solaris*)
 
8702
    case $cc_basename in
 
8703
      CC)
 
8704
        # Sun C++ 4.2, 5.x and Centerline C++
 
8705
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
 
8706
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 
8707
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
8708
        $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
8709
 
 
8710
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
8711
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
8712
        case $host_os in
 
8713
          solaris2.[0-5] | solaris2.[0-5].*) ;;
 
8714
          *)
 
8715
            # The C++ compiler is used as linker so we must use $wl
 
8716
            # flag to pass the commands to the underlying system
 
8717
            # linker.
 
8718
            # Supported since Solaris 2.6 (maybe 2.5.1?)
 
8719
            _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 
8720
            ;;
 
8721
        esac
 
8722
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
8723
 
 
8724
        # Commands to make compiler produce verbose output that lists
 
8725
        # what "hidden" libraries, object files and flags are used when
 
8726
        # linking a shared library.
 
8727
        #
 
8728
        # There doesn't appear to be a way to prevent this compiler from
 
8729
        # explicitly linking system object files so we need to strip them
 
8730
        # from the output so that they don't get included in the library
 
8731
        # dependencies.
 
8732
        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'
 
8733
 
 
8734
        # Archives containing C++ object files must be created using
 
8735
        # "CC -xar", where "CC" is the Sun C++ compiler.  This is
 
8736
        # necessary to make sure instantiated templates are included
 
8737
        # in the archive.
 
8738
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
 
8739
        ;;
 
8740
      gcx)
 
8741
        # Green Hills C++ Compiler
 
8742
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
8743
 
 
8744
        # The C++ compiler must be used to create the archive.
 
8745
        _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 
8746
        ;;
 
8747
      *)
 
8748
        # GNU C++ compiler with Solaris linker
 
8749
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 
8750
          _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
 
8751
          if $CC --version | grep -v '^2\.7' > /dev/null; then
 
8752
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
8753
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
8754
                $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
8755
 
 
8756
            # Commands to make compiler produce verbose output that lists
 
8757
            # what "hidden" libraries, object files and flags are used when
 
8758
            # linking a shared library.
 
8759
            output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
 
8760
          else
 
8761
            # g++ 2.7 appears to require `-G' NOT `-shared' on this
 
8762
            # platform.
 
8763
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
8764
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
8765
                $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
8766
 
 
8767
            # Commands to make compiler produce verbose output that lists
 
8768
            # what "hidden" libraries, object files and flags are used when
 
8769
            # linking a shared library.
 
8770
            output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
 
8771
          fi
 
8772
 
 
8773
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
 
8774
        fi
 
8775
        ;;
 
8776
    esac
 
8777
    ;;
 
8778
  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
 
8779
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8780
    ;;
 
8781
  tandem*)
 
8782
    case $cc_basename in
 
8783
      NCC)
 
8784
        # NonStop-UX NCC 3.20
 
8785
        # FIXME: insert proper C++ library support
 
8786
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8787
        ;;
 
8788
      *)
 
8789
        # FIXME: insert proper C++ library support
 
8790
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8791
        ;;
 
8792
    esac
 
8793
    ;;
 
8794
  vxworks*)
 
8795
    # FIXME: insert proper C++ library support
 
8796
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8797
    ;;
 
8798
  *)
 
8799
    # FIXME: insert proper C++ library support
 
8800
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
8801
    ;;
 
8802
esac
 
8803
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 
8804
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
8805
 
 
8806
_LT_AC_TAGVAR(GCC, $1)="$GXX"
 
8807
_LT_AC_TAGVAR(LD, $1)="$LD"
 
8808
 
 
8809
## CAVEAT EMPTOR:
 
8810
## There is no encapsulation within the following macros, do not change
 
8811
## the running order or otherwise move them around unless you know exactly
 
8812
## what you are doing...
 
8813
AC_LIBTOOL_POSTDEP_PREDEP($1)
 
8814
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
8815
AC_LIBTOOL_PROG_CC_C_O($1)
 
8816
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
8817
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
8818
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
8819
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
8820
AC_LIBTOOL_SYS_LIB_STRIP
 
8821
AC_LIBTOOL_DLOPEN_SELF($1)
 
8822
 
 
8823
AC_LIBTOOL_CONFIG($1)
 
8824
 
 
8825
AC_LANG_POP
 
8826
CC=$lt_save_CC
 
8827
LDCXX=$LD
 
8828
LD=$lt_save_LD
 
8829
GCC=$lt_save_GCC
 
8830
with_gnu_ldcxx=$with_gnu_ld
 
8831
with_gnu_ld=$lt_save_with_gnu_ld
 
8832
lt_cv_path_LDCXX=$lt_cv_path_LD
 
8833
lt_cv_path_LD=$lt_save_path_LD
 
8834
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
 
8835
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 
8836
])# AC_LIBTOOL_LANG_CXX_CONFIG
 
8837
 
 
8838
# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
 
8839
# ------------------------
 
8840
# Figure out "hidden" library dependencies from verbose
 
8841
# compiler output when linking a shared library.
 
8842
# Parse the compiler output and extract the necessary
 
8843
# objects, libraries and library flags.
 
8844
AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
 
8845
dnl we can't use the lt_simple_compile_test_code here,
 
8846
dnl because it contains code intended for an executable,
 
8847
dnl not a library.  It's possible we should let each
 
8848
dnl tag define a new lt_????_link_test_code variable,
 
8849
dnl but it's only used here...
 
8850
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
 
8851
int a;
 
8852
void foo (void) { a = 0; }
 
8853
EOF
 
8854
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
 
8855
class Foo
 
8856
{
 
8857
public:
 
8858
  Foo (void) { a = 0; }
 
8859
private:
 
8860
  int a;
 
8861
};
 
8862
EOF
 
8863
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
 
8864
      subroutine foo
 
8865
      implicit none
 
8866
      integer*4 a
 
8867
      a=0
 
8868
      return
 
8869
      end
 
8870
EOF
 
8871
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
 
8872
public class foo {
 
8873
  private int a;
 
8874
  public void bar (void) {
 
8875
    a = 0;
 
8876
  }
 
8877
};
 
8878
EOF
 
8879
])
 
8880
dnl Parse the compiler output and extract the necessary
 
8881
dnl objects, libraries and library flags.
 
8882
if AC_TRY_EVAL(ac_compile); then
 
8883
  # Parse the compiler output and extract the necessary
 
8884
  # objects, libraries and library flags.
 
8885
 
 
8886
  # Sentinel used to keep track of whether or not we are before
 
8887
  # the conftest object file.
 
8888
  pre_test_object_deps_done=no
 
8889
 
 
8890
  # The `*' in the case matches for architectures that use `case' in
 
8891
  # $output_verbose_cmd can trigger glob expansion during the loop
 
8892
  # eval without this substitution.
 
8893
  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
 
8894
 
 
8895
  for p in `eval $output_verbose_link_cmd`; do
 
8896
    case $p in
 
8897
 
 
8898
    -L* | -R* | -l*)
 
8899
       # Some compilers place space between "-{L,R}" and the path.
 
8900
       # Remove the space.
 
8901
       if test $p = "-L" \
 
8902
          || test $p = "-R"; then
 
8903
         prev=$p
 
8904
         continue
 
8905
       else
 
8906
         prev=
 
8907
       fi
 
8908
 
 
8909
       if test "$pre_test_object_deps_done" = no; then
 
8910
         case $p in
 
8911
         -L* | -R*)
 
8912
           # Internal compiler library paths should come after those
 
8913
           # provided the user.  The postdeps already come after the
 
8914
           # user supplied libs so there is no need to process them.
 
8915
           if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
 
8916
             _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
 
8917
           else
 
8918
             _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
 
8919
           fi
 
8920
           ;;
 
8921
         # The "-l" case would never come before the object being
 
8922
         # linked, so don't bother handling this case.
 
8923
         esac
 
8924
       else
 
8925
         if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
 
8926
           _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
 
8927
         else
 
8928
           _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
 
8929
         fi
 
8930
       fi
 
8931
       ;;
 
8932
 
 
8933
    *.$objext|*.$libext)
 
8934
       # This assumes that the test object file only shows up
 
8935
       # once in the compiler output.
 
8936
       if test "$p" = "conftest.$objext"; then
 
8937
         pre_test_object_deps_done=yes
 
8938
         continue
 
8939
       fi
 
8940
 
 
8941
       if test "$pre_test_object_deps_done" = no; then
 
8942
         if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
 
8943
           _LT_AC_TAGVAR(predep_objects, $1)="$p"
 
8944
         else
 
8945
           _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
 
8946
         fi
 
8947
       else
 
8948
         if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
 
8949
           _LT_AC_TAGVAR(postdep_objects, $1)="$p"
 
8950
         else
 
8951
           _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
 
8952
         fi
 
8953
       fi
 
8954
       ;;
 
8955
 
 
8956
    *) ;; # Ignore the rest.
 
8957
 
 
8958
    esac
 
8959
  done
 
8960
 
 
8961
  # Clean up.
 
8962
  rm -f a.out a.exe
 
8963
else
 
8964
  echo "libtool.m4: error: problem compiling $1 test program"
 
8965
fi
 
8966
 
 
8967
$rm -f confest.$objext
 
8968
 
 
8969
case " $_LT_AC_TAGVAR(postdeps, $1) " in
 
8970
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 
8971
esac
 
8972
])# AC_LIBTOOL_POSTDEP_PREDEP
 
8973
 
 
8974
# AC_LIBTOOL_LANG_F77_CONFIG
 
8975
# ------------------------
 
8976
# Ensure that the configuration vars for the C compiler are
 
8977
# suitably defined.  Those variables are subsequently used by
 
8978
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
8979
AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
 
8980
AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
 
8981
[AC_REQUIRE([AC_PROG_F77])
 
8982
AC_LANG_PUSH(Fortran 77)
 
8983
 
 
8984
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
8985
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
8986
_LT_AC_TAGVAR(always_export_symbols, $1)=no
 
8987
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
8988
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
8989
_LT_AC_TAGVAR(hardcode_direct, $1)=no
 
8990
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
8991
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
8992
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
8993
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
8994
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
8995
_LT_AC_TAGVAR(module_cmds, $1)=
 
8996
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
 
8997
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
8998
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
8999
_LT_AC_TAGVAR(no_undefined_flag, $1)=
 
9000
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
9001
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
9002
 
 
9003
# Source file extension for f77 test sources.
 
9004
ac_ext=f
 
9005
 
 
9006
# Object file extension for compiled f77 test sources.
 
9007
objext=o
 
9008
_LT_AC_TAGVAR(objext, $1)=$objext
 
9009
 
 
9010
# Code to be used in simple compile tests
 
9011
lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
 
9012
 
 
9013
# Code to be used in simple link tests
 
9014
lt_simple_link_test_code="      program t\n      end\n"
 
9015
 
 
9016
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9017
_LT_AC_SYS_COMPILER
 
9018
 
 
9019
# Allow CC to be a program name with arguments.
 
9020
lt_save_CC="$CC"
 
9021
CC=${F77-"f77"}
 
9022
compiler=$CC
 
9023
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9024
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
9025
 
 
9026
AC_MSG_CHECKING([if libtool supports shared libraries])
 
9027
AC_MSG_RESULT([$can_build_shared])
 
9028
 
 
9029
AC_MSG_CHECKING([whether to build shared libraries])
 
9030
test "$can_build_shared" = "no" && enable_shared=no
 
9031
 
 
9032
# On AIX, shared libraries and static libraries use the same namespace, and
 
9033
# are all built from PIC.
 
9034
case "$host_os" in
 
9035
aix3*)
 
9036
  test "$enable_shared" = yes && enable_static=no
 
9037
  if test -n "$RANLIB"; then
 
9038
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
 
9039
    postinstall_cmds='$RANLIB $lib'
 
9040
  fi
 
9041
  ;;
 
9042
aix4*)
 
9043
  test "$enable_shared" = yes && enable_static=no
 
9044
  ;;
 
9045
esac
 
9046
AC_MSG_RESULT([$enable_shared])
 
9047
 
 
9048
AC_MSG_CHECKING([whether to build static libraries])
 
9049
# Make sure either enable_shared or enable_static is yes.
 
9050
test "$enable_shared" = yes || enable_static=yes
 
9051
AC_MSG_RESULT([$enable_static])
 
9052
 
 
9053
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
9054
 
 
9055
_LT_AC_TAGVAR(GCC, $1)="$G77"
 
9056
_LT_AC_TAGVAR(LD, $1)="$LD"
 
9057
 
 
9058
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
9059
AC_LIBTOOL_PROG_CC_C_O($1)
 
9060
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
9061
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
9062
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
9063
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
9064
AC_LIBTOOL_SYS_LIB_STRIP
 
9065
 
 
9066
 
 
9067
AC_LIBTOOL_CONFIG($1)
 
9068
 
 
9069
AC_LANG_POP
 
9070
CC="$lt_save_CC"
 
9071
])# AC_LIBTOOL_LANG_F77_CONFIG
 
9072
 
 
9073
 
 
9074
# AC_LIBTOOL_LANG_GCJ_CONFIG
 
9075
# --------------------------
 
9076
# Ensure that the configuration vars for the C compiler are
 
9077
# suitably defined.  Those variables are subsequently used by
 
9078
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
9079
AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
 
9080
AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
 
9081
[AC_LANG_SAVE
 
9082
 
 
9083
# Source file extension for Java test sources.
 
9084
ac_ext=java
 
9085
 
 
9086
# Object file extension for compiled Java test sources.
 
9087
objext=o
 
9088
_LT_AC_TAGVAR(objext, $1)=$objext
 
9089
 
 
9090
# Code to be used in simple compile tests
 
9091
lt_simple_compile_test_code="class foo {}\n"
 
9092
 
 
9093
# Code to be used in simple link tests
 
9094
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
9095
 
 
9096
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9097
_LT_AC_SYS_COMPILER
 
9098
 
 
9099
# Allow CC to be a program name with arguments.
 
9100
lt_save_CC="$CC"
 
9101
CC=${GCJ-"gcj"}
 
9102
compiler=$CC
 
9103
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9104
 
 
9105
# GCJ did not exist at the time GCC didn't implicitly link libc in.
 
9106
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
9107
 
 
9108
## CAVEAT EMPTOR:
 
9109
## There is no encapsulation within the following macros, do not change
 
9110
## the running order or otherwise move them around unless you know exactly
 
9111
## what you are doing...
 
9112
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 
9113
AC_LIBTOOL_PROG_COMPILER_PIC($1)
 
9114
AC_LIBTOOL_PROG_CC_C_O($1)
 
9115
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
 
9116
AC_LIBTOOL_PROG_LD_SHLIBS($1)
 
9117
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 
9118
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 
9119
AC_LIBTOOL_SYS_LIB_STRIP
 
9120
AC_LIBTOOL_DLOPEN_SELF($1)
 
9121
 
 
9122
AC_LIBTOOL_CONFIG($1)
 
9123
 
 
9124
AC_LANG_RESTORE
 
9125
CC="$lt_save_CC"
 
9126
])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
9127
 
 
9128
 
 
9129
# AC_LIBTOOL_LANG_RC_CONFIG
 
9130
# --------------------------
 
9131
# Ensure that the configuration vars for the Windows resource compiler are
 
9132
# suitably defined.  Those variables are subsequently used by
 
9133
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
 
9134
AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
 
9135
AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
 
9136
[AC_LANG_SAVE
 
9137
 
 
9138
# Source file extension for RC test sources.
 
9139
ac_ext=rc
 
9140
 
 
9141
# Object file extension for compiled RC test sources.
 
9142
objext=o
 
9143
_LT_AC_TAGVAR(objext, $1)=$objext
 
9144
 
 
9145
# Code to be used in simple compile tests
 
9146
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
9147
 
 
9148
# Code to be used in simple link tests
 
9149
lt_simple_link_test_code="$lt_simple_compile_test_code"
 
9150
 
 
9151
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
9152
_LT_AC_SYS_COMPILER
 
9153
 
 
9154
# Allow CC to be a program name with arguments.
 
9155
lt_save_CC="$CC"
 
9156
CC=${RC-"windres"}
 
9157
compiler=$CC
 
9158
_LT_AC_TAGVAR(compiler, $1)=$CC
 
9159
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
9160
 
 
9161
AC_LIBTOOL_CONFIG($1)
 
9162
 
 
9163
AC_LANG_RESTORE
 
9164
CC="$lt_save_CC"
 
9165
])# AC_LIBTOOL_LANG_RC_CONFIG
 
9166
 
 
9167
 
 
9168
# AC_LIBTOOL_CONFIG([TAGNAME])
 
9169
# ----------------------------
 
9170
# If TAGNAME is not passed, then create an initial libtool script
 
9171
# with a default configuration from the untagged config vars.  Otherwise
 
9172
# add code to config.status for appending the configuration named by
 
9173
# TAGNAME from the matching tagged config vars.
 
9174
AC_DEFUN([AC_LIBTOOL_CONFIG],
 
9175
[# The else clause should only fire when bootstrapping the
 
9176
# libtool distribution, otherwise you forgot to ship ltmain.sh
 
9177
# with your package, and you will get complaints that there are
 
9178
# no rules to generate ltmain.sh.
 
9179
if test -f "$ltmain"; then
 
9180
  # See if we are running on zsh, and set the options which allow our commands through
 
9181
  # without removal of \ escapes.
 
9182
  if test -n "${ZSH_VERSION+set}" ; then
 
9183
    setopt NO_GLOB_SUBST
 
9184
  fi  
 
9185
  # Now quote all the things that may contain metacharacters while being
 
9186
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
 
9187
  # variables and quote the copies for generation of the libtool script.
 
9188
  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
 
9189
    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
 
9190
    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
 
9191
    deplibs_check_method reload_flag reload_cmds need_locks \
 
9192
    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
 
9193
    lt_cv_sys_global_symbol_to_c_name_address \
 
9194
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
 
9195
    old_postinstall_cmds old_postuninstall_cmds \
 
9196
    _LT_AC_TAGVAR(compiler, $1) \
 
9197
    _LT_AC_TAGVAR(CC, $1) \
 
9198
    _LT_AC_TAGVAR(LD, $1) \
 
9199
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
 
9200
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
 
9201
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
 
9202
    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
 
9203
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
 
9204
    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
 
9205
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
 
9206
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
 
9207
    _LT_AC_TAGVAR(old_archive_cmds, $1) \
 
9208
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
 
9209
    _LT_AC_TAGVAR(predep_objects, $1) \
 
9210
    _LT_AC_TAGVAR(postdep_objects, $1) \
 
9211
    _LT_AC_TAGVAR(predeps, $1) \
 
9212
    _LT_AC_TAGVAR(postdeps, $1) \
 
9213
    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
 
9214
    _LT_AC_TAGVAR(archive_cmds, $1) \
 
9215
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
 
9216
    _LT_AC_TAGVAR(postinstall_cmds, $1) \
 
9217
    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
 
9218
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
 
9219
    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
 
9220
    _LT_AC_TAGVAR(no_undefined_flag, $1) \
 
9221
    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
 
9222
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
 
9223
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
 
9224
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
 
9225
    _LT_AC_TAGVAR(hardcode_automatic, $1) \
 
9226
    _LT_AC_TAGVAR(module_cmds, $1) \
 
9227
    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
 
9228
    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
 
9229
    _LT_AC_TAGVAR(exclude_expsyms, $1) \
 
9230
    _LT_AC_TAGVAR(include_expsyms, $1); do
 
9231
 
 
9232
    case $var in
 
9233
    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
 
9234
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
 
9235
    _LT_AC_TAGVAR(archive_cmds, $1) | \
 
9236
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
 
9237
    _LT_AC_TAGVAR(module_cmds, $1) | \
 
9238
    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
 
9239
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
 
9240
    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
 
9241
    extract_expsyms_cmds | reload_cmds | finish_cmds | \
 
9242
    postinstall_cmds | postuninstall_cmds | \
 
9243
    old_postinstall_cmds | old_postuninstall_cmds | \
 
9244
    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
 
9245
      # Double-quote double-evaled strings.
 
9246
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
 
9247
      ;;
 
9248
    *)
 
9249
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
 
9250
      ;;
 
9251
    esac
 
9252
  done
 
9253
 
 
9254
  case $lt_echo in
 
9255
  *'\[$]0 --fallback-echo"')
 
9256
    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
 
9257
    ;;
 
9258
  esac
 
9259
 
 
9260
ifelse([$1], [],
 
9261
  [cfgfile="${ofile}T"
 
9262
  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
 
9263
  $rm -f "$cfgfile"
 
9264
  AC_MSG_NOTICE([creating $ofile])],
 
9265
  [cfgfile="$ofile"])
 
9266
 
 
9267
  cat <<__EOF__ >> "$cfgfile"
 
9268
ifelse([$1], [],
 
9269
[#! $SHELL
 
9270
 
 
9271
# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
 
9272
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
 
9273
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
 
9274
#
 
9275
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
 
9276
# Free Software Foundation, Inc.
 
9277
#
 
9278
# This file is part of GNU Libtool:
 
9279
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
9280
#
 
9281
# This program is free software; you can redistribute it and/or modify
 
9282
# it under the terms of the GNU General Public License as published by
 
9283
# the Free Software Foundation; either version 2 of the License, or
 
9284
# (at your option) any later version.
 
9285
#
 
9286
# This program is distributed in the hope that it will be useful, but
 
9287
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
9288
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9289
# General Public License for more details.
 
9290
#
 
9291
# You should have received a copy of the GNU General Public License
 
9292
# along with this program; if not, write to the Free Software
 
9293
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
9294
#
 
9295
# As a special exception to the GNU General Public License, if you
 
9296
# distribute this file as part of a program that contains a
 
9297
# configuration script generated by Autoconf, you may include it under
 
9298
# the same distribution terms that you use for the rest of that program.
 
9299
 
 
9300
# A sed program that does not truncate output.
 
9301
SED=$lt_SED
 
9302
 
 
9303
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
 
9304
Xsed="$SED -e s/^X//"
 
9305
 
 
9306
# The HP-UX ksh and POSIX shell print the target directory to stdout
 
9307
# if CDPATH is set.
 
9308
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
 
9309
 
 
9310
# The names of the tagged configurations supported by this script.
 
9311
available_tags=
 
9312
 
 
9313
# ### BEGIN LIBTOOL CONFIG],
 
9314
[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
 
9315
 
 
9316
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
9317
 
 
9318
# Shell to use when invoking shell scripts.
 
9319
SHELL=$lt_SHELL
 
9320
 
 
9321
# Whether or not to build shared libraries.
 
9322
build_libtool_libs=$enable_shared
 
9323
 
 
9324
# Whether or not to build static libraries.
 
9325
build_old_libs=$enable_static
 
9326
 
 
9327
# Whether or not to add -lc for building shared libraries.
 
9328
build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
 
9329
 
 
9330
# Whether or not to disallow shared libs when runtime libs are static
 
9331
allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
 
9332
 
 
9333
# Whether or not to optimize for fast installation.
 
9334
fast_install=$enable_fast_install
 
9335
 
 
9336
# The host system.
 
9337
host_alias=$host_alias
 
9338
host=$host
 
9339
 
 
9340
# An echo program that does not interpret backslashes.
 
9341
echo=$lt_echo
 
9342
 
 
9343
# The archiver.
 
9344
AR=$lt_AR
 
9345
AR_FLAGS=$lt_AR_FLAGS
 
9346
 
 
9347
# A C compiler.
 
9348
LTCC=$lt_LTCC
 
9349
 
 
9350
# A language-specific compiler.
 
9351
CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
9352
 
 
9353
# Is the compiler the GNU C compiler?
 
9354
with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
9355
 
 
9356
# An ERE matcher.
 
9357
EGREP=$lt_EGREP
 
9358
 
 
9359
# The linker used to build libraries.
 
9360
LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
 
9361
 
 
9362
# Whether we need hard or soft links.
 
9363
LN_S=$lt_LN_S
 
9364
 
 
9365
# A BSD-compatible nm program.
 
9366
NM=$lt_NM
 
9367
 
 
9368
# A symbol stripping program
 
9369
STRIP=$STRIP
 
9370
 
 
9371
# Used to examine libraries when file_magic_cmd begins "file"
 
9372
MAGIC_CMD=$MAGIC_CMD
 
9373
 
 
9374
# Used on cygwin: DLL creation program.
 
9375
DLLTOOL="$DLLTOOL"
 
9376
 
 
9377
# Used on cygwin: object dumper.
 
9378
OBJDUMP="$OBJDUMP"
 
9379
 
 
9380
# Used on cygwin: assembler.
 
9381
AS="$AS"
 
9382
 
 
9383
# The name of the directory that contains temporary libtool files.
 
9384
objdir=$objdir
 
9385
 
 
9386
# How to create reloadable object files.
 
9387
reload_flag=$lt_reload_flag
 
9388
reload_cmds=$lt_reload_cmds
 
9389
 
 
9390
# How to pass a linker flag through the compiler.
 
9391
wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
9392
 
 
9393
# Object file suffix (normally "o").
 
9394
objext="$ac_objext"
 
9395
 
 
9396
# Old archive suffix (normally "a").
 
9397
libext="$libext"
 
9398
 
 
9399
# Shared library suffix (normally ".so").
 
9400
shrext='$shrext'
 
9401
 
 
9402
# Executable file suffix (normally "").
 
9403
exeext="$exeext"
 
9404
 
 
9405
# Additional compiler flags for building library objects.
 
9406
pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
 
9407
pic_mode=$pic_mode
 
9408
 
 
9409
# What is the maximum length of a command?
 
9410
max_cmd_len=$lt_cv_sys_max_cmd_len
 
9411
 
 
9412
# Does compiler simultaneously support -c and -o options?
 
9413
compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
9414
 
 
9415
# Must we lock files when doing compilation ?
 
9416
need_locks=$lt_need_locks
 
9417
 
 
9418
# Do we need the lib prefix for modules?
 
9419
need_lib_prefix=$need_lib_prefix
 
9420
 
 
9421
# Do we need a version for libraries?
 
9422
need_version=$need_version
 
9423
 
 
9424
# Whether dlopen is supported.
 
9425
dlopen_support=$enable_dlopen
 
9426
 
 
9427
# Whether dlopen of programs is supported.
 
9428
dlopen_self=$enable_dlopen_self
 
9429
 
 
9430
# Whether dlopen of statically linked programs is supported.
 
9431
dlopen_self_static=$enable_dlopen_self_static
 
9432
 
 
9433
# Compiler flag to prevent dynamic linking.
 
9434
link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
 
9435
 
 
9436
# Compiler flag to turn off builtin functions.
 
9437
no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
 
9438
 
 
9439
# Compiler flag to allow reflexive dlopens.
 
9440
export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
 
9441
 
 
9442
# Compiler flag to generate shared objects directly from archives.
 
9443
whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
 
9444
 
 
9445
# Compiler flag to generate thread-safe objects.
 
9446
thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
 
9447
 
 
9448
# Library versioning type.
 
9449
version_type=$version_type
 
9450
 
 
9451
# Format of library name prefix.
 
9452
libname_spec=$lt_libname_spec
 
9453
 
 
9454
# List of archive names.  First name is the real one, the rest are links.
 
9455
# The last name is the one that the linker finds with -lNAME.
 
9456
library_names_spec=$lt_library_names_spec
 
9457
 
 
9458
# The coded name of the library, if different from the real name.
 
9459
soname_spec=$lt_soname_spec
 
9460
 
 
9461
# Commands used to build and install an old-style archive.
 
9462
RANLIB=$lt_RANLIB
 
9463
old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
 
9464
old_postinstall_cmds=$lt_old_postinstall_cmds
 
9465
old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
9466
 
 
9467
# Create an old-style archive from a shared archive.
 
9468
old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
 
9469
 
 
9470
# Create a temporary old-style archive to link instead of a shared archive.
 
9471
old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
 
9472
 
 
9473
# Commands used to build and install a shared archive.
 
9474
archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
 
9475
archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
 
9476
postinstall_cmds=$lt_postinstall_cmds
 
9477
postuninstall_cmds=$lt_postuninstall_cmds
 
9478
 
 
9479
# Commands used to build a loadable module (assumed same as above if empty)
 
9480
module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
 
9481
module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
 
9482
 
 
9483
# Commands to strip libraries.
 
9484
old_striplib=$lt_old_striplib
 
9485
striplib=$lt_striplib
 
9486
 
 
9487
# Dependencies to place before the objects being linked to create a
 
9488
# shared library.
 
9489
predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
 
9490
 
 
9491
# Dependencies to place after the objects being linked to create a
 
9492
# shared library.
 
9493
postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
 
9494
 
 
9495
# Dependencies to place before the objects being linked to create a
 
9496
# shared library.
 
9497
predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
 
9498
 
 
9499
# Dependencies to place after the objects being linked to create a
 
9500
# shared library.
 
9501
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
9502
 
 
9503
# The library search path used internally by the compiler when linking
 
9504
# a shared library.
 
9505
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
 
9506
 
 
9507
# Method to check whether dependent libraries are shared objects.
 
9508
deplibs_check_method=$lt_deplibs_check_method
 
9509
 
 
9510
# Command to use when deplibs_check_method == file_magic.
 
9511
file_magic_cmd=$lt_file_magic_cmd
 
9512
 
 
9513
# Flag that allows shared libraries with undefined symbols to be built.
 
9514
allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
 
9515
 
 
9516
# Flag that forces no undefined symbols.
 
9517
no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
 
9518
 
 
9519
# Commands used to finish a libtool library installation in a directory.
 
9520
finish_cmds=$lt_finish_cmds
 
9521
 
 
9522
# Same as above, but a single script fragment to be evaled but not shown.
 
9523
finish_eval=$lt_finish_eval
 
9524
 
 
9525
# Take the output of nm and produce a listing of raw symbols and C names.
 
9526
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
9527
 
 
9528
# Transform the output of nm in a proper C declaration
 
9529
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
9530
 
 
9531
# Transform the output of nm in a C name address pair
 
9532
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
9533
 
 
9534
# This is the shared library runtime path variable.
 
9535
runpath_var=$runpath_var
 
9536
 
 
9537
# This is the shared library path variable.
 
9538
shlibpath_var=$shlibpath_var
 
9539
 
 
9540
# Is shlibpath searched before the hard-coded library search path?
 
9541
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
9542
 
 
9543
# How to hardcode a shared library path into an executable.
 
9544
hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
 
9545
 
 
9546
# Whether we should hardcode library paths into libraries.
 
9547
hardcode_into_libs=$hardcode_into_libs
 
9548
 
 
9549
# Flag to hardcode \$libdir into a binary during linking.
 
9550
# This must work even if \$libdir does not exist.
 
9551
hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
 
9552
 
 
9553
# If ld is used when linking, flag to hardcode \$libdir into
 
9554
# a binary during linking. This must work even if \$libdir does
 
9555
# not exist.
 
9556
hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
 
9557
 
 
9558
# Whether we need a single -rpath flag with a separated argument.
 
9559
hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
 
9560
 
 
9561
# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
 
9562
# resulting binary.
 
9563
hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
 
9564
 
 
9565
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
 
9566
# resulting binary.
 
9567
hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
 
9568
 
 
9569
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
 
9570
# the resulting binary.
 
9571
hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
 
9572
 
 
9573
# Set to yes if building a shared library automatically hardcodes DIR into the library
 
9574
# and all subsequent libraries and executables linked against it.
 
9575
hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
 
9576
 
 
9577
# Variables whose values should be saved in libtool wrapper scripts and
 
9578
# restored at relink time.
 
9579
variables_saved_for_relink="$variables_saved_for_relink"
 
9580
 
 
9581
# Whether libtool must link a program against all its dependency libraries.
 
9582
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
 
9583
 
 
9584
# Compile-time system search path for libraries
 
9585
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
9586
 
 
9587
# Run-time system search path for libraries
 
9588
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
9589
 
 
9590
# Fix the shell variable \$srcfile for the compiler.
 
9591
fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
 
9592
 
 
9593
# Set to yes if exported symbols are required.
 
9594
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
 
9595
 
 
9596
# The commands to list exported symbols.
 
9597
export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
 
9598
 
 
9599
# The commands to extract the exported symbol list from a shared archive.
 
9600
extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
9601
 
 
9602
# Symbols that should not be listed in the preloaded symbols.
 
9603
exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
 
9604
 
 
9605
# Symbols that must always be exported.
 
9606
include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
 
9607
 
 
9608
ifelse([$1],[],
 
9609
[# ### END LIBTOOL CONFIG],
 
9610
[# ### END LIBTOOL TAG CONFIG: $tagname])
 
9611
 
 
9612
__EOF__
 
9613
 
 
9614
ifelse([$1],[], [
 
9615
  case $host_os in
 
9616
  aix3*)
 
9617
    cat <<\EOF >> "$cfgfile"
 
9618
 
 
9619
# AIX sometimes has problems with the GCC collect2 program.  For some
 
9620
# reason, if we set the COLLECT_NAMES environment variable, the problems
 
9621
# vanish in a puff of smoke.
 
9622
if test "X${COLLECT_NAMES+set}" != Xset; then
 
9623
  COLLECT_NAMES=
 
9624
  export COLLECT_NAMES
 
9625
fi
 
9626
EOF
 
9627
    ;;
 
9628
  esac
 
9629
 
 
9630
  # We use sed instead of cat because bash on DJGPP gets confused if
 
9631
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
 
9632
  # text mode, it properly converts lines to CR/LF.  This bash problem
 
9633
  # is reportedly fixed, but why not run on old versions too?
 
9634
  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
 
9635
 
 
9636
  mv -f "$cfgfile" "$ofile" || \
 
9637
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
 
9638
  chmod +x "$ofile"
 
9639
])
 
9640
else
 
9641
  # If there is no Makefile yet, we rely on a make rule to execute
 
9642
  # `config.status --recheck' to rerun these tests and create the
 
9643
  # libtool script then.
 
9644
  test -f Makefile && make "$ltmain"
 
9645
fi
 
9646
])# AC_LIBTOOL_CONFIG
 
9647
 
 
9648
 
 
9649
# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
 
9650
# -------------------------------------------
 
9651
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
 
9652
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
9653
 
 
9654
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
9655
 
 
9656
if test "$GCC" = yes; then
 
9657
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
9658
 
 
9659
  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
 
9660
    lt_cv_prog_compiler_rtti_exceptions,
 
9661
    [-fno-rtti -fno-exceptions], [],
 
9662
    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
 
9663
fi
 
9664
])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
 
9665
 
 
9666
 
 
9667
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
9668
# ---------------------------------
 
9669
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
 
9670
[AC_REQUIRE([AC_CANONICAL_HOST])
 
9671
AC_REQUIRE([AC_PROG_NM])
 
9672
AC_REQUIRE([AC_OBJEXT])
 
9673
# Check for command to grab the raw symbol name followed by C symbol from nm.
 
9674
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
 
9675
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
 
9676
[
 
9677
# These are sane defaults that work on at least a few old systems.
 
9678
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
9679
 
 
9680
# Character class describing NM global symbol codes.
 
9681
symcode='[[BCDEGRST]]'
 
9682
 
 
9683
# Regexp to match symbols that can be accessed directly from C.
 
9684
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
9685
 
 
9686
# Transform the above into a raw symbol and a C symbol.
 
9687
symxfrm='\1 \2\3 \3'
 
9688
 
 
9689
# Transform an extracted symbol line into a proper C declaration
 
9690
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
9691
 
 
9692
# Transform an extracted symbol line into symbol name and symbol address
 
9693
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'"
 
9694
 
 
9695
# Define system-specific variables.
 
9696
case $host_os in
 
9697
aix*)
 
9698
  symcode='[[BCDT]]'
 
9699
  ;;
 
9700
cygwin* | mingw* | pw32*)
 
9701
  symcode='[[ABCDGISTW]]'
 
9702
  ;;
 
9703
hpux*) # Its linker distinguishes data from code symbols
 
9704
  if test "$host_cpu" = ia64; then
 
9705
    symcode='[[ABCDEGRST]]'
 
9706
  fi
 
9707
  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
9708
  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'"
 
9709
  ;;
 
9710
irix* | nonstopux*)
 
9711
  symcode='[[BCDEGRST]]'
 
9712
  ;;
 
9713
osf*)
 
9714
  symcode='[[BCDEGQRST]]'
 
9715
  ;;
 
9716
solaris* | sysv5*)
 
9717
  symcode='[[BDT]]'
 
9718
  ;;
 
9719
sysv4)
 
9720
  symcode='[[DFNSTU]]'
 
9721
  ;;
 
9722
esac
 
9723
 
 
9724
# Handle CRLF in mingw tool chain
 
9725
opt_cr=
 
9726
case $build_os in
 
9727
mingw*)
 
9728
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
 
9729
  ;;
 
9730
esac
 
9731
 
 
9732
# If we're using GNU nm, then use its standard symbol codes.
 
9733
case `$NM -V 2>&1` in
 
9734
*GNU* | *'with BFD'*)
 
9735
  symcode='[[ABCDGISTW]]' ;;
 
9736
esac
 
9737
 
 
9738
# Try without a prefix undercore, then with it.
 
9739
for ac_symprfx in "" "_"; do
 
9740
 
 
9741
  # Write the raw and C identifiers.
 
9742
  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
 
9743
 
 
9744
  # Check to see that the pipe works correctly.
 
9745
  pipe_works=no
 
9746
 
 
9747
  rm -f conftest*
 
9748
  cat > conftest.$ac_ext <<EOF
 
9749
#ifdef __cplusplus
 
9750
extern "C" {
 
9751
#endif
 
9752
char nm_test_var;
 
9753
void nm_test_func(){}
 
9754
#ifdef __cplusplus
 
9755
}
 
9756
#endif
 
9757
int main(){nm_test_var='a';nm_test_func();return(0);}
 
9758
EOF
 
9759
 
 
9760
  if AC_TRY_EVAL(ac_compile); then
 
9761
    # Now try to grab the symbols.
 
9762
    nlist=conftest.nm
 
9763
    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
 
9764
      # Try sorting and uniquifying the output.
 
9765
      if sort "$nlist" | uniq > "$nlist"T; then
 
9766
        mv -f "$nlist"T "$nlist"
 
9767
      else
 
9768
        rm -f "$nlist"T
 
9769
      fi
 
9770
 
 
9771
      # Make sure that we snagged all the symbols we need.
 
9772
      if grep ' nm_test_var$' "$nlist" >/dev/null; then
 
9773
        if grep ' nm_test_func$' "$nlist" >/dev/null; then
 
9774
          cat <<EOF > conftest.$ac_ext
 
9775
#ifdef __cplusplus
 
9776
extern "C" {
 
9777
#endif
 
9778
 
 
9779
EOF
 
9780
          # Now generate the symbol file.
 
9781
          eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
9782
 
 
9783
          cat <<EOF >> conftest.$ac_ext
 
9784
#if defined (__STDC__) && __STDC__
 
9785
# define lt_ptr_t void *
 
9786
#else
 
9787
# define lt_ptr_t char *
 
9788
# define const
 
9789
#endif
 
9790
 
 
9791
/* The mapping between symbol names and symbols. */
 
9792
const struct {
 
9793
  const char *name;
 
9794
  lt_ptr_t address;
 
9795
}
 
9796
lt_preloaded_symbols[[]] =
 
9797
{
 
9798
EOF
 
9799
          $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
 
9800
          cat <<\EOF >> conftest.$ac_ext
 
9801
  {0, (lt_ptr_t) 0}
 
9802
};
 
9803
 
 
9804
#ifdef __cplusplus
 
9805
}
 
9806
#endif
 
9807
EOF
 
9808
          # Now try linking the two files.
 
9809
          mv conftest.$ac_objext conftstm.$ac_objext
 
9810
          lt_save_LIBS="$LIBS"
 
9811
          lt_save_CFLAGS="$CFLAGS"
 
9812
          LIBS="conftstm.$ac_objext"
 
9813
          CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
 
9814
          if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 
9815
            pipe_works=yes
 
9816
          fi
 
9817
          LIBS="$lt_save_LIBS"
 
9818
          CFLAGS="$lt_save_CFLAGS"
 
9819
        else
 
9820
          echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
 
9821
        fi
 
9822
      else
 
9823
        echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
 
9824
      fi
 
9825
    else
 
9826
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
 
9827
    fi
 
9828
  else
 
9829
    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
 
9830
    cat conftest.$ac_ext >&5
 
9831
  fi
 
9832
  rm -f conftest* conftst*
 
9833
 
 
9834
  # Do not use the global_symbol_pipe unless it works.
 
9835
  if test "$pipe_works" = yes; then
 
9836
    break
 
9837
  else
 
9838
    lt_cv_sys_global_symbol_pipe=
 
9839
  fi
 
9840
done
 
9841
])
 
9842
if test -z "$lt_cv_sys_global_symbol_pipe"; then
 
9843
  lt_cv_sys_global_symbol_to_cdecl=
 
9844
fi
 
9845
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
 
9846
  AC_MSG_RESULT(failed)
 
9847
else
 
9848
  AC_MSG_RESULT(ok)
 
9849
fi
 
9850
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
9851
 
 
9852
 
 
9853
# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
 
9854
# ---------------------------------------
 
9855
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
 
9856
[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
 
9857
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
9858
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
 
9859
 
 
9860
AC_MSG_CHECKING([for $compiler option to produce PIC])
 
9861
 ifelse([$1],[CXX],[
 
9862
  # C++ specific cases for pic, static, wl, etc.
 
9863
  if test "$GXX" = yes; then
 
9864
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
9865
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
9866
 
 
9867
    case $host_os in
 
9868
    aix*)
 
9869
      # All AIX code is PIC.
 
9870
      if test "$host_cpu" = ia64; then
 
9871
        # AIX 5 now supports IA64 processor
 
9872
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
9873
      fi
 
9874
      ;;
 
9875
    amigaos*)
 
9876
      # FIXME: we need at least 68020 code to build shared libraries, but
 
9877
      # adding the `-m68020' flag to GCC prevents building anything better,
 
9878
      # like `-m68040'.
 
9879
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
 
9880
      ;;
 
9881
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
 
9882
      # PIC is the default for these OSes.
 
9883
      ;;
 
9884
    mingw* | os2* | pw32*)
 
9885
      # This hack is so that the source file can tell whether it is being
 
9886
      # built for inclusion in a dll (and should export symbols for example).
 
9887
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
9888
      ;;
 
9889
    darwin* | rhapsody*)
 
9890
      # PIC is the default on this platform
 
9891
      # Common symbols not allowed in MH_DYLIB files
 
9892
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
 
9893
      ;;
 
9894
    *djgpp*)
 
9895
      # DJGPP does not support shared libraries at all
 
9896
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
9897
      ;;
 
9898
    sysv4*MP*)
 
9899
      if test -d /usr/nec; then
 
9900
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
 
9901
      fi
 
9902
      ;;
 
9903
    hpux*)
 
9904
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
9905
      # not for PA HP-UX.
 
9906
      case "$host_cpu" in
 
9907
      hppa*64*|ia64*)
 
9908
        ;;
 
9909
      *)
 
9910
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
9911
        ;;
 
9912
      esac
 
9913
      ;;
 
9914
    *)
 
9915
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
9916
      ;;
 
9917
    esac
 
9918
  else
 
9919
    case $host_os in
 
9920
      aix4* | aix5*)
 
9921
        # All AIX code is PIC.
 
9922
        if test "$host_cpu" = ia64; then
 
9923
          # AIX 5 now supports IA64 processor
 
9924
          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
9925
        else
 
9926
          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
 
9927
        fi
 
9928
        ;;
 
9929
      chorus*)
 
9930
        case $cc_basename in
 
9931
        cxch68)
 
9932
          # Green Hills C++ Compiler
 
9933
          # _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"
 
9934
          ;;
 
9935
        esac
 
9936
        ;;
 
9937
      dgux*)
 
9938
        case $cc_basename in
 
9939
          ec++)
 
9940
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
9941
            ;;
 
9942
          ghcx)
 
9943
            # Green Hills C++ Compiler
 
9944
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
9945
            ;;
 
9946
          *)
 
9947
            ;;
 
9948
        esac
 
9949
        ;;
 
9950
      freebsd*)
 
9951
        # FreeBSD uses GNU C++
 
9952
        ;;
 
9953
      hpux9* | hpux10* | hpux11*)
 
9954
        case $cc_basename in
 
9955
          CC)
 
9956
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
9957
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
 
9958
            if test "$host_cpu" != ia64; then
 
9959
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
9960
            fi
 
9961
            ;;
 
9962
          aCC)
 
9963
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
9964
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
 
9965
            case "$host_cpu" in
 
9966
            hppa*64*|ia64*)
 
9967
              # +Z the default
 
9968
              ;;
 
9969
            *)
 
9970
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
9971
              ;;
 
9972
            esac
 
9973
            ;;
 
9974
          *)
 
9975
            ;;
 
9976
        esac
 
9977
        ;;
 
9978
      irix5* | irix6* | nonstopux*)
 
9979
        case $cc_basename in
 
9980
          CC)
 
9981
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
9982
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
9983
            # CC pic flag -KPIC is the default.
 
9984
            ;;
 
9985
          *)
 
9986
            ;;
 
9987
        esac
 
9988
        ;;
 
9989
      linux*)
 
9990
        case $cc_basename in
 
9991
          KCC)
 
9992
            # KAI C++ Compiler
 
9993
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 
9994
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
9995
            ;;
 
9996
          icpc)
 
9997
            # Intel C++
 
9998
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
9999
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10000
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10001
            ;; 
 
10002
          cxx)
 
10003
            # Compaq C++
 
10004
            # Make sure the PIC flag is empty.  It appears that all Alpha
 
10005
            # Linux and Compaq Tru64 Unix objects are PIC.
 
10006
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10007
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10008
            ;;
 
10009
          *)
 
10010
            ;;
 
10011
        esac
 
10012
        ;;
 
10013
      lynxos*)
 
10014
        ;;
 
10015
      m88k*)
 
10016
        ;;
 
10017
      mvs*)
 
10018
        case $cc_basename in
 
10019
          cxx)
 
10020
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
 
10021
            ;;
 
10022
          *)
 
10023
            ;;
 
10024
        esac
 
10025
        ;;
 
10026
      netbsd*)
 
10027
        ;;
 
10028
      osf3* | osf4* | osf5*)
 
10029
        case $cc_basename in
 
10030
          KCC)
 
10031
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 
10032
            ;;
 
10033
          RCC)
 
10034
            # Rational C++ 2.4.1
 
10035
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10036
            ;;
 
10037
          cxx)
 
10038
            # Digital/Compaq C++
 
10039
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10040
            # Make sure the PIC flag is empty.  It appears that all Alpha
 
10041
            # Linux and Compaq Tru64 Unix objects are PIC.
 
10042
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10043
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10044
            ;;
 
10045
          *)
 
10046
            ;;
 
10047
        esac
 
10048
        ;;
 
10049
      psos*)
 
10050
        ;;
 
10051
      sco*)
 
10052
        case $cc_basename in
 
10053
          CC)
 
10054
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10055
            ;;
 
10056
          *)
 
10057
            ;;
 
10058
        esac
 
10059
        ;;
 
10060
      solaris*)
 
10061
        case $cc_basename in
 
10062
          CC)
 
10063
            # Sun C++ 4.2, 5.x and Centerline C++
 
10064
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10065
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10066
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 
10067
            ;;
 
10068
          gcx)
 
10069
            # Green Hills C++ Compiler
 
10070
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 
10071
            ;;
 
10072
          *)
 
10073
            ;;
 
10074
        esac
 
10075
        ;;
 
10076
      sunos4*)
 
10077
        case $cc_basename in
 
10078
          CC)
 
10079
            # Sun C++ 4.x
 
10080
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10081
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10082
            ;;
 
10083
          lcc)
 
10084
            # Lucid
 
10085
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10086
            ;;
 
10087
          *)
 
10088
            ;;
 
10089
        esac
 
10090
        ;;
 
10091
      tandem*)
 
10092
        case $cc_basename in
 
10093
          NCC)
 
10094
            # NonStop-UX NCC 3.20
 
10095
            _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10096
            ;;
 
10097
          *)
 
10098
            ;;
 
10099
        esac
 
10100
        ;;
 
10101
      unixware*)
 
10102
        ;;
 
10103
      vxworks*)
 
10104
        ;;
 
10105
      *)
 
10106
        _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10107
        ;;
 
10108
    esac
 
10109
  fi
 
10110
],
 
10111
[
 
10112
  if test "$GCC" = yes; then
 
10113
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10114
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10115
 
 
10116
    case $host_os in
 
10117
      aix*)
 
10118
      # All AIX code is PIC.
 
10119
      if test "$host_cpu" = ia64; then
 
10120
        # AIX 5 now supports IA64 processor
 
10121
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10122
      fi
 
10123
      ;;
 
10124
 
 
10125
    amigaos*)
 
10126
      # FIXME: we need at least 68020 code to build shared libraries, but
 
10127
      # adding the `-m68020' flag to GCC prevents building anything better,
 
10128
      # like `-m68040'.
 
10129
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
 
10130
      ;;
 
10131
 
 
10132
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
 
10133
      # PIC is the default for these OSes.
 
10134
      ;;
 
10135
 
 
10136
    mingw* | pw32* | os2*)
 
10137
      # This hack is so that the source file can tell whether it is being
 
10138
      # built for inclusion in a dll (and should export symbols for example).
 
10139
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
10140
      ;;
 
10141
 
 
10142
    darwin* | rhapsody*)
 
10143
      # PIC is the default on this platform
 
10144
      # Common symbols not allowed in MH_DYLIB files
 
10145
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
 
10146
      ;;
 
10147
 
 
10148
    msdosdjgpp*)
 
10149
      # Just because we use GCC doesn't mean we suddenly get shared libraries
 
10150
      # on systems that don't support them.
 
10151
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10152
      enable_shared=no
 
10153
      ;;
 
10154
 
 
10155
    sysv4*MP*)
 
10156
      if test -d /usr/nec; then
 
10157
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
 
10158
      fi
 
10159
      ;;
 
10160
 
 
10161
    hpux*)
 
10162
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
10163
      # not for PA HP-UX.
 
10164
      case "$host_cpu" in
 
10165
      hppa*64*|ia64*)
 
10166
        # +Z the default
 
10167
        ;;
 
10168
      *)
 
10169
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10170
        ;;
 
10171
      esac
 
10172
      ;;
 
10173
 
 
10174
    *)
 
10175
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 
10176
      ;;
 
10177
    esac
 
10178
  else
 
10179
    # PORTME Check for flag to pass linker flags through the system compiler.
 
10180
    case $host_os in
 
10181
    aix*)
 
10182
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10183
      if test "$host_cpu" = ia64; then
 
10184
        # AIX 5 now supports IA64 processor
 
10185
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10186
      else
 
10187
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
 
10188
      fi
 
10189
      ;;
 
10190
 
 
10191
    mingw* | pw32* | os2*)
 
10192
      # This hack is so that the source file can tell whether it is being
 
10193
      # built for inclusion in a dll (and should export symbols for example).
 
10194
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
 
10195
      ;;
 
10196
 
 
10197
    hpux9* | hpux10* | hpux11*)
 
10198
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10199
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
 
10200
      # not for PA HP-UX.
 
10201
      case "$host_cpu" in
 
10202
      hppa*64*|ia64*)
 
10203
        # +Z the default
 
10204
        ;;
 
10205
      *)
 
10206
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 
10207
        ;;
 
10208
      esac
 
10209
      # Is there a better lt_prog_compiler_static that works with the bundled CC?
 
10210
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 
10211
      ;;
 
10212
 
 
10213
    irix5* | irix6* | nonstopux*)
 
10214
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10215
      # PIC (with -KPIC) is the default.
 
10216
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10217
      ;;
 
10218
 
 
10219
    newsos6)
 
10220
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10221
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10222
      ;;
 
10223
 
 
10224
    linux*)
 
10225
      case $CC in
 
10226
      icc* | ecc*)
 
10227
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10228
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10229
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
10230
        ;;
 
10231
      ccc*)
 
10232
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10233
        # All Alpha code is PIC.
 
10234
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10235
        ;;
 
10236
      esac
 
10237
      ;;
 
10238
 
 
10239
    osf3* | osf4* | osf5*)
 
10240
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10241
      # All OSF/1 code is PIC.
 
10242
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 
10243
      ;;
 
10244
 
 
10245
    sco3.2v5*)
 
10246
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
 
10247
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
 
10248
      ;;
 
10249
 
 
10250
    solaris*)
 
10251
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10252
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10253
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10254
      ;;
 
10255
 
 
10256
    sunos4*)
 
10257
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 
10258
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 
10259
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10260
      ;;
 
10261
 
 
10262
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 
10263
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 
10264
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 
10265
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10266
      ;;
 
10267
 
 
10268
    sysv4*MP*)
 
10269
      if test -d /usr/nec ;then
 
10270
        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 
10271
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10272
      fi
 
10273
      ;;
 
10274
 
 
10275
    uts4*)
 
10276
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 
10277
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 
10278
      ;;
 
10279
 
 
10280
    *)
 
10281
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 
10282
      ;;
 
10283
    esac
 
10284
  fi
 
10285
])
 
10286
AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
 
10287
 
 
10288
#
 
10289
# Check to make sure the PIC flag actually works.
 
10290
#
 
10291
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
 
10292
  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
 
10293
    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
 
10294
    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
 
10295
    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
 
10296
     "" | " "*) ;;
 
10297
     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
 
10298
     esac],
 
10299
    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10300
     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 
10301
fi
 
10302
case "$host_os" in
 
10303
  # For platforms which do not support PIC, -DPIC is meaningless:
 
10304
  *djgpp*)
 
10305
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
 
10306
    ;;
 
10307
  *)
 
10308
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
 
10309
    ;;
 
10310
esac
 
10311
])
 
10312
 
 
10313
 
 
10314
# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
 
10315
# ------------------------------------
 
10316
# See if the linker supports building shared libraries.
 
10317
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
 
10318
[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 
10319
ifelse([$1],[CXX],[
 
10320
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10321
  case $host_os in
 
10322
  aix4* | aix5*)
 
10323
    # If we're using GNU nm, then we don't want the "-C" option.
 
10324
    # -C means demangle to AIX nm, but means don't demangle with GNU nm
 
10325
    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 
10326
      _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'
 
10327
    else
 
10328
      _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'
 
10329
    fi
 
10330
    ;;
 
10331
  pw32*)
 
10332
    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
 
10333
  ;;
 
10334
  cygwin* | mingw*)
 
10335
    _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'
 
10336
  ;;
 
10337
  *)
 
10338
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10339
  ;;
 
10340
  esac
 
10341
],[
 
10342
  runpath_var=
 
10343
  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
10344
  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
10345
  _LT_AC_TAGVAR(archive_cmds, $1)=
 
10346
  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
 
10347
  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
 
10348
  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
 
10349
  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
 
10350
  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
10351
  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
 
10352
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
10353
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 
10354
  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
10355
  _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10356
  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
10357
  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
10358
  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
 
10359
  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
 
10360
  _LT_AC_TAGVAR(module_cmds, $1)=
 
10361
  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
 
10362
  _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
10363
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
 
10364
  # include_expsyms should be a list of space-separated symbols to be *always*
 
10365
  # included in the symbol list
 
10366
  _LT_AC_TAGVAR(include_expsyms, $1)=
 
10367
  # exclude_expsyms can be an extended regexp of symbols to exclude
 
10368
  # it will be wrapped by ` (' and `)$', so one must not match beginning or
 
10369
  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
 
10370
  # as well as any symbol that contains `d'.
 
10371
  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
 
10372
  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
 
10373
  # platforms (ab)use it in PIC code, but their linkers get confused if
 
10374
  # the symbol is explicitly referenced.  Since portable code cannot
 
10375
  # rely on this symbol name, it's probably fine to never include it in
 
10376
  # preloaded symbol tables.
 
10377
  extract_expsyms_cmds=
 
10378
 
 
10379
  case $host_os in
 
10380
  cygwin* | mingw* | pw32*)
 
10381
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
 
10382
    # When not using gcc, we currently assume that we are using
 
10383
    # Microsoft Visual C++.
 
10384
    if test "$GCC" != yes; then
 
10385
      with_gnu_ld=no
 
10386
    fi
 
10387
    ;;
 
10388
  openbsd*)
 
10389
    with_gnu_ld=no
 
10390
    ;;
 
10391
  esac
 
10392
 
 
10393
  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
10394
  if test "$with_gnu_ld" = yes; then
 
10395
    # If archive_cmds runs LD, not CC, wlarc should be empty
 
10396
    wlarc='${wl}'
 
10397
 
 
10398
    # See if GNU ld supports shared libraries.
 
10399
    case $host_os in
 
10400
    aix3* | aix4* | aix5*)
 
10401
      # On AIX/PPC, the GNU linker is very broken
 
10402
      if test "$host_cpu" != ia64; then
 
10403
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10404
        cat <<EOF 1>&2
 
10405
 
 
10406
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
 
10407
*** to be unable to reliably create shared libraries on AIX.
 
10408
*** Therefore, libtool is disabling shared libraries support.  If you
 
10409
*** really care for shared libraries, you may want to modify your PATH
 
10410
*** so that a non-GNU linker is found, and then restart.
 
10411
 
 
10412
EOF
 
10413
      fi
 
10414
      ;;
 
10415
 
 
10416
    amigaos*)
 
10417
      _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)'
 
10418
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10419
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10420
 
 
10421
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
 
10422
      # that the semantics of dynamic libraries on AmigaOS, at least up
 
10423
      # to version 4, is to share data among multiple programs linked
 
10424
      # with the same dynamic library.  Since this doesn't match the
 
10425
      # behavior of shared libraries on other platforms, we can't use
 
10426
      # them.
 
10427
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10428
      ;;
 
10429
 
 
10430
    beos*)
 
10431
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10432
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10433
        # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 
10434
        # support --undefined.  This deserves some investigation.  FIXME
 
10435
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
10436
      else
 
10437
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10438
      fi
 
10439
      ;;
 
10440
 
 
10441
    cygwin* | mingw* | pw32*)
 
10442
      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 
10443
      # as there is no search path for DLLs.
 
10444
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10445
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10446
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
10447
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
10448
      _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'
 
10449
 
 
10450
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
 
10451
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
 
10452
        # If the export-symbols file already is a .def file (1st line
 
10453
        # is EXPORTS), use it as is; otherwise, prepend...
 
10454
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
 
10455
          cp $export_symbols $output_objdir/$soname.def;
 
10456
        else
 
10457
          echo EXPORTS > $output_objdir/$soname.def;
 
10458
          cat $export_symbols >> $output_objdir/$soname.def;
 
10459
        fi~
 
10460
        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
 
10461
      else
 
10462
        ld_shlibs=no
 
10463
      fi
 
10464
      ;;
 
10465
 
 
10466
    netbsd*)
 
10467
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
10468
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 
10469
        wlarc=
 
10470
      else
 
10471
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
10472
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10473
      fi
 
10474
      ;;
 
10475
 
 
10476
    solaris* | sysv5*)
 
10477
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 
10478
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10479
        cat <<EOF 1>&2
 
10480
 
 
10481
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
 
10482
*** create shared libraries on Solaris systems.  Therefore, libtool
 
10483
*** is disabling shared libraries support.  We urge you to upgrade GNU
 
10484
*** binutils to release 2.9.1 or newer.  Another option is to modify
 
10485
*** your PATH or compiler configuration so that the native linker is
 
10486
*** used, and then restart.
 
10487
 
 
10488
EOF
 
10489
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10490
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
10491
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10492
      else
 
10493
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10494
      fi
 
10495
      ;;
 
10496
 
 
10497
    sunos4*)
 
10498
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
10499
      wlarc=
 
10500
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10501
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10502
      ;;
 
10503
 
 
10504
    *)
 
10505
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 
10506
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
10507
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
10508
      else
 
10509
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10510
      fi
 
10511
      ;;
 
10512
    esac
 
10513
 
 
10514
    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
 
10515
      runpath_var=LD_RUN_PATH
 
10516
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 
10517
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
10518
      # ancient GNU ld didn't support --whole-archive et. al.
 
10519
      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
 
10520
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 
10521
      else
 
10522
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
 
10523
      fi
 
10524
    fi
 
10525
  else
 
10526
    # PORTME fill in a description of your system's linker (not GNU ld)
 
10527
    case $host_os in
 
10528
    aix3*)
 
10529
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10530
      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
10531
      _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'
 
10532
      # Note: this linker hardcodes the directories in LIBPATH if there
 
10533
      # are no directories specified by -L.
 
10534
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10535
      if test "$GCC" = yes && test -z "$link_static_flag"; then
 
10536
        # Neither direct hardcoding nor static linking is supported with a
 
10537
        # broken collect2.
 
10538
        _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
10539
      fi
 
10540
      ;;
 
10541
 
 
10542
    aix4* | aix5*)
 
10543
      if test "$host_cpu" = ia64; then
 
10544
        # On IA64, the linker does run time linking by default, so we don't
 
10545
        # have to do anything special.
 
10546
        aix_use_runtimelinking=no
 
10547
        exp_sym_flag='-Bexport'
 
10548
        no_entry_flag=""
 
10549
      else
 
10550
        # If we're using GNU nm, then we don't want the "-C" option.
 
10551
        # -C means demangle to AIX nm, but means don't demangle with GNU nm
 
10552
        if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 
10553
          _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'
 
10554
        else
 
10555
          _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'
 
10556
        fi
 
10557
 
 
10558
        # KDE requires run time linking.  Make it the default.
 
10559
        aix_use_runtimelinking=yes
 
10560
        exp_sym_flag='-bexport'
 
10561
        no_entry_flag='-bnoentry'
 
10562
      fi
 
10563
 
 
10564
      # When large executables or shared objects are built, AIX ld can
 
10565
      # have problems creating the table of contents.  If linking a library
 
10566
      # or program results in "error TOC overflow" add -mminimal-toc to
 
10567
      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
 
10568
      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
10569
 
 
10570
      _LT_AC_TAGVAR(archive_cmds, $1)=''
 
10571
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10572
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
 
10573
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
10574
 
 
10575
      if test "$GCC" = yes; then
 
10576
        case $host_os in aix4.[012]|aix4.[012].*)
 
10577
        # We only want to do this on AIX 4.2 and lower, the check
 
10578
        # below for broken collect2 doesn't work under 4.3+
 
10579
          collect2name=`${CC} -print-prog-name=collect2`
 
10580
          if test -f "$collect2name" && \
 
10581
           strings "$collect2name" | grep resolve_lib_name >/dev/null
 
10582
          then
 
10583
          # We have reworked collect2
 
10584
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10585
          else
 
10586
          # We have old collect2
 
10587
          _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
 
10588
          # It fails to find uninstalled libraries when the uninstalled
 
10589
          # path is not listed in the libpath.  Setting hardcode_minus_L
 
10590
          # to unsupported forces relinking
 
10591
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10592
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10593
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 
10594
          fi
 
10595
        esac
 
10596
        shared_flag='-shared'
 
10597
      else
 
10598
        # not using gcc
 
10599
        if test "$host_cpu" = ia64; then
 
10600
        # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 
10601
        # chokes on -Wl,-G. The following line is correct:
 
10602
          shared_flag='-G'
 
10603
        else
 
10604
        if test "$aix_use_runtimelinking" = yes; then
 
10605
            shared_flag='-qmkshrobj ${wl}-G'
 
10606
          else
 
10607
            shared_flag='-qmkshrobj'
 
10608
        fi
 
10609
        fi
 
10610
      fi
 
10611
 
 
10612
      # Let the compiler handle the export list.
 
10613
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
 
10614
      if test "$aix_use_runtimelinking" = yes; then
 
10615
        # Warning - without using the other runtime loading flags (-brtl),
 
10616
        # -berok will link without error, but may produce a broken library.
 
10617
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
 
10618
       # Determine the default libpath from the value encoded in an empty executable.
 
10619
        _LT_AC_SYS_LIBPATH_AIX
 
10620
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
10621
        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
 
10622
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
 
10623
       else
 
10624
        if test "$host_cpu" = ia64; then
 
10625
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 
10626
          _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
 
10627
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
 
10628
        else
 
10629
         # Determine the default libpath from the value encoded in an empty executable.
 
10630
         _LT_AC_SYS_LIBPATH_AIX
 
10631
         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
10632
          # Warning - without using the other run time loading flags,
 
10633
          # -berok will link without error, but may produce a broken library.
 
10634
          _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 
10635
          _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
 
10636
          # -bexpall does not export symbols beginning with underscore (_)
 
10637
          _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 
10638
          # Exported symbols can be pulled into shared objects from archives
 
10639
          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 
10640
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
10641
          # This is similar to how AIX traditionally builds it's shared libraries.
 
10642
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 
10643
        fi
 
10644
      fi
 
10645
      ;;
 
10646
 
 
10647
    amigaos*)
 
10648
      _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)'
 
10649
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10650
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10651
      # see comment about different semantics on the GNU ld section
 
10652
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10653
      ;;
 
10654
 
 
10655
    bsdi4*)
 
10656
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
 
10657
      ;;
 
10658
 
 
10659
    cygwin* | mingw* | pw32*)
 
10660
      # When not using gcc, we currently assume that we are using
 
10661
      # Microsoft Visual C++.
 
10662
      # hardcode_libdir_flag_spec is actually meaningless, as there is
 
10663
      # no search path for DLLs.
 
10664
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
 
10665
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10666
      # Tell ltmain to make .lib files, not .a files.
 
10667
      libext=lib
 
10668
      # Tell ltmain to make .dll files, not .so files.
 
10669
      shrext=".dll"
 
10670
      # FIXME: Setting linknames here is a bad hack.
 
10671
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
 
10672
      # The linker will automatically build a .lib file if we build a DLL.
 
10673
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
 
10674
      # FIXME: Should let the user specify the lib program.
 
10675
      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
 
10676
      fix_srcfile_path='`cygpath -w "$srcfile"`'
 
10677
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
10678
      ;;
 
10679
 
 
10680
    darwin* | rhapsody*)
 
10681
    if test "$GXX" = yes ; then
 
10682
      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
10683
      case "$host_os" in
 
10684
      rhapsody* | darwin1.[[012]])
 
10685
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
 
10686
        ;;
 
10687
      *) # Darwin 1.3 on
 
10688
        test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
 
10689
        ;;
 
10690
      esac
 
10691
        lt_int_apple_cc_single_mod=no
 
10692
        output_verbose_link_cmd='echo'
 
10693
        if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
 
10694
          lt_int_apple_cc_single_mod=yes
 
10695
        fi
 
10696
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
10697
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
 
10698
        else
 
10699
        _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 $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
 
10700
      fi
 
10701
      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
 
10702
      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
 
10703
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
 
10704
          _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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
10705
        else
 
10706
          _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 $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
10707
        fi
 
10708
          _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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
 
10709
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10710
      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
 
10711
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 
10712
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
 
10713
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
10714
    else  
 
10715
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10716
    fi  
 
10717
      ;;
 
10718
 
 
10719
    dgux*)
 
10720
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10721
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10722
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10723
      ;;
 
10724
 
 
10725
    freebsd1*)
 
10726
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
10727
      ;;
 
10728
 
 
10729
    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
 
10730
    # support.  Future versions do this automatically, but an explicit c++rt0.o
 
10731
    # does not break anything, and helps significantly (at the cost of a little
 
10732
    # extra space).
 
10733
    freebsd2.2*)
 
10734
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
 
10735
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
10736
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10737
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10738
      ;;
 
10739
 
 
10740
    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
 
10741
    freebsd2*)
 
10742
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
10743
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10744
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10745
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10746
      ;;
 
10747
 
 
10748
    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
 
10749
    freebsd*)
 
10750
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
 
10751
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
10752
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10753
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10754
      ;;
 
10755
 
 
10756
    hpux9*)
 
10757
      if test "$GCC" = yes; then
 
10758
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
 
10759
      else
 
10760
        _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'
 
10761
      fi
 
10762
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
10763
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10764
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10765
 
 
10766
      # hardcode_minus_L: Not really in the search PATH,
 
10767
      # but as the default location of the library.
 
10768
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10769
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
10770
      ;;
 
10771
 
 
10772
    hpux10* | hpux11*)
 
10773
      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
 
10774
        case "$host_cpu" in
 
10775
        hppa*64*|ia64*)
 
10776
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 
10777
          ;;
 
10778
        *)
 
10779
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 
10780
          ;;
 
10781
        esac
 
10782
      else
 
10783
        case "$host_cpu" in
 
10784
        hppa*64*|ia64*)
 
10785
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10786
          ;;
 
10787
        *)
 
10788
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 
10789
          ;;
 
10790
        esac
 
10791
      fi
 
10792
      if test "$with_gnu_ld" = no; then
 
10793
        case "$host_cpu" in
 
10794
        hppa*64*)
 
10795
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
10796
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 
10797
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10798
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10799
          _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10800
          ;;
 
10801
        ia64*)
 
10802
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10803
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10804
          _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10805
 
 
10806
          # hardcode_minus_L: Not really in the search PATH,
 
10807
          # but as the default location of the library.
 
10808
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10809
          ;;
 
10810
        *)
 
10811
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 
10812
          _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10813
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10814
          _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
10815
 
 
10816
          # hardcode_minus_L: Not really in the search PATH,
 
10817
          # but as the default location of the library.
 
10818
          _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10819
          ;;
 
10820
        esac
 
10821
      fi
 
10822
      ;;
 
10823
 
 
10824
    irix5* | irix6* | nonstopux*)
 
10825
      if test "$GCC" = yes; then
 
10826
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
10827
      else
 
10828
        _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'
 
10829
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
 
10830
      fi
 
10831
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
10832
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10833
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
10834
      ;;
 
10835
 
 
10836
    netbsd*)
 
10837
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 
10838
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
 
10839
      else
 
10840
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
 
10841
      fi
 
10842
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
10843
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10844
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10845
      ;;
 
10846
 
 
10847
    newsos6)
 
10848
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10849
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10850
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
10851
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10852
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10853
      ;;
 
10854
 
 
10855
    openbsd*)
 
10856
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10857
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10858
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 
10859
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
 
10860
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
10861
        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
10862
      else
 
10863
       case $host_os in
 
10864
         openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
 
10865
           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
 
10866
           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
10867
           ;;
 
10868
         *)
 
10869
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
 
10870
           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 
10871
           ;;
 
10872
       esac
 
10873
      fi
 
10874
      ;;
 
10875
 
 
10876
    os2*)
 
10877
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10878
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10879
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
 
10880
      _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 $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
 
10881
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
 
10882
      ;;
 
10883
 
 
10884
    osf3*)
 
10885
      if test "$GCC" = yes; then
 
10886
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
10887
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
10888
      else
 
10889
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
10890
        _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'
 
10891
      fi
 
10892
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
10893
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10894
      ;;
 
10895
 
 
10896
    osf4* | osf5*)      # as osf3* with the addition of -msym flag
 
10897
      if test "$GCC" = yes; then
 
10898
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 
10899
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${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'
 
10900
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 
10901
      else
 
10902
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 
10903
        _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'
 
10904
        _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~
 
10905
        $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'
 
10906
 
 
10907
        # Both c and cxx compiler support -rpath directly
 
10908
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 
10909
      fi
 
10910
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
10911
      ;;
 
10912
 
 
10913
    sco3.2v5*)
 
10914
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10915
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10916
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
 
10917
      runpath_var=LD_RUN_PATH
 
10918
      hardcode_runpath_var=yes
 
10919
      ;;
 
10920
 
 
10921
    solaris*)
 
10922
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
 
10923
      if test "$GCC" = yes; then
 
10924
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 
10925
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
10926
          $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
 
10927
      else
 
10928
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10929
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
10930
        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
 
10931
      fi
 
10932
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 
10933
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10934
      case $host_os in
 
10935
      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 
10936
      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
 
10937
        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
 
10938
      esac
 
10939
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
10940
      ;;
 
10941
 
 
10942
    sunos4*)
 
10943
      if test "x$host_vendor" = xsequent; then
 
10944
        # Use $CC to link under sequent, because it throws in some extra .o
 
10945
        # files that make .init and .fini sections work.
 
10946
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
 
10947
      else
 
10948
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
 
10949
      fi
 
10950
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
10951
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10952
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
 
10953
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10954
      ;;
 
10955
 
 
10956
    sysv4)
 
10957
      case $host_vendor in
 
10958
        sni)
 
10959
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10960
          _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
 
10961
        ;;
 
10962
        siemens)
 
10963
          ## LD is ld it makes a PLAMLIB
 
10964
          ## CC just makes a GrossModule.
 
10965
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
 
10966
          _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
 
10967
          _LT_AC_TAGVAR(hardcode_direct, $1)=no
 
10968
        ;;
 
10969
        motorola)
 
10970
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10971
          _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
 
10972
        ;;
 
10973
      esac
 
10974
      runpath_var='LD_RUN_PATH'
 
10975
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10976
      ;;
 
10977
 
 
10978
    sysv4.3*)
 
10979
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10980
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10981
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
 
10982
      ;;
 
10983
 
 
10984
    sysv4*MP*)
 
10985
      if test -d /usr/nec; then
 
10986
        _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
10987
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10988
        runpath_var=LD_RUN_PATH
 
10989
        hardcode_runpath_var=yes
 
10990
        _LT_AC_TAGVAR(ld_shlibs, $1)=yes
 
10991
      fi
 
10992
      ;;
 
10993
 
 
10994
    sysv4.2uw2*)
 
10995
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
 
10996
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 
10997
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
 
10998
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
10999
      hardcode_runpath_var=yes
 
11000
      runpath_var=LD_RUN_PATH
 
11001
      ;;
 
11002
 
 
11003
   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
 
11004
      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
 
11005
      if test "$GCC" = yes; then
 
11006
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 
11007
      else
 
11008
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 
11009
      fi
 
11010
      runpath_var='LD_RUN_PATH'
 
11011
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11012
      ;;
 
11013
 
 
11014
    sysv5*)
 
11015
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
 
11016
      # $CC -shared without GNU ld will not create a library from C++
 
11017
      # object files and a static libstdc++, better avoid it by now
 
11018
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11019
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 
11020
                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
 
11021
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
 
11022
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11023
      runpath_var='LD_RUN_PATH'
 
11024
      ;;
 
11025
 
 
11026
    uts4*)
 
11027
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
 
11028
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 
11029
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
11030
      ;;
 
11031
 
 
11032
    *)
 
11033
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
 
11034
      ;;
 
11035
    esac
 
11036
  fi
 
11037
])
 
11038
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 
11039
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
11040
 
 
11041
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
 
11042
if test "$GCC" = yes; then
 
11043
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 
11044
fi
 
11045
 
 
11046
#
 
11047
# Do we need to explicitly link libc?
 
11048
#
 
11049
case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
 
11050
x|xyes)
 
11051
  # Assume -lc should be added
 
11052
  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
11053
 
 
11054
  if test "$enable_shared" = yes && test "$GCC" = yes; then
 
11055
    case $_LT_AC_TAGVAR(archive_cmds, $1) in
 
11056
    *'~'*)
 
11057
      # FIXME: we may have to deal with multi-command sequences.
 
11058
      ;;
 
11059
    '$CC '*)
 
11060
      # Test whether the compiler implicitly links with -lc since on some
 
11061
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
 
11062
      # to ld, don't add -lc before -lgcc.
 
11063
      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
 
11064
      $rm conftest*
 
11065
      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
11066
  
 
11067
      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
 
11068
        soname=conftest
 
11069
        lib=conftest
 
11070
        libobjs=conftest.$ac_objext
 
11071
        deplibs=
 
11072
        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
11073
        compiler_flags=-v
 
11074
        linker_flags=-v
 
11075
        verstring=
 
11076
        output_objdir=.
 
11077
        libname=conftest
 
11078
        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
 
11079
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
 
11080
        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
 
11081
        then
 
11082
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
11083
        else
 
11084
          _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
 
11085
        fi
 
11086
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
 
11087
      else
 
11088
        cat conftest.err 1>&5
 
11089
      fi
 
11090
      $rm conftest*
 
11091
      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
 
11092
      ;;
 
11093
    esac
 
11094
  fi
 
11095
  ;;
 
11096
esac
 
11097
])# AC_LIBTOOL_PROG_LD_SHLIBS
 
11098
 
 
11099
 
 
11100
# _LT_AC_FILE_LTDLL_C
 
11101
# -------------------
 
11102
# Be careful that the start marker always follows a newline.
 
11103
AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
 
11104
# /* ltdll.c starts here */
 
11105
# #define WIN32_LEAN_AND_MEAN
 
11106
# #include <windows.h>
 
11107
# #undef WIN32_LEAN_AND_MEAN
 
11108
# #include <stdio.h>
 
11109
#
 
11110
# #ifndef __CYGWIN__
 
11111
# #  ifdef __CYGWIN32__
 
11112
# #    define __CYGWIN__ __CYGWIN32__
 
11113
# #  endif
 
11114
# #endif
 
11115
#
 
11116
# #ifdef __cplusplus
 
11117
# extern "C" {
 
11118
# #endif
 
11119
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
 
11120
# #ifdef __cplusplus
 
11121
# }
 
11122
# #endif
 
11123
#
 
11124
# #ifdef __CYGWIN__
 
11125
# #include <cygwin/cygwin_dll.h>
 
11126
# DECLARE_CYGWIN_DLL( DllMain );
 
11127
# #endif
 
11128
# HINSTANCE __hDllInstance_base;
 
11129
#
 
11130
# BOOL APIENTRY
 
11131
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
 
11132
# {
 
11133
#   __hDllInstance_base = hInst;
 
11134
#   return TRUE;
 
11135
# }
 
11136
# /* ltdll.c ends here */
 
11137
])# _LT_AC_FILE_LTDLL_C
 
11138
 
 
11139
 
 
11140
# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
 
11141
# ---------------------------------
 
11142
AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
 
11143
 
 
11144
 
 
11145
# old names
 
11146
AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
 
11147
AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
 
11148
AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
 
11149
AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
 
11150
AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
 
11151
AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
 
11152
AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
 
11153
 
 
11154
# This is just to silence aclocal about the macro not being used
 
11155
ifelse([AC_DISABLE_FAST_INSTALL])
 
11156
 
 
11157
AC_DEFUN([LT_AC_PROG_GCJ],
 
11158
[AC_CHECK_TOOL(GCJ, gcj, no)
 
11159
  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
 
11160
  AC_SUBST(GCJFLAGS)
 
11161
])
 
11162
 
 
11163
AC_DEFUN([LT_AC_PROG_RC],
 
11164
[AC_CHECK_TOOL(RC, windres, no)
 
11165
])
 
11166
 
 
11167
############################################################
 
11168
# NOTE: This macro has been submitted for inclusion into   #
 
11169
#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
 
11170
#  a released version of Autoconf we should remove this    #
 
11171
#  macro and use it instead.                               #
 
11172
############################################################
 
11173
# LT_AC_PROG_SED
 
11174
# --------------
 
11175
# Check for a fully-functional sed program, that truncates
 
11176
# as few characters as possible.  Prefer GNU sed if found.
 
11177
AC_DEFUN([LT_AC_PROG_SED],
 
11178
[AC_MSG_CHECKING([for a sed that does not truncate output])
 
11179
AC_CACHE_VAL(lt_cv_path_SED,
 
11180
[# Loop through the user's path and test for sed and gsed.
 
11181
# Then use that list of sed's as ones to test for truncation.
 
11182
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
11183
for as_dir in $PATH
 
11184
do
 
11185
  IFS=$as_save_IFS
 
11186
  test -z "$as_dir" && as_dir=.
 
11187
  for lt_ac_prog in sed gsed; do
 
11188
    for ac_exec_ext in '' $ac_executable_extensions; do
 
11189
      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
 
11190
        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
 
11191
      fi
 
11192
    done
 
11193
  done
 
11194
done
 
11195
lt_ac_max=0
 
11196
lt_ac_count=0
 
11197
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
 
11198
# along with /bin/sed that truncates output.
 
11199
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
 
11200
  test ! -f $lt_ac_sed && break
 
11201
  cat /dev/null > conftest.in
 
11202
  lt_ac_count=0
 
11203
  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
 
11204
  # Check for GNU sed and select it if it is found.
 
11205
  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
 
11206
    lt_cv_path_SED=$lt_ac_sed
 
11207
    break
 
11208
  fi
 
11209
  while true; do
 
11210
    cat conftest.in conftest.in >conftest.tmp
 
11211
    mv conftest.tmp conftest.in
 
11212
    cp conftest.in conftest.nl
 
11213
    echo >>conftest.nl
 
11214
    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
 
11215
    cmp -s conftest.out conftest.nl || break
 
11216
    # 10000 chars as input seems more than enough
 
11217
    test $lt_ac_count -gt 10 && break
 
11218
    lt_ac_count=`expr $lt_ac_count + 1`
 
11219
    if test $lt_ac_count -gt $lt_ac_max; then
 
11220
      lt_ac_max=$lt_ac_count
 
11221
      lt_cv_path_SED=$lt_ac_sed
 
11222
    fi
 
11223
  done
 
11224
done
 
11225
])
 
11226
SED=$lt_cv_path_SED
 
11227
AC_MSG_RESULT([$SED])
 
11228
])