~ubuntu-branches/ubuntu/trusty/kanjisaver/trusty

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Schultz
  • Date: 2005-12-13 19:35:14 UTC
  • Revision ID: james.westby@ubuntu.com-20051213193514-yonsuwfu7344n121
Tags: upstream-0.9.9
ImportĀ upstreamĀ versionĀ 0.9.9

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