Subversion Repositories public

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
88 andreas 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., 51 Franklin Street, Fifth Floor,
20
dnl    Boston, MA 02110-1301, USA.
21
 
22
dnl IMPORTANT NOTE:
23
dnl Please do not modify this file unless you expect your modifications to be
24
dnl carried into every other module in the repository. 
25
dnl
26
dnl Single-module modifications are best placed in configure.in for kdelibs
27
dnl and kdebase or configure.in.in if present.
28
 
29
# KDE_PATH_X_DIRECT
30
dnl Internal subroutine of AC_PATH_X.
31
dnl Set ac_x_includes and/or ac_x_libraries.
32
AC_DEFUN([KDE_PATH_X_DIRECT],
33
[
34
AC_REQUIRE([KDE_CHECK_LIB64])
35
 
36
if test "$ac_x_includes" = NO; then
37
  # Guess where to find include files, by looking for this one X11 .h file.
38
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
39
 
40
  # First, try using that file with no special directory specified.
41
AC_TRY_CPP([#include <$x_direct_test_include>],
42
[# We can compile using X headers with no special include directory.
43
ac_x_includes=],
44
[# Look for the header file in a standard set of common directories.
45
# Check X11 before X11Rn because it is often a symlink to the current release.
46
  for ac_dir in               \
47
    /usr/X11/include          \
48
    /usr/X11R6/include        \
49
    /usr/X11R5/include        \
50
    /usr/X11R4/include        \
51
                              \
52
    /usr/include/X11          \
53
    /usr/include/X11R6        \
54
    /usr/include/X11R5        \
55
    /usr/include/X11R4        \
56
                              \
57
    /usr/local/X11/include    \
58
    /usr/local/X11R6/include  \
59
    /usr/local/X11R5/include  \
60
    /usr/local/X11R4/include  \
61
                              \
62
    /usr/local/include/X11    \
63
    /usr/local/include/X11R6  \
64
    /usr/local/include/X11R5  \
65
    /usr/local/include/X11R4  \
66
                              \
67
    /usr/X386/include         \
68
    /usr/x386/include         \
69
    /usr/XFree86/include/X11  \
70
                              \
71
    /usr/include              \
72
    /usr/local/include        \
73
    /usr/unsupported/include  \
74
    /usr/athena/include       \
75
    /usr/local/x11r5/include  \
76
    /usr/lpp/Xamples/include  \
77
                              \
78
    /usr/openwin/include      \
79
    /usr/openwin/share/include \
80
    ; \
81
  do
82
    if test -r "$ac_dir/$x_direct_test_include"; then
83
      ac_x_includes=$ac_dir
84
      break
85
    fi
86
  done])
87
fi # $ac_x_includes = NO
88
 
89
if test "$ac_x_libraries" = NO; then
90
  # Check for the libraries.
91
 
92
  test -z "$x_direct_test_library" && x_direct_test_library=Xt
93
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
94
 
95
  # See if we find them without any special options.
96
  # Don't add to $LIBS permanently.
97
  ac_save_LIBS="$LIBS"
98
  LIBS="-l$x_direct_test_library $LIBS"
99
AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100
[LIBS="$ac_save_LIBS"
101
# We can link X programs with no special library path.
102
ac_x_libraries=],
103
[LIBS="$ac_save_LIBS"
104
# First see if replacing the include by lib works.
105
# Check X11 before X11Rn because it is often a symlink to the current release.
106
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
107
    /usr/X11/lib${kdelibsuff}           \
108
    /usr/X11R6/lib${kdelibsuff}         \
109
    /usr/X11R5/lib${kdelibsuff}         \
110
    /usr/X11R4/lib${kdelibsuff}         \
111
                                        \
112
    /usr/lib${kdelibsuff}/X11           \
113
    /usr/lib${kdelibsuff}/X11R6         \
114
    /usr/lib${kdelibsuff}/X11R5         \
115
    /usr/lib${kdelibsuff}/X11R4         \
116
                                        \
117
    /usr/local/X11/lib${kdelibsuff}     \
118
    /usr/local/X11R6/lib${kdelibsuff}   \
119
    /usr/local/X11R5/lib${kdelibsuff}   \
120
    /usr/local/X11R4/lib${kdelibsuff}   \
121
                                        \
122
    /usr/local/lib${kdelibsuff}/X11     \
123
    /usr/local/lib${kdelibsuff}/X11R6   \
124
    /usr/local/lib${kdelibsuff}/X11R5   \
125
    /usr/local/lib${kdelibsuff}/X11R4   \
126
                                        \
127
    /usr/X386/lib${kdelibsuff}          \
128
    /usr/x386/lib${kdelibsuff}          \
129
    /usr/XFree86/lib${kdelibsuff}/X11   \
130
                                        \
131
    /usr/lib${kdelibsuff}               \
132
    /usr/local/lib${kdelibsuff}         \
133
    /usr/unsupported/lib${kdelibsuff}   \
134
    /usr/athena/lib${kdelibsuff}        \
135
    /usr/local/x11r5/lib${kdelibsuff}   \
136
    /usr/lpp/Xamples/lib${kdelibsuff}   \
137
    /lib/usr/lib${kdelibsuff}/X11       \
138
                                        \
139
    /usr/openwin/lib${kdelibsuff}       \
140
    /usr/openwin/share/lib${kdelibsuff} \
141
    ; \
142
do
143
dnl Don't even attempt the hair of trying to link an X program!
144
  for ac_extension in a so sl; do
145
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
146
      ac_x_libraries=$ac_dir
147
      break 2
148
    fi
149
  done
150
done])
151
fi # $ac_x_libraries = NO
152
])
153
 
154
 
155
dnl ------------------------------------------------------------------------
156
dnl Find a file (or one of more files in a list of dirs)
157
dnl ------------------------------------------------------------------------
158
dnl
159
AC_DEFUN([AC_FIND_FILE],
160
[
161
$3=NO
162
for i in $2;
163
do
164
  for j in $1;
165
  do
166
    echo "configure: __oline__: $i/$j" >&AC_FD_CC
167
    if test -r "$i/$j"; then
168
      echo "taking that" >&AC_FD_CC
169
      $3=$i
170
      break 2
171
    fi
172
  done
173
done
174
])
175
 
176
dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177
dnl	if-not-found, test-parameter, prepend-path)
178
dnl
179
dnl Look for program-name in list-of-dirs+$PATH.
180
dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
181
dnl If found, $variable-name is set. If not, if-not-found is evaluated.
182
dnl test-parameter: if set, the program is executed with this arg,
183
dnl                 and only a successful exit code is required.
184
AC_DEFUN([KDE_FIND_PATH],
185
[
186
   AC_MSG_CHECKING([for $1])
187
   if test -n "$$2"; then
188
        kde_cv_path="$$2";
189
   else
190
        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
191
 
192
        AC_CACHE_VAL(kde_cv_path_$kde_cache,
193
        [
194
        kde_cv_path="NONE"
195
	kde_save_IFS=$IFS
196
	IFS=':'
197
	dirs=""
198
	for dir in $PATH; do
199
	  dirs="$dirs $dir"
200
	done
201
	if test -z "$6"; then  dnl Append dirs in PATH (default)
202
	  dirs="$3 $dirs"
203
        else  dnl Prepend dirs in PATH (if 6th arg is set)
204
	  dirs="$dirs $3"
205
	fi
206
	IFS=$kde_save_IFS
207
 
208
        for dir in $dirs; do
209
	  if test -x "$dir/$1"; then
210
	    if test -n "$5"
211
	    then
212
              evalstr="$dir/$1 $5 2>&1 "
213
	      if eval $evalstr; then
214
                kde_cv_path="$dir/$1"
215
                break
216
	      fi
217
            else
218
		kde_cv_path="$dir/$1"
219
                break
220
	    fi
221
          fi
222
        done
223
 
224
        eval "kde_cv_path_$kde_cache=$kde_cv_path"
225
 
226
        ])
227
 
228
      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
229
 
230
   fi
231
 
232
   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
233
      AC_MSG_RESULT(not found)
234
      $4
235
   else
236
      AC_MSG_RESULT($kde_cv_path)
237
      $2=$kde_cv_path
238
 
239
   fi
240
])
241
 
242
AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
243
[
244
    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
245
Please check whether you installed Qt correctly.
246
You need to have a running moc binary.
247
configure tried to run $ac_cv_path_moc and the test didn't
248
succeed. If configure shouldn't have tried this one, set
249
the environment variable MOC to the right one before running
250
configure.
251
])
252
])
253
 
254
AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
255
[
256
    AC_MSG_WARN([No Qt ui compiler (uic) found!
257
Please check whether you installed Qt correctly.
258
You need to have a running uic binary.
259
configure tried to run $ac_cv_path_uic and the test didn't
260
succeed. If configure shouldn't have tried this one, set
261
the environment variable UIC to the right one before running
262
configure.
263
])
264
])
265
 
266
 
267
AC_DEFUN([KDE_CHECK_UIC_FLAG],
268
[
269
    AC_MSG_CHECKING([whether uic supports -$1 ])
270
    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
271
    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
272
    [
273
        cat >conftest.ui <<EOT
274
        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
275
EOT
276
        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
277
        if AC_TRY_EVAL(ac_uic_testrun); then
278
            eval "kde_cv_prog_uic_$kde_cache=yes"
279
        else
280
            eval "kde_cv_prog_uic_$kde_cache=no"
281
        fi
282
        rm -f conftest*
283
    ])
284
 
285
    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
286
        AC_MSG_RESULT([yes])
287
        :
288
        $3
289
    else
290
        AC_MSG_RESULT([no])
291
        :
292
        $4
293
    fi
294
])
295
 
296
 
297
dnl ------------------------------------------------------------------------
298
dnl Find the meta object compiler and the ui compiler in the PATH,
299
dnl in $QTDIR/bin, and some more usual places
300
dnl ------------------------------------------------------------------------
301
dnl
302
AC_DEFUN([AC_PATH_QT_MOC_UIC],
303
[
304
   AC_REQUIRE([KDE_CHECK_PERL])
305
   qt_bindirs=""
306
   for dir in $kde_qt_dirs; do
307
      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
308
   done
309
   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
310
   if test ! "$ac_qt_bindir" = "NO"; then
311
      qt_bindirs="$ac_qt_bindir $qt_bindirs"
312
   fi
313
 
314
   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
315
   if test -z "$UIC_NOT_NEEDED"; then
316
     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
317
     if test -z "$UIC_PATH" ; then
318
       KDE_UIC_ERROR_MESSAGE
319
       exit 1
320
     else
321
       UIC=$UIC_PATH
322
 
323
       if test $kde_qtver = 3; then
324
         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
325
         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
326
 
327
         if test x$ac_uic_supports_libpath = xyes; then
328
             UIC="$UIC -L \$(kde_widgetdir)"
329
         fi
330
         if test x$ac_uic_supports_nounload = xyes; then
331
             UIC="$UIC -nounload"
332
         fi
333
       fi
334
     fi
335
   else
336
     UIC="echo uic not available: "
337
   fi
338
 
339
   AC_SUBST(MOC)
340
   AC_SUBST(UIC)
341
 
342
   UIC_TR="i18n"
343
   if test $kde_qtver = 3; then
344
     UIC_TR="tr2i18n"
345
   fi
346
 
347
   AC_SUBST(UIC_TR)
348
])
349
 
350
AC_DEFUN([KDE_1_CHECK_PATHS],
351
[
352
  KDE_1_CHECK_PATH_HEADERS
353
 
354
  KDE_TEST_RPATH=
355
 
356
  if test -n "$USE_RPATH"; then
357
 
358
     if test -n "$kde_libraries"; then
359
       KDE_TEST_RPATH="-R $kde_libraries"
360
     fi
361
 
362
     if test -n "$qt_libraries"; then
363
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
364
     fi
365
 
366
     if test -n "$x_libraries"; then
367
       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
368
     fi
369
 
370
     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
371
  fi
372
 
373
AC_MSG_CHECKING([for KDE libraries installed])
374
ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
375
 
376
if AC_TRY_EVAL(ac_link) && test -s conftest; then
377
  AC_MSG_RESULT(yes)
378
else
379
  AC_MSG_ERROR([your system fails at linking a small KDE application!
380
Check, if your compiler is installed correctly and if you have used the
381
same compiler to compile Qt and kdelibs as you did use now.
382
For more details about this problem, look at the end of config.log.])
383
fi
384
 
385
if eval `KDEDIR= ./conftest 2>&5`; then
386
  kde_result=done
387
else
388
  kde_result=problems
389
fi
390
 
391
KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392
kde_have_all_paths=yes
393
 
394
KDE_SET_PATHS($kde_result)
395
 
396
])
397
 
398
AC_DEFUN([KDE_SET_PATHS],
399
[
400
  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
401
	kde_htmldir=\"$kde_htmldir\" \
402
	kde_appsdir=\"$kde_appsdir\" \
403
	kde_icondir=\"$kde_icondir\" \
404
	kde_sounddir=\"$kde_sounddir\" \
405
	kde_datadir=\"$kde_datadir\" \
406
	kde_locale=\"$kde_locale\" \
407
	kde_cgidir=\"$kde_cgidir\" \
408
	kde_confdir=\"$kde_confdir\" \
409
	kde_kcfgdir=\"$kde_kcfgdir\" \
410
	kde_mimedir=\"$kde_mimedir\" \
411
	kde_toolbardir=\"$kde_toolbardir\" \
412
	kde_wallpaperdir=\"$kde_wallpaperdir\" \
413
	kde_templatesdir=\"$kde_templatesdir\" \
414
	kde_bindir=\"$kde_bindir\" \
415
	kde_servicesdir=\"$kde_servicesdir\" \
416
	kde_servicetypesdir=\"$kde_servicetypesdir\" \
417
	kde_moduledir=\"$kde_moduledir\" \
418
	kde_styledir=\"$kde_styledir\" \
419
	kde_widgetdir=\"$kde_widgetdir\" \
420
	xdg_appsdir=\"$xdg_appsdir\" \
421
	xdg_menudir=\"$xdg_menudir\" \
422
	xdg_directorydir=\"$xdg_directorydir\" \
423
	kde_result=$1"
424
])
425
 
426
AC_DEFUN([KDE_SET_DEFAULT_PATHS],
427
[
428
if test "$1" = "default"; then
429
 
430
  if test -z "$kde_htmldir"; then
431
    kde_htmldir='\${datadir}/doc/HTML'
432
  fi
433
  if test -z "$kde_appsdir"; then
434
    kde_appsdir='\${datadir}/applnk'
435
  fi
436
  if test -z "$kde_icondir"; then
437
    kde_icondir='\${datadir}/icons'
438
  fi
439
  if test -z "$kde_sounddir"; then
440
    kde_sounddir='\${datadir}/sounds'
441
  fi
442
  if test -z "$kde_datadir"; then
443
    kde_datadir='\${datadir}/apps'
444
  fi
445
  if test -z "$kde_locale"; then
446
    kde_locale='\${datadir}/locale'
447
  fi
448
  if test -z "$kde_cgidir"; then
449
    kde_cgidir='\${exec_prefix}/cgi-bin'
450
  fi
451
  if test -z "$kde_confdir"; then
452
    kde_confdir='\${datadir}/config'
453
  fi
454
  if test -z "$kde_kcfgdir"; then
455
    kde_kcfgdir='\${datadir}/config.kcfg'
456
  fi
457
  if test -z "$kde_mimedir"; then
458
    kde_mimedir='\${datadir}/mimelnk'
459
  fi
460
  if test -z "$kde_toolbardir"; then
461
    kde_toolbardir='\${datadir}/toolbar'
462
  fi
463
  if test -z "$kde_wallpaperdir"; then
464
    kde_wallpaperdir='\${datadir}/wallpapers'
465
  fi
466
  if test -z "$kde_templatesdir"; then
467
    kde_templatesdir='\${datadir}/templates'
468
  fi
469
  if test -z "$kde_bindir"; then
470
    kde_bindir='\${exec_prefix}/bin'
471
  fi
472
  if test -z "$kde_servicesdir"; then
473
    kde_servicesdir='\${datadir}/services'
474
  fi
475
  if test -z "$kde_servicetypesdir"; then
476
    kde_servicetypesdir='\${datadir}/servicetypes'
477
  fi
478
  if test -z "$kde_moduledir"; then
479
    if test "$kde_qtver" = "2"; then
480
      kde_moduledir='\${libdir}/kde2'
481
    else
482
      kde_moduledir='\${libdir}/kde3'
483
    fi
484
  fi
485
  if test -z "$kde_styledir"; then
486
    kde_styledir='\${libdir}/kde3/plugins/styles'
487
  fi
488
  if test -z "$kde_widgetdir"; then
489
    kde_widgetdir='\${libdir}/kde3/plugins/designer'
490
  fi
491
  if test -z "$xdg_appsdir"; then
492
    xdg_appsdir='\${datadir}/applications/kde'
493
  fi
494
  if test -z "$xdg_menudir"; then
495
    xdg_menudir='\${sysconfdir}/xdg/menus'
496
  fi
497
  if test -z "$xdg_directorydir"; then
498
    xdg_directorydir='\${datadir}/desktop-directories'
499
  fi
500
 
501
  KDE_SET_PATHS(defaults)
502
 
503
else
504
 
505
  if test $kde_qtver = 1; then
506
     AC_MSG_RESULT([compiling])
507
     KDE_1_CHECK_PATHS
508
  else
509
     AC_MSG_ERROR([path checking not yet supported for KDE 2])
510
  fi
511
 
512
fi
513
])
514
 
515
AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
516
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
517
   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
518
   test -z "$kde_datadir" || test -z "$kde_locale"  ||
519
   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
520
   test -z "$kde_kcfgdir" ||
521
   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
522
   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
523
   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
524
   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
525
   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
526
   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
527
   test "x$kde_have_all_paths" != "xyes"; then
528
     kde_have_all_paths=no
529
  fi
530
])
531
 
532
AC_DEFUN([KDE_MISSING_PROG_ERROR],
533
[
534
    AC_MSG_ERROR([The important program $1 was not found!
535
Please check whether you installed KDE correctly.
536
])
537
])
538
 
539
AC_DEFUN([KDE_MISSING_ARTS_ERROR],
540
[
541
    AC_MSG_ERROR([The important program $1 was not found!
542
Please check whether you installed aRts correctly or use
543
--without-arts to compile without aRts support (this will remove functionality).
544
])
545
])
546
 
547
AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
548
[
549
    kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
550
    test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
551
    if test -n "$KDEDIRS"; then
552
       kde_save_IFS=$IFS
553
       IFS=:
554
       for dir in $KDEDIRS; do
555
            kde_default_bindirs="$dir/bin $kde_default_bindirs "
556
       done
557
       IFS=$kde_save_IFS
558
    fi
559
])
560
 
561
AC_DEFUN([KDE_SUBST_PROGRAMS],
562
[
563
    AC_ARG_WITH(arts,
564
        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565
        [build_arts=$withval],
566
        [build_arts=yes]
567
    )
568
    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
569
    if test "$build_arts" = "no"; then
570
        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
571
    fi
572
 
573
        KDE_SET_DEFAULT_BINDIRS
574
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577
        if test "$build_arts" '!=' "no"; then
578
          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579
          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
580
        fi
581
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
582
 
583
        kde32ornewer=1
584
        kde33ornewer=1
585
        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
586
            kde32ornewer=
587
            kde33ornewer=
588
        else
589
            if test "$kde_qtver" = "3"; then
590
              if test "$kde_qtsubver" -le 1; then
591
                kde32ornewer=
592
              fi
593
              if test "$kde_qtsubver" -le 2; then
594
                kde33ornewer=
595
              fi
596
              if test "$KDECONFIG" != "compiled"; then
597
                if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
598
                  kde33ornewer=
599
                fi
600
              fi
601
            fi
602
        fi
603
 
604
        if test -n "$kde32ornewer"; then
605
            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
606
            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
607
        fi
608
        if test -n "$kde33ornewer"; then
609
            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
610
            AC_SUBST(MAKEKDEWIDGETS)
611
        fi
612
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
613
 
614
        if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
615
 	    kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
616
            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
617
            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
618
	    if test "$KDE_XSL_STYLESHEET" = "NO"; then
619
		KDE_XSL_STYLESHEET=""
620
	    else
621
                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
622
	    fi
623
        fi
624
 
625
        DCOP_DEPENDENCIES='$(DCOPIDL)'
626
        if test -n "$kde32ornewer"; then
627
            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
628
            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
629
            AC_SUBST(KCONFIG_COMPILER)
630
            AC_SUBST(KCFG_DEPENDENCIES)
631
            AC_SUBST(DCOPIDLNG)
632
        fi
633
        AC_SUBST(DCOPIDL)
634
        AC_SUBST(DCOPIDL2CPP)
635
        AC_SUBST(DCOP_DEPENDENCIES)
636
        AC_SUBST(MCOPIDL)
637
        AC_SUBST(ARTSCCONFIG)
638
	AC_SUBST(MEINPROC)
639
 	AC_SUBST(KDE_XSL_STYLESHEET)
640
	AC_SUBST(XMLLINT)
641
])dnl
642
 
643
AC_DEFUN([AC_CREATE_KFSSTND],
644
[
645
AC_REQUIRE([AC_CHECK_RPATH])
646
 
647
AC_MSG_CHECKING([for KDE paths])
648
kde_result=""
649
kde_cached_paths=yes
650
AC_CACHE_VAL(kde_cv_all_paths,
651
[
652
  KDE_SET_DEFAULT_PATHS($1)
653
  kde_cached_paths=no
654
])
655
eval "$kde_cv_all_paths"
656
KDE_CHECK_PATHS_FOR_COMPLETENESS
657
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
658
  # wrong values were cached, may be, we can set better ones
659
  kde_result=
660
  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
661
  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
662
  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
663
  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
664
  kde_have_all_paths=
665
  kde_styledir=
666
  kde_widgetdir=
667
  xdg_appsdir = xdg_menudir= xdg_directorydir= 
668
  KDE_SET_DEFAULT_PATHS($1)
669
  eval "$kde_cv_all_paths"
670
  KDE_CHECK_PATHS_FOR_COMPLETENESS
671
  kde_result="$kde_result (cache overridden)"
672
fi
673
if test "$kde_have_all_paths" = "no"; then
674
  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
675
Since it had compiled and linked before, it must be a strange problem on your system.
676
Look at config.log for details. If you are not able to fix this, look at
677
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
678
(If you're using an egcs version on Linux, you may update binutils!)
679
])
680
else
681
  rm -f conftest*
682
  AC_MSG_RESULT($kde_result)
683
fi
684
 
685
bindir=$kde_bindir
686
 
687
KDE_SUBST_PROGRAMS
688
 
689
])
690
 
691
AC_DEFUN([AC_SUBST_KFSSTND],
692
[
693
AC_SUBST(kde_htmldir)
694
AC_SUBST(kde_appsdir)
695
AC_SUBST(kde_icondir)
696
AC_SUBST(kde_sounddir)
697
AC_SUBST(kde_datadir)
698
AC_SUBST(kde_locale)
699
AC_SUBST(kde_confdir)
700
AC_SUBST(kde_kcfgdir)
701
AC_SUBST(kde_mimedir)
702
AC_SUBST(kde_wallpaperdir)
703
AC_SUBST(kde_bindir)
704
dnl X Desktop Group standards
705
AC_SUBST(xdg_appsdir)
706
AC_SUBST(xdg_menudir)
707
AC_SUBST(xdg_directorydir)
708
dnl for KDE 2
709
AC_SUBST(kde_templatesdir)
710
AC_SUBST(kde_servicesdir)
711
AC_SUBST(kde_servicetypesdir)
712
AC_SUBST(kde_moduledir)
713
AC_SUBST(kdeinitdir, '$(kde_moduledir)')
714
AC_SUBST(kde_styledir)
715
AC_SUBST(kde_widgetdir)
716
if test "$kde_qtver" = 1; then
717
  kde_minidir="$kde_icondir/mini"
718
else
719
# for KDE 1 - this breaks KDE2 apps using minidir, but
720
# that's the plan ;-/
721
  kde_minidir="/dev/null"
722
fi
723
dnl AC_SUBST(kde_minidir)
724
dnl AC_SUBST(kde_cgidir)
725
dnl AC_SUBST(kde_toolbardir)
726
])
727
 
728
AC_DEFUN([KDE_MISC_TESTS],
729
[
730
   dnl Checks for libraries.
731
   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
732
   AC_SUBST(LIBUTIL)
733
   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
734
   AC_SUBST(LIBCOMPAT)
735
   kde_have_crypt=
736
   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
737
      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
738
        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
739
You should install libcrypt from another source or configure with PAM
740
support])
741
	kde_have_crypt=no
742
      ]))
743
   AC_SUBST(LIBCRYPT)
744
   if test $kde_have_crypt = yes; then
745
      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
746
   fi
747
   AC_CHECK_SOCKLEN_T
748
   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
749
   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
750
      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
751
        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
752
   fi
753
   AC_CHECK_FUNC(inet_ntoa)
754
   if test $ac_cv_func_inet_ntoa = no; then
755
     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
756
   fi
757
   AC_CHECK_FUNC(connect)
758
   if test $ac_cv_func_connect = no; then
759
      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
760
        $X_EXTRA_LIBS)
761
   fi
762
 
763
   AC_CHECK_FUNC(remove)
764
   if test $ac_cv_func_remove = no; then
765
      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
766
   fi
767
 
768
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
769
   AC_CHECK_FUNC(shmat, ,
770
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
155 andreas 771
 
88 andreas 772
   # more headers that need to be explicitly included on darwin
773
   AC_CHECK_HEADERS(sys/types.h stdint.h)
774
 
775
   # sys/bitypes.h is needed for uint32_t and friends on Tru64
776
   AC_CHECK_HEADERS(sys/bitypes.h)
777
 
778
   # darwin requires a poll emulation library
779
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
780
 
781
   # for some image handling on Mac OS X
782
   AC_CHECK_HEADERS(Carbon/Carbon.h)
783
 
155 andreas 784
   # Geodetic library
785
   AC_CHECK_HEADER(gdal/gdal.h, [
786
     AC_DEFINE(HAVE_GDAL, 1, [Define if you have the GDAL API])
787
   ])
788
 
789
   AC_CHECK_FUNC(GDALAllRegister, ,
790
     AC_CHECK_LIB(gdal1.5.0, GDALAllRegister, [], [ echo "ERROR: GDAL library v1.5.0 was not found!" ]))
791
 
88 andreas 792
   # CoreAudio framework
793
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
794
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
795
     FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
796
   ])
797
 
798
   AC_CHECK_RES_INIT
799
   AC_SUBST(LIB_POLL)
800
   AC_SUBST(FRAMEWORK_COREAUDIO)
801
   LIBSOCKET="$X_EXTRA_LIBS"
802
   AC_SUBST(LIBSOCKET)
803
   AC_SUBST(X_EXTRA_LIBS)
804
   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
805
   AC_SUBST(LIBUCB)
806
 
807
   case $host in  dnl this *is* LynxOS specific
808
   *-*-lynxos* )
809
        AC_MSG_CHECKING([LynxOS header file wrappers])
810
        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
811
        AC_MSG_RESULT(disabled)
812
        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
813
         ;;
814
    esac
815
 
816
   KDE_CHECK_TYPES
817
   KDE_CHECK_LIBDL
818
   KDE_CHECK_STRLCPY
819
   KDE_CHECK_PIE_SUPPORT
820
 
821
# darwin needs this to initialize the environment
822
AC_CHECK_HEADERS(crt_externs.h)
823
AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
824
 
825
AH_VERBATIM(_DARWIN_ENVIRON,
826
[
827
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
828
# include <sys/time.h>
829
# include <crt_externs.h>
830
# define environ (*_NSGetEnviron())
831
#endif
832
])
833
 
834
AH_VERBATIM(_AIX_STRINGS_H_BZERO,
835
[
836
/*
837
 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
838
 * that defines bzero.
839
 */
840
 
841
#if defined(_AIX)
842
#include <strings.h>
843
#endif
844
])
845
 
846
AC_CHECK_FUNCS([vsnprintf snprintf])
847
 
848
AH_VERBATIM(_TRU64,[
849
/*
850
 * On HP-UX, the declaration of vsnprintf() is needed every time !
851
 */
852
 
853
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
854
#if __STDC__
855
#include <stdarg.h>
856
#include <stdlib.h>
857
#else
858
#include <varargs.h>
859
#endif
860
#ifdef __cplusplus
861
extern "C"
862
#endif
863
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
864
#ifdef __cplusplus
865
extern "C"
866
#endif
867
int snprintf(char *str, size_t n, char const *fmt, ...);
868
#endif
869
])
870
 
871
])
872
 
873
dnl ------------------------------------------------------------------------
874
dnl Find the header files and libraries for X-Windows. Extended the
875
dnl macro AC_PATH_X
876
dnl ------------------------------------------------------------------------
877
dnl
878
AC_DEFUN([K_PATH_X],
879
[
880
AC_REQUIRE([KDE_MISC_TESTS])dnl
881
AC_REQUIRE([KDE_CHECK_LIB64])
882
 
883
AC_ARG_ENABLE(
884
  embedded,
885
  AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
886
  kde_use_qt_emb=$enableval,
887
  kde_use_qt_emb=no
888
)
889
 
890
AC_ARG_ENABLE(
891
  qtopia,
892
  AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
893
  kde_use_qt_emb_palm=$enableval,
894
  kde_use_qt_emb_palm=no
895
)
896
 
897
AC_ARG_ENABLE(
898
  mac,
899
  AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
900
  kde_use_qt_mac=$enableval,
901
  kde_use_qt_mac=no
902
)
903
 
904
# used to disable x11-specific stuff on special platforms
905
AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
906
 
907
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
908
 
909
AC_MSG_CHECKING(for X)
910
 
911
AC_CACHE_VAL(kde_cv_have_x,
912
[# One or both of the vars are not set, and there is no cached value.
913
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
914
   kde_x_includes=NO
915
else
916
   kde_x_includes=$x_includes
917
fi
918
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
919
   kde_x_libraries=NO
920
else
921
   kde_x_libraries=$x_libraries
922
fi
923
 
924
# below we use the standard autoconf calls
925
ac_x_libraries=$kde_x_libraries
926
ac_x_includes=$kde_x_includes
927
 
928
KDE_PATH_X_DIRECT
929
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
930
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
931
dnl location. The correct location is /usr/lib32 or an undefined value
932
dnl (the linker is smart enough to pick the correct default library).
933
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
934
dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
935
dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
936
dnl x_includes should be left alone.
937
case "$host" in
938
mips-sgi-irix6*)
939
  ;;
940
*-*-solaris*)
941
  ;;
942
*)
943
  _AC_PATH_X_XMKMF
944
  if test -z "$ac_x_includes"; then
945
    ac_x_includes="."
946
  fi
947
  if test -z "$ac_x_libraries"; then
948
    ac_x_libraries="/usr/lib${kdelibsuff}"
949
  fi
950
esac
951
#from now on we use our own again
952
 
953
# when the user already gave --x-includes, we ignore
954
# what the standard autoconf macros told us.
955
if test "$kde_x_includes" = NO; then
956
  kde_x_includes=$ac_x_includes
957
fi
958
 
959
# for --x-libraries too
960
if test "$kde_x_libraries" = NO; then
961
  kde_x_libraries=$ac_x_libraries
962
fi
963
 
964
if test "$kde_x_includes" = NO; then
965
  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
966
fi
967
 
968
if test "$kde_x_libraries" = NO; then
969
  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
970
fi
971
 
972
# Record where we found X for the cache.
973
kde_cv_have_x="have_x=yes \
974
         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
975
])dnl
976
 
977
eval "$kde_cv_have_x"
978
 
979
if test "$have_x" != yes; then
980
  AC_MSG_RESULT($have_x)
981
  no_x=yes
982
else
983
  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
984
fi
985
 
986
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
987
  X_INCLUDES=""
988
  x_includes="."; dnl better than nothing :-
989
 else
990
  x_includes=$kde_x_includes
991
  X_INCLUDES="-I$x_includes"
992
fi
993
 
994
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
995
  X_LDFLAGS=""
996
  x_libraries="/usr/lib"; dnl better than nothing :-
997
 else
998
  x_libraries=$kde_x_libraries
999
  X_LDFLAGS="-L$x_libraries"
1000
fi
1001
all_includes="$X_INCLUDES"
1002
all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
1003
 
1004
# Check for libraries that X11R6 Xt/Xaw programs need.
1005
ac_save_LDFLAGS="$LDFLAGS"
1006
LDFLAGS="$LDFLAGS $X_LDFLAGS"
1007
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1008
# check for ICE first), but we must link in the order -lSM -lICE or
1009
# we get undefined symbols.  So assume we have SM if we have ICE.
1010
# These have to be linked with before -lX11, unlike the other
1011
# libraries we check for below, so use a different variable.
1012
#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1013
AC_CHECK_LIB(ICE, IceConnectionNumber,
1014
  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
1015
LDFLAGS="$ac_save_LDFLAGS"
1016
 
1017
LIB_X11='-lX11 $(LIBSOCKET)'
1018
 
1019
AC_MSG_CHECKING(for libXext)
1020
AC_CACHE_VAL(kde_cv_have_libXext,
1021
[
1022
kde_ldflags_safe="$LDFLAGS"
1023
kde_libs_safe="$LIBS"
1024
 
1025
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1026
LIBS="-lXext -lX11 $LIBSOCKET"
1027
 
1028
AC_TRY_LINK([
1029
#include <stdio.h>
1030
#ifdef STDC_HEADERS
1031
# include <stdlib.h>
1032
#endif
1033
],
1034
[
1035
printf("hello Xext\n");
1036
],
1037
kde_cv_have_libXext=yes,
1038
kde_cv_have_libXext=no
1039
)
1040
 
1041
LDFLAGS=$kde_ldflags_safe
1042
LIBS=$kde_libs_safe
1043
])
1044
 
1045
AC_MSG_RESULT($kde_cv_have_libXext)
1046
 
1047
if test "$kde_cv_have_libXext" = "no"; then
1048
  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1049
can't find it itself, we stop here assuming that make wouldn't find
1050
them either.])
1051
fi
1052
 
1053
LIB_XEXT="-lXext"
1054
QTE_NORTTI=""
1055
 
1056
elif test "$kde_use_qt_emb" = "yes"; then
1057
  dnl We're using QT Embedded
1058
  CPPFLAGS=-DQWS
1059
  CXXFLAGS="$CXXFLAGS -fno-rtti"
1060
  QTE_NORTTI="-fno-rtti -DQWS"
1061
  X_PRE_LIBS=""
1062
  LIB_X11=""
1063
  LIB_XEXT=""
1064
  LIB_XRENDER=""
1065
  LIBSM=""
1066
  X_INCLUDES=""
1067
  X_LDFLAGS=""
1068
  x_includes=""
1069
  x_libraries=""
1070
elif test "$kde_use_qt_mac" = "yes"; then
1071
  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1072
  dnl be included to get the information) --Sam
1073
  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1074
  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1075
  X_PRE_LIBS=""
1076
  LIB_X11=""
1077
  LIB_XEXT=""
1078
  LIB_XRENDER=""
1079
  LIBSM=""
1080
  X_INCLUDES=""
1081
  X_LDFLAGS=""
1082
  x_includes=""
1083
  x_libraries=""
1084
fi
1085
AC_SUBST(X_PRE_LIBS)
1086
AC_SUBST(LIB_X11)
1087
AC_SUBST(LIB_XRENDER)
1088
AC_SUBST(LIBSM)
1089
AC_SUBST(X_INCLUDES)
1090
AC_SUBST(X_LDFLAGS)
1091
AC_SUBST(x_includes)
1092
AC_SUBST(x_libraries)
1093
AC_SUBST(QTE_NORTTI)
1094
AC_SUBST(LIB_XEXT)
1095
 
1096
])
1097
 
1098
AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1099
[
1100
AC_REQUIRE([KDE_USE_QT])
1101
cat > conftest.$ac_ext <<EOF
1102
#include "confdefs.h"
1103
#include <qglobal.h>
1104
#include <qapplication.h>
1105
EOF
1106
if test "$kde_qtver" = "2"; then
1107
cat >> conftest.$ac_ext <<EOF
1108
#include <qevent.h>
1109
#include <qstring.h>
1110
#include <qstyle.h>
1111
EOF
1112
 
1113
if test $kde_qtsubver -gt 0; then
1114
cat >> conftest.$ac_ext <<EOF
1115
#if QT_VERSION < 210
1116
#error 1
1117
#endif
1118
EOF
1119
fi
1120
fi
1121
 
1122
if test "$kde_qtver" = "3"; then
1123
cat >> conftest.$ac_ext <<EOF
1124
#include <qcursor.h>
1125
#include <qstylefactory.h>
1126
#include <private/qucomextra_p.h>
1127
EOF
1128
fi
1129
 
1130
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1131
cat >> conftest.$ac_ext <<EOF
1132
#error 1
1133
#endif
1134
 
1135
int main() {
1136
EOF
1137
if test "$kde_qtver" = "2"; then
1138
cat >> conftest.$ac_ext <<EOF
1139
    QStringList *t = new QStringList();
1140
    Q_UNUSED(t);
1141
EOF
1142
if test $kde_qtsubver -gt 0; then
1143
cat >> conftest.$ac_ext <<EOF
1144
    QString s;
1145
    s.setLatin1("Elvis is alive", 14);
1146
EOF
1147
fi
1148
fi
1149
if test "$kde_qtver" = "3"; then
1150
cat >> conftest.$ac_ext <<EOF
1151
    (void)QStyleFactory::create(QString::null);
1152
    QCursor c(Qt::WhatsThisCursor);
1153
EOF
1154
fi
1155
cat >> conftest.$ac_ext <<EOF
1156
    return 0;
1157
}
1158
EOF
1159
])
1160
 
1161
AC_DEFUN([KDE_USE_QT],
1162
[
1163
if test -z "$1"; then
1164
  # Current default Qt version: 3.3
1165
  kde_qtver=3
1166
  kde_qtsubver=3
1167
else
1168
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1169
  # following is the check if subversion isnt found in passed argument
1170
  if test "$kde_qtsubver" = "$1"; then
1171
    kde_qtsubver=1
1172
  fi
1173
  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1174
  if test "$kde_qtver" = "1"; then
1175
    kde_qtsubver=42
1176
  fi
1177
fi
1178
 
1179
if test -z "$2"; then
1180
  if test "$kde_qtver" = "2"; then
1181
    if test $kde_qtsubver -gt 0; then
1182
      kde_qt_minversion=">= Qt 2.2.2"
1183
    else
1184
      kde_qt_minversion=">= Qt 2.0.2"
1185
    fi
1186
  fi
1187
  if test "$kde_qtver" = "3"; then
1188
    if test $kde_qtsubver -gt 0; then
1189
	 if test $kde_qtsubver -gt 1; then
1190
	    if test $kde_qtsubver -gt 2; then
1191
		kde_qt_minversion=">= Qt 3.3 and < 4.0"
1192
	    else
1193
	        kde_qt_minversion=">= Qt 3.2 and < 4.0"
1194
	    fi
1195
	 else
1196
            kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
1197
         fi
1198
    else
1199
      kde_qt_minversion=">= Qt 3.0 and < 4.0"
1200
    fi
1201
  fi
1202
  if test "$kde_qtver" = "1"; then
1203
    kde_qt_minversion=">= 1.42 and < 2.0"
1204
  fi
1205
else
1206
   kde_qt_minversion="$2"
1207
fi
1208
 
1209
if test -z "$3"; then
1210
   if test $kde_qtver = 3; then
1211
     if test $kde_qtsubver -gt 0; then
1212
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
1213
       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1214
       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1215
     else
1216
       kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
1217
     fi
1218
   fi
1219
   if test $kde_qtver = 2; then
1220
     if test $kde_qtsubver -gt 0; then
1221
       kde_qt_verstring="QT_VERSION >= 222"
1222
     else
1223
       kde_qt_verstring="QT_VERSION >= 200"
1224
     fi
1225
   fi
1226
   if test $kde_qtver = 1; then
1227
    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1228
   fi
1229
else
1230
   kde_qt_verstring="$3"
1231
fi
1232
 
1233
if test $kde_qtver = 4; then
1234
  kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
1235
fi
1236
if test $kde_qtver = 3; then
1237
  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1238
fi
1239
if test $kde_qtver = 2; then
1240
   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1241
fi
1242
if test $kde_qtver = 1; then
1243
   kde_qt_dirs="$QTDIR /usr/lib/qt"
1244
fi
1245
])
1246
 
1247
AC_DEFUN([KDE_CHECK_QT_DIRECT],
1248
[
1249
AC_REQUIRE([KDE_USE_QT])
1250
AC_MSG_CHECKING([if Qt compiles without flags])
1251
AC_CACHE_VAL(kde_cv_qt_direct,
1252
[
1253
AC_LANG_SAVE
1254
AC_LANG_CPLUSPLUS
1255
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1256
ac_LIBRARY_PATH="$LIBRARY_PATH"
1257
ac_cxxflags_safe="$CXXFLAGS"
1258
ac_ldflags_safe="$LDFLAGS"
1259
ac_libs_safe="$LIBS"
1260
 
1261
CXXFLAGS="$CXXFLAGS -I$qt_includes"
1262
LDFLAGS="$LDFLAGS $X_LDFLAGS"
1263
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1264
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1265
else
1266
LIBS="$LIBQT $LIBSOCKET"
1267
fi
1268
LD_LIBRARY_PATH=
1269
export LD_LIBRARY_PATH
1270
LIBRARY_PATH=
1271
export LIBRARY_PATH
1272
 
1273
KDE_PRINT_QT_PROGRAM
1274
 
1275
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1276
  kde_cv_qt_direct="yes"
1277
else
1278
  kde_cv_qt_direct="no"
1279
  echo "configure: failed program was:" >&AC_FD_CC
1280
  cat conftest.$ac_ext >&AC_FD_CC
1281
fi
1282
 
1283
rm -f conftest*
1284
CXXFLAGS="$ac_cxxflags_safe"
1285
LDFLAGS="$ac_ldflags_safe"
1286
LIBS="$ac_libs_safe"
1287
 
1288
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1289
export LD_LIBRARY_PATH
1290
LIBRARY_PATH="$ac_LIBRARY_PATH"
1291
export LIBRARY_PATH
1292
AC_LANG_RESTORE
1293
])
1294
 
1295
if test "$kde_cv_qt_direct" = "yes"; then
1296
  AC_MSG_RESULT(yes)
1297
  $1
1298
else
1299
  AC_MSG_RESULT(no)
1300
  $2
1301
fi
1302
])
1303
 
1304
dnl ------------------------------------------------------------------------
1305
dnl Try to find the Qt headers and libraries.
1306
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1307
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1308
dnl ------------------------------------------------------------------------
1309
dnl
1310
AC_DEFUN([AC_PATH_QT_1_3],
1311
[
1312
AC_REQUIRE([K_PATH_X])
1313
AC_REQUIRE([KDE_USE_QT])
1314
AC_REQUIRE([KDE_CHECK_LIB64])
1315
 
1316
dnl ------------------------------------------------------------------------
1317
dnl Add configure flag to enable linking to MT version of Qt library.
1318
dnl ------------------------------------------------------------------------
1319
 
1320
AC_ARG_ENABLE(
1321
  mt,
1322
  AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1323
  kde_use_qt_mt=$enableval,
1324
  [
1325
    if test $kde_qtver = 3; then
1326
      kde_use_qt_mt=yes
1327
    else
1328
      kde_use_qt_mt=no
1329
    fi
1330
  ]
1331
)
1332
 
1333
USING_QT_MT=""
1334
 
1335
dnl ------------------------------------------------------------------------
1336
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1337
dnl ------------------------------------------------------------------------
1338
 
1339
KDE_MT_LDFLAGS=
1340
KDE_MT_LIBS=
1341
if test "x$kde_use_qt_mt" = "xyes"; then
1342
  KDE_CHECK_THREADING
1343
  if test "x$kde_use_threading" = "xyes"; then
1344
    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1345
    KDE_MT_LDFLAGS="$USE_THREADS"
1346
    KDE_MT_LIBS="$LIBPTHREAD"
1347
  else
1348
    kde_use_qt_mt=no
1349
  fi
1350
fi
1351
AC_SUBST(KDE_MT_LDFLAGS)
1352
AC_SUBST(KDE_MT_LIBS)
1353
 
1354
kde_qt_was_given=yes
1355
 
1356
dnl ------------------------------------------------------------------------
1357
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1358
dnl ------------------------------------------------------------------------
1359
if test -z "$LIBQT_GLOB"; then
1360
  if test "x$kde_use_qt_emb" = "xyes"; then
1361
    LIBQT_GLOB="libqte.*"
1362
  else
1363
    LIBQT_GLOB="libqt.*"
1364
  fi
1365
fi
1366
 
1367
dnl ------------------------------------------------------------
1368
dnl If we got --enable-embedded then adjust the Qt library name.
1369
dnl ------------------------------------------------------------
1370
if test "x$kde_use_qt_emb" = "xyes"; then
1371
  qtlib="qte"
1372
else
1373
  qtlib="qt"
1374
fi
1375
 
1376
kde_int_qt="-l$qtlib"
1377
 
1378
if test -z "$LIBQPE"; then
1379
dnl ------------------------------------------------------------
1380
dnl If we got --enable-palmtop then add -lqpe to the link line
1381
dnl ------------------------------------------------------------
1382
  if test "x$kde_use_qt_emb" = "xyes"; then
1383
    if test "x$kde_use_qt_emb_palm" = "xyes"; then
1384
      LIB_QPE="-lqpe"
1385
    else
1386
      LIB_QPE=""
1387
    fi
1388
  else
1389
    LIB_QPE=""
1390
  fi
1391
fi
1392
 
1393
dnl ------------------------------------------------------------------------
1394
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1395
dnl ------------------------------------------------------------------------
1396
 
1397
if test "x$kde_use_qt_mt" = "xyes"; then
1398
  LIBQT="-l$qtlib-mt"
1399
  kde_int_qt="-l$qtlib-mt"
1400
  LIBQT_GLOB="lib$qtlib-mt.*"
1401
  USING_QT_MT="using -mt"
1402
else
1403
  LIBQT="-l$qtlib"
1404
fi
1405
 
1406
if test $kde_qtver != 1; then
1407
 
1408
  AC_REQUIRE([AC_FIND_PNG])
1409
  AC_REQUIRE([AC_FIND_JPEG])
1410
  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1411
fi
1412
 
1413
if test $kde_qtver = 3; then
1414
  AC_REQUIRE([KDE_CHECK_LIBDL])
1415
  LIBQT="$LIBQT $LIBDL"
1416
fi
1417
 
1418
AC_MSG_CHECKING([for Qt])
1419
 
1420
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1421
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1422
fi
1423
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1424
qt_libraries=""
1425
qt_includes=""
1426
AC_ARG_WITH(qt-dir,
1427
    AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1428
    [  ac_qt_includes="$withval"/include
1429
       ac_qt_libraries="$withval"/lib${kdelibsuff}
1430
       ac_qt_bindir="$withval"/bin
1431
    ])
1432
 
1433
AC_ARG_WITH(qt-includes,
1434
    AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1435
    [
1436
       ac_qt_includes="$withval"
1437
    ])
1438
 
1439
kde_qt_libs_given=no
1440
 
1441
AC_ARG_WITH(qt-libraries,
1442
    AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1443
    [  ac_qt_libraries="$withval"
1444
       kde_qt_libs_given=yes
1445
    ])
1446
 
1447
AC_CACHE_VAL(ac_cv_have_qt,
1448
[#try to guess Qt locations
1449
 
1450
qt_incdirs=""
1451
for dir in $kde_qt_dirs; do
1452
   qt_incdirs="$qt_incdirs $dir/include $dir"
1453
done
1454
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"
1455
if test ! "$ac_qt_includes" = "NO"; then
1456
   qt_incdirs="$ac_qt_includes $qt_incdirs"
1457
fi
1458
 
1459
if test "$kde_qtver" != "1"; then
1460
  kde_qt_header=qstyle.h
1461
else
1462
  kde_qt_header=qglobal.h
1463
fi
1464
 
1465
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1466
ac_qt_includes="$qt_incdir"
1467
 
1468
qt_libdirs=""
1469
for dir in $kde_qt_dirs; do
1470
   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1471
done
1472
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1473
if test ! "$ac_qt_libraries" = "NO"; then
1474
  qt_libdir=$ac_qt_libraries
1475
else
1476
  qt_libdirs="$ac_qt_libraries $qt_libdirs"
1477
  # if the Qt was given, the chance is too big that libqt.* doesn't exist
1478
  qt_libdir=NONE
1479
  for dir in $qt_libdirs; do
1480
    try="ls -1 $dir/${LIBQT_GLOB}"
1481
    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1482
  done
1483
fi
1484
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1485
  if test -e "$a"; then
1486
    LIBQT="$LIBQT ${kde_int_qt}_incremental"
1487
    break
1488
  fi
1489
done
1490
 
1491
ac_qt_libraries="$qt_libdir"
1492
 
1493
AC_LANG_SAVE
1494
AC_LANG_CPLUSPLUS
1495
 
1496
ac_cxxflags_safe="$CXXFLAGS"
1497
ac_ldflags_safe="$LDFLAGS"
1498
ac_libs_safe="$LIBS"
1499
 
1500
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1501
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1502
LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1503
 
1504
KDE_PRINT_QT_PROGRAM
1505
 
1506
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1507
  rm -f conftest*
1508
else
1509
  echo "configure: failed program was:" >&AC_FD_CC
1510
  cat conftest.$ac_ext >&AC_FD_CC
1511
  ac_qt_libraries="NO"
1512
fi
1513
rm -f conftest*
1514
CXXFLAGS="$ac_cxxflags_safe"
1515
LDFLAGS="$ac_ldflags_safe"
1516
LIBS="$ac_libs_safe"
1517
 
1518
AC_LANG_RESTORE
1519
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1520
  ac_cv_have_qt="have_qt=no"
1521
  ac_qt_notfound=""
1522
  missing_qt_mt=""
1523
  if test "$ac_qt_includes" = NO; then
1524
    if test "$ac_qt_libraries" = NO; then
1525
      ac_qt_notfound="(headers and libraries)";
1526
    else
1527
      ac_qt_notfound="(headers)";
1528
    fi
1529
  else
1530
    if test "x$kde_use_qt_mt" = "xyes"; then
1531
       missing_qt_mt="
1532
Make sure that you have compiled Qt with thread support!"
1533
       ac_qt_notfound="(library $qtlib-mt)";
1534
    else
1535
       ac_qt_notfound="(library $qtlib)";
1536
    fi
1537
  fi
1538
 
1539
  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1540
For more details about this problem, look at the end of config.log.$missing_qt_mt])
1541
else
1542
  have_qt="yes"
1543
fi
1544
])
1545
 
1546
eval "$ac_cv_have_qt"
1547
 
1548
if test "$have_qt" != yes; then
1549
  AC_MSG_RESULT([$have_qt]);
1550
else
1551
  ac_cv_have_qt="have_qt=yes \
1552
    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1553
  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1554
 
1555
  qt_libraries="$ac_qt_libraries"
1556
  qt_includes="$ac_qt_includes"
1557
fi
1558
 
1559
if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1560
     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1561
fi
1562
 
1563
AC_SUBST(qt_libraries)
1564
AC_SUBST(qt_includes)
1565
 
1566
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1567
 QT_INCLUDES=""
1568
else
1569
 QT_INCLUDES="-I$qt_includes"
1570
 all_includes="$QT_INCLUDES $all_includes"
1571
fi
1572
 
1573
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1574
 QT_LDFLAGS=""
1575
else
1576
 QT_LDFLAGS="-L$qt_libraries"
1577
 all_libraries="$QT_LDFLAGS $all_libraries"
1578
fi
1579
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1580
 
1581
AC_SUBST(QT_INCLUDES)
1582
AC_SUBST(QT_LDFLAGS)
1583
AC_PATH_QT_MOC_UIC
1584
 
1585
KDE_CHECK_QT_JPEG
1586
 
1587
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1588
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1589
else
1590
LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1591
fi
1592
test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1593
for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1594
  if test -e "$a"; then
1595
     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1596
     break
1597
  fi
1598
done
1599
 
1600
AC_SUBST(LIB_QT)
1601
AC_SUBST(LIB_QPE)
1602
 
1603
AC_SUBST(kde_qtver)
1604
])
1605
 
1606
AC_DEFUN([AC_PATH_QT],
1607
[
1608
AC_PATH_QT_1_3
1609
])
1610
 
1611
AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1612
[
1613
AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1614
 
1615
if test x$ac_uic_supports_libpath = xyes; then
1616
 
1617
AC_MSG_CHECKING([if UIC has KDE plugins available])
1618
AC_CACHE_VAL(kde_cv_uic_plugins,
1619
[
1620
cat > actest.ui << EOF
1621
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1622
<class>NewConnectionDialog</class>
1623
<widget class="QDialog">
1624
   <widget class="KLineEdit">
1625
        <property name="name">
1626
           <cstring>testInput</cstring>
1627
        </property>
1628
   </widget>
1629
</widget>
1630
</UI>
1631
EOF
1632
 
1633
 
1634
 
1635
kde_cv_uic_plugins=no
1636
kde_line="$UIC_PATH -L $kde_widgetdir"
1637
if test x$ac_uic_supports_nounload = xyes; then
1638
   kde_line="$kde_line -nounload"
1639
fi
1640
kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1641
if AC_TRY_EVAL(kde_line); then
1642
	# if you're trying to debug this check and think it's incorrect,
1643
	# better check your installation. The check _is_ correct - your
1644
	# installation is not.
1645
	if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1646
		kde_cv_uic_plugins=yes
1647
	fi
1648
fi
1649
rm -f actest.ui actest.cpp
1650
])
1651
 
1652
AC_MSG_RESULT([$kde_cv_uic_plugins])
1653
if test "$kde_cv_uic_plugins" != yes; then
1654
	AC_MSG_ERROR([
1655
you need to install kdelibs first.
1656
 
1657
If you did install kdelibs, then the Qt version that is picked up by
1658
this configure is not the same version you used to compile kdelibs. 
1659
The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the 
1660
_same Qt version_, compiled with the _same compiler_ and the same Qt
1661
configuration settings.
1662
])
1663
fi
1664
fi
1665
])
1666
 
1667
AC_DEFUN([KDE_CHECK_FINAL],
1668
[
1669
  AC_ARG_ENABLE(final,
1670
	AC_HELP_STRING([--enable-final],
1671
		       [build size optimized apps (experimental - needs lots of memory)]),
1672
	kde_use_final=$enableval, kde_use_final=no)
1673
 
1674
  if test "x$kde_use_final" = "xyes"; then
1675
      KDE_USE_FINAL_TRUE=""
1676
      KDE_USE_FINAL_FALSE="#"
1677
   else
1678
      KDE_USE_FINAL_TRUE="#"
1679
      KDE_USE_FINAL_FALSE=""
1680
  fi
1681
  AC_SUBST(KDE_USE_FINAL_TRUE)
1682
  AC_SUBST(KDE_USE_FINAL_FALSE)
1683
])
1684
 
1685
AC_DEFUN([KDE_CHECK_CLOSURE],
1686
[
1687
  AC_ARG_ENABLE(closure,
1688
		AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1689
  	kde_use_closure=$enableval, kde_use_closure=no)
1690
 
1691
  KDE_NO_UNDEFINED=""
1692
  if test "x$kde_use_closure" = "xyes"; then
1693
       KDE_USE_CLOSURE_TRUE=""
1694
       KDE_USE_CLOSURE_FALSE="#"
1695
#       CXXFLAGS="$CXXFLAGS $REPO"
1696
  else
1697
       KDE_USE_CLOSURE_TRUE="#"
1698
       KDE_USE_CLOSURE_FALSE=""
1699
       KDE_NO_UNDEFINED=""
1700
       case $host in 
1701
         *-*-linux-gnu)
1702
           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1703
                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1704
		[KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1705
		[KDE_NO_UNDEFINED=""])],
1706
	    [KDE_NO_UNDEFINED=""])
1707
           ;;
1708
       esac
1709
  fi
1710
  AC_SUBST(KDE_USE_CLOSURE_TRUE)
1711
  AC_SUBST(KDE_USE_CLOSURE_FALSE)
1712
  AC_SUBST(KDE_NO_UNDEFINED)
1713
])
1714
 
1715
dnl Check if the linker supports --enable-new-dtags and --as-needed
1716
AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
1717
[
1718
  AC_ARG_ENABLE(new_ldflags,
1719
		AC_HELP_STRING([--enable-new-ldflags],
1720
		[enable the new linker flags]),
1721
	kde_use_new_ldflags=$enableval, 
1722
	kde_use_new_ldflags=no)
1723
 
1724
  LDFLAGS_AS_NEEDED=""
1725
  LDFLAGS_NEW_DTAGS=""
1726
  if test "x$kde_use_new_ldflags" = "xyes"; then
1727
       LDFLAGS_NEW_DTAGS=""
1728
       KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
1729
		[LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
1730
 
1731
       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1732
		[LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1733
  fi
1734
  AC_SUBST(LDFLAGS_AS_NEEDED)
1735
  AC_SUBST(LDFLAGS_NEW_DTAGS)
1736
])
1737
 
1738
AC_DEFUN([KDE_CHECK_NMCHECK],
1739
[
1740
  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1741
	kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1742
 
1743
  if test "$kde_use_nmcheck" = "yes"; then
1744
      KDE_USE_NMCHECK_TRUE=""
1745
      KDE_USE_NMCHECK_FALSE="#"
1746
   else
1747
      KDE_USE_NMCHECK_TRUE="#"
1748
      KDE_USE_NMCHECK_FALSE=""
1749
  fi
1750
  AC_SUBST(KDE_USE_NMCHECK_TRUE)
1751
  AC_SUBST(KDE_USE_NMCHECK_FALSE)
1752
])
1753
 
1754
AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1755
savex=$exec_prefix
1756
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1757
tmp=$$2
1758
while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1759
exec_prefix=$savex
1760
])
1761
 
1762
dnl ------------------------------------------------------------------------
1763
dnl Now, the same with KDE
1764
dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1765
dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1766
dnl ------------------------------------------------------------------------
1767
dnl
1768
AC_DEFUN([AC_BASE_PATH_KDE],
1769
[
1770
AC_REQUIRE([KDE_CHECK_STL])
1771
AC_REQUIRE([AC_PATH_QT])dnl
1772
AC_REQUIRE([KDE_CHECK_LIB64])
1773
 
1774
AC_CHECK_RPATH
1775
AC_MSG_CHECKING([for KDE])
1776
 
1777
if test "${prefix}" != NONE; then
1778
  kde_includes=${includedir}
1779
  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1780
 
1781
  kde_libraries=${libdir}
1782
  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1783
 
1784
else
1785
  ac_kde_includes=
1786
  ac_kde_libraries=
1787
  kde_libraries=""
1788
  kde_includes=""
1789
fi
1790
 
1791
AC_CACHE_VAL(ac_cv_have_kde,
1792
[#try to guess kde locations
1793
 
1794
if test "$kde_qtver" = 1; then
1795
  kde_check_header="ksock.h"
1796
  kde_check_lib="libkdecore.la"
1797
else
1798
  kde_check_header="ksharedptr.h"
1799
  kde_check_lib="libkio.la"
1800
fi
1801
 
1802
if test -z "$1"; then
1803
 
1804
kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1805
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1806
kde_incdirs="$ac_kde_includes $kde_incdirs"
1807
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1808
ac_kde_includes="$kde_incdir"
1809
 
1810
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1811
  AC_MSG_ERROR([
1812
in the prefix, you've chosen, are no KDE headers installed. This will fail.
1813
So, check this please and use another prefix!])
1814
fi
1815
 
1816
kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1817
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1818
kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1819
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1820
ac_kde_libraries="$kde_libdir"
1821
 
1822
kde_widgetdir=NO
1823
dnl this might be somewhere else
1824
AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1825
 
1826
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1827
AC_MSG_ERROR([
1828
in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1829
So, check this please and use another prefix!])
1830
fi
1831
 
1832
if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1833
AC_MSG_ERROR([
1834
I can't find the designer plugins. These are required and should have been installed
1835
by kdelibs])
1836
fi
1837
 
1838
if test -n "$kde_widgetdir"; then
1839
    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1840
fi
1841
 
1842
 
1843
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1844
  ac_cv_have_kde="have_kde=no"
1845
else
1846
  ac_cv_have_kde="have_kde=yes \
1847
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1848
fi
1849
 
1850
else dnl test -z $1, e.g. from kdelibs
1851
 
1852
  ac_cv_have_kde="have_kde=no"
1853
 
1854
fi
1855
])dnl
1856
 
1857
eval "$ac_cv_have_kde"
1858
 
1859
if test "$have_kde" != "yes"; then
1860
 if test "${prefix}" = NONE; then
1861
  ac_kde_prefix="$ac_default_prefix"
1862
 else
1863
  ac_kde_prefix="$prefix"
1864
 fi
1865
 if test "$exec_prefix" = NONE; then
1866
  ac_kde_exec_prefix="$ac_kde_prefix"
1867
  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1868
 else
1869
  ac_kde_exec_prefix="$exec_prefix"
1870
  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1871
 fi
1872
 
1873
 kde_libraries="${libdir}"
1874
 kde_includes="${includedir}"
1875
 
1876
else
1877
  ac_cv_have_kde="have_kde=yes \
1878
    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1879
  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1880
 
1881
  kde_libraries="$ac_kde_libraries"
1882
  kde_includes="$ac_kde_includes"
1883
fi
1884
AC_SUBST(kde_libraries)
1885
AC_SUBST(kde_includes)
1886
 
1887
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1888
 KDE_INCLUDES=""
1889
else
1890
 KDE_INCLUDES="-I$kde_includes"
1891
 all_includes="$KDE_INCLUDES $all_includes"
1892
fi
1893
 
1894
KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1895
 
1896
KDE_LDFLAGS="-L$kde_libraries"
1897
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1898
 all_libraries="$KDE_LDFLAGS $all_libraries"
1899
fi
1900
 
1901
AC_SUBST(KDE_LDFLAGS)
1902
AC_SUBST(KDE_INCLUDES)
1903
 
1904
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1905
 
1906
all_libraries="$all_libraries $USER_LDFLAGS"
1907
all_includes="$all_includes $USER_INCLUDES"
1908
AC_SUBST(all_includes)
1909
AC_SUBST(all_libraries)
1910
 
1911
if test -z "$1"; then
1912
KDE_CHECK_UIC_PLUGINS
1913
fi
1914
 
1915
ac_kde_libraries="$kde_libdir"
1916
 
1917
AC_SUBST(AUTODIRS)
1918
 
1919
 
1920
])
1921
 
1922
AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1923
[
1924
AC_MSG_CHECKING(for extra includes)
1925
AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1926
  kde_use_extra_includes="$withval",
1927
  kde_use_extra_includes=NONE
1928
)
1929
kde_extra_includes=
1930
if test -n "$kde_use_extra_includes" && \
1931
   test "$kde_use_extra_includes" != "NONE"; then
1932
 
1933
   ac_save_ifs=$IFS
1934
   IFS=':'
1935
   for dir in $kde_use_extra_includes; do
1936
     kde_extra_includes="$kde_extra_includes $dir"
1937
     USER_INCLUDES="$USER_INCLUDES -I$dir"
1938
   done
1939
   IFS=$ac_save_ifs
1940
   kde_use_extra_includes="added"
1941
else
1942
   kde_use_extra_includes="no"
1943
fi
1944
AC_SUBST(USER_INCLUDES)
1945
 
1946
AC_MSG_RESULT($kde_use_extra_includes)
1947
 
1948
kde_extra_libs=
1949
AC_MSG_CHECKING(for extra libs)
1950
AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1951
  kde_use_extra_libs=$withval,
1952
  kde_use_extra_libs=NONE
1953
)
1954
if test -n "$kde_use_extra_libs" && \
1955
   test "$kde_use_extra_libs" != "NONE"; then
1956
 
1957
   ac_save_ifs=$IFS
1958
   IFS=':'
1959
   for dir in $kde_use_extra_libs; do
1960
     kde_extra_libs="$kde_extra_libs $dir"
1961
     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1962
     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1963
   done
1964
   IFS=$ac_save_ifs
1965
   kde_use_extra_libs="added"
1966
else
1967
   kde_use_extra_libs="no"
1968
fi
1969
 
1970
AC_SUBST(USER_LDFLAGS)
1971
 
1972
AC_MSG_RESULT($kde_use_extra_libs)
1973
 
1974
])
1975
 
1976
AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1977
[
1978
    AC_MSG_CHECKING([for KDE headers installed])
1979
    AC_LANG_SAVE
1980
    AC_LANG_CPLUSPLUS
1981
cat > conftest.$ac_ext <<EOF
1982
#ifdef STDC_HEADERS
1983
# include <stdlib.h>
1984
#endif
1985
#include <stdio.h>
1986
#include "confdefs.h"
1987
#include <kapp.h>
1988
 
1989
int main() {
1990
    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1991
    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1992
    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1993
    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1994
    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1995
    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1996
    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1997
    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1998
    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1999
    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
2000
    printf("kde_wallpaperdir=\\"%s\\"\n",
2001
	KApplication::kde_wallpaperdir().data());
2002
    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
2003
    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
2004
    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
2005
    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
2006
    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
2007
    printf("kde_styledir=\\"/tmp/dummy\\"\n");
2008
    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
2009
    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
2010
    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
2011
    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
2012
    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
2013
    return 0;
2014
    }
2015
EOF
2016
 
2017
 ac_save_CPPFLAGS=$CPPFLAGS
2018
 CPPFLAGS="$all_includes $CPPFLAGS"
2019
 if AC_TRY_EVAL(ac_compile); then
2020
   AC_MSG_RESULT(yes)
2021
 else
2022
   AC_MSG_ERROR([your system is not able to compile a small KDE application!
2023
Check, if you installed the KDE header files correctly.
2024
For more details about this problem, look at the end of config.log.])
2025
  fi
2026
  CPPFLAGS=$ac_save_CPPFLAGS
2027
 
2028
  AC_LANG_RESTORE
2029
])
2030
 
2031
AC_DEFUN([KDE_CHECK_KDEQTADDON],
2032
[
2033
AC_MSG_CHECKING(for kde-qt-addon)
2034
AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2035
[
2036
 kde_ldflags_safe="$LDFLAGS"
2037
 kde_libs_safe="$LIBS"
2038
 kde_cxxflags_safe="$CXXFLAGS"
2039
 
2040
 LIBS="-lkde-qt-addon $LIBQT $LIBS"
2041
 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2042
 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2043
 
2044
 AC_TRY_LINK([
2045
   #include <qdom.h>
2046
 ],
2047
 [
2048
   QDomDocument doc;
2049
 ],
2050
  kde_cv_have_kdeqtaddon=yes,
2051
  kde_cv_have_kdeqtaddon=no
2052
 )
2053
 
2054
 LDFLAGS=$kde_ldflags_safe
2055
 LIBS=$kde_libs_safe
2056
 CXXFLAGS=$kde_cxxflags_safe
2057
])
2058
 
2059
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2060
 
2061
if test "$kde_cv_have_kdeqtaddon" = "no"; then
2062
  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2063
It is a separate package (and CVS module) named kde-qt-addon.])
2064
fi
2065
])
2066
 
2067
AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2068
[
2069
   AC_REQUIRE([KDE_MISC_TESTS])
2070
   AC_REQUIRE([KDE_CHECK_LIBDL])
2071
   AC_REQUIRE([K_PATH_X])
2072
 
2073
if test $kde_qtver = 3; then
2074
   case $host in 
2075
               *cygwin*) lib_kded="-lkdeinit_kded" ;;
2076
               *) lib_kded="" ;;
2077
       esac
2078
   AC_SUBST(LIB_KDED, $lib_kded)
2079
   AC_SUBST(LIB_KDECORE, "-lkdecore")
2080
   AC_SUBST(LIB_KDEUI, "-lkdeui")
2081
   AC_SUBST(LIB_KIO, "-lkio")
2082
   AC_SUBST(LIB_KJS, "-lkjs")
2083
   AC_SUBST(LIB_SMB, "-lsmb")
2084
   AC_SUBST(LIB_KAB, "-lkab")
2085
   AC_SUBST(LIB_KABC, "-lkabc")
2086
   AC_SUBST(LIB_KHTML, "-lkhtml")
2087
   AC_SUBST(LIB_KSPELL, "-lkspell")
2088
   AC_SUBST(LIB_KPARTS, "-lkparts")
2089
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2090
   AC_SUBST(LIB_KUTILS, "-lkutils")
2091
   AC_SUBST(LIB_KDEPIM, "-lkdepim")
2092
   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2093
   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2094
   AC_SUBST(LIB_KDNSSD, "-lkdnssd")
2095
   AC_SUBST(LIB_KUNITTEST, "-lkunittest")
2096
# these are for backward compatibility
2097
   AC_SUBST(LIB_KSYCOCA, "-lkio")
2098
   AC_SUBST(LIB_KFILE, "-lkio")
2099
elif test $kde_qtver = 2; then
2100
   AC_SUBST(LIB_KDECORE, "-lkdecore")
2101
   AC_SUBST(LIB_KDEUI, "-lkdeui")
2102
   AC_SUBST(LIB_KIO, "-lkio")
2103
   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2104
   AC_SUBST(LIB_SMB, "-lsmb")
2105
   AC_SUBST(LIB_KFILE, "-lkfile")
2106
   AC_SUBST(LIB_KAB, "-lkab")
2107
   AC_SUBST(LIB_KHTML, "-lkhtml")
2108
   AC_SUBST(LIB_KSPELL, "-lkspell")
2109
   AC_SUBST(LIB_KPARTS, "-lkparts")
2110
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2111
else
2112
   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2113
   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2114
   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2115
   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2116
   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2117
fi
2118
])
2119
 
2120
AC_DEFUN([AC_PATH_KDE],
2121
[
2122
  AC_BASE_PATH_KDE
2123
  AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2124
  [
2125
  if test "$enableval" = "no";
2126
    then ac_use_path_checking="default"
2127
    else ac_use_path_checking=""
2128
  fi
2129
  ],
2130
  [
2131
  if test "$kde_qtver" = 1;
2132
    then ac_use_path_checking=""
2133
    else ac_use_path_checking="default"
2134
  fi
2135
  ]
2136
  )
2137
 
2138
  AC_CREATE_KFSSTND($ac_use_path_checking)
2139
 
2140
  AC_SUBST_KFSSTND
2141
  KDE_CREATE_LIBS_ALIASES
2142
])
2143
 
2144
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2145
AC_DEFUN([KDE_CHECK_FUNC_EXT],
2146
[
2147
AC_MSG_CHECKING(for $1)
2148
AC_CACHE_VAL(kde_cv_func_$1,
2149
[
2150
AC_LANG_SAVE
2151
AC_LANG_CPLUSPLUS
2152
save_CXXFLAGS="$CXXFLAGS"
2153
kde_safe_LIBS="$LIBS"
2154
LIBS="$LIBS $X_EXTRA_LIBS"
2155
if test "$GXX" = "yes"; then
2156
CXXFLAGS="$CXXFLAGS -pedantic-errors"
2157
fi
2158
AC_TRY_COMPILE([
2159
$2
2160
],
2161
[
2162
$3
2163
],
2164
kde_cv_func_$1=yes,
2165
kde_cv_func_$1=no)
2166
CXXFLAGS="$save_CXXFLAGS"
2167
LIBS="$kde_safe_LIBS"
2168
AC_LANG_RESTORE
2169
])
2170
 
2171
AC_MSG_RESULT($kde_cv_func_$1)
2172
 
2173
AC_MSG_CHECKING([if $1 needs custom prototype])
2174
AC_CACHE_VAL(kde_cv_proto_$1,
2175
[
2176
if test "x$kde_cv_func_$1" = xyes; then
2177
  kde_cv_proto_$1=no
2178
else
2179
  case "$1" in
2180
	setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2181
		kde_cv_proto_$1="yes - in libkdefakes"
2182
		;;
2183
	*)
2184
		kde_cv_proto_$1=unknown
2185
		;;
2186
  esac
2187
fi
2188
 
2189
if test "x$kde_cv_proto_$1" = xunknown; then
2190
 
2191
AC_LANG_SAVE
2192
AC_LANG_CPLUSPLUS
2193
  kde_safe_libs=$LIBS
2194
  LIBS="$LIBS $X_EXTRA_LIBS"
2195
  AC_TRY_LINK([
2196
$2
2197
 
2198
extern "C" $4;
2199
],
2200
[
2201
$3
2202
],
2203
[ kde_cv_func_$1=yes
2204
  kde_cv_proto_$1=yes ],
2205
  [kde_cv_proto_$1="$1 unavailable"]
2206
)
2207
LIBS=$kde_safe_libs
2208
AC_LANG_RESTORE
2209
fi
2210
])
2211
AC_MSG_RESULT($kde_cv_proto_$1)
2212
 
2213
if test "x$kde_cv_func_$1" = xyes; then
2214
  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2215
  $6
2216
fi
2217
if test "x$kde_cv_proto_$1" = xno; then
2218
  AC_DEFINE(HAVE_$5_PROTO, 1,
2219
  [Define if you have the $1 prototype])
2220
fi
2221
 
2222
AH_VERBATIM([_HAVE_$5_PROTO],
2223
[
2224
#if !defined(HAVE_$5_PROTO)
2225
#ifdef __cplusplus
2226
extern "C" {
2227
#endif
2228
$4;
2229
#ifdef __cplusplus
2230
}
2231
#endif
2232
#endif
2233
])
2234
])
2235
 
2236
AC_DEFUN([AC_CHECK_SETENV],
2237
[
2238
	KDE_CHECK_FUNC_EXT(setenv, [
2239
#include <stdlib.h>
2240
], 
2241
		[setenv("VAR", "VALUE", 1);],
2242
	        [int setenv (const char *, const char *, int)],
2243
		[SETENV])
2244
])
2245
 
2246
AC_DEFUN([AC_CHECK_UNSETENV],
2247
[
2248
	KDE_CHECK_FUNC_EXT(unsetenv, [
2249
#include <stdlib.h>
2250
], 
2251
		[unsetenv("VAR");],
2252
	        [void unsetenv (const char *)],
2253
		[UNSETENV])
2254
])
2255
 
2256
AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2257
[
2258
	KDE_CHECK_FUNC_EXT(getdomainname, [
2259
#include <stdlib.h>
2260
#include <unistd.h>
2261
#include <netdb.h>
2262
], 
2263
		[
2264
char buffer[200];
2265
getdomainname(buffer, 200);
2266
], 	
2267
	        [#include <sys/types.h>
2268
		int getdomainname (char *, size_t)],
2269
		[GETDOMAINNAME])
2270
])
2271
 
2272
AC_DEFUN([AC_CHECK_GETHOSTNAME],
2273
[
2274
	KDE_CHECK_FUNC_EXT(gethostname, [
2275
#include <stdlib.h>
2276
#include <unistd.h>
2277
], 
2278
		[
2279
char buffer[200];
2280
gethostname(buffer, 200);
2281
], 	
2282
	        [int gethostname (char *, unsigned int)],
2283
		[GETHOSTNAME])
2284
])
2285
 
2286
AC_DEFUN([AC_CHECK_USLEEP],
2287
[
2288
	KDE_CHECK_FUNC_EXT(usleep, [
2289
#include <unistd.h>
2290
], 
2291
		[
2292
usleep(200);
2293
], 	
2294
	        [int usleep (unsigned int)],
2295
		[USLEEP])
2296
])
2297
 
2298
 
2299
AC_DEFUN([AC_CHECK_RANDOM],
2300
[
2301
	KDE_CHECK_FUNC_EXT(random, [
2302
#include <stdlib.h>
2303
], 
2304
		[
2305
random();
2306
], 	
2307
	        [long int random(void)],
2308
		[RANDOM])
2309
 
2310
	KDE_CHECK_FUNC_EXT(srandom, [
2311
#include <stdlib.h>
2312
], 
2313
		[
2314
srandom(27);
2315
], 	
2316
	        [void srandom(unsigned int)],
2317
		[SRANDOM])
2318
 
2319
])
2320
 
2321
AC_DEFUN([AC_CHECK_INITGROUPS],
2322
[
2323
	KDE_CHECK_FUNC_EXT(initgroups, [
2324
#include <sys/types.h>
2325
#include <unistd.h>
2326
#include <grp.h>
2327
],
2328
	[
2329
char buffer[200];
2330
initgroups(buffer, 27);
2331
],
2332
	[int initgroups(const char *, gid_t)],
2333
	[INITGROUPS])
2334
])
2335
 
2336
AC_DEFUN([AC_CHECK_MKSTEMPS],
2337
[
2338
	KDE_CHECK_FUNC_EXT(mkstemps, [
2339
#include <stdlib.h>
2340
#include <unistd.h>
2341
],
2342
	[
2343
mkstemps("/tmp/aaaXXXXXX", 6);
2344
],
2345
	[int mkstemps(char *, int)],
2346
	[MKSTEMPS])
2347
])
2348
 
2349
AC_DEFUN([AC_CHECK_MKSTEMP],
2350
[
2351
	KDE_CHECK_FUNC_EXT(mkstemp, [
2352
#include <stdlib.h>
2353
#include <unistd.h>
2354
],
2355
	[
2356
mkstemp("/tmp/aaaXXXXXX");
2357
],
2358
	[int mkstemp(char *)],
2359
	[MKSTEMP])
2360
])
2361
 
2362
AC_DEFUN([AC_CHECK_MKDTEMP],
2363
[
2364
	KDE_CHECK_FUNC_EXT(mkdtemp, [
2365
#include <stdlib.h>
2366
#include <unistd.h>
2367
],
2368
	[
2369
mkdtemp("/tmp/aaaXXXXXX");
2370
],
2371
	[char *mkdtemp(char *)],
2372
	[MKDTEMP])
2373
])
2374
 
2375
 
2376
AC_DEFUN([AC_CHECK_RES_INIT],
2377
[
2378
  AC_MSG_CHECKING([if res_init needs -lresolv])
2379
  kde_libs_safe="$LIBS"
2380
  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2381
  AC_TRY_LINK(
2382
    [
2383
#include <sys/types.h>
2384
#include <netinet/in.h>
2385
#include <arpa/nameser.h>
2386
#include <resolv.h>
2387
    ],
2388
    [
2389
      res_init(); 
2390
    ],
2391
    [
2392
      LIBRESOLV="-lresolv"
2393
      AC_MSG_RESULT(yes)
2394
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2395
    ],
2396
    [ AC_MSG_RESULT(no) ]
2397
  )
2398
  LIBS=$kde_libs_safe
2399
  AC_SUBST(LIBRESOLV)
2400
 
2401
  KDE_CHECK_FUNC_EXT(res_init,
2402
    [
2403
#include <sys/types.h>
2404
#include <netinet/in.h>
2405
#include <arpa/nameser.h>
2406
#include <resolv.h>
2407
    ],
2408
    [res_init()],
2409
    [int res_init(void)],
2410
    [RES_INIT])
2411
])
2412
 
2413
AC_DEFUN([AC_CHECK_STRLCPY],
2414
[
2415
	KDE_CHECK_FUNC_EXT(strlcpy, [
2416
#include <string.h>
2417
],
2418
[ char buf[20];
2419
  strlcpy(buf, "KDE function test", sizeof(buf));
2420
],
2421
 	[unsigned long strlcpy(char*, const char*, unsigned long)],
2422
	[STRLCPY])
2423
])
2424
 
2425
AC_DEFUN([AC_CHECK_STRLCAT],
2426
[
2427
	KDE_CHECK_FUNC_EXT(strlcat, [
2428
#include <string.h>
2429
],
2430
[ char buf[20];
2431
  buf[0]='\0';
2432
  strlcat(buf, "KDE function test", sizeof(buf));
2433
],
2434
 	[unsigned long strlcat(char*, const char*, unsigned long)],
2435
	[STRLCAT])
2436
])
2437
 
2438
AC_DEFUN([AC_CHECK_RES_QUERY],
2439
[
2440
	KDE_CHECK_FUNC_EXT(res_query, [
2441
#include <sys/types.h>
2442
#include <netinet/in.h>
2443
#include <arpa/nameser.h>
2444
#include <resolv.h>
2445
#include <netdb.h>
2446
],
2447
[
2448
res_query(NULL, 0, 0, NULL, 0);
2449
],
2450
	[int res_query(const char *, int, int, unsigned char *, int)],
2451
	[RES_QUERY])
2452
])
2453
 
2454
AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2455
[
2456
	KDE_CHECK_FUNC_EXT(dn_skipname, [
2457
#include <sys/types.h>
2458
#include <netinet/in.h>
2459
#include <arpa/nameser.h>
2460
#include <resolv.h>
2461
],
2462
[
2463
dn_skipname (NULL, NULL);
2464
],
2465
	[int dn_skipname (unsigned char *, unsigned char *)],
2466
	[DN_SKIPNAME])
2467
])
2468
 
2469
 
2470
AC_DEFUN([AC_FIND_GIF],
2471
   [AC_MSG_CHECKING([for giflib])
2472
AC_CACHE_VAL(ac_cv_lib_gif,
2473
[ac_save_LIBS="$LIBS"
2474
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2475
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2476
else
2477
LIBS="$all_libraries -lgif"
2478
fi
2479
AC_TRY_LINK(dnl
2480
[
2481
#ifdef __cplusplus
2482
extern "C" {
2483
#endif
2484
int GifLastError(void);
2485
#ifdef __cplusplus
2486
}
2487
#endif
2488
/* We use char because int might match the return type of a gcc2
2489
    builtin and then its argument prototype would still apply.  */
2490
],
2491
            [return GifLastError();],
2492
            eval "ac_cv_lib_gif=yes",
2493
            eval "ac_cv_lib_gif=no")
2494
LIBS="$ac_save_LIBS"
2495
])dnl
2496
if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2497
  AC_MSG_RESULT(yes)
2498
  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2499
else
2500
  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2501
fi
2502
])
2503
 
2504
AC_DEFUN([KDE_FIND_JPEG_HELPER],
2505
[
2506
AC_MSG_CHECKING([for libjpeg$2])
2507
AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2508
[
2509
ac_save_LIBS="$LIBS"
2510
LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2511
ac_save_CFLAGS="$CFLAGS"
2512
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2513
AC_TRY_LINK(
2514
[
2515
#ifdef __cplusplus
2516
extern "C" {
2517
#endif
2518
void jpeg_CreateDecompress();
2519
#ifdef __cplusplus
2520
}
2521
#endif
2522
],
2523
[jpeg_CreateDecompress();],
2524
            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2525
            eval "ac_cv_lib_jpeg_$1=no")
2526
LIBS="$ac_save_LIBS"
2527
CFLAGS="$ac_save_CFLAGS"
2528
])
2529
 
2530
if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2531
  LIBJPEG="$ac_cv_lib_jpeg_$1"
2532
  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2533
else
2534
  AC_MSG_RESULT(no)
2535
  $3
2536
fi
2537
 
2538
])
2539
 
2540
AC_DEFUN([AC_FIND_JPEG],
2541
[
2542
dnl first look for libraries
2543
KDE_FIND_JPEG_HELPER(6b, 6b,
2544
   KDE_FIND_JPEG_HELPER(normal, [],
2545
    [
2546
       LIBJPEG=
2547
    ]
2548
   )
2549
)
2550
 
2551
dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2552
dnl requires system dependent includes loaded before it)
2553
jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2554
AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2555
test "x$jpeg_incdir" = xNO && jpeg_incdir=
2556
 
2557
dnl if headers _and_ libraries are missing, this is no error, and we
2558
dnl continue with a warning (the user will get no jpeg support in khtml)
2559
dnl if only one is missing, it means a configuration error, but we still
2560
dnl only warn
2561
if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2562
  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2563
else
2564
  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2565
    AC_MSG_WARN([
2566
There is an installation error in jpeg support. You seem to have only one
2567
of either the headers _or_ the libraries installed. You may need to either
2568
provide correct --with-extra-... options, or the development package of
2569
libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2570
Disabling JPEG support.
2571
])
2572
  else
2573
    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2574
  fi
2575
  jpeg_incdir=
2576
  LIBJPEG=
2577
fi
2578
 
2579
AC_SUBST(LIBJPEG)
2580
AH_VERBATIM(_AC_CHECK_JPEG,
2581
[/*
2582
 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2583
 * headers and I'm too lazy to write a configure test as long as only
2584
 * unixware is related
2585
 */
2586
#ifdef _UNIXWARE
2587
#define HAVE_BOOLEAN
2588
#endif
2589
])
2590
])
2591
 
2592
AC_DEFUN([KDE_CHECK_QT_JPEG],
2593
[
2594
if test -n "$LIBJPEG"; then
2595
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2596
AC_CACHE_VAL(kde_cv_qt_jpeg,
2597
[
2598
AC_LANG_SAVE
2599
AC_LANG_CPLUSPLUS
2600
ac_save_LIBS="$LIBS"
2601
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2602
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2603
ac_save_CXXFLAGS="$CXXFLAGS"
2604
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2605
AC_TRY_LINK(
2606
[#include <qapplication.h>],
2607
            [
2608
            int argc;
2609
            char** argv;
2610
            QApplication app(argc, argv);],
2611
            eval "kde_cv_qt_jpeg=no",
2612
            eval "kde_cv_qt_jpeg=yes")
2613
LIBS="$ac_save_LIBS"
2614
CXXFLAGS="$ac_save_CXXFLAGS"
2615
AC_LANG_RESTORE
2616
fi
2617
])
2618
 
2619
if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2620
  AC_MSG_RESULT(yes)
2621
  LIBJPEG_QT='$(LIBJPEG)'
2622
else
2623
  AC_MSG_RESULT(no)
2624
  LIBJPEG_QT=
2625
fi
2626
 
2627
])
2628
 
2629
AC_DEFUN([AC_FIND_ZLIB],
2630
[
2631
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2632
AC_MSG_CHECKING([for libz])
2633
AC_CACHE_VAL(ac_cv_lib_z,
2634
[
2635
kde_save_LIBS="$LIBS"
2636
LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2637
kde_save_CFLAGS="$CFLAGS"
2638
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2639
AC_TRY_LINK(dnl
2640
[
2641
#include<zlib.h>
2642
],
2643
[
2644
  char buf[42];
2645
  gzFile f = (gzFile) 0;
2646
  /* this would segfault.. but we only link, don't run */
2647
  (void) gzgets(f, buf, sizeof(buf));
2648
 
2649
  return (zlibVersion() == ZLIB_VERSION); 
2650
],
2651
            eval "ac_cv_lib_z='-lz'",
2652
            eval "ac_cv_lib_z=no")
2653
LIBS="$kde_save_LIBS"
2654
CFLAGS="$kde_save_CFLAGS"
2655
])dnl
2656
if test ! "$ac_cv_lib_z" = no; then
2657
  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2658
  LIBZ="$ac_cv_lib_z"
2659
  AC_MSG_RESULT($ac_cv_lib_z)
2660
else
2661
  AC_MSG_ERROR(not found. 
2662
          Possibly configure picks up an outdated version
2663
          installed by XFree86. Remove it from your system.
2664
 
2665
          Check your installation and look into config.log)
2666
  LIBZ=""
2667
fi
2668
AC_SUBST(LIBZ)
2669
])
2670
 
2671
AC_DEFUN([KDE_TRY_TIFFLIB],
2672
[
2673
AC_MSG_CHECKING([for libtiff $1])
2674
 
2675
AC_CACHE_VAL(kde_cv_libtiff_$1,
2676
[
2677
AC_LANG_SAVE
2678
AC_LANG_CPLUSPLUS
2679
kde_save_LIBS="$LIBS"
2680
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2681
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2682
else
2683
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2684
fi
2685
kde_save_CXXFLAGS="$CXXFLAGS"
2686
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2687
 
2688
AC_TRY_LINK(dnl
2689
[
2690
#include<tiffio.h>
2691
],
2692
    [return (TIFFOpen( "", "r") == 0); ],
2693
[
2694
    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2695
], [
2696
    kde_cv_libtiff_$1=no
2697
])
2698
 
2699
LIBS="$kde_save_LIBS"
2700
CXXFLAGS="$kde_save_CXXFLAGS"
2701
AC_LANG_RESTORE
2702
])
2703
 
2704
if test "$kde_cv_libtiff_$1" = "no"; then
2705
    AC_MSG_RESULT(no)
2706
    LIBTIFF=""
2707
    $3
2708
else
2709
    LIBTIFF="$kde_cv_libtiff_$1"
2710
    AC_MSG_RESULT(yes)
2711
    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2712
    $2
2713
fi
2714
 
2715
])
2716
 
2717
AC_DEFUN([AC_FIND_TIFF],
2718
[
2719
AC_REQUIRE([K_PATH_X])
2720
AC_REQUIRE([AC_FIND_ZLIB])
2721
AC_REQUIRE([AC_FIND_JPEG])
2722
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2723
 
2724
KDE_TRY_TIFFLIB(tiff, [],
2725
   KDE_TRY_TIFFLIB(tiff34))
2726
 
2727
AC_SUBST(LIBTIFF)
2728
])
2729
 
2730
AC_DEFUN([KDE_FIND_LIBEXR],
2731
[
2732
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2733
AC_REQUIRE([AC_FIND_ZLIB])
2734
AC_CACHE_VAL(ac_cv_libexr,
2735
[
2736
  if test -z "$PKG_CONFIG"; then
2737
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2738
  fi
2739
 
2740
  AC_MSG_CHECKING([for OpenEXR libraries])
2741
 
2742
  if test "$PKG_CONFIG" = "no" ; then
2743
     AC_MSG_RESULT(no)
2744
     echo "*** The pkg-config script could not be found. Make sure it is"
2745
     echo "*** in your path, or set the PKG_CONFIG environment variable"
2746
     echo "*** to the full path to pkg-config."
2747
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
2748
  else
2749
     if !(`$PKG_CONFIG --exists OpenEXR`) ; then
2750
        AC_MSG_RESULT(no)
2751
        EXRSTATUS=no
2752
     else
2753
        if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
2754
           AC_MSG_RESULT(no)
2755
           EXRSTATUS=old
2756
        else
2757
           kde_save_LIBS="$LIBS"
2758
           LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
2759
           AC_LANG_SAVE
2760
           AC_LANG_CPLUSPLUS
2761
           kde_save_CXXFLAGS="$CXXFLAGS"
2762
           EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
2763
           CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
2764
 
2765
           AC_TRY_LINK(dnl
2766
               [
2767
               #include <ImfRgbaFile.h>
2768
               ],
2769
               [
2770
               using namespace Imf;
2771
               RgbaInputFile file ("dummy");
2772
               return 0;
2773
               ],
2774
               eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
2775
               eval "ac_cv_libexr=no"
2776
           )
2777
           LIBS="$kde_save_LIBS"
2778
           CXXFLAGS="$kde_save_CXXFLAGS"
2779
           AC_LANG_RESTORE
2780
           ])dnl
2781
           if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
2782
               AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
2783
               LIB_EXR="$ac_cv_libexr"
2784
               AC_MSG_RESULT($ac_cv_libexr)
2785
           else
2786
               AC_MSG_RESULT(no)
2787
               LIB_EXR=""
2788
           fi
2789
        fi
2790
     fi
2791
  fi
2792
  AC_SUBST(LIB_EXR)
2793
  AC_SUBST(EXR_FLAGS)
2794
])
2795
 
2796
 
2797
 
2798
AC_DEFUN([AC_FIND_PNG],
2799
[
2800
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2801
AC_REQUIRE([AC_FIND_ZLIB])
2802
AC_MSG_CHECKING([for libpng])
2803
AC_CACHE_VAL(ac_cv_lib_png,
2804
[
2805
kde_save_LIBS="$LIBS"
2806
if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2807
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2808
else
2809
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2810
fi
2811
kde_save_CFLAGS="$CFLAGS"
2812
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2813
 
2814
AC_TRY_LINK(dnl
2815
    [
2816
    #include<png.h>
2817
    ],
2818
    [
2819
    png_structp png_ptr = png_create_read_struct(  /* image ptr */
2820
		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2821
    return( png_ptr != 0 );
2822
    ],
2823
    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2824
    eval "ac_cv_lib_png=no"
2825
)
2826
LIBS="$kde_save_LIBS"
2827
CFLAGS="$kde_save_CFLAGS"
2828
])dnl
2829
if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2830
  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2831
  LIBPNG="$ac_cv_lib_png"
2832
  AC_SUBST(LIBPNG)
2833
  AC_MSG_RESULT($ac_cv_lib_png)
2834
else
2835
  AC_MSG_RESULT(no)
2836
  LIBPNG=""
2837
  AC_SUBST(LIBPNG)
2838
fi
2839
])
2840
 
2841
 
2842
AC_DEFUN([AC_FIND_JASPER],
2843
[
2844
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2845
AC_REQUIRE([AC_FIND_JPEG])
2846
AC_MSG_CHECKING([for jasper])
2847
AC_CACHE_VAL(ac_cv_jasper,
2848
[
2849
kde_save_LIBS="$LIBS"
2850
LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2851
kde_save_CFLAGS="$CFLAGS"
2852
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2853
 
2854
AC_TRY_LINK(dnl
2855
    [
2856
    #include<jasper/jasper.h>
2857
    ],
2858
    [
2859
    return( jas_init() );
2860
    ],
2861
    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2862
    eval "ac_cv_jasper=no"
2863
)
2864
LIBS="$kde_save_LIBS"
2865
CFLAGS="$kde_save_CFLAGS"
2866
])dnl
2867
if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2868
  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2869
  LIB_JASPER="$ac_cv_jasper"
2870
  AC_MSG_RESULT($ac_cv_jasper)
2871
else
2872
  AC_MSG_RESULT(no)
2873
  LIB_JASPER=""
2874
fi
2875
AC_SUBST(LIB_JASPER)
2876
])
2877
 
2878
AC_DEFUN([AC_CHECK_BOOL],
2879
[
2880
  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2881
])
2882
 
2883
AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2884
[
2885
AC_MSG_CHECKING(if you need GNU extensions)
2886
AC_CACHE_VAL(ac_cv_gnu_extensions,
2887
[
2888
cat > conftest.c << EOF
2889
#include <features.h>
2890
 
2891
#ifdef __GNU_LIBRARY__
2892
yes
2893
#endif
2894
EOF
2895
 
2896
if (eval "$ac_cpp conftest.c") 2>&5 |
2897
  egrep "yes" >/dev/null 2>&1; then
2898
  rm -rf conftest*
2899
  ac_cv_gnu_extensions=yes
2900
else
2901
  ac_cv_gnu_extensions=no
2902
fi
2903
])
2904
 
2905
AC_MSG_RESULT($ac_cv_gnu_extensions)
2906
if test "$ac_cv_gnu_extensions" = "yes"; then
2907
  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2908
fi
2909
])
2910
 
2911
AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2912
[
2913
AC_MSG_CHECKING([whether $CXX supports -$1])
2914
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2915
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2916
[
2917
  AC_LANG_SAVE
2918
  AC_LANG_CPLUSPLUS
2919
  save_CXXFLAGS="$CXXFLAGS"
2920
  CXXFLAGS="$CXXFLAGS -$1"
2921
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2922
  CXXFLAGS="$save_CXXFLAGS"
2923
  AC_LANG_RESTORE
2924
])
2925
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2926
 AC_MSG_RESULT(yes)
2927
 :
2928
 $2
2929
else
2930
 AC_MSG_RESULT(no)
2931
 :
2932
 $3
2933
fi
2934
])
2935
 
2936
AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2937
[
2938
AC_MSG_CHECKING([whether $CC supports -$1])
2939
kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2940
AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2941
[
2942
  AC_LANG_SAVE
2943
  AC_LANG_C
2944
  save_CFLAGS="$CFLAGS"
2945
  CFLAGS="$CFLAGS -$1"
2946
  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2947
  CFLAGS="$save_CFLAGS"
2948
  AC_LANG_RESTORE
2949
])
2950
if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2951
 AC_MSG_RESULT(yes)
2952
 :
2953
 $2
2954
else
2955
 AC_MSG_RESULT(no)
2956
 :
2957
 $3
2958
fi
2959
])
2960
 
2961
 
2962
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2963
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2964
dnl it's all white-space separated
2965
AC_DEFUN([AC_REMOVE_FORBIDDEN],
2966
[ __val=$$1
2967
  __forbid=" $2 "
2968
  if test -n "$__val"; then
2969
    __new=""
2970
    ac_save_IFS=$IFS
2971
    IFS=" 	"
2972
    for i in $__val; do
2973
      case "$__forbid" in
2974
        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2975
	*) # Careful to not add spaces, where there were none, because otherwise
2976
	   # libtool gets confused, if we change e.g. CXX
2977
	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2978
      esac
2979
    done
2980
    IFS=$ac_save_IFS
2981
    $1=$__new
2982
  fi
2983
])
2984
 
2985
 
2986
AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
2987
[
2988
  AC_MSG_CHECKING([whether $CC is blacklisted])
2989
 
2990
  dnl In theory we have tu run this test against $CC and $CXX
2991
  dnl in C and in C++ mode, because its perfectly legal for
2992
  dnl the user to mix compiler versions, since C has a defined
2993
  dnl ABI. 
2994
  dnl 
2995
  dnl For now, we assume the user is not on crack.
2996
 
2997
  AC_TRY_COMPILE([
2998
#ifdef __GNUC__
2999
#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
3000
choke me
3001
#endif
3002
#endif
3003
], ,
3004
  kde_bad_compiler=no, 
3005
  kde_bad_compiler=yes
3006
)
3007
 
3008
  AC_MSG_RESULT($kde_bad_compiler)
3009
 
3010
if test "$kde_bad_compiler" = "yes"; then
3011
  AC_MSG_ERROR([
3012
 
3013
This particular compiler version is blacklisted because it
3014
is known to miscompile KDE. Please use a newer version, or
3015
if that is not yet available, choose an older version. 
3016
 
3017
Please do not report a bug or bother us reporting this
3018
configure error. We know about it, and we introduced
3019
it by intention to avoid untraceable bugs or crashes in KDE.
3020
 
3021
])
3022
fi
3023
 
3024
])
3025
 
3026
 
3027
AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
3028
[
3029
  AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
3030
    kde_cv_opt_noinline_match,
3031
  [
3032
  kde_cv_opt_noinline_match=irrelevant
3033
  dnl if we don't use both -O2 and -fno-inline, this check is moot
3034
  if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
3035
     && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
3036
 
3037
    ac_cflags_save="$CFLAGS"
3038
    CFLAGS="$CFLAGS -D_USE_GNU"
3039
 
3040
    AC_TRY_LINK([
3041
  #include <string.h>
3042
], [  const char *pt, *et;
3043
  et = __extension__      ({ char __a0, __a1, __a2;       (__builtin_constant_p (  ";,"  ) && ((size_t)(const void *)((   ";,"   )+ 1) - (size_t)(const void *)(   ";,"   ) == 1)        ? ((__a0 =((__const char  *) (  ";,"  ))[0], __a0 == '\0')     ? ((void) (  pt ),((void *)0) )        : ((__a1 = ((__const char *) (  ";,"  ))[1], __a1== '\0')      ? (__extension__ (__builtin_constant_p (  __a0 ) && ( __a0 ) == '\0'   ? (char *) __rawmemchr (   pt  ,   __a0)       : strchr(   pt  ,   __a0 )))   : ((__a2 = ((__const char *) (  ";,"  ))[2], __a2 == '\0')      ? __strpbrk_c2 (  pt , __a0, __a1)      :(((__const char *) (  ";,"  ))[3] == '\0'     ? __strpbrk_c3 (  pt ,__a0, __a1, __a2): strpbrk (  pt ,   ";,"  ))))) : strpbrk (  pt ,  ";,"  )); }) ;
3044
],
3045
    kde_cv_opt_noinline_match=yes,
3046
    kde_cv_opt_noinline_match=no
3047
    )
3048
 
3049
    CFLAGS="$ac_cflags_save"
3050
  fi
3051
  ])
3052
])
3053
 
3054
 
3055
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
3056
AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
3057
[dnl
3058
if test "x$kde_use_qt_emb" != "xyes"; then
3059
 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
3060
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
3061
else
3062
 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
3063
 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
3064
fi
3065
])
3066
 
3067
AC_DEFUN([AC_CHECK_COMPILERS],
3068
[
3069
  AC_ARG_ENABLE(debug,
3070
	        AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
3071
  [
3072
    case $enableval in
3073
      yes)
3074
        kde_use_debug_code="yes"
3075
        kde_use_debug_define=no
3076
        ;;
3077
      full)
3078
        kde_use_debug_code="full"
3079
        kde_use_debug_define=no
3080
        ;;
3081
      *)
3082
        kde_use_debug_code="no"
3083
        kde_use_debug_define=yes
3084
        ;;
3085
    esac
3086
  ], 
3087
    [kde_use_debug_code="no"
3088
      kde_use_debug_define=no
3089
  ])
3090
 
3091
  dnl Just for configure --help
3092
  AC_ARG_ENABLE(dummyoption,
3093
	        AC_HELP_STRING([--disable-debug],
3094
	  		       [disables debug output and debug symbols [default=no]]),
3095
		[],[])
3096
 
3097
  AC_ARG_ENABLE(strict,
3098
		AC_HELP_STRING([--enable-strict],
3099
			      [compiles with strict compiler options (may not work!)]),
3100
   [
3101
    if test $enableval = "no"; then
3102
         kde_use_strict_options="no"
3103
       else
3104
         kde_use_strict_options="yes"
3105
    fi
3106
   ], [kde_use_strict_options="no"])
3107
 
3108
  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
3109
   [
3110
    if test $enableval = "no"; then
3111
         kde_use_warnings="no"
3112
       else
3113
         kde_use_warnings="yes"
3114
    fi
3115
   ], [kde_use_warnings="yes"])
3116
 
3117
  dnl enable warnings for debug build
3118
  if test "$kde_use_debug_code" != "no"; then
3119
    kde_use_warnings=yes
3120
  fi
3121
 
3122
  AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
3123
    [kde_use_profiling=$enableval],
3124
    [kde_use_profiling="no"]
3125
  )
3126
 
3127
  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
3128
  CFLAGS=" $CFLAGS"
3129
 
3130
  AC_PROG_CC 
3131
 
3132
  AC_PROG_CPP
3133
 
3134
  if test "$GCC" = "yes"; then
3135
    if test "$kde_use_debug_code" != "no"; then
3136
      if test $kde_use_debug_code = "full"; then
3137
        CFLAGS="-g3 -fno-inline $CFLAGS"
3138
      else
3139
        CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
3140
      fi
3141
    else
3142
      CFLAGS="-O2 $CFLAGS"
3143
    fi
3144
  fi
3145
 
3146
  if test "$kde_use_debug_define" = "yes"; then
3147
    CFLAGS="-DNDEBUG $CFLAGS"
3148
  fi
3149
 
3150
 
3151
  case "$host" in
3152
  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
3153
  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
3154
  esac
3155
 
3156
  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
3157
     LDFLAGS=""
3158
  fi
3159
 
3160
  CXXFLAGS=" $CXXFLAGS"
3161
 
3162
  AC_PROG_CXX
3163
 
3164
  KDE_CHECK_FOR_BAD_COMPILER
3165
 
3166
  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
3167
    if test "$kde_use_debug_code" != "no"; then
3168
      if test "$CXX" = "KCC"; then
3169
        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3170
      else
3171
        if test "$kde_use_debug_code" = "full"; then
3172
          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3173
        else
3174
          CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
3175
        fi
3176
      fi
3177
      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3178
 
3179
      dnl convenience compiler flags
3180
      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3181
      AC_SUBST(WOVERLOADED_VIRTUAL)
3182
    else
3183
      if test "$CXX" = "KCC"; then
3184
        CXXFLAGS="+K3 $CXXFLAGS"
3185
      else
3186
        CXXFLAGS="-O2 $CXXFLAGS"
3187
      fi
3188
    fi
3189
  fi
3190
 
3191
  if test "$kde_use_debug_define" = "yes"; then
3192
    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3193
  fi  
3194
 
3195
  if test "$kde_use_profiling" = "yes"; then
3196
    KDE_CHECK_COMPILER_FLAG(pg,
3197
    [
3198
      CFLAGS="-pg $CFLAGS"
3199
      CXXFLAGS="-pg $CXXFLAGS"
3200
    ])
3201
  fi
3202
 
3203
  if test "$kde_use_warnings" = "yes"; then
3204
      if test "$GCC" = "yes"; then
3205
        CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
3206
        case $host in
3207
          *-*-linux-gnu)	
3208
            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3209
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
3210
            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3211
            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3212
          ;;
3213
        esac
3214
        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3215
        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3216
        dnl ### FIXME: revert for KDE 4
3217
        KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
3218
     fi
3219
  fi
3220
 
3221
  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3222
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3223
  fi
3224
 
3225
  AC_ARG_ENABLE(pch,
3226
     AC_HELP_STRING([--enable-pch],
3227
                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3228
    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3229
 
3230
  HAVE_GCC_VISIBILITY=0
3231
  AC_SUBST([HAVE_GCC_VISIBILITY])
3232
 
3233
  if test "$GXX" = "yes"; then
3234
    gcc_no_reorder_blocks=NO
3235
    KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
3236
    if test $kde_use_debug_code != "no" && \
3237
       test $kde_use_debug_code != "full" && \
3238
       test "YES" = "$gcc_no_reorder_blocks" ; then
3239
          CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
3240
          CFLAGS="$CFLAGS -fno-reorder-blocks"
3241
    fi
3242
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3243
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3244
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3245
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=	)
3246
    ENABLE_PERMISSIVE_FLAG="-fpermissive"
3247
 
3248
    if test "$kde_use_pch" = "yes"; then
3249
        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3250
        echo >conftest.h
3251
        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3252
            kde_gcc_supports_pch=yes
3253
            AC_MSG_RESULT(yes)
3254
        else
3255
            kde_gcc_supports_pch=no
3256
            AC_MSG_RESULT(no)
3257
        fi
3258
        if test "$kde_gcc_supports_pch" = "yes"; then
3259
            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3260
            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3261
                kde_gcc_supports_pch=yes
3262
                AC_MSG_RESULT(yes)
3263
            else
3264
                kde_gcc_supports_pch=no
3265
                AC_MSG_RESULT(no)
3266
            fi
3267
        fi
3268
        rm -f conftest.h conftest.h.gch
3269
    fi
3270
 
3271
    KDE_CHECK_FOR_OPT_NOINLINE_MATCH
3272
    if test "x$kde_cv_opt_noinline_match" = "xno" ; then
3273
       CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
3274
    fi
3275
  fi
3276
  AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3277
  if test "$CXX" = "KCC"; then
3278
    dnl unfortunately we currently cannot disable exception support in KCC
3279
    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3280
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3281
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=	)
3282
 
3283
    if test "$kde_use_pch" = "yes"; then
3284
      dnl TODO: support --pch-dir!
3285
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3286
      dnl the below works (but the dir must exist), but it's
3287
      dnl useless for a whole package.
3288
      dnl The are precompiled headers for each source file, so when compiling
3289
      dnl from scratch, it doesn't make a difference, and they take up
3290
      dnl around ~5Mb _per_ sourcefile.
3291
      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3292
      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3293
    fi
3294
    dnl this flag controls inlining. by default KCC inlines in optimisation mode
3295
    dnl all implementations that are defined inside the class {} declaration. 
3296
    dnl because of templates-compatibility with broken gcc compilers, this
3297
    dnl can cause excessive inlining. This flag limits it to a sane level
3298
    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3299
    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3300
    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3301
    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3302
    dnl Some source files are shared between multiple executables
3303
    dnl (or libraries) and some of those need template instantiations.
3304
    dnl In that case KCC needs to compile those sources with
3305
    dnl --one_instantiation_per_object.  To make it easy for us we compile
3306
    dnl _all_ objects with that flag (--one_per is a shorthand).
3307
    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3308
  fi
3309
  AC_SUBST(USE_EXCEPTIONS)
3310
  dnl obsolete macro - provided to keep things going
3311
  USE_RTTI=
3312
  AC_SUBST(USE_RTTI)
3313
 
3314
  case "$host" in
3315
      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3316
      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3317
      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3318
      *-*-solaris*) 
3319
        if test "$GXX" = yes; then
3320
          libstdcpp=`$CXX -print-file-name=libstdc++.so`
3321
          if test ! -f $libstdcpp; then
3322
             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])
3323
          fi
3324
        fi
3325
        ;;
3326
  esac
3327
 
3328
  AC_VALIDIFY_CXXFLAGS
3329
 
3330
  AC_PROG_CXXCPP
3331
 
3332
  if test "$GCC" = yes; then
3333
     NOOPT_CFLAGS=-O0
3334
  fi
3335
  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3336
 
3337
  AC_ARG_ENABLE(coverage,
3338
    AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
3339
      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
3340
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3341
        ac_coverage_linker="-lgcc"
3342
      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
3343
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3344
        ac_coverage_linker=""
3345
      else
3346
        AC_MSG_ERROR([coverage with your compiler is not supported])
3347
      fi
3348
      CFLAGS="$CFLAGS $ac_coverage_compiler"
3349
      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
3350
      LDFLAGS="$LDFLAGS $ac_coverage_linker"
3351
    ])
3352
 
3353
  AC_SUBST(NOOPT_CXXFLAGS)
3354
  AC_SUBST(NOOPT_CFLAGS)
3355
  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3356
 
3357
  KDE_CHECK_NEW_LDFLAGS
3358
  KDE_CHECK_FINAL
3359
  KDE_CHECK_CLOSURE
3360
  KDE_CHECK_NMCHECK
3361
 
3362
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3363
])
3364
 
3365
AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
3366
  [
3367
    AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
3368
      [
3369
        AC_LANG_SAVE
3370
        AC_LANG_CPLUSPLUS
3371
 
3372
        safe_CXXFLAGS=$CXXFLAGS
3373
        safe_LDFLAGS=$LDFLAGS
3374
        CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
3375
        LDFLAGS="$LDFLAGS -shared -fPIC"
3376
 
3377
        AC_TRY_LINK(
3378
        [
3379
          /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
3380
	  #include <string>
3381
          int some_function( void ) __attribute__ ((visibility("default")));
3382
          int some_function( void )
3383
          {
3384
	    std::string s("blafasel");
3385
            return 0;
3386
          }
3387
        ], [/* elvis is alive */],
3388
        kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
3389
 
3390
        CXXFLAGS=$safe_CXXFLAGS
3391
        LDFLAGS=$safe_LDFLAGS
3392
        AC_LANG_RESTORE
3393
      ]
3394
    )
3395
 
3396
    if test x$kde_cv_val_gcc_visibility_bug = xno; then
3397
      CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
3398
    fi
3399
  ]
3400
)
3401
 
3402
AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3403
[
3404
  AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
3405
 
3406
  AC_MSG_CHECKING([grepping for visibility push/pop in headers])
3407
 
3408
  if test "x$GXX" = "xyes"; then
3409
    AC_LANG_SAVE
3410
    AC_LANG_CPLUSPLUS
3411
    AC_EGREP_CPP(
3412
       [GCC visibility push],
3413
       [ #include <exception> 
3414
       ], 
3415
    [
3416
      AC_MSG_RESULT(yes)
3417
      kde_stdc_visibility_patched=yes ],
3418
    [ 
3419
      AC_MSG_RESULT(no)
3420
      AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for 
3421
                   visibility support. Disabling -fvisibility=hidden])
3422
 
3423
      kde_stdc_visibility_patched=no ])
3424
 
3425
    AC_LANG_RESTORE
3426
 
3427
    kde_have_gcc_visibility=no
3428
    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
3429
    [
3430
      kde_have_gcc_visibility=yes
3431
      dnl the whole toolchain is just a mess, gcc is just too buggy
3432
      dnl to handle STL with visibility enabled. Lets reconsider 
3433
      dnl when gcc 4.2 is out or when things get fixed in the compiler.
3434
      dnl Contact mueller@kde.org for details.
3435
      AC_ARG_ENABLE(gcc-hidden-visibility,
3436
        AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
3437
          [kde_have_gcc_visibility=$enableval],
3438
          [kde_have_gcc_visibility=no])
3439
 
3440
      AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
3441
        [
3442
          AC_LANG_SAVE
3443
          AC_LANG_CPLUSPLUS
3444
 
3445
          safe_CXXFLAGS=$CXXFLAGS
3446
          CXXFLAGS="$CXXFLAGS $all_includes"
3447
 
3448
          AC_TRY_COMPILE(
3449
          [
3450
#include <qglobal.h>
3451
#if Q_EXPORT - 0 != 0
3452
/* if this compiles, then Q_EXPORT is undefined */
3453
/* if Q_EXPORT is nonempty, this will break compilation */
3454
#endif
3455
          ], [/* elvis is alive */],
3456
          kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
3457
 
3458
          CXXFLAGS=$safe_CXXFLAGS
3459
          AC_LANG_RESTORE
3460
        ]
3461
      )
3462
 
3463
      if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
3464
        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
3465
        KDE_CHECK_VISIBILITY_GCC_BUG
3466
        HAVE_GCC_VISIBILITY=1
3467
        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3468
      fi
3469
    ])
3470
  fi
3471
])
3472
 
3473
AC_DEFUN([KDE_ADD_DEPENDENCIES],
3474
[
3475
   [A]M_DEPENDENCIES(CC)
3476
   [A]M_DEPENDENCIES(CXX)
3477
])
3478
 
3479
dnl just a wrapper to clean up configure.in
3480
AC_DEFUN([KDE_PROG_LIBTOOL],
3481
[
3482
AC_REQUIRE([AC_CHECK_COMPILERS])
3483
AC_REQUIRE([AC_ENABLE_SHARED])
3484
AC_REQUIRE([AC_ENABLE_STATIC])
3485
 
3486
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3487
AC_REQUIRE([KDE_CHECK_LIB64])
3488
 
3489
AC_OBJEXT
3490
AC_EXEEXT
3491
 
3492
AM_PROG_LIBTOOL
3493
AC_LIBTOOL_CXX
3494
 
3495
LIBTOOL_SHELL="/bin/sh ./libtool"
3496
#  LIBTOOL="$LIBTOOL --silent"
3497
KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3498
AC_SUBST(KDE_PLUGIN)
3499
 
3500
# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
3501
KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
3502
AC_SUBST(KDE_CHECK_PLUGIN)
3503
 
3504
# we patch configure quite some so we better keep that consistent for incremental runs 
3505
AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3506
])
3507
 
3508
AC_DEFUN([KDE_CHECK_LIB64],
3509
[
3510
    AC_ARG_ENABLE(libsuffix,
3511
        AC_HELP_STRING([--enable-libsuffix],
3512
            [/lib directory suffix (64,32,none,auto[=default])]),
3513
            kdelibsuff=$enableval, kdelibsuff="auto")
3514
 
3515
    if test "$kdelibsuff" = "auto"; then
3516
 
3517
cat > conftest.c << EOF
3518
#include <stdio.h>
3519
int main() {
3520
 return 0;
3521
}
3522
EOF
3523
        kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
3524
    s,.*/lib\([[^\/]]*\)/.*,\1, 
3525
    p 
3526
}'`
3527
	rm -rf conftest.*
3528
    fi	
3529
 
3530
    if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
3531
       kdelibsuff=
3532
    fi
3533
    if test -z "$kdelibsuff"; then
3534
        AC_MSG_RESULT([not using lib directory suffix])
3535
        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3536
    else
3537
        if test "$libdir" = '${exec_prefix}/lib'; then
3538
            libdir="$libdir${kdelibsuff}"
3539
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3540
        fi
3541
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3542
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3543
    fi
3544
])
3545
 
3546
AC_DEFUN([KDE_CHECK_TYPES],
3547
[  AC_CHECK_SIZEOF(int, 4)dnl
3548
   AC_CHECK_SIZEOF(short)dnl
3549
  AC_CHECK_SIZEOF(long, 4)dnl
3550
  AC_CHECK_SIZEOF(char *, 4)dnl
3551
])dnl
3552
 
3553
dnl Not used - kept for compat only?
3554
AC_DEFUN([KDE_DO_IT_ALL],
3555
[
3556
AC_CANONICAL_SYSTEM
3557
AC_ARG_PROGRAM
3558
AM_INIT_AUTOMAKE($1, $2)
3559
AM_DISABLE_LIBRARIES
3560
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3561
AC_CHECK_COMPILERS
3562
KDE_PROG_LIBTOOL
3563
AM_KDE_WITH_NLS
3564
AC_PATH_KDE
3565
])
3566
 
3567
AC_DEFUN([AC_CHECK_RPATH],
3568
[
3569
AC_MSG_CHECKING(for rpath)
3570
AC_ARG_ENABLE(rpath,
3571
      AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3572
      USE_RPATH=$enableval, USE_RPATH=yes)
3573
 
3574
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3575
 
3576
  KDE_RPATH="-R \$(libdir)"
3577
 
3578
  if test "$kde_libraries" != "$libdir"; then
3579
      KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
3580
  fi
3581
 
3582
  if test -n "$qt_libraries"; then
3583
    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3584
  fi
3585
  dnl $x_libraries is set to /usr/lib in case
3586
  if test -n "$X_LDFLAGS"; then
3587
    X_RPATH="-R \$(x_libraries)"
3588
    KDE_RPATH="$KDE_RPATH $X_RPATH"
3589
  fi
3590
  if test -n "$KDE_EXTRA_RPATH"; then
3591
    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3592
  fi
3593
fi
3594
AC_SUBST(KDE_EXTRA_RPATH)
3595
AC_SUBST(KDE_RPATH)
3596
AC_SUBST(X_RPATH)
3597
AC_MSG_RESULT($USE_RPATH)
3598
])
3599
 
3600
dnl Check for the type of the third argument of getsockname
3601
AC_DEFUN([AC_CHECK_SOCKLEN_T],
3602
[
3603
   AC_MSG_CHECKING(for socklen_t)
3604
   AC_CACHE_VAL(kde_cv_socklen_t,
3605
   [
3606
      AC_LANG_PUSH(C++)
3607
      kde_cv_socklen_t=no
3608
      AC_TRY_COMPILE([
3609
         #include <sys/types.h>
3610
         #include <sys/socket.h>
3611
      ],
3612
      [
3613
         socklen_t len;
3614
         getpeername(0,0,&len);
3615
      ],
3616
      [
3617
         kde_cv_socklen_t=yes
3618
         kde_cv_socklen_t_equiv=socklen_t
3619
      ])
3620
      AC_LANG_POP(C++)
3621
   ])
3622
   AC_MSG_RESULT($kde_cv_socklen_t)
3623
   if test $kde_cv_socklen_t = no; then
3624
      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3625
      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3626
      [
3627
         kde_cv_socklen_t_equiv=int
3628
         AC_LANG_PUSH(C++)
3629
         for t in int size_t unsigned long "unsigned long"; do
3630
            AC_TRY_COMPILE([
3631
               #include <sys/types.h>
3632
               #include <sys/socket.h>
3633
            ],
3634
            [
3635
               $t len;
3636
               getpeername(0,0,&len);
3637
            ],
3638
            [
3639
               kde_cv_socklen_t_equiv="$t"
3640
               break
3641
            ])
3642
         done
3643
         AC_LANG_POP(C++)
3644
      ])
3645
      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3646
   fi
3647
   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3648
                     [type to use in place of socklen_t if not defined])
3649
   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3650
                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3651
])
3652
 
3653
dnl This is a merge of some macros out of the gettext aclocal.m4
3654
dnl since we don't need anything, I took the things we need
3655
dnl the copyright for them is:
3656
dnl >
3657
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3658
dnl This Makefile.in is free software; the Free Software Foundation
3659
dnl gives unlimited permission to copy and/or distribute it,
3660
dnl with or without modifications, as long as this notice is preserved.
3661
 
3662
dnl This program is distributed in the hope that it will be useful,
3663
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3664
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3665
dnl PARTICULAR PURPOSE.
3666
dnl >
3667
dnl for this file it is relicensed under LGPL
3668
 
3669
AC_DEFUN([AM_KDE_WITH_NLS],
3670
  [
3671
    dnl If we use NLS figure out what method
3672
 
3673
    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3674
        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3675
    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3676
 
3677
     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3678
        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3679
        GMSGFMT=":"
3680
      fi
3681
      MSGFMT=$GMSGFMT
3682
      AC_SUBST(GMSGFMT)
3683
      AC_SUBST(MSGFMT)
3684
 
3685
      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3686
	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3687
 
3688
      dnl Test whether we really found GNU xgettext.
3689
      if test "$XGETTEXT" != ":"; then
3690
	dnl If it is no GNU xgettext we define it as : so that the
3691
	dnl Makefiles still can work.
3692
	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3693
	  : ;
3694
	else
3695
	  AC_MSG_RESULT(
3696
	    [found xgettext programs is not GNU xgettext; ignore it])
3697
	  XGETTEXT=":"
3698
	fi
3699
      fi
3700
     AC_SUBST(XGETTEXT)
3701
 
3702
  ])
3703
 
3704
# Search path for a program which passes the given test.
3705
# Ulrich Drepper <drepper@cygnus.com>, 1996.
3706
 
3707
# serial 1
3708
# Stephan Kulow: I appended a _KDE against name conflicts
3709
 
3710
dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3711
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3712
AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3713
[# Extract the first word of "$2", so it can be a program name with args.
3714
set dummy $2; ac_word=[$]2
3715
AC_MSG_CHECKING([for $ac_word])
3716
AC_CACHE_VAL(ac_cv_path_$1,
3717
[case "[$]$1" in
3718
  /*)
3719
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3720
  ;;
3721
  *)
3722
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3723
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
3724
    test -z "$ac_dir" && ac_dir=.
3725
    if test -f $ac_dir/$ac_word; then
3726
      if [$3]; then
3727
	ac_cv_path_$1="$ac_dir/$ac_word"
3728
	break
3729
      fi
3730
    fi
3731
  done
3732
  IFS="$ac_save_ifs"
3733
dnl If no 4th arg is given, leave the cache variable unset,
3734
dnl so AC_PATH_PROGS will keep looking.
3735
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3736
])dnl
3737
  ;;
3738
esac])dnl
3739
$1="$ac_cv_path_$1"
3740
if test -n "[$]$1"; then
3741
  AC_MSG_RESULT([$]$1)
3742
else
3743
  AC_MSG_RESULT(no)
3744
fi
3745
AC_SUBST($1)dnl
3746
])
3747
 
3748
 
3749
# Check whether LC_MESSAGES is available in <locale.h>.
3750
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3751
 
3752
# serial 1
3753
 
3754
AC_DEFUN([AM_LC_MESSAGES],
3755
  [if test $ac_cv_header_locale_h = yes; then
3756
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3757
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3758
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3759
    if test $am_cv_val_LC_MESSAGES = yes; then
3760
      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3761
    fi
3762
  fi])
3763
 
3764
dnl From Jim Meyering.
3765
dnl FIXME: migrate into libit.
3766
 
3767
AC_DEFUN([AM_FUNC_OBSTACK],
3768
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3769
 [AC_TRY_LINK([#include "obstack.h"],
3770
	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
3771
	      am_cv_func_obstack=yes,
3772
	      am_cv_func_obstack=no)])
3773
 if test $am_cv_func_obstack = yes; then
3774
   AC_DEFINE(HAVE_OBSTACK)
3775
 else
3776
   LIBOBJS="$LIBOBJS obstack.o"
3777
 fi
3778
])
3779
 
3780
dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3781
dnl FIXME: Migrate into libit
3782
 
3783
AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3784
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3785
 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3786
              am_cv_lib_error_at_line=yes,
3787
	      am_cv_lib_error_at_line=no)])
3788
 if test $am_cv_lib_error_at_line = no; then
3789
   LIBOBJS="$LIBOBJS error.o"
3790
 fi
3791
 AC_SUBST(LIBOBJS)dnl
3792
])
3793
 
3794
# Macro to add for using GNU gettext.
3795
# Ulrich Drepper <drepper@cygnus.com>, 1995.
3796
 
3797
# serial 1
3798
# Stephan Kulow: I put a KDE in it to avoid name conflicts
3799
 
3800
AC_DEFUN([AM_KDE_GNU_GETTEXT],
3801
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3802
   AC_REQUIRE([AC_PROG_RANLIB])dnl
3803
   AC_REQUIRE([AC_HEADER_STDC])dnl
3804
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
3805
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3806
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3807
   AC_REQUIRE([AC_FUNC_MMAP])dnl
3808
   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3809
   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3810
   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3811
__argz_count __argz_stringify __argz_next])
3812
 
3813
   AC_MSG_CHECKING(for stpcpy)
3814
   AC_CACHE_VAL(kde_cv_func_stpcpy,
3815
   [
3816
   kde_safe_cxxflags=$CXXFLAGS
3817
   CXXFLAGS="-Werror"
3818
   AC_LANG_SAVE
3819
   AC_LANG_CPLUSPLUS
3820
   AC_TRY_COMPILE([
3821
   #include <string.h>
3822
   ],
3823
   [
3824
   char buffer[200];
3825
   stpcpy(buffer, buffer);
3826
   ],
3827
   kde_cv_func_stpcpy=yes,
3828
   kde_cv_func_stpcpy=no)
3829
   AC_LANG_RESTORE
3830
   CXXFLAGS=$kde_safe_cxxflags
3831
   ])
3832
   AC_MSG_RESULT($kde_cv_func_stpcpy)
3833
   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3834
     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3835
   fi
3836
 
3837
   AM_LC_MESSAGES
3838
 
3839
   if test "x$CATOBJEXT" != "x"; then
3840
     if test "x$ALL_LINGUAS" = "x"; then
3841
       LINGUAS=
3842
     else
3843
       AC_MSG_CHECKING(for catalogs to be installed)
3844
       NEW_LINGUAS=
3845
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
3846
         case "$ALL_LINGUAS" in
3847
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3848
         esac
3849
       done
3850
       LINGUAS=$NEW_LINGUAS
3851
       AC_MSG_RESULT($LINGUAS)
3852
     fi
3853
 
3854
     dnl Construct list of names of catalog files to be constructed.
3855
     if test -n "$LINGUAS"; then
3856
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3857
     fi
3858
   fi
3859
 
3860
  ])
3861
 
3862
AC_DEFUN([AC_HAVE_XPM],
3863
 [AC_REQUIRE_CPP()dnl
3864
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3865
 
3866
 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3867
 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3868
 
3869
 AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3870
	xpm_test=$withval, xpm_test="yes")
3871
 if test "x$xpm_test" = xno; then
3872
   ac_cv_have_xpm=no
3873
 else
3874
   AC_MSG_CHECKING(for XPM)
3875
   AC_CACHE_VAL(ac_cv_have_xpm,
3876
   [
3877
    ac_save_ldflags="$LDFLAGS"
3878
    ac_save_cflags="$CFLAGS"
3879
    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3880
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3881
    else
3882
      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3883
    fi
3884
    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3885
    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3886
    AC_TRY_LINK([#include <X11/xpm.h>],[],
3887
	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3888
    LDFLAGS="$ac_save_ldflags"
3889
    CFLAGS="$ac_save_cflags"
3890
   ])dnl
3891
 
3892
  if test "$ac_cv_have_xpm" = no; then
3893
    AC_MSG_RESULT(no)
3894
    XPM_LDFLAGS=""
3895
    XPMINC=""
3896
    $2
3897
  else
3898
    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3899
    if test "$XPM_LDFLAGS" = ""; then
3900
       XPMLIB='-lXpm $(LIB_X11)'
3901
    else
3902
       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3903
    fi
3904
    if test "$XPM_INCLUDE" = ""; then
3905
       XPMINC=""
3906
    else
3907
       XPMINC="-I$XPM_INCLUDE"
3908
    fi
3909
    AC_MSG_RESULT(yes)
3910
    $1
3911
  fi
3912
 fi
3913
 AC_SUBST(XPMINC)
3914
 AC_SUBST(XPMLIB)
3915
])
3916
 
3917
AC_DEFUN([AC_HAVE_DPMS],
3918
 [AC_REQUIRE_CPP()dnl
3919
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3920
 
3921
 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3922
 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3923
 DPMS_LIB=
3924
 
3925
 AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3926
	dpms_test=$withval, dpms_test="yes")
3927
 if test "x$dpms_test" = xno; then
3928
   ac_cv_have_dpms=no
3929
 else
3930
   AC_MSG_CHECKING(for DPMS)
3931
   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3932
   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3933
   AC_CACHE_VAL(ac_cv_have_dpms,
3934
   [
3935
    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3936
      AC_MSG_RESULT(no)
3937
      ac_cv_have_dpms="no"
3938
    else
3939
      ac_save_ldflags="$LDFLAGS"
3940
      ac_save_cflags="$CFLAGS"
3941
      ac_save_libs="$LIBS"
3942
      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
3943
      LIBS="-lX11 -lXext $LIBSOCKET"
3944
      CFLAGS="$CFLAGS $X_INCLUDES"
3945
      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3946
      AC_TRY_LINK([
3947
	  #include <X11/Xproto.h>
3948
	  #include <X11/X.h>
3949
	  #include <X11/Xlib.h>
3950
	  #include <X11/extensions/dpms.h>
3951
	  int foo_test_dpms()
3952
	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3953
	  ac_cv_have_dpms="yes", [
3954
              LIBS="-lXdpms $LIBS"
3955
              AC_TRY_LINK([
3956
	          #include <X11/Xproto.h>
3957
        	  #include <X11/X.h>
3958
        	  #include <X11/Xlib.h>
3959
        	  #include <X11/extensions/dpms.h>
3960
        	  int foo_test_dpms()
3961
        	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3962
        	  [
3963
                  ac_cv_have_dpms="-lXdpms"
3964
                  ],ac_cv_have_dpms="no")
3965
              ])
3966
      LDFLAGS="$ac_save_ldflags"
3967
      CFLAGS="$ac_save_cflags"
3968
      LIBS="$ac_save_libs"
3969
    fi
3970
   ])dnl
3971
 
3972
  if test "$ac_cv_have_dpms" = no; then
3973
    AC_MSG_RESULT(no)
3974
    DPMS_LDFLAGS=""
3975
    DPMSINC=""
3976
    $2
3977
  else
3978
    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3979
    if test "$ac_cv_have_dpms" = "-lXdpms"; then
3980
       DPMS_LIB="-lXdpms"
3981
    fi
3982
    if test "$DPMS_LDFLAGS" = ""; then
3983
       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3984
    else
3985
       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3986
    fi
3987
    if test "$DPMS_INCLUDE" = ""; then
3988
       DPMSINC=""
3989
    else
3990
       DPMSINC="-I$DPMS_INCLUDE"
3991
    fi
3992
    AC_MSG_RESULT(yes)
3993
    $1
3994
  fi
3995
 fi
3996
 ac_save_cflags="$CFLAGS"
3997
 CFLAGS="$CFLAGS $X_INCLUDES"
3998
 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3999
 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
4000
   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
4001
 AC_CHECK_DECL(DPMSCapable,
4002
   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
4003
   [#include <X11/Xlib.h>
4004
   #include <X11/extensions/dpms.h>])
4005
 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
4006
   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
4007
 AC_CHECK_DECL(DPMSInfo,
4008
   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
4009
   [#include <X11/Xlib.h>
4010
   #include <X11/extensions/dpms.h>])
4011
 CFLAGS="$ac_save_cflags"
4012
 AC_SUBST(DPMSINC)
4013
 AC_SUBST(DPMSLIB)
4014
])
4015
 
4016
AC_DEFUN([AC_HAVE_GL],
4017
 [AC_REQUIRE_CPP()dnl
4018
  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4019
 
4020
 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
4021
 test -z "$GL_INCLUDE" && GL_INCLUDE=
4022
 
4023
 AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
4024
	gl_test=$withval, gl_test="yes")
4025
 if test "x$kde_use_qt_emb" = "xyes"; then
4026
   # GL and Qt Embedded is a no-go for now.
4027
   ac_cv_have_gl=no
4028
 elif test "x$gl_test" = xno; then
4029
   ac_cv_have_gl=no
4030
 else
4031
   AC_MSG_CHECKING(for GL)
4032
   AC_CACHE_VAL(ac_cv_have_gl,
4033
   [
4034
    AC_LANG_SAVE
4035
    AC_LANG_CPLUSPLUS
4036
    ac_save_ldflags=$LDFLAGS
4037
    ac_save_cxxflags=$CXXFLAGS
4038
    ac_save_libs=$LIBS
4039
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
4040
    LIBS="$LIBS -lGL -lGLU"
4041
    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
4042
    LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
4043
    CXXFLAGS="$CFLAGS $X_INCLUDES"
4044
    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
4045
    AC_TRY_LINK([#include <GL/gl.h>
4046
#include <GL/glu.h>
4047
], [],
4048
	ac_cv_have_gl="yes", ac_cv_have_gl="no")
4049
    AC_LANG_RESTORE
4050
    LDFLAGS=$ac_save_ldflags
4051
    CXXFLAGS=$ac_save_cxxflags
4052
    LIBS=$ac_save_libs
4053
   ])dnl
4054
 
4055
  if test "$ac_cv_have_gl" = "no"; then
4056
    AC_MSG_RESULT(no)
4057
    GL_LDFLAGS=""
4058
    GLINC=""
4059
    $2
4060
  else
4061
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
4062
    if test "$GL_LDFLAGS" = ""; then
4063
       GLLIB='-lGLU -lGL $(LIB_X11)'
4064
    else
4065
       GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
4066
    fi
4067
    if test "$GL_INCLUDE" = ""; then
4068
       GLINC=""
4069
    else
4070
       GLINC="-I$GL_INCLUDE"
4071
    fi
4072
    AC_MSG_RESULT($ac_cv_have_gl)
4073
    $1
4074
  fi
4075
 fi
4076
 AC_SUBST(GLINC)
4077
 AC_SUBST(GLLIB)
4078
])
4079
 
4080
 
4081
 dnl shadow password and PAM magic - maintained by ossi@kde.org
4082
 
4083
AC_DEFUN([KDE_PAM], [
4084
  AC_REQUIRE([KDE_CHECK_LIBDL])
4085
 
4086
  want_pam=
4087
  AC_ARG_WITH(pam,
4088
    AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
4089
    [ if test "x$withval" = "xyes"; then
4090
        want_pam=yes
4091
        pam_service=kde
4092
      elif test "x$withval" = "xno"; then
4093
        want_pam=no
4094
      else
4095
        want_pam=yes
4096
        pam_service=$withval
4097
      fi
4098
    ], [ pam_service=kde ])
4099
 
4100
  use_pam=
4101
  PAMLIBS=
4102
  if test "x$want_pam" != xno; then
4103
    AC_CHECK_LIB(pam, pam_start, [
4104
      AC_CHECK_HEADER(security/pam_appl.h,
4105
        [ pam_header=security/pam_appl.h ],
4106
        [ AC_CHECK_HEADER(pam/pam_appl.h,
4107
            [ pam_header=pam/pam_appl.h ],
4108
            [
4109
    AC_MSG_WARN([PAM detected, but no headers found!
4110
Make sure you have the necessary development packages installed.])
4111
            ]
4112
          )
4113
        ]
4114
      )
4115
    ], , $LIBDL)
4116
    if test -z "$pam_header"; then
4117
      if test "x$want_pam" = xyes; then
4118
        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
4119
      fi
4120
    else
4121
      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
4122
      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
4123
      use_pam=yes
4124
 
4125
      dnl darwin claims to be something special
4126
      if test "$pam_header" = "pam/pam_appl.h"; then
4127
        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
4128
      fi
4129
 
4130
      dnl test whether struct pam_message is const (Linux) or not (Sun)
4131
      AC_MSG_CHECKING(for const pam_message)
4132
      AC_EGREP_HEADER([struct pam_message], $pam_header,
4133
        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
4134
                          [AC_MSG_RESULT([const: Linux-type PAM])],
4135
                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
4136
                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
4137
                          )],
4138
        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
4139
    fi
4140
  fi
4141
 
4142
  AC_SUBST(PAMLIBS)
4143
])
4144
 
4145
dnl DEF_PAM_SERVICE(arg name, full name, define name)
4146
AC_DEFUN([DEF_PAM_SERVICE], [
4147
  AC_ARG_WITH($1-pam,
4148
    AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
4149
    [ if test "x$use_pam" = xyes; then
4150
        $3_PAM_SERVICE=$withval
4151
      else
4152
        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
4153
You may want to enforce it by using --with-pam.])
4154
      fi
4155
    ], 
4156
    [ if test "x$use_pam" = xyes; then
4157
        $3_PAM_SERVICE="$pam_service"
4158
      fi
4159
    ])
4160
    if test -n "$$3_PAM_SERVICE"; then
4161
      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
4162
      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
4163
    fi
4164
    AC_SUBST($3_PAM_SERVICE)
4165
])
4166
 
4167
AC_DEFUN([KDE_SHADOWPASSWD], [
4168
  AC_REQUIRE([KDE_PAM])
4169
 
4170
  AC_CHECK_LIB(shadow, getspent,
4171
    [ LIBSHADOW="-lshadow"
4172
      ac_use_shadow=yes
4173
    ],
4174
    [ dnl for UnixWare
4175
      AC_CHECK_LIB(gen, getspent, 
4176
        [ LIBGEN="-lgen"
4177
          ac_use_shadow=yes
4178
        ], 
4179
        [ AC_CHECK_FUNC(getspent, 
4180
            [ ac_use_shadow=yes ],
4181
            [ ac_use_shadow=no ])
4182
	])
4183
    ])
4184
  AC_SUBST(LIBSHADOW)
4185
  AC_SUBST(LIBGEN)
4186
 
4187
  AC_MSG_CHECKING([for shadow passwords])
4188
 
4189
  AC_ARG_WITH(shadow,
4190
    AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
4191
    [ if test "x$withval" != "xno"; then
4192
        use_shadow=yes
4193
      else
4194
        use_shadow=no
4195
      fi
4196
    ], [
4197
      use_shadow="$ac_use_shadow"
4198
    ])
4199
 
4200
  if test "x$use_shadow" = xyes; then
4201
    AC_MSG_RESULT(yes)
4202
    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
4203
  else
4204
    AC_MSG_RESULT(no)
4205
    LIBSHADOW=
4206
    LIBGEN=
4207
  fi
4208
 
4209
  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
4210
  dnl this still applies, if we could use it indirectly through pam.
4211
  if test "x$use_shadow" = xyes || 
4212
     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
4213
      case $host in
4214
      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
4215
	SETUIDFLAGS="-m 4755 -o root";;
4216
      *)
4217
	SETUIDFLAGS="-m 4755";;
4218
      esac
4219
  fi
4220
  AC_SUBST(SETUIDFLAGS)
4221
 
4222
])
4223
 
4224
AC_DEFUN([KDE_PASSWDLIBS], [
4225
  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
4226
  AC_REQUIRE([KDE_PAM])
4227
  AC_REQUIRE([KDE_SHADOWPASSWD])
4228
 
4229
  if test "x$use_pam" = "xyes"; then 
4230
    PASSWDLIBS="$PAMLIBS"
4231
  else
4232
    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
4233
  fi
4234
 
4235
  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
4236
  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
4237
  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
4238
  dnl may need to read /etc/master.passwd).
4239
  case $host in
4240
  *-*-freebsd*)
4241
    SETUIDFLAGS="-m 4755 -o root"
4242
    ;;
4243
  *)
4244
    ;;
4245
  esac
4246
 
4247
  AC_SUBST(PASSWDLIBS)
4248
])
4249
 
4250
AC_DEFUN([KDE_CHECK_LIBDL],
4251
[
4252
AC_CHECK_LIB(dl, dlopen, [
4253
LIBDL="-ldl"
4254
ac_cv_have_dlfcn=yes
4255
])
4256
 
4257
AC_CHECK_LIB(dld, shl_unload, [
4258
LIBDL="-ldld"
4259
ac_cv_have_shload=yes
4260
])
4261
 
4262
AC_SUBST(LIBDL)
4263
])
4264
 
4265
AC_DEFUN([KDE_CHECK_DLOPEN],
4266
[
4267
KDE_CHECK_LIBDL
4268
AC_CHECK_HEADERS(dlfcn.h dl.h)
4269
if test "$ac_cv_header_dlfcn_h" = "no"; then
4270
  ac_cv_have_dlfcn=no
4271
fi
4272
 
4273
if test "$ac_cv_header_dl_h" = "no"; then
4274
  ac_cv_have_shload=no
4275
fi
4276
 
4277
dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
4278
dnl (MM)
4279
AC_ARG_ENABLE(dlopen,
4280
AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
4281
enable_dlopen=$enableval,
4282
enable_dlopen=yes)
4283
 
4284
# override the user's opinion, if we know it better ;)
4285
if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
4286
  enable_dlopen=no
4287
fi
4288
 
4289
if test "$ac_cv_have_dlfcn" = "yes"; then
4290
  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4291
fi
4292
 
4293
if test "$ac_cv_have_shload" = "yes"; then
4294
  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4295
fi
4296
 
4297
if test "$enable_dlopen" = no ; then
4298
  test -n "$1" && eval $1
4299
else
4300
  test -n "$2" && eval $2
4301
fi
4302
 
4303
])
4304
 
4305
AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4306
[
4307
KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4308
KDE_PROG_LIBTOOL
4309
AC_MSG_CHECKING([dynamic loading])
4310
eval "`egrep '^build_libtool_libs=' libtool`"
4311
if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4312
  dynamic_loading=yes
4313
  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4314
else
4315
  dynamic_loading=no
4316
fi
4317
AC_MSG_RESULT($dynamic_loading)
4318
if test "$dynamic_loading" = "yes"; then
4319
  $1
4320
else
4321
  $2
4322
fi
4323
])
4324
 
4325
AC_DEFUN([KDE_ADD_INCLUDES],
4326
[
4327
if test -z "$1"; then
4328
  test_include="Pix.h"
4329
else
4330
  test_include="$1"
4331
fi
4332
 
4333
AC_MSG_CHECKING([for libg++ ($test_include)])
4334
 
4335
AC_CACHE_VAL(kde_cv_libgpp_includes,
4336
[
4337
kde_cv_libgpp_includes=no
4338
 
4339
   for ac_dir in               \
4340
                               \
4341
     /usr/include/g++          \
4342
     /usr/include              \
4343
     /usr/unsupported/include  \
4344
     /opt/include              \
4345
     $extra_include            \
4346
     ; \
4347
   do
4348
     if test -r "$ac_dir/$test_include"; then
4349
       kde_cv_libgpp_includes=$ac_dir
4350
       break
4351
     fi
4352
   done
4353
])
4354
 
4355
AC_MSG_RESULT($kde_cv_libgpp_includes)
4356
if test "$kde_cv_libgpp_includes" != "no"; then
4357
  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4358
fi
4359
])
4360
])
4361
 
4362
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4363
[
4364
  dnl This code is here specifically to handle the
4365
  dnl various flavors of threading library on FreeBSD
4366
  dnl 4-, 5-, and 6-, and the (weird) rules around it.
4367
  dnl There may be an environment PTHREAD_LIBS that 
4368
  dnl specifies what to use; otherwise, search for it.
4369
  dnl -pthread is special cased and unsets LIBPTHREAD
4370
  dnl below if found.
4371
  LIBPTHREAD=""
4372
 
4373
  if test -n "$PTHREAD_LIBS"; then
4374
    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4375
      LIBPTHREAD="PTHREAD"
4376
    else
4377
      PTHREAD_LIBS_save="$PTHREAD_LIBS"
4378
      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4379
      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4380
      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4381
          LIBPTHREAD="$PTHREAD_LIBS_save"])
4382
      PTHREAD_LIBS="$PTHREAD_LIBS_save"
4383
    fi
4384
  fi
4385
 
4386
  dnl Is this test really needed, in the face of the Tru64 test below?
4387
  if test -z "$LIBPTHREAD"; then
4388
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4389
  fi
4390
 
4391
  dnl This is a special Tru64 check, see BR 76171 issue #18.
4392
  if test -z "$LIBPTHREAD" ; then
4393
    AC_MSG_CHECKING([for pthread_create in -lpthread])
4394
    kde_safe_libs=$LIBS
4395
    LIBS="$LIBS -lpthread"
4396
    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4397
        AC_MSG_RESULT(yes)
4398
        LIBPTHREAD="-lpthread"],[
4399
	AC_MSG_RESULT(no)])
4400
    LIBS=$kde_safe_libs
4401
  fi
4402
 
4403
  dnl Un-special-case for FreeBSD.
4404
  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4405
    LIBPTHREAD=""
4406
  fi
4407
 
4408
  AC_SUBST(LIBPTHREAD)
4409
])
4410
 
4411
AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4412
[
4413
      USE_THREADS=""
4414
      if test -z "$LIBPTHREAD"; then
4415
        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4416
      fi
4417
 
4418
    AH_VERBATIM(__svr_define, [
4419
#if defined(__SVR4) && !defined(__svr4__)
4420
#define __svr4__ 1
4421
#endif
4422
])
4423
    case $host_os in
4424
 	solaris*)
4425
		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4426
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4427
    		;;
4428
        freebsd*)
4429
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4430
                ;;
4431
        aix*)
4432
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4433
                LIBPTHREAD="$LIBPTHREAD -lc_r"
4434
                ;;
4435
        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4436
                if test "$CXX" = "KCC"; then
4437
                  CXXFLAGS="$CXXFLAGS --thread_safe"
4438
		  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4439
                fi
4440
                ;;
4441
	*)
4442
		;;
4443
    esac
4444
    AC_SUBST(USE_THREADS)
4445
    AC_SUBST(LIBPTHREAD)
4446
])
4447
 
4448
AC_DEFUN([KDE_CHECK_THREADING],
4449
[
4450
  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4451
  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4452
  dnl default is yes if libpthread is found and no if no libpthread is available
4453
  if test -z "$LIBPTHREAD"; then
4454
    if test -z "$USE_THREADS"; then
4455
      kde_check_threading_default=no
4456
    else
4457
      kde_check_threading_default=yes
4458
    fi
4459
  else
4460
    kde_check_threading_default=yes
4461
  fi
4462
  AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4463
   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4464
  if test "x$kde_use_threading" = "xyes"; then
4465
    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4466
  fi
4467
])
4468
 
4469
AC_DEFUN([KDE_TRY_LINK_PYTHON],
4470
[
4471
if test "$kde_python_link_found" = no; then
4472
 
4473
if test "$1" = normal; then
4474
  AC_MSG_CHECKING(if a Python application links)
4475
else
4476
  AC_MSG_CHECKING(if Python depends on $2)
4477
fi
4478
 
4479
AC_CACHE_VAL(kde_cv_try_link_python_$1,
4480
[
4481
kde_save_cflags="$CFLAGS"
4482
CFLAGS="$CFLAGS $PYTHONINC"
4483
kde_save_libs="$LIBS"
4484
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4485
kde_save_ldflags="$LDFLAGS"
4486
LDFLAGS="$LDFLAGS $PYTHONLIB"
4487
 
4488
AC_TRY_LINK(
4489
[
4490
#include <Python.h>
4491
],[
4492
	PySys_SetArgv(1, 0);
4493
],
4494
	[kde_cv_try_link_python_$1=yes],
4495
	[kde_cv_try_link_python_$1=no]
4496
)
4497
CFLAGS="$kde_save_cflags"
4498
LIBS="$kde_save_libs"
4499
LDFLAGS="$kde_save_ldflags"
4500
])
4501
 
4502
if test "$kde_cv_try_link_python_$1" = "yes"; then
4503
  AC_MSG_RESULT(yes)
4504
  kde_python_link_found=yes
4505
  if test ! "$1" = normal; then
4506
    LIBPYTHON="$LIBPYTHON $2"
4507
  fi
4508
  $3
4509
else
4510
  AC_MSG_RESULT(no)
4511
  $4
4512
fi
4513
 
4514
fi
4515
 
4516
])
4517
 
4518
AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4519
[
4520
AC_MSG_CHECKING([for Python directory])
4521
 
4522
AC_CACHE_VAL(kde_cv_pythondir,
4523
[
4524
  if test -z "$PYTHONDIR"; then
4525
    kde_cv_pythondir=/usr/local
4526
  else
4527
    kde_cv_pythondir="$PYTHONDIR"
4528
  fi
4529
])
4530
 
4531
AC_ARG_WITH(pythondir,
4532
AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4533
[
4534
  ac_python_dir=$withval
4535
], ac_python_dir=$kde_cv_pythondir
4536
)
4537
 
4538
AC_MSG_RESULT($ac_python_dir)
4539
])
4540
 
4541
AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4542
[
4543
AC_REQUIRE([KDE_CHECK_LIBDL])
4544
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4545
AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4546
 
4547
if test -z "$1"; then
4548
  version="1.5"
4549
else
4550
  version="$1"
4551
fi
4552
 
4553
AC_MSG_CHECKING([for Python$version])
4554
 
4555
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4556
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4557
if test ! -r $python_incdir/Python.h; then
4558
  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4559
  python_incdir=$python_incdir/python$version
4560
  if test ! -r $python_incdir/Python.h; then
4561
    python_incdir=no
4562
  fi
4563
fi
4564
 
4565
PYTHONINC=-I$python_incdir
4566
 
4567
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4568
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4569
if test ! -r $python_libdir/libpython$version.so; then
4570
  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4571
  if test ! -r $python_libdir/libpython$version.a; then
4572
    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4573
    python_libdir=$python_libdir/python$version/config
4574
    if test ! -r $python_libdir/libpython$version.a; then
4575
      python_libdir=no
4576
    fi
4577
  fi
4578
fi
4579
 
4580
PYTHONLIB=-L$python_libdir
4581
kde_orig_LIBPYTHON=$LIBPYTHON
4582
if test -z "$LIBPYTHON"; then
4583
  LIBPYTHON=-lpython$version
4584
fi
4585
 
4586
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4587
python_moddir=$python_moddir/python$version
4588
if test ! -r $python_moddir/copy.py; then
4589
  python_moddir=no
4590
fi
4591
 
4592
PYTHONMODDIR=$python_moddir
4593
 
4594
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4595
 
4596
if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4597
   LIBPYTHON=$kde_orig_LIBPYTHON
4598
   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4599
   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4600
   $2
4601
else 
4602
  dnl Note: this test is very weak
4603
  kde_python_link_found=no
4604
  KDE_TRY_LINK_PYTHON(normal)
4605
  KDE_TRY_LINK_PYTHON(m, -lm)
4606
  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4607
  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4608
  KDE_TRY_LINK_PYTHON(db2, -ldb2)
4609
  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4610
  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4611
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4612
  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4613
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4614
  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4615
  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4616
  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4617
	[AC_MSG_WARN([it seems, Python depends on another library.
4618
    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4619
    and contact the authors to let them know about this problem])
4620
	])
4621
 
4622
  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4623
  AC_SUBST(PYTHONINC)
4624
  AC_SUBST(PYTHONLIB)
4625
  AC_SUBST(LIBPYTHON)
4626
  AC_SUBST(PYTHONMODDIR)
4627
  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4628
fi
4629
 
4630
])
4631
 
4632
 
4633
AC_DEFUN([KDE_CHECK_PYTHON],
4634
[
4635
  KDE_CHECK_PYTHON_INTERN("2.5",
4636
    [KDE_CHECK_PYTHON_INTERN("2.4",
4637
     [KDE_CHECK_PYTHON_INTERN("2.3", 
4638
       [KDE_CHECK_PYTHON_INTERN("2.2", 
4639
         [KDE_CHECK_PYTHON_INTERN("2.1", 
4640
           [KDE_CHECK_PYTHON_INTERN("2.0", 
4641
             [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4642
           ])
4643
         ])
4644
       ])
4645
     ])
4646
  ])
4647
])
4648
 
4649
AC_DEFUN([KDE_CHECK_STL],
4650
[
4651
    AC_LANG_SAVE
4652
    AC_LANG_CPLUSPLUS
4653
    ac_save_CXXFLAGS="$CXXFLAGS"
4654
    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4655
 
4656
    AC_MSG_CHECKING([if C++ programs can be compiled])
4657
    AC_CACHE_VAL(kde_cv_stl_works,
4658
    [
4659
      AC_TRY_COMPILE([
4660
#include <string>
4661
using namespace std;
4662
],[
4663
  string astring="Hallo Welt.";
4664
  astring.erase(0, 6); // now astring is "Welt"
4665
  return 0;
4666
], kde_cv_stl_works=yes,
4667
   kde_cv_stl_works=no)
4668
])
4669
 
4670
   AC_MSG_RESULT($kde_cv_stl_works)
4671
 
4672
   if test "$kde_cv_stl_works" = "yes"; then
4673
     # back compatible
4674
	 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4675
   else
4676
	 AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4677
Check config.log for details - if you're using a Linux distribution you might miss
4678
a package named similar to libstdc++-dev.])
4679
   fi
4680
 
4681
   CXXFLAGS="$ac_save_CXXFLAGS"
4682
   AC_LANG_RESTORE
4683
])
4684
 
4685
AC_DEFUN([AC_FIND_QIMGIO],
4686
   [AC_REQUIRE([AC_FIND_JPEG])
4687
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4688
AC_MSG_CHECKING([for qimgio])
4689
AC_CACHE_VAL(ac_cv_lib_qimgio,
4690
[
4691
AC_LANG_SAVE
4692
AC_LANG_CPLUSPLUS
4693
ac_save_LIBS="$LIBS"
4694
ac_save_CXXFLAGS="$CXXFLAGS"
4695
LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4696
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4697
AC_TRY_RUN(dnl
4698
[
4699
#include <qimageio.h>
4700
#include <qstring.h>
4701
int main() {
4702
		QString t = "hallo";
4703
		t.fill('t');
4704
		qInitImageIO();
4705
}
4706
],
4707
            ac_cv_lib_qimgio=yes,
4708
            ac_cv_lib_qimgio=no,
4709
	    ac_cv_lib_qimgio=no)
4710
LIBS="$ac_save_LIBS"
4711
CXXFLAGS="$ac_save_CXXFLAGS"
4712
AC_LANG_RESTORE
4713
])dnl
4714
if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4715
  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4716
  AC_MSG_RESULT(yes)
4717
  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4718
  AC_SUBST(LIBQIMGIO)
4719
else
4720
  AC_MSG_RESULT(not found)
4721
fi
4722
])
4723
 
4724
AC_DEFUN([AM_DISABLE_LIBRARIES],
4725
[
4726
    AC_PROVIDE([AM_ENABLE_STATIC])
4727
    AC_PROVIDE([AM_ENABLE_SHARED])
4728
    enable_static=no
4729
    enable_shared=yes
4730
])
4731
 
4732
 
4733
AC_DEFUN([AC_CHECK_UTMP_FILE],
4734
[
4735
    AC_MSG_CHECKING([for utmp file])
4736
 
4737
    AC_CACHE_VAL(kde_cv_utmp_file,
4738
    [
4739
    kde_cv_utmp_file=no
4740
 
4741
    for ac_file in    \
4742
                      \
4743
	/var/run/utmp \
4744
	/var/adm/utmp \
4745
	/etc/utmp     \
4746
     ; \
4747
    do
4748
     if test -r "$ac_file"; then
4749
       kde_cv_utmp_file=$ac_file
4750
       break
4751
     fi
4752
    done
4753
    ])
4754
 
4755
    if test "$kde_cv_utmp_file" != "no"; then
4756
	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4757
	$1
4758
	AC_MSG_RESULT($kde_cv_utmp_file)
4759
    else
4760
    	$2
4761
	AC_MSG_RESULT([non found])
4762
    fi
4763
])
4764
 
4765
 
4766
AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4767
[
4768
 
4769
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4770
TOPSUBDIRS=""
4771
 
4772
if test ! -s $srcdir/subdirs; then
4773
  dnl Note: Makefile.common creates subdirs, so this is just a fallback
4774
  files=`cd $srcdir && ls -1`
4775
  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4776
  for i in $dirs; do
4777
    echo $i >> $srcdir/subdirs
4778
  done
4779
fi
4780
 
4781
ac_topsubdirs=
4782
if test -s $srcdir/inst-apps; then
4783
  ac_topsubdirs="`cat $srcdir/inst-apps`"
4784
elif test -s $srcdir/subdirs; then
4785
  ac_topsubdirs="`cat $srcdir/subdirs`"
4786
fi
4787
 
4788
for i in $ac_topsubdirs; do
4789
  AC_MSG_CHECKING([if $i should be compiled])
4790
  if test -d $srcdir/$i; then
4791
    install_it="yes"
4792
    for j in $DO_NOT_COMPILE; do
4793
      if test $i = $j; then
4794
        install_it="no"
4795
      fi
4796
    done
4797
  else
4798
    install_it="no"
4799
  fi
4800
  AC_MSG_RESULT($install_it)
4801
  vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4802
  if test $install_it = "yes"; then
4803
    TOPSUBDIRS="$TOPSUBDIRS $i"
4804
    eval "$vari""_SUBDIR_included=yes"
4805
  else
4806
    eval "$vari""_SUBDIR_included=no"
4807
  fi
4808
done
4809
 
4810
AC_SUBST(TOPSUBDIRS)
4811
])
4812
 
4813
AC_DEFUN([KDE_CHECK_NAMESPACES],
4814
[
4815
AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4816
AC_LANG_SAVE
4817
AC_LANG_CPLUSPLUS
4818
AC_TRY_COMPILE([
4819
],
4820
[
4821
namespace Foo {
4822
  extern int i;
4823
  namespace Bar {
4824
    extern int i;
4825
  }
4826
}
4827
 
4828
int Foo::i = 0;
4829
int Foo::Bar::i = 1;
4830
],[
4831
  AC_MSG_RESULT(yes)
4832
  AC_DEFINE(HAVE_NAMESPACES)
4833
], [
4834
AC_MSG_RESULT(no)
4835
])
4836
AC_LANG_RESTORE
4837
])
4838
 
4839
dnl ------------------------------------------------------------------------
4840
dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4841
dnl ------------------------------------------------------------------------
4842
dnl
4843
AC_DEFUN([AC_CHECK_S_ISSOCK],
4844
[
4845
AC_MSG_CHECKING(for S_ISSOCK)
4846
AC_CACHE_VAL(ac_cv_have_s_issock,
4847
[
4848
AC_TRY_LINK(
4849
[
4850
#include <sys/stat.h>
4851
],
4852
[
4853
struct stat buff;
4854
int b = S_ISSOCK( buff.st_mode );
4855
],
4856
ac_cv_have_s_issock=yes,
4857
ac_cv_have_s_issock=no)
4858
])
4859
AC_MSG_RESULT($ac_cv_have_s_issock)
4860
if test "$ac_cv_have_s_issock" = "yes"; then
4861
  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4862
fi
4863
 
4864
AH_VERBATIM(_ISSOCK,
4865
[
4866
#ifndef HAVE_S_ISSOCK
4867
#define HAVE_S_ISSOCK
4868
#define S_ISSOCK(mode) (1==0)
4869
#endif
4870
])
4871
 
4872
])
4873
 
4874
dnl ------------------------------------------------------------------------
4875
dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4876
dnl ------------------------------------------------------------------------
4877
dnl
4878
AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4879
[
4880
AC_MSG_CHECKING(for MAXPATHLEN)
4881
AC_CACHE_VAL(ac_cv_maxpathlen,
4882
[
4883
cat > conftest.$ac_ext <<EOF
4884
#ifdef STDC_HEADERS
4885
# include <stdlib.h>
4886
#endif
4887
#include <stdio.h>
4888
#include <sys/param.h>
4889
#ifndef MAXPATHLEN
4890
#define MAXPATHLEN 1024
4891
#endif
4892
 
4893
KDE_HELLO MAXPATHLEN
4894
 
4895
EOF
4896
 
4897
ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4898
 
4899
if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4900
    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4901
else
4902
    ac_cv_maxpathlen=1024
4903
fi
4904
 
4905
rm conftest.*
4906
 
4907
])
4908
AC_MSG_RESULT($ac_cv_maxpathlen)
4909
AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4910
])
4911
 
4912
AC_DEFUN([KDE_CHECK_HEADER],
4913
[
4914
   kde_safe_cppflags=$CPPFLAGS
4915
   CPPFLAGS="$CPPFLAGS $all_includes"
4916
   AC_LANG_SAVE
4917
   AC_LANG_CPLUSPLUS
4918
   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4919
   AC_LANG_RESTORE
4920
   CPPFLAGS=$kde_safe_cppflags
4921
])
4922
 
4923
AC_DEFUN([KDE_CHECK_HEADERS],
4924
[
4925
   AH_CHECK_HEADERS([$1])
4926
   AC_LANG_SAVE
4927
   kde_safe_cppflags=$CPPFLAGS
4928
   CPPFLAGS="$CPPFLAGS $all_includes"
4929
   AC_LANG_CPLUSPLUS
4930
   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4931
   CPPFLAGS=$kde_safe_cppflags
4932
   AC_LANG_RESTORE
4933
])
4934
 
4935
AC_DEFUN([KDE_FAST_CONFIGURE],
4936
[
4937
  dnl makes configure fast (needs perl)
4938
  AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4939
      with_fast_perl=$enableval, with_fast_perl=yes)
4940
])
4941
 
4942
AC_DEFUN([KDE_CONF_FILES],
4943
[
4944
  val=
4945
  if test -f $srcdir/configure.files ; then
4946
    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4947
  fi
4948
  CONF_FILES=
4949
  if test -n "$val" ; then
4950
    for i in $val ; do
4951
      CONF_FILES="$CONF_FILES $i"
4952
    done
4953
  fi
4954
  AC_SUBST(CONF_FILES)
4955
])dnl
4956
 
4957
dnl This sets the prefix, for arts and kdelibs
4958
dnl Do NOT use in any other module.
4959
dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4960
AC_DEFUN([KDE_SET_PREFIX_CORE],
4961
[
4962
  unset CDPATH
4963
  dnl make $KDEDIR the default for the installation
4964
  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4965
 
4966
  if test "x$prefix" = "xNONE"; then
4967
    prefix=$ac_default_prefix
4968
    ac_configure_args="$ac_configure_args --prefix=$prefix"
4969
  fi
4970
  # And delete superfluous '/' to make compares easier
4971
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4972
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4973
 
4974
  kde_libs_prefix='$(prefix)'
4975
  kde_libs_htmldir='$(kde_htmldir)'
4976
  AC_SUBST(kde_libs_prefix)
4977
  AC_SUBST(kde_libs_htmldir)
4978
  KDE_FAST_CONFIGURE
4979
  KDE_CONF_FILES
4980
])
4981
 
4982
 
4983
AC_DEFUN([KDE_SET_PREFIX],
4984
[
4985
  unset CDPATH
4986
  dnl We can't give real code to that macro, only a value.
4987
  dnl It only matters for --help, since we set the prefix in this function anyway.
4988
  AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
4989
 
4990
  KDE_SET_DEFAULT_BINDIRS
4991
  if test "x$prefix" = "xNONE"; then
4992
    dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
4993
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4994
  else
4995
    dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
4996
    kde_save_PATH="$PATH"
4997
    PATH="$exec_prefix/bin:$prefix/bin:$PATH"
4998
    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4999
    PATH="$kde_save_PATH"
5000
  fi
5001
 
5002
  kde_libs_prefix=`$KDECONFIG --prefix`
5003
  if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
5004
       AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
5005
                    This means it has been moved since you installed it.
5006
                    This won't work. Please recompile kdelibs for the new prefix.
5007
                    ])
5008
  fi
5009
  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
5010
 
5011
  AC_MSG_CHECKING([where to install])
5012
  if test "x$prefix" = "xNONE"; then
5013
    prefix=$kde_libs_prefix
5014
    AC_MSG_RESULT([$prefix (as returned by kde-config)])
5015
  else
5016
    dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
5017
    given_prefix=$prefix
5018
    AC_MSG_RESULT([$prefix (as requested)])
5019
  fi
5020
 
5021
  # And delete superfluous '/' to make compares easier
5022
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5023
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5024
  given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5025
 
5026
  AC_SUBST(KDECONFIG)
5027
  AC_SUBST(kde_libs_prefix)
5028
  AC_SUBST(kde_libs_htmldir)
5029
 
5030
  KDE_FAST_CONFIGURE
5031
  KDE_CONF_FILES
5032
])
5033
 
5034
pushdef([AC_PROG_INSTALL],
5035
[
5036
  dnl our own version, testing for a -p flag
5037
  popdef([AC_PROG_INSTALL])
5038
  dnl as AC_PROG_INSTALL works as it works we first have
5039
  dnl to save if the user didn't specify INSTALL, as the
5040
  dnl autoconf one overwrites INSTALL and we have no chance to find
5041
  dnl out afterwards
5042
  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
5043
  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
5044
  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
5045
  AC_PROG_INSTALL
5046
 
5047
  if test -z "$kde_save_INSTALL_given" ; then
5048
    # OK, user hasn't given any INSTALL, autoconf found one for us
5049
    # now we test, if it supports the -p flag
5050
    AC_MSG_CHECKING(for -p flag to install)
5051
    rm -f confinst.$$.* > /dev/null 2>&1
5052
    echo "Testtest" > confinst.$$.orig
5053
    ac_res=no
5054
    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
5055
      if test -f confinst.$$.new ; then
5056
        # OK, -p seems to do no harm to install
5057
	INSTALL="${INSTALL} -p"
5058
	ac_res=yes
5059
      fi
5060
    fi
5061
    rm -f confinst.$$.*
5062
    AC_MSG_RESULT($ac_res)
5063
  fi
5064
  dnl the following tries to resolve some signs and wonders coming up
5065
  dnl with different autoconf/automake versions
5066
  dnl e.g.:
5067
  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
5068
  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
5069
  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
5070
  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
5071
  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
5072
  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
5073
  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
5074
  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
5075
  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
5076
  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
5077
  dnl   automake (due to broken Makefile.am or whatever) to install programs,
5078
  dnl   and so does not see the -s flag in automake > 1.4
5079
  dnl to clean up that mess we:
5080
  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
5081
  dnl   which cleans KDE's program with automake > 1.4;
5082
  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
5083
  dnl   with automake<=1.4
5084
  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
5085
  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
5086
  dnl
5087
  dnl And to all this comes, that I even can't write in comments variable
5088
  dnl  names used by automake, because it is so stupid to think I wanted to
5089
  dnl  _use_ them, therefor I have written A_M_... instead of AM_
5090
  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
5091
 
5092
  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
5093
    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
5094
  fi
5095
  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
5096
    INSTALL_SCRIPT='${INSTALL}'
5097
  fi
5098
])dnl
5099
 
5100
AC_DEFUN([KDE_LANG_CPLUSPLUS],
5101
[AC_LANG_CPLUSPLUS
5102
ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
5103
pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
5104
])
5105
 
5106
pushdef([AC_LANG_CPLUSPLUS],
5107
[popdef([AC_LANG_CPLUSPLUS])
5108
KDE_LANG_CPLUSPLUS
5109
])
5110
 
5111
AC_DEFUN([KDE_CHECK_LONG_LONG],
5112
[
5113
AC_MSG_CHECKING(for long long)
5114
AC_CACHE_VAL(kde_cv_c_long_long,
5115
[
5116
  AC_LANG_SAVE
5117
  AC_LANG_CPLUSPLUS
5118
  AC_TRY_LINK([], [
5119
  long long foo = 0;
5120
  foo = foo+1;
5121
  ],
5122
  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
5123
  AC_LANG_RESTORE
5124
])
5125
AC_MSG_RESULT($kde_cv_c_long_long)
5126
if test "$kde_cv_c_long_long" = yes; then
5127
   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
5128
fi
5129
])
5130
 
5131
AC_DEFUN([KDE_CHECK_LIB],
5132
[
5133
     kde_save_LDFLAGS="$LDFLAGS"
5134
     dnl AC_CHECK_LIB modifies LIBS, so save it here
5135
     kde_save_LIBS="$LIBS"
5136
     LDFLAGS="$LDFLAGS $all_libraries"
5137
     case $host_os in
5138
      aix*) LDFLAGS="-brtl $LDFLAGS"
5139
	test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
5140
	;;
5141
     esac
5142
     AC_CHECK_LIB($1, $2, $3, $4, $5)
5143
     LDFLAGS="$kde_save_LDFLAGS"
5144
     LIBS="$kde_save_LIBS"
5145
])
5146
 
5147
AC_DEFUN([KDE_JAVA_PREFIX],
5148
[
5149
	dir=`dirname "$1"`
5150
	base=`basename "$1"`
5151
	list=`ls -1 $dir 2> /dev/null`
5152
	for entry in $list; do 
5153
		if test -d $dir/$entry/bin; then
5154
			case $entry in
5155
			   $base)
5156
				javadirs="$javadirs $dir/$entry/bin"
5157
				;;
5158
			esac
5159
		elif test -d $dir/$entry/jre/bin; then
5160
			case $entry in
5161
			   $base)
5162
				javadirs="$javadirs $dir/$entry/jre/bin"
5163
				;;
5164
			esac
5165
		fi
5166
	done
5167
])
5168
 
5169
dnl KDE_CHEC_JAVA_DIR(onlyjre)
5170
AC_DEFUN([KDE_CHECK_JAVA_DIR],
5171
[
5172
 
5173
AC_ARG_WITH(java,
5174
AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
5175
[  ac_java_dir=$withval
5176
], ac_java_dir=""
5177
)
5178
 
5179
AC_MSG_CHECKING([for Java])
5180
 
5181
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
5182
if test "x$ac_java_dir" = "xno"; then
5183
   kde_java_bindir=no
5184
   kde_java_includedir=no
5185
   kde_java_libjvmdir=no
5186
   kde_java_libgcjdir=no
5187
   kde_java_libhpidir=no
5188
else
5189
  if test "x$ac_java_dir" = "x"; then
5190
 
5191
 
5192
      dnl No option set -> collect list of candidate paths
5193
      if test -n "$JAVA_HOME"; then
5194
        KDE_JAVA_PREFIX($JAVA_HOME)
5195
      fi
5196
      KDE_JAVA_PREFIX(/usr/j2se)
5197
      KDE_JAVA_PREFIX(/usr/lib/j2se)
5198
      KDE_JAVA_PREFIX(/usr/j*dk*)
5199
      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
5200
      KDE_JAVA_PREFIX(/opt/j*sdk*)
5201
      KDE_JAVA_PREFIX(/usr/lib/java*)
5202
      KDE_JAVA_PREFIX(/usr/java*)
5203
      KDE_JAVA_PREFIX(/usr/java/j*dk*)
5204
      KDE_JAVA_PREFIX(/usr/java/j*re*)
5205
      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
5206
      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
5207
      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
5208
      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
5209
      KDE_JAVA_PREFIX(/opt/java*)
5210
 
5211
      kde_cv_path="NONE"
5212
      kde_save_IFS=$IFS
5213
      IFS=':'
5214
      for dir in $PATH; do
5215
	  if test -d "$dir"; then
5216
	      javadirs="$javadirs $dir"
5217
	  fi
5218
      done
5219
      IFS=$kde_save_IFS
5220
      jredirs=
5221
 
5222
      dnl Now javadirs contains a list of paths that exist, all ending with bin/
5223
      for dir in $javadirs; do
5224
          dnl Check for the java executable
5225
	  if test -x "$dir/java"; then
5226
	      sane_path=$(cd $dir; /bin/pwd)
5227
	      dnl And also check for a libjvm.so somewhere under there
5228
	      dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
5229
              if test "$sane_path" != "/usr/bin"; then
5230
                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5231
		  if test ! -f $libjvmdir/libjvm.so; then continue; fi
5232
		  jredirs="$jredirs $dir"
5233
	      fi
5234
	  fi
5235
      done
5236
 
5237
      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
5238
      JAVAC=
5239
      JAVA=
5240
      kde_java_bindir=no
5241
      for dir in $jredirs; do
5242
	  JAVA="$dir/java"
5243
	  kde_java_bindir=$dir
5244
	  if test -x "$dir/javac"; then
5245
		JAVAC="$dir/javac"
5246
                break
5247
	  fi
5248
      done
5249
 
5250
      if test -n "$JAVAC"; then
5251
          dnl this substitution might not work - well, we test for jni.h below
5252
          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
5253
      else
5254
          kde_java_includedir=no
5255
      fi
5256
  else
5257
    dnl config option set
5258
    kde_java_bindir=$ac_java_dir/bin
5259
    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
5260
	kde_java_includedir=no
5261
    else
5262
        kde_java_includedir=$ac_java_dir/include
5263
    fi
5264
  fi
5265
fi
5266
 
5267
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
5268
if test "x$kde_java_bindir" != "xno"; then
5269
 
5270
  dnl Look for libjvm.so
5271
  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5272
  dnl Look for libgcj.so
5273
  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
5274
  dnl Look for libhpi.so and avoid green threads
5275
  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
5276
 
5277
  dnl Now check everything's fine under there
5278
  dnl the include dir is our flag for having the JDK
5279
  if test -d "$kde_java_includedir"; then
5280
    if test ! -x "$kde_java_bindir/javac"; then
5281
      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
5282
    fi
5283
    if test ! -x "$kde_java_bindir/javah"; then
5284
      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5285
    fi
5286
    if test ! -x "$kde_java_bindir/jar"; then
5287
      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5288
    fi
5289
    if test ! -r "$kde_java_includedir/jni.h"; then
5290
      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5291
    fi
5292
 
5293
    jni_includes="-I$kde_java_includedir"
5294
    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5295
    dnl and under linux here.. 
5296
 
5297
    dnl not needed for gcj
5298
 
5299
    if test "x$kde_java_libgcjdir" = "x"; then 
5300
      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5301
      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5302
      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5303
    fi
5304
 
5305
  else
5306
    JAVAC=
5307
    jni_includes=
5308
  fi
5309
 
5310
  if test "x$kde_java_libgcjdir" = "x"; then 
5311
     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5312
        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5313
     fi 
5314
  else
5315
     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5316
        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5317
     fi 
5318
  fi
5319
 
5320
  if test ! -x "$kde_java_bindir/java"; then
5321
      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5322
  fi
5323
 
5324
  dnl not needed for gcj compile
5325
 
5326
  if test "x$kde_java_libgcjdir" = "x"; then 
5327
      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5328
        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5329
      fi
5330
  fi
5331
 
5332
  if test -n "$jni_includes"; then
5333
    dnl Check for JNI version
5334
    AC_LANG_SAVE
5335
    AC_LANG_CPLUSPLUS
5336
    ac_cxxflags_safe="$CXXFLAGS"
5337
    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5338
 
5339
    AC_TRY_COMPILE([
5340
  #include <jni.h>
5341
	      ],
5342
	      [
5343
  #ifndef JNI_VERSION_1_2
5344
  Syntax Error
5345
  #endif
5346
	      ],[ kde_jni_works=yes ],
5347
	      [ kde_jni_works=no ])
5348
 
5349
    if test $kde_jni_works = no; then
5350
      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5351
		    You need to have Java Development Kit (JDK) version 1.2. 
5352
 
5353
		    Use --with-java to specify another location.
5354
		    Use --without-java to configure without java support.
5355
		    Or download a newer JDK and try again. 
5356
		    See e.g. http://java.sun.com/products/jdk/1.2 ])
5357
    fi
5358
 
5359
    CXXFLAGS="$ac_cxxflags_safe"    
5360
    AC_LANG_RESTORE
5361
 
5362
    dnl All tests ok, inform and subst the variables
5363
 
5364
    JAVAC=$kde_java_bindir/javac
5365
    JAVAH=$kde_java_bindir/javah
5366
    JAR=$kde_java_bindir/jar
5367
    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5368
    if test "x$kde_java_libgcjdir" = "x"; then 
5369
      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5370
    else
5371
      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5372
    fi
5373
    AC_MSG_RESULT([java JDK in $kde_java_bindir])
5374
 
5375
  else
5376
      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5377
      AC_MSG_RESULT([java JRE in $kde_java_bindir])
5378
  fi
5379
elif test -d "/Library/Java/Home"; then
5380
  kde_java_bindir="/Library/Java/Home/bin"
5381
  jni_includes="-I/Library/Java/Home/include"
5382
 
5383
  JAVAC=$kde_java_bindir/javac
5384
  JAVAH=$kde_java_bindir/javah
5385
  JAR=$kde_java_bindir/jar
5386
  JVMLIBS="-Wl,-framework,JavaVM"
5387
 
5388
  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5389
  AC_MSG_RESULT([Apple Java Framework])
5390
else
5391
  AC_MSG_RESULT([none found])
5392
fi
5393
 
5394
AC_SUBST(JAVAC)
5395
AC_SUBST(JAVAH)
5396
AC_SUBST(JAR)
5397
AC_SUBST(JVMLIBS)
5398
AC_SUBST(jni_includes)
5399
 
5400
# for backward compat
5401
kde_cv_java_includedir=$kde_java_includedir
5402
kde_cv_java_bindir=$kde_java_bindir
5403
])
5404
 
5405
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5406
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5407
dnl big packages, m4_foreach is dog-slow.  So use our own version of
5408
dnl it.  (matz@kde.org)
5409
m4_define([mm_foreach],
5410
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5411
m4_define([mm_car], [[$1]])
5412
m4_define([mm_car2], [[$@]])
5413
m4_define([_mm_foreach],
5414
[m4_if(m4_quote($2), [], [],
5415
       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5416
                                                   mm_car2(m4_shift($2)),
5417
                                                   [$3])])])
5418
m4_define([AC_FOREACH],
5419
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5420
 
5421
AC_DEFUN([KDE_NEED_FLEX],
5422
[
5423
kde_libs_safe=$LIBS
5424
LIBS="$LIBS $USER_LDFLAGS"
5425
AM_PROG_LEX
5426
LIBS=$kde_libs_safe
5427
if test -z "$LEXLIB"; then
5428
    AC_MSG_ERROR([You need to have flex installed.])
5429
fi
5430
AC_SUBST(LEXLIB)
5431
])
5432
 
5433
AC_DEFUN([AC_PATH_QTOPIA],
5434
[
5435
  dnl TODO: use AC_CACHE_VAL
5436
 
5437
  if test -z "$1"; then
5438
    qtopia_minver_maj=1
5439
    qtopia_minver_min=5
5440
    qtopia_minver_pat=0
5441
  else
5442
    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5443
    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5444
    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5445
  fi
5446
 
5447
  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5448
  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5449
 
5450
  AC_REQUIRE([AC_PATH_QT])
5451
 
5452
  AC_MSG_CHECKING([for Qtopia])
5453
 
5454
  LIB_QTOPIA="-lqpe"
5455
  AC_SUBST(LIB_QTOPIA)
5456
 
5457
  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5458
 
5459
  ac_qtopia_incdir=NO
5460
 
5461
  AC_ARG_WITH(qtopia-dir,
5462
              AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5463
              [  ac_qtopia_incdir="$withval"/include] ) 
5464
 
5465
  qtopia_incdirs=""
5466
  for dir in $kde_qtopia_dirs; do
5467
    qtopia_incdirs="$qtopia_incdirs $dir/include"
5468
  done
5469
 
5470
  if test ! "$ac_qtopia_incdir" = "NO"; then
5471
    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5472
  fi
5473
 
5474
  qtopia_incdir=""
5475
  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5476
  ac_qtopia_incdir="$qtopia_incdir"
5477
 
5478
  if test -z "$qtopia_incdir"; then
5479
    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5480
  fi
5481
 
5482
  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5483
  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5484
  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5485
 
5486
  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5487
  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5488
  if test "$qtopia_ver" -lt "$qtopia_minver"; then
5489
    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5490
is required.])
5491
  fi
5492
 
5493
  AC_LANG_SAVE
5494
  AC_LANG_CPLUSPLUS
5495
 
5496
  ac_cxxflags_safe="$CXXFLAGS"
5497
  ac_ldflags_safe="$LDFLAGS"
5498
  ac_libs_safe="$LIBS"
5499
 
5500
  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5501
  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5502
  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5503
 
5504
  cat > conftest.$ac_ext <<EOF
5505
#include "confdefs.h"
5506
#include <qpe/qpeapplication.h>
5507
#include <qpe/version.h>
5508
 
5509
int main( int argc, char **argv )
5510
{
5511
    QPEApplication app( argc, argv );
5512
    return 0;
5513
}
5514
EOF
5515
 
5516
  if AC_TRY_EVAL(ac_link) && test -s conftest; then
5517
    rm -f conftest*
5518
  else
5519
    rm -f conftest*
5520
    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5521
the end of config.log])
5522
  fi
5523
 
5524
  CXXFLAGS="$ac_cxxflags_safe"
5525
  LDFLAGS="$ac_ldflags_safe"
5526
  LIBS="$ac_libs_safe"
5527
 
5528
  AC_LANG_RESTORE
5529
 
5530
  QTOPIA_INCLUDES="-I$qtopia_incdir"
5531
  AC_SUBST(QTOPIA_INCLUDES)
5532
 
5533
  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5534
])
5535
 
5536
 
5537
AC_DEFUN([KDE_INIT_DOXYGEN],
5538
[
5539
AC_MSG_CHECKING([for Qt docs])
5540
kde_qtdir=
5541
if test "${with_qt_dir+set}" = set; then
5542
  kde_qtdir="$with_qt_dir"
5543
fi
5544
 
5545
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)
5546
AC_MSG_RESULT($QTDOCDIR)
5547
 
5548
AC_SUBST(QTDOCDIR)
5549
 
5550
KDE_FIND_PATH(dot, DOT, [], [])
5551
if test -n "$DOT"; then
5552
  KDE_HAVE_DOT="YES"
5553
else
5554
  KDE_HAVE_DOT="NO"
5555
fi
5556
AC_SUBST(KDE_HAVE_DOT)
5557
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5558
AC_SUBST(DOXYGEN)
5559
 
5560
DOXYGEN_PROJECT_NAME="$1"
5561
DOXYGEN_PROJECT_NUMBER="$2"
5562
AC_SUBST(DOXYGEN_PROJECT_NAME)
5563
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5564
 
5565
KDE_HAS_DOXYGEN=no
5566
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5567
  KDE_HAS_DOXYGEN=yes
5568
fi
5569
AC_SUBST(KDE_HAS_DOXYGEN)
5570
 
5571
])
5572
 
5573
 
5574
AC_DEFUN([AC_FIND_BZIP2],
5575
[
5576
AC_MSG_CHECKING([for bzDecompress in libbz2])
5577
AC_CACHE_VAL(ac_cv_lib_bzip2,
5578
[
5579
AC_LANG_SAVE
5580
AC_LANG_CPLUSPLUS
5581
kde_save_LIBS="$LIBS"
5582
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5583
kde_save_CXXFLAGS="$CXXFLAGS"
5584
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5585
AC_TRY_LINK(dnl
5586
[
5587
#define BZ_NO_STDIO
5588
#include<bzlib.h>
5589
],
5590
            [ bz_stream s; (void) bzDecompress(&s); ],
5591
            eval "ac_cv_lib_bzip2='-lbz2'",
5592
            eval "ac_cv_lib_bzip2=no")
5593
LIBS="$kde_save_LIBS"
5594
CXXFLAGS="$kde_save_CXXFLAGS"
5595
AC_LANG_RESTORE
5596
])dnl
5597
AC_MSG_RESULT($ac_cv_lib_bzip2)
5598
 
5599
if test ! "$ac_cv_lib_bzip2" = no; then
5600
  BZIP2DIR=bzip2
5601
 
5602
  LIBBZ2="$ac_cv_lib_bzip2"
5603
  AC_SUBST(LIBBZ2)
5604
 
5605
else
5606
 
5607
   cxx_shared_flag=
5608
   ld_shared_flag=
5609
   KDE_CHECK_COMPILER_FLAG(shared, [
5610
	ld_shared_flag="-shared"
5611
   ])
5612
   KDE_CHECK_COMPILER_FLAG(fPIC, [
5613
        cxx_shared_flag="-fPIC"
5614
   ])
5615
 
5616
   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5617
   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5618
   [
5619
   AC_LANG_SAVE
5620
   AC_LANG_CPLUSPLUS
5621
   kde_save_LIBS="$LIBS"
5622
   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5623
   kde_save_CXXFLAGS="$CXXFLAGS"
5624
   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5625
 
5626
   AC_TRY_LINK(dnl
5627
   [
5628
   #define BZ_NO_STDIO
5629
   #include<bzlib.h>
5630
   ],
5631
               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5632
               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5633
               eval "ac_cv_lib_bzip2_prefix=no")
5634
   LIBS="$kde_save_LIBS"
5635
   CXXFLAGS="$kde_save_CXXFLAGS"
5636
   AC_LANG_RESTORE
5637
   ])dnl
5638
 
5639
   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5640
 
5641
   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5642
     BZIP2DIR=bzip2
5643
 
5644
     LIBBZ2="$ac_cv_lib_bzip2_prefix"
5645
     AC_SUBST(LIBBZ2)
5646
 
5647
     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5648
   dnl else, we just ignore this
5649
   fi
5650
 
5651
fi
5652
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5653
])
5654
 
5655
dnl ------------------------------------------------------------------------
155 andreas 5656
dnl Try to find the GDAL headers and libraries.
5657
dnl $(GDAL_LDFLAGS) will be -Lgdalliblocation (if needed)
5658
dnl and $(GDAL_INCLUDES) will be -Igdalhdrlocation (if needed)
5659
dnl ------------------------------------------------------------------------
5660
AC_DEFUN([CHECK_GDAL],
5661
[
5662
LIBGDAL="-lgdal1.5.0"
5663
AC_REQUIRE([KDE_CHECK_LIB64])
5664
 
5665
ac_gdal_includes=NO ac_gdal_libraries=NO
5666
gdal_libraries=""
5667
gdal_includes=""
5668
AC_ARG_WITH(gdal-dir,
5669
    AC_HELP_STRING([--with-gdal-dir=DIR],[where the root of GDAL is installed]),
5670
    [  ac_gdal_includes="$withval"/include
5671
       ac_gdal_libraries="$withval"/lib$kdelibstuff
5672
    ])
5673
 
5674
want_gdal=yes
5675
AC_ARG_WITH(gdal,
5676
    AC_HELP_STRING([--without-gdal],[disable GDAL checks]),
5677
    [want_gdal=$withval])
5678
 
5679
if test $want_gdal = yes; then
5680
 
5681
AC_MSG_CHECKING(for GDAL)
5682
 
5683
AC_CACHE_VAL(ac_cv_have_gdal,
5684
[#try to guess GDAL locations
5685
 
5686
  gdal_incdirs="/usr/include /usr/local/include /usr/include/gdal /usr/local/include/gdal $prefix/include $prefix/include/gdal"
5687
  gdal_incdirs="$ac_gdal_includes $gdal_incdirs"
5688
  AC_FIND_FILE(gdal/gdal_priv.h, $gdal_incdirs, gdal_incdir)
5689
  ac_gdal_includes="$gdal_incdir"
5690
 
5691
  gdal_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/gdal/lib$kdelibsuff /usr/local/gdal/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5692
  if test ! "$ac_gdal_libraries" = "NO"; then
5693
    gdal_libdirs="$ac_gdal_libraries $gdal_libdirs"
5694
  fi
5695
 
5696
  test=NONE
5697
  gdal_libdir=NONE
5698
  for dir in $gdal_libdirs; do
5699
    try="ls -1 $dir/libgdal1.5.0*"
5700
    if test=`eval $try 2> /dev/null`; then gdal_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5701
  done
5702
 
5703
  ac_gdal_libraries="$gdal_libdir"
5704
 
5705
  ac_ldflags_safe="$LDFLAGS"
5706
  ac_libs_safe="$LIBS"
5707
 
5708
  LDFLAGS="$LDFLAGS -L$gdal_libdir $all_libraries"
5709
  LIBS="$LIBS $LIBGDAL"
5710
 
5711
  AC_TRY_LINK(,GDALOpen ("/.", GA_ReadOnly);,
5712
  ac_gdal_test="yes"
5713
  ,
5714
  ac_gdal_test="no"
5715
  )
5716
 
5717
  LDFLAGS="$ac_ldflags_safe"
5718
  LIBS="$ac_libs_safe"
5719
 
5720
  if test "$ac_gdal_includes" = NO || test "$ac_gdal_libraries" = NO; then
5721
    have_gdal=no
5722
  else
5723
    have_gdal=yes;
5724
  fi
5725
 
5726
  ])
5727
 
5728
  eval "$ac_cv_have_gdal"
5729
 
5730
  AC_MSG_RESULT([libraries $ac_gdal_libraries, headers $ac_gdal_includes])
5731
else
5732
  have_gdal=no
5733
fi
5734
 
5735
if test "$have_gdal" = yes; then
5736
  AC_MSG_CHECKING(for GDAL version)
5737
  dnl Check for GDAL version
5738
  AC_CACHE_VAL(ac_cv_gdal_version,
5739
  [
5740
 
5741
    cat >conftest.$ac_ext <<EOF
5742
#include <gdal/gdal_priv.h>
5743
#include <stdio.h>
5744
    int main() {
5745
 
5746
#ifndef GDAL_VERSION_NUM
5747
      printf("gdal_version=\\"error\\"\n");
5748
#else
5749
      if (GDAL_VERSION_NUM < 1500)
5750
        printf("gdal_version=\\"old\\"\n");
5751
      else
5752
        printf("gdal_version=\\"ok\\"\n");
5753
#endif
5754
     return (0);
5755
    }
5756
EOF
5757
 
5758
    ac_save_CPPFLAGS=$CPPFLAGS
5759
    if test "$ac_gdal_includes" != "/usr/include"; then
5760
        CPPFLAGS="$CPPFLAGS -I$ac_gdal_includes"
5761
    fi
5762
 
5763
    if AC_TRY_EVAL(ac_link); then 
5764
 
5765
      if eval `./conftest 2>&5`; then
5766
        if test $gdal_version = error; then
5767
          AC_MSG_ERROR([$gdal_incdir/gdal/gdal_priv.h doesn't define GDAL_VERSION_NUM !])
5768
        else
5769
          if test $gdal_version = old; then
5770
            AC_MSG_WARN([GDAL version too old. Upgrade to 1.5.0 at least, see http://www.gdal.org. GDAL support disabled.])
5771
            have_gdal=no
5772
          fi
5773
        fi
5774
        ac_cv_gdal_version="gdal_version=$gdal_version"
5775
      else
5776
        AC_MSG_ERROR([Your system couldn't run a small GDAL test program.
5777
        Check config.log, and if you can't figure it out, send a mail to 
5778
        Andreas Theofilu <andreas@theosys.at>, attaching your config.log])
5779
      fi
5780
 
5781
    else
5782
      AC_MSG_ERROR([Your system couldn't link a small GDAL test program.
5783
      Check config.log, and if you can't figure it out, send a mail to 
5784
      Andreas Theofilu <andreas@theosys.at>, attaching your config.log])
5785
    fi 
5786
    CPPFLAGS=$ac_save_CPPFLAGS
5787
 
5788
  ])
5789
 
5790
  eval "$ac_cv_gdal_version"
5791
  AC_MSG_RESULT($gdal_version)
5792
fi
5793
 
5794
if test "$have_gdal" != yes; then
5795
  LIBGDAL="";
5796
else
5797
  AC_DEFINE(HAVE_GDAL, 1, [If we are going to use GDAL])
5798
  ac_cv_have_gdal="have_gdal=yes \
5799
    ac_gdal_includes=$ac_gdal_includes ac_gdal_libraries=$ac_gdal_libraries"
5800
 
5801
  gdal_libraries="$ac_gdal_libraries"
5802
  gdal_includes="$ac_gdal_includes"
5803
 
5804
  if test $gdal_version = "old"; then
5805
    AC_DEFINE(HAVE_OLD_GDAL_API, 1, [Define if you have GDAL < 1.5.0])
5806
  fi
5807
fi
5808
 
5809
GDAL_INCLUDES=
5810
 
5811
if test "$gdal_includes" = "/usr/include"; then
5812
  if test -f /usr/kerberos/include/krb5.h; then
5813
	GDAL_INCLUDES="-I/usr/kerberos/include"
5814
  fi
5815
elif test  "$gdal_includes" != "/usr/local/include" && test -n "$gdal_includes"; then
5816
  GDAL_INCLUDES="-I$gdal_includes"
5817
fi
5818
 
5819
if test "$gdal_libraries" = "/usr/lib" || test "$gdal_libraries" = "/usr/local/lib" || test -z "$gdal_libraries" || test "$gdal_libraries" = "NONE"; then
5820
 GDAL_LDFLAGS=""
5821
else
5822
 GDAL_LDFLAGS="-L$gdal_libraries -R$gdal_libraries"
5823
fi
5824
 
5825
AC_SUBST(GDAL_INCLUDES)
5826
AC_SUBST(GDAL_LDFLAGS)
5827
AC_SUBST(LIBGDAL)
5828
])
5829
 
5830
dnl ------------------------------------------------------------------------
88 andreas 5831
dnl Try to find the SSL headers and libraries.
5832
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5833
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5834
dnl ------------------------------------------------------------------------
5835
dnl
5836
AC_DEFUN([KDE_CHECK_SSL],
5837
[
5838
LIBSSL="-lssl -lcrypto"
5839
AC_REQUIRE([KDE_CHECK_LIB64])
5840
 
5841
ac_ssl_includes=NO ac_ssl_libraries=NO
5842
ssl_libraries=""
5843
ssl_includes=""
5844
AC_ARG_WITH(ssl-dir,
5845
    AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5846
    [  ac_ssl_includes="$withval"/include
5847
       ac_ssl_libraries="$withval"/lib$kdelibsuff
5848
    ])
5849
 
5850
want_ssl=yes
5851
AC_ARG_WITH(ssl,
5852
    AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5853
    [want_ssl=$withval])
5854
 
5855
if test $want_ssl = yes; then
5856
 
5857
AC_MSG_CHECKING(for OpenSSL)
5858
 
5859
AC_CACHE_VAL(ac_cv_have_ssl,
5860
[#try to guess OpenSSL locations
5861
 
5862
  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5863
  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5864
  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5865
  ac_ssl_includes="$ssl_incdir"
5866
 
5867
  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"
5868
  if test ! "$ac_ssl_libraries" = "NO"; then
5869
    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5870
  fi
5871
 
5872
  test=NONE
5873
  ssl_libdir=NONE
5874
  for dir in $ssl_libdirs; do
5875
    try="ls -1 $dir/libssl*"
5876
    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5877
  done
5878
 
5879
  ac_ssl_libraries="$ssl_libdir"
5880
 
5881
  ac_ldflags_safe="$LDFLAGS"
5882
  ac_libs_safe="$LIBS"
5883
 
5884
  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5885
  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5886
 
5887
  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5888
  ac_ssl_rsaref="yes"
5889
  ,
5890
  ac_ssl_rsaref="no"
5891
  )
5892
 
5893
  LDFLAGS="$ac_ldflags_safe"
5894
  LIBS="$ac_libs_safe"
5895
 
5896
  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5897
    have_ssl=no
5898
  else
5899
    have_ssl=yes;
5900
  fi
5901
 
5902
  ])
5903
 
5904
  eval "$ac_cv_have_ssl"
5905
 
5906
  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5907
 
5908
  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5909
  AC_MSG_RESULT($ac_ssl_rsaref)
5910
 
5911
  AC_MSG_CHECKING([for easter eggs])
5912
  AC_MSG_RESULT([none found])
5913
 
5914
else
5915
  have_ssl=no
5916
fi
5917
 
5918
if test "$have_ssl" = yes; then
5919
  AC_MSG_CHECKING(for OpenSSL version)
5920
  dnl Check for SSL version
5921
  AC_CACHE_VAL(ac_cv_ssl_version,
5922
  [
5923
 
5924
    cat >conftest.$ac_ext <<EOF
5925
#include <openssl/opensslv.h>
5926
#include <stdio.h>
5927
    int main() {
5928
 
5929
#ifndef OPENSSL_VERSION_NUMBER
5930
      printf("ssl_version=\\"error\\"\n");
5931
#else
5932
      if (OPENSSL_VERSION_NUMBER < 0x00906000)
5933
        printf("ssl_version=\\"old\\"\n");
5934
      else
5935
        printf("ssl_version=\\"ok\\"\n");
5936
#endif
5937
     return (0);
5938
    }
5939
EOF
5940
 
5941
    ac_save_CPPFLAGS=$CPPFLAGS
5942
    if test "$ac_ssl_includes" != "/usr/include"; then
5943
        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5944
    fi
5945
 
5946
    if AC_TRY_EVAL(ac_link); then 
5947
 
5948
      if eval `./conftest 2>&5`; then
5949
        if test $ssl_version = error; then
5950
          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5951
        else
5952
          if test $ssl_version = old; then
5953
            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5954
            have_ssl=no
5955
          fi
5956
        fi
5957
        ac_cv_ssl_version="ssl_version=$ssl_version"
5958
      else
5959
        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5960
        Check config.log, and if you can't figure it out, send a mail to 
5961
        David Faure <faure@kde.org>, attaching your config.log])
5962
      fi
5963
 
5964
    else
5965
      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5966
      Check config.log, and if you can't figure it out, send a mail to 
5967
      David Faure <faure@kde.org>, attaching your config.log])
5968
    fi 
5969
    CPPFLAGS=$ac_save_CPPFLAGS
5970
 
5971
  ])
5972
 
5973
  eval "$ac_cv_ssl_version"
5974
  AC_MSG_RESULT($ssl_version)
5975
fi
5976
 
5977
if test "$have_ssl" != yes; then
5978
  LIBSSL="";
5979
else
5980
  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5981
  ac_cv_have_ssl="have_ssl=yes \
5982
    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5983
 
5984
 
5985
  ssl_libraries="$ac_ssl_libraries"
5986
  ssl_includes="$ac_ssl_includes"
5987
 
5988
  if test "$ac_ssl_rsaref" = yes; then
5989
    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
5990
  fi
5991
 
5992
  if test $ssl_version = "old"; then
5993
    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5994
  fi
5995
fi
5996
 
5997
SSL_INCLUDES=
5998
 
5999
if test "$ssl_includes" = "/usr/include"; then
6000
  if test -f /usr/kerberos/include/krb5.h; then
6001
	SSL_INCLUDES="-I/usr/kerberos/include"
6002
  fi
6003
elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
6004
  SSL_INCLUDES="-I$ssl_includes"
6005
fi
6006
 
6007
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
6008
 SSL_LDFLAGS=""
6009
else
6010
 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
6011
fi
6012
 
6013
AC_SUBST(SSL_INCLUDES)
6014
AC_SUBST(SSL_LDFLAGS)
6015
AC_SUBST(LIBSSL)
6016
])
6017
 
6018
AC_DEFUN([KDE_CHECK_STRLCPY],
6019
[
6020
  AC_REQUIRE([AC_CHECK_STRLCAT])
6021
  AC_REQUIRE([AC_CHECK_STRLCPY])
6022
  AC_CHECK_SIZEOF(size_t)
6023
  AC_CHECK_SIZEOF(unsigned long)
6024
 
6025
  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
6026
  AC_TRY_COMPILE(,[
6027
    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
6028
       choke me
6029
    #endif
6030
    ],AC_MSG_RESULT([yes]),[
6031
      AC_MSG_RESULT(no)
6032
      AC_MSG_ERROR([
6033
       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
6034
       does not apply. Please mail kde-devel@kde.org with a description of your system!
6035
      ])
6036
  ])
6037
])
6038
 
6039
AC_DEFUN([KDE_CHECK_BINUTILS],
6040
[
6041
  AC_MSG_CHECKING([if ld supports unversioned version maps])
6042
 
6043
  kde_save_LDFLAGS="$LDFLAGS"
6044
  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
6045
  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
6046
  AC_TRY_LINK([int foo;],
6047
[
6048
#ifdef __INTEL_COMPILER
6049
icc apparently does not support libtools version-info and version-script
6050
at the same time. Dunno where the bug is, but until somebody figured out,
6051
better disable the optional version scripts.
6052
#endif
6053
 
6054
  foo = 42;
6055
], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
6056
  LDFLAGS="$kde_save_LDFLAGS"
6057
  rm -f conftest.map
6058
  AM_CONDITIONAL(include_VERSION_SCRIPT, 
6059
    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
6060
 
6061
  AC_MSG_RESULT($kde_supports_versionmaps)
6062
])
6063
 
6064
AC_DEFUN([AM_PROG_OBJC],[
6065
AC_CHECK_PROGS(OBJC, gcc, gcc)
6066
test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
6067
if test "x${OBJCFLAGS-unset}" = xunset; then
6068
   OBJCFLAGS="-g -O2"
6069
fi
6070
AC_SUBST(OBJCFLAGS)
6071
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
6072
])
6073
 
6074
AC_DEFUN([KDE_CHECK_PERL],
6075
[
6076
	KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
6077
		    AC_MSG_ERROR([No Perl found in your $PATH.
6078
We need perl to generate some code.])
6079
	])
6080
    AC_SUBST(PERL)
6081
])
6082
 
6083
AC_DEFUN([KDE_CHECK_LARGEFILE],
6084
[
6085
AC_SYS_LARGEFILE
6086
if test "$ac_cv_sys_file_offset_bits" != no; then
6087
  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6088
fi
6089
 
6090
if test "x$ac_cv_sys_large_files" != "xno"; then
6091
  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
6092
fi
6093
 
6094
])
6095
 
6096
dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
6097
dnl which allows to search for libs that get installed into the KDE prefix.
6098
dnl
6099
dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
6100
dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
6101
dnl also defines KSTUFF_PKG_ERRORS on error
6102
AC_DEFUN([KDE_PKG_CHECK_MODULES], [
6103
 
6104
   PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
6105
   if test "$prefix" != "$kde_libs_prefix"; then
6106
       PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
6107
   fi
6108
   export PKG_CONFIG_PATH
6109
   PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
6110
])
6111
 
6112
 
6113
dnl Check for PIE support in the compiler and linker
6114
AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
6115
[
6116
  AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
6117
  [
6118
    AC_LANG_SAVE
6119
    AC_LANG_CPLUSPLUS
6120
    safe_CXXFLAGS=$CXXFLAGS
6121
    safe_LDFLAGS=$LDFLAGS
6122
    CXXFLAGS="$CXXFLAGS -fPIE"
6123
    LDFLAGS="$LDFLAGS -pie"
6124
 
6125
    AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
6126
 
6127
    CXXFLAGS=$safe_CXXFLAGS
6128
    LDFLAGS=$safe_LDFLAGS
6129
    AC_LANG_RESTORE
6130
  ])
6131
 
6132
  AC_MSG_CHECKING(if enabling -pie/fPIE support)
6133
 
6134
  AC_ARG_ENABLE(pie,
6135
    AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
6136
      [kde_has_pie_support=$enableval],
6137
      [kde_has_pie_support=detect])
6138
 
6139
  if test "$kde_has_pie_support" = "detect"; then
6140
    kde_has_pie_support=$kde_cv_val_pie_support
6141
  fi
6142
 
6143
  AC_MSG_RESULT([$kde_has_pie_support])
6144
 
6145
  KDE_USE_FPIE=""
6146
  KDE_USE_PIE=""
6147
 
6148
  AC_SUBST([KDE_USE_FPIE])
6149
  AC_SUBST([KDE_USE_PIE])
6150
 
6151
  if test "$kde_has_pie_support" = "yes"; then
6152
    KDE_USE_FPIE="-fPIE"
6153
    KDE_USE_PIE="-pie"
6154
  fi
6155
])
6156
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
6157
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
6158
## Free Software Foundation, Inc.
6159
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6160
##
6161
## This program is free software; you can redistribute it and/or modify
6162
## it under the terms of the GNU General Public License as published by
6163
## the Free Software Foundation; either version 2 of the License, or
6164
## (at your option) any later version.
6165
##
6166
## This program is distributed in the hope that it will be useful, but
6167
## WITHOUT ANY WARRANTY; without even the implied warranty of
6168
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6169
## General Public License for more details.
6170
##
6171
## You should have received a copy of the GNU General Public License
6172
## along with this program; if not, write to the Free Software
6173
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
6174
##
6175
## As a special exception to the GNU General Public License, if you
6176
## distribute this file as part of a program that contains a
6177
## configuration script generated by Autoconf, you may include it under
6178
## the same distribution terms that you use for the rest of that program.
6179
 
6180
# serial 47 AC_PROG_LIBTOOL
6181
 
6182
 
6183
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
6184
# -----------------------------------------------------------
6185
# If this macro is not defined by Autoconf, define it here.
6186
m4_ifdef([AC_PROVIDE_IFELSE],
6187
         [],
6188
         [m4_define([AC_PROVIDE_IFELSE],
6189
	         [m4_ifdef([AC_PROVIDE_$1],
6190
		           [$2], [$3])])])
6191
 
6192
 
6193
# AC_PROG_LIBTOOL
6194
# ---------------
6195
AC_DEFUN([AC_PROG_LIBTOOL],
6196
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
6197
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
6198
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
6199
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
6200
    [AC_LIBTOOL_CXX],
6201
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
6202
  ])])
6203
dnl And a similar setup for Fortran 77 support
6204
  AC_PROVIDE_IFELSE([AC_PROG_F77],
6205
    [AC_LIBTOOL_F77],
6206
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
6207
])])
6208
 
6209
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
6210
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
6211
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
6212
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
6213
    [AC_LIBTOOL_GCJ],
6214
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
6215
      [AC_LIBTOOL_GCJ],
6216
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
6217
	[AC_LIBTOOL_GCJ],
6218
      [ifdef([AC_PROG_GCJ],
6219
	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6220
       ifdef([A][M_PROG_GCJ],
6221
	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6222
       ifdef([LT_AC_PROG_GCJ],
6223
	     [define([LT_AC_PROG_GCJ],
6224
		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
6225
])])# AC_PROG_LIBTOOL
6226
 
6227
 
6228
# _AC_PROG_LIBTOOL
6229
# ----------------
6230
AC_DEFUN([_AC_PROG_LIBTOOL],
6231
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
6232
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
6233
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
6234
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
6235
 
6236
# This can be used to rebuild libtool when needed
6237
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
6238
 
6239
# Always use our own libtool.
6240
LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
6241
AC_SUBST(LIBTOOL)dnl
6242
 
6243
# Prevent multiple expansion
6244
define([AC_PROG_LIBTOOL], [])
6245
])# _AC_PROG_LIBTOOL
6246
 
6247
 
6248
# AC_LIBTOOL_SETUP
6249
# ----------------
6250
AC_DEFUN([AC_LIBTOOL_SETUP],
6251
[AC_PREREQ(2.50)dnl
6252
AC_REQUIRE([AC_ENABLE_SHARED])dnl
6253
AC_REQUIRE([AC_ENABLE_STATIC])dnl
6254
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
6255
AC_REQUIRE([AC_CANONICAL_HOST])dnl
6256
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
6257
AC_REQUIRE([AC_PROG_CC])dnl
6258
AC_REQUIRE([AC_PROG_LD])dnl
6259
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
6260
AC_REQUIRE([AC_PROG_NM])dnl
6261
 
6262
AC_REQUIRE([AC_PROG_LN_S])dnl
6263
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
6264
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
6265
AC_REQUIRE([AC_OBJEXT])dnl
6266
AC_REQUIRE([AC_EXEEXT])dnl
6267
dnl
6268
 
6269
AC_LIBTOOL_SYS_MAX_CMD_LEN
6270
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
6271
AC_LIBTOOL_OBJDIR
6272
 
6273
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6274
_LT_AC_PROG_ECHO_BACKSLASH
6275
 
6276
case $host_os in
6277
aix3*)
6278
  # AIX sometimes has problems with the GCC collect2 program.  For some
6279
  # reason, if we set the COLLECT_NAMES environment variable, the problems
6280
  # vanish in a puff of smoke.
6281
  if test "X${COLLECT_NAMES+set}" != Xset; then
6282
    COLLECT_NAMES=
6283
    export COLLECT_NAMES
6284
  fi
6285
  ;;
6286
esac
6287
 
6288
# Sed substitution that helps us do robust quoting.  It backslashifies
6289
# metacharacters that are still active within double-quoted strings.
6290
Xsed='sed -e s/^X//'
6291
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
6292
 
6293
# Same as above, but do not quote variable references.
6294
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
6295
 
6296
# Sed substitution to delay expansion of an escaped shell variable in a
6297
# double_quote_subst'ed string.
6298
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
6299
 
6300
# Sed substitution to avoid accidental globbing in evaled expressions
6301
no_glob_subst='s/\*/\\\*/g'
6302
 
6303
# Constants:
6304
rm="rm -f"
6305
 
6306
# Global variables:
6307
default_ofile=libtool
6308
can_build_shared=yes
6309
 
6310
# All known linkers require a `.a' archive for static linking (except M$VC,
6311
# which needs '.lib').
6312
libext=a
6313
ltmain="$ac_aux_dir/ltmain.sh"
6314
ofile="$default_ofile"
6315
with_gnu_ld="$lt_cv_prog_gnu_ld"
6316
 
6317
AC_CHECK_TOOL(AR, ar, false)
6318
AC_CHECK_TOOL(RANLIB, ranlib, :)
6319
AC_CHECK_TOOL(STRIP, strip, :)
6320
 
6321
old_CC="$CC"
6322
old_CFLAGS="$CFLAGS"
6323
 
6324
# Set sane defaults for various variables
6325
test -z "$AR" && AR=ar
6326
test -z "$AR_FLAGS" && AR_FLAGS=cru
6327
test -z "$AS" && AS=as
6328
test -z "$CC" && CC=cc
6329
test -z "$LTCC" && LTCC=$CC
6330
test -z "$DLLTOOL" && DLLTOOL=dlltool
6331
test -z "$LD" && LD=ld
6332
test -z "$LN_S" && LN_S="ln -s"
6333
test -z "$MAGIC_CMD" && MAGIC_CMD=file
6334
test -z "$NM" && NM=nm
6335
test -z "$SED" && SED=sed
6336
test -z "$OBJDUMP" && OBJDUMP=objdump
6337
test -z "$RANLIB" && RANLIB=:
6338
test -z "$STRIP" && STRIP=:
6339
test -z "$ac_objext" && ac_objext=o
6340
 
6341
# Determine commands to create old-style static archives.
6342
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
6343
old_postinstall_cmds='chmod 644 $oldlib'
6344
old_postuninstall_cmds=
6345
 
6346
if test -n "$RANLIB"; then
6347
  case $host_os in
6348
  openbsd*)
6349
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
6350
    ;;
6351
  *)
6352
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
6353
    ;;
6354
  esac
6355
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
6356
fi
6357
 
6358
# Only perform the check for file, if the check method requires it
6359
case $deplibs_check_method in
6360
file_magic*)
6361
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
6362
    AC_PATH_MAGIC
6363
  fi
6364
  ;;
6365
esac
6366
 
6367
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
6368
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6369
enable_win32_dll=yes, enable_win32_dll=no)
6370
 
6371
AC_ARG_ENABLE([libtool-lock],
6372
    [AC_HELP_STRING([--disable-libtool-lock],
6373
	[avoid locking (might break parallel builds)])])
6374
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6375
 
6376
AC_ARG_WITH([pic],
6377
    [AC_HELP_STRING([--with-pic],
6378
	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
6379
    [pic_mode="$withval"],
6380
    [pic_mode=default])
6381
test -z "$pic_mode" && pic_mode=default
6382
 
6383
# Use C for the default configuration in the libtool script
6384
tagname=
6385
AC_LIBTOOL_LANG_C_CONFIG
6386
_LT_AC_TAGCONFIG
6387
])# AC_LIBTOOL_SETUP
6388
 
6389
 
6390
# _LT_AC_SYS_COMPILER
6391
# -------------------
6392
AC_DEFUN([_LT_AC_SYS_COMPILER],
6393
[AC_REQUIRE([AC_PROG_CC])dnl
6394
 
6395
# If no C compiler was specified, use CC.
6396
LTCC=${LTCC-"$CC"}
6397
 
6398
# Allow CC to be a program name with arguments.
6399
compiler=$CC
6400
])# _LT_AC_SYS_COMPILER
6401
 
6402
 
6403
# _LT_AC_SYS_LIBPATH_AIX
6404
# ----------------------
6405
# Links a minimal program and checks the executable
6406
# for the system default hardcoded library path. In most cases,
6407
# this is /usr/lib:/lib, but when the MPI compilers are used
6408
# the location of the communication and MPI libs are included too.
6409
# If we don't find anything, use the default library path according
6410
# to the aix ld manual.
6411
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
6412
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
6413
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
6414
}'`
6415
# Check for a 64-bit object if we didn't find anything.
6416
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; }
6417
}'`; fi],[])
6418
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
6419
])# _LT_AC_SYS_LIBPATH_AIX
6420
 
6421
 
6422
# _LT_AC_SHELL_INIT(ARG)
6423
# ----------------------
6424
AC_DEFUN([_LT_AC_SHELL_INIT],
6425
[ifdef([AC_DIVERSION_NOTICE],
6426
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
6427
	 [AC_DIVERT_PUSH(NOTICE)])
6428
$1
6429
AC_DIVERT_POP
6430
])# _LT_AC_SHELL_INIT
6431
 
6432
 
6433
# _LT_AC_PROG_ECHO_BACKSLASH
6434
# --------------------------
6435
# Add some code to the start of the generated configure script which
6436
# will find an echo command which doesn't interpret backslashes.
6437
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
6438
[_LT_AC_SHELL_INIT([
6439
# Check that we are running under the correct shell.
6440
SHELL=${CONFIG_SHELL-/bin/sh}
6441
 
6442
case X$ECHO in
6443
X*--fallback-echo)
6444
  # Remove one level of quotation (which was required for Make).
6445
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
6446
  ;;
6447
esac
6448
 
6449
echo=${ECHO-echo}
6450
if test "X[$]1" = X--no-reexec; then
6451
  # Discard the --no-reexec flag, and continue.
6452
  shift
6453
elif test "X[$]1" = X--fallback-echo; then
6454
  # Avoid inline document here, it may be left over
6455
  :
6456
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
6457
  # Yippee, $echo works!
6458
  :
6459
else
6460
  # Restart under the correct shell.
6461
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
6462
fi
6463
 
6464
if test "X[$]1" = X--fallback-echo; then
6465
  # used as fallback echo
6466
  shift
6467
  cat <<EOF
6468
[$]*
6469
EOF
6470
  exit 0
6471
fi
6472
 
6473
# The HP-UX ksh and POSIX shell print the target directory to stdout
6474
# if CDPATH is set.
6475
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
6476
 
6477
if test -z "$ECHO"; then
6478
if test "X${echo_test_string+set}" != Xset; then
6479
# find a string as large as possible, as long as the shell can cope with it
6480
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
6481
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
6482
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
6483
       echo_test_string="`eval $cmd`" &&
6484
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
6485
    then
6486
      break
6487
    fi
6488
  done
6489
fi
6490
 
6491
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6492
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6493
   test "X$echo_testing_string" = "X$echo_test_string"; then
6494
  :
6495
else
6496
  # The Solaris, AIX, and Digital Unix default echo programs unquote
6497
  # backslashes.  This makes it impossible to quote backslashes using
6498
  #   echo "$something" | sed 's/\\/\\\\/g'
6499
  #
6500
  # So, first we look for a working echo in the user's PATH.
6501
 
6502
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
6503
  for dir in $PATH /usr/ucb; do
6504
    IFS="$lt_save_ifs"
6505
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
6506
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
6507
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
6508
       test "X$echo_testing_string" = "X$echo_test_string"; then
6509
      echo="$dir/echo"
6510
      break
6511
    fi
6512
  done
6513
  IFS="$lt_save_ifs"
6514
 
6515
  if test "X$echo" = Xecho; then
6516
    # We didn't find a better echo, so look for alternatives.
6517
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
6518
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
6519
       test "X$echo_testing_string" = "X$echo_test_string"; then
6520
      # This shell has a builtin print -r that does the trick.
6521
      echo='print -r'
6522
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
6523
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
6524
      # If we have ksh, try running configure again with it.
6525
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
6526
      export ORIGINAL_CONFIG_SHELL
6527
      CONFIG_SHELL=/bin/ksh
6528
      export CONFIG_SHELL
6529
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
6530
    else
6531
      # Try using printf.
6532
      echo='printf %s\n'
6533
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6534
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6535
	 test "X$echo_testing_string" = "X$echo_test_string"; then
6536
	# Cool, printf works
6537
	:
6538
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6539
	   test "X$echo_testing_string" = 'X\t' &&
6540
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6541
	   test "X$echo_testing_string" = "X$echo_test_string"; then
6542
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
6543
	export CONFIG_SHELL
6544
	SHELL="$CONFIG_SHELL"
6545
	export SHELL
6546
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
6547
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6548
	   test "X$echo_testing_string" = 'X\t' &&
6549
	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6550
	   test "X$echo_testing_string" = "X$echo_test_string"; then
6551
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
6552
      else
6553
	# maybe with a smaller string...
6554
	prev=:
6555
 
6556
	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
6557
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
6558
	  then
6559
	    break
6560
	  fi
6561
	  prev="$cmd"
6562
	done
6563
 
6564
	if test "$prev" != 'sed 50q "[$]0"'; then
6565
	  echo_test_string=`eval $prev`
6566
	  export echo_test_string
6567
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
6568
	else
6569
	  # Oops.  We lost completely, so just stick with echo.
6570
	  echo=echo
6571
	fi
6572
      fi
6573
    fi
6574
  fi
6575
fi
6576
fi
6577
 
6578
# Copy echo and quote the copy suitably for passing to libtool from
6579
# the Makefile, instead of quoting the original, which is used later.
6580
ECHO=$echo
6581
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
6582
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
6583
fi
6584
 
6585
AC_SUBST(ECHO)
6586
])])# _LT_AC_PROG_ECHO_BACKSLASH
6587
 
6588
 
6589
# _LT_AC_LOCK
6590
# -----------
6591
AC_DEFUN([_LT_AC_LOCK],
6592
[AC_ARG_ENABLE([libtool-lock],
6593
    [AC_HELP_STRING([--disable-libtool-lock],
6594
	[avoid locking (might break parallel builds)])])
6595
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6596
 
6597
# Some flags need to be propagated to the compiler or linker for good
6598
# libtool support.
6599
case $host in
6600
ia64-*-hpux*)
6601
  # Find out which ABI we are using.
6602
  echo 'int i;' > conftest.$ac_ext
6603
  if AC_TRY_EVAL(ac_compile); then
6604
    case `/usr/bin/file conftest.$ac_objext` in
6605
    *ELF-32*)
6606
      HPUX_IA64_MODE="32"
6607
      ;;
6608
    *ELF-64*)
6609
      HPUX_IA64_MODE="64"
6610
      ;;
6611
    esac
6612
  fi
6613
  rm -rf conftest*
6614
  ;;
6615
*-*-irix6*)
6616
  # Find out which ABI we are using.
6617
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
6618
  if AC_TRY_EVAL(ac_compile); then
6619
   if test "$lt_cv_prog_gnu_ld" = yes; then
6620
    case `/usr/bin/file conftest.$ac_objext` in
6621
    *32-bit*)
6622
      LD="${LD-ld} -melf32bsmip"
6623
      ;;
6624
    *N32*)
6625
      LD="${LD-ld} -melf32bmipn32"
6626
      ;;
6627
    *64-bit*)
6628
      LD="${LD-ld} -melf64bmip"
6629
      ;;
6630
    esac
6631
   else
6632
    case `/usr/bin/file conftest.$ac_objext` in
6633
    *32-bit*)
6634
      LD="${LD-ld} -32"
6635
      ;;
6636
    *N32*)
6637
      LD="${LD-ld} -n32"
6638
      ;;
6639
    *64-bit*)
6640
      LD="${LD-ld} -64"
6641
      ;;
6642
    esac
6643
   fi
6644
  fi
6645
  rm -rf conftest*
6646
  ;;
6647
 
6648
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
6649
  # Find out which ABI we are using.
6650
  echo 'int i;' > conftest.$ac_ext
6651
  if AC_TRY_EVAL(ac_compile); then
6652
    case "`/usr/bin/file conftest.o`" in
6653
    *32-bit*)
6654
      LINUX_64_MODE="32"
6655
      case $host in
6656
        x86_64-*linux*)
6657
          LD="${LD-ld} -m elf_i386"
6658
          ;;
6659
        ppc64-*linux*)
6660
          LD="${LD-ld} -m elf32ppclinux"
6661
          ;;
6662
        s390x-*linux*)
6663
          LD="${LD-ld} -m elf_s390"
6664
          ;;
6665
        sparc64-*linux*)
6666
          LD="${LD-ld} -m elf32_sparc"
6667
          ;;
6668
      esac
6669
      ;;
6670
    *64-bit*)
6671
      LINUX_64_MODE="64"
6672
      case $host in
6673
        x86_64-*linux*)
6674
          LD="${LD-ld} -m elf_x86_64"
6675
          ;;
6676
        ppc*-*linux*|powerpc*-*linux*)
6677
          LD="${LD-ld} -m elf64ppc"
6678
          ;;
6679
        s390*-*linux*)
6680
          LD="${LD-ld} -m elf64_s390"
6681
          ;;
6682
        sparc*-*linux*)
6683
          LD="${LD-ld} -m elf64_sparc"
6684
          ;;
6685
      esac
6686
      ;;
6687
    esac
6688
  fi
6689
  rm -rf conftest*
6690
  ;;
6691
 
6692
*-*-sco3.2v5*)
6693
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6694
  SAVE_CFLAGS="$CFLAGS"
6695
  CFLAGS="$CFLAGS -belf"
6696
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
6697
    [AC_LANG_PUSH(C)
6698
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
6699
     AC_LANG_POP])
6700
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6701
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6702
    CFLAGS="$SAVE_CFLAGS"
6703
  fi
6704
  ;;
6705
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6706
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
6707
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
6708
  AC_CHECK_TOOL(AS, as, false)
6709
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
6710
  ;;
6711
  ])
6712
esac
6713
 
6714
need_locks="$enable_libtool_lock"
6715
 
6716
])# _LT_AC_LOCK
6717
 
6718
 
6719
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6720
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6721
# ----------------------------------------------------------------
6722
# Check whether the given compiler option works
6723
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6724
[AC_REQUIRE([LT_AC_PROG_SED])
6725
AC_CACHE_CHECK([$1], [$2],
6726
  [$2=no
6727
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6728
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6729
   lt_compiler_flag="$3"
6730
   # Insert the option either (1) after the last *FLAGS variable, or
6731
   # (2) before a word containing "conftest.", or (3) at the end.
6732
   # Note that $ac_compile itself does not contain backslashes and begins
6733
   # with a dollar sign (not a hyphen), so the echo should work correctly.
6734
   # The option is referenced via a variable to avoid confusing sed.
6735
   lt_compile=`echo "$ac_compile" | $SED \
6736
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
6737
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6738
   -e 's:$: $lt_compiler_flag:'`
6739
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6740
   (eval "$lt_compile" 2>conftest.err)
6741
   ac_status=$?
6742
   cat conftest.err >&AS_MESSAGE_LOG_FD
6743
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6744
   if (exit $ac_status) && test -s "$ac_outfile"; then
6745
     # The compiler can only warn and ignore the option if not recognized
6746
     # So say no if there are warnings
6747
     if test ! -s conftest.err; then
6748
       $2=yes
6749
     fi
6750
   fi
6751
   $rm conftest*
6752
])
6753
 
6754
if test x"[$]$2" = xyes; then
6755
    ifelse([$5], , :, [$5])
6756
else
6757
    ifelse([$6], , :, [$6])
6758
fi
6759
])# AC_LIBTOOL_COMPILER_OPTION
6760
 
6761
 
6762
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6763
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
6764
# ------------------------------------------------------------
6765
# Check whether the given compiler option works
6766
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6767
[AC_CACHE_CHECK([$1], [$2],
6768
  [$2=no
6769
   save_LDFLAGS="$LDFLAGS"
6770
   LDFLAGS="$LDFLAGS $3"
6771
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
6772
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6773
     # The compiler can only warn and ignore the option if not recognized
6774
     # So say no if there are warnings
6775
     if test -s conftest.err; then
6776
       # Append any errors to the config.log.
6777
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
6778
     else
6779
       $2=yes
6780
     fi
6781
   fi
6782
   $rm conftest*
6783
   LDFLAGS="$save_LDFLAGS"
6784
])
6785
 
6786
if test x"[$]$2" = xyes; then
6787
    ifelse([$4], , :, [$4])
6788
else
6789
    ifelse([$5], , :, [$5])
6790
fi
6791
])# AC_LIBTOOL_LINKER_OPTION
6792
 
6793
 
6794
# AC_LIBTOOL_SYS_MAX_CMD_LEN
6795
# --------------------------
6796
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
6797
[# find the maximum length of command line arguments
6798
AC_MSG_CHECKING([the maximum length of command line arguments])
6799
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
6800
  i=0
6801
  testring="ABCD"
6802
 
6803
  case $build_os in
6804
  msdosdjgpp*)
6805
    # On DJGPP, this test can blow up pretty badly due to problems in libc
6806
    # (any single argument exceeding 2000 bytes causes a buffer overrun
6807
    # during glob expansion).  Even if it were fixed, the result of this
6808
    # check would be larger than it should be.
6809
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
6810
    ;;
6811
 
6812
  gnu*)
6813
    # Under GNU Hurd, this test is not required because there is
6814
    # no limit to the length of command line arguments.
6815
    # Libtool will interpret -1 as no limit whatsoever
6816
    lt_cv_sys_max_cmd_len=-1;
6817
    ;;
6818
 
6819
  cygwin* | mingw*)
6820
    # On Win9x/ME, this test blows up -- it succeeds, but takes
6821
    # about 5 minutes as the teststring grows exponentially.
6822
    # Worse, since 9x/ME are not pre-emptively multitasking,
6823
    # you end up with a "frozen" computer, even though with patience
6824
    # the test eventually succeeds (with a max line length of 256k).
6825
    # Instead, let's just punt: use the minimum linelength reported by
6826
    # all of the supported platforms: 8192 (on NT/2K/XP).
6827
    lt_cv_sys_max_cmd_len=8192;
6828
    ;;
6829
 
6830
 *)
6831
    # If test is not a shell built-in, we'll probably end up computing a
6832
    # maximum length that is only half of the actual maximum length, but
6833
    # we can't tell.
6834
    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
6835
	       = "XX$testring") >/dev/null 2>&1 &&
6836
	    new_result=`expr "X$testring" : ".*" 2>&1` &&
6837
	    lt_cv_sys_max_cmd_len=$new_result &&
6838
	    test $i != 17 # 1/2 MB should be enough
6839
    do
6840
      i=`expr $i + 1`
6841
      testring=$testring$testring
6842
    done
6843
    testring=
6844
    # Add a significant safety factor because C++ compilers can tack on massive
6845
    # amounts of additional arguments before passing them to the linker.
6846
    # It appears as though 1/2 is a usable value.
6847
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6848
    ;;
6849
  esac
6850
])
6851
if test -n $lt_cv_sys_max_cmd_len ; then
6852
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
6853
else
6854
  AC_MSG_RESULT(none)
6855
fi
6856
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
6857
 
6858
 
6859
# _LT_AC_CHECK_DLFCN
6860
# --------------------
6861
AC_DEFUN([_LT_AC_CHECK_DLFCN],
6862
[AC_CHECK_HEADERS(dlfcn.h)dnl
6863
])# _LT_AC_CHECK_DLFCN
6864
 
6865
 
6866
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
6867
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
6868
# ------------------------------------------------------------------
6869
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
6870
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6871
if test "$cross_compiling" = yes; then :
6872
  [$4]
6873
else
6874
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6875
  lt_status=$lt_dlunknown
6876
  cat > conftest.$ac_ext <<EOF
6877
[#line __oline__ "configure"
6878
#include "confdefs.h"
6879
 
6880
#if HAVE_DLFCN_H
6881
#include <dlfcn.h>
6882
#endif
6883
 
6884
#include <stdio.h>
6885
 
6886
#ifdef RTLD_GLOBAL
6887
#  define LT_DLGLOBAL		RTLD_GLOBAL
6888
#else
6889
#  ifdef DL_GLOBAL
6890
#    define LT_DLGLOBAL		DL_GLOBAL
6891
#  else
6892
#    define LT_DLGLOBAL		0
6893
#  endif
6894
#endif
6895
 
6896
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6897
   find out it does not work in some platform. */
6898
#ifndef LT_DLLAZY_OR_NOW
6899
#  ifdef RTLD_LAZY
6900
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
6901
#  else
6902
#    ifdef DL_LAZY
6903
#      define LT_DLLAZY_OR_NOW		DL_LAZY
6904
#    else
6905
#      ifdef RTLD_NOW
6906
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
6907
#      else
6908
#        ifdef DL_NOW
6909
#          define LT_DLLAZY_OR_NOW	DL_NOW
6910
#        else
6911
#          define LT_DLLAZY_OR_NOW	0
6912
#        endif
6913
#      endif
6914
#    endif
6915
#  endif
6916
#endif
6917
 
6918
#ifdef __cplusplus
6919
extern "C" void exit (int);
6920
#endif
6921
 
6922
void fnord() { int i=42;}
6923
int main ()
6924
{
6925
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6926
  int status = $lt_dlunknown;
6927
 
6928
  if (self)
6929
    {
6930
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6931
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6932
      /* dlclose (self); */
6933
    }
6934
 
6935
    exit (status);
6936
}]
6937
EOF
6938
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
6939
    (./conftest; exit; ) 2>/dev/null
6940
    lt_status=$?
6941
    case x$lt_status in
6942
      x$lt_dlno_uscore) $1 ;;
6943
      x$lt_dlneed_uscore) $2 ;;
6944
      x$lt_unknown|x*) $3 ;;
6945
    esac
6946
  else :
6947
    # compilation failed
6948
    $3
6949
  fi
6950
fi
6951
rm -fr conftest*
6952
])# _LT_AC_TRY_DLOPEN_SELF
6953
 
6954
 
6955
# AC_LIBTOOL_DLOPEN_SELF
6956
# -------------------
6957
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
6958
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6959
if test "x$enable_dlopen" != xyes; then
6960
  enable_dlopen=unknown
6961
  enable_dlopen_self=unknown
6962
  enable_dlopen_self_static=unknown
6963
else
6964
  lt_cv_dlopen=no
6965
  lt_cv_dlopen_libs=
6966
 
6967
  case $host_os in
6968
  beos*)
6969
    lt_cv_dlopen="load_add_on"
6970
    lt_cv_dlopen_libs=
6971
    lt_cv_dlopen_self=yes
6972
    ;;
6973
 
6974
  mingw* | pw32*)
6975
    lt_cv_dlopen="LoadLibrary"
6976
    lt_cv_dlopen_libs=
6977
   ;;
6978
 
6979
  cygwin*)
6980
    lt_cv_dlopen="dlopen"
6981
    lt_cv_dlopen_libs=
6982
   ;;
6983
 
6984
  darwin*)
6985
  # if libdl is installed we need to link against it
6986
    AC_CHECK_LIB([dl], [dlopen],
6987
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
6988
    lt_cv_dlopen="dyld"
6989
    lt_cv_dlopen_libs=
6990
    lt_cv_dlopen_self=yes
6991
    ])
6992
   ;;
6993
 
6994
  *)
6995
    AC_CHECK_FUNC([shl_load],
6996
	  [lt_cv_dlopen="shl_load"],
6997
      [AC_CHECK_LIB([dld], [shl_load],
6998
	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
6999
	[AC_CHECK_FUNC([dlopen],
7000
	      [lt_cv_dlopen="dlopen"],
7001
	  [AC_CHECK_LIB([dl], [dlopen],
7002
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
7003
	    [AC_CHECK_LIB([svld], [dlopen],
7004
		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
7005
	      [AC_CHECK_LIB([dld], [dld_link],
7006
		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
7007
	      ])
7008
	    ])
7009
	  ])
7010
	])
7011
      ])
7012
    ;;
7013
  esac
7014
 
7015
  if test "x$lt_cv_dlopen" != xno; then
7016
    enable_dlopen=yes
7017
  else
7018
    enable_dlopen=no
7019
  fi
7020
 
7021
  case $lt_cv_dlopen in
7022
  dlopen)
7023
    save_CPPFLAGS="$CPPFLAGS"
7024
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
7025
 
7026
    save_LDFLAGS="$LDFLAGS"
7027
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
7028
 
7029
    save_LIBS="$LIBS"
7030
    LIBS="$lt_cv_dlopen_libs $LIBS"
7031
 
7032
    AC_CACHE_CHECK([whether a program can dlopen itself],
7033
	  lt_cv_dlopen_self, [dnl
7034
	  _LT_AC_TRY_DLOPEN_SELF(
7035
	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
7036
	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
7037
    ])
7038
 
7039
    if test "x$lt_cv_dlopen_self" = xyes; then
7040
      LDFLAGS="$LDFLAGS $link_static_flag"
7041
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
7042
    	  lt_cv_dlopen_self_static, [dnl
7043
	  _LT_AC_TRY_DLOPEN_SELF(
7044
	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
7045
	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
7046
      ])
7047
    fi
7048
 
7049
    CPPFLAGS="$save_CPPFLAGS"
7050
    LDFLAGS="$save_LDFLAGS"
7051
    LIBS="$save_LIBS"
7052
    ;;
7053
  esac
7054
 
7055
  case $lt_cv_dlopen_self in
7056
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7057
  *) enable_dlopen_self=unknown ;;
7058
  esac
7059
 
7060
  case $lt_cv_dlopen_self_static in
7061
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7062
  *) enable_dlopen_self_static=unknown ;;
7063
  esac
7064
fi
7065
])# AC_LIBTOOL_DLOPEN_SELF
7066
 
7067
 
7068
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
7069
# ---------------------------------
7070
# Check to see if options -c and -o are simultaneously supported by compiler
7071
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
7072
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
7073
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
7074
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
7075
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
7076
   $rm -r conftest 2>/dev/null
7077
   mkdir conftest
7078
   cd conftest
7079
   mkdir out
7080
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7081
 
7082
   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
7083
   # that will create temporary files in the current directory regardless of
7084
   # the output directory.  Thus, making CWD read-only will cause this test
7085
   # to fail, enabling locking or at least warning the user not to do parallel
7086
   # builds.
7087
   chmod -w .
7088
 
7089
   lt_compiler_flag="-o out/conftest2.$ac_objext"
7090
   # Insert the option either (1) after the last *FLAGS variable, or
7091
   # (2) before a word containing "conftest.", or (3) at the end.
7092
   # Note that $ac_compile itself does not contain backslashes and begins
7093
   # with a dollar sign (not a hyphen), so the echo should work correctly.
7094
   lt_compile=`echo "$ac_compile" | $SED \
7095
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
7096
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
7097
   -e 's:$: $lt_compiler_flag:'`
7098
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
7099
   (eval "$lt_compile" 2>out/conftest.err)
7100
   ac_status=$?
7101
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
7102
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
7103
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
7104
   then
7105
     # The compiler can only warn and ignore the option if not recognized
7106
     # So say no if there are warnings
7107
     if test ! -s out/conftest.err; then
7108
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7109
     fi
7110
   fi
7111
   chmod u+w .
7112
   $rm conftest* out/*
7113
   rmdir out
7114
   cd ..
7115
   rmdir conftest
7116
   $rm conftest*
7117
])
7118
])# AC_LIBTOOL_PROG_CC_C_O
7119
 
7120
 
7121
# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
7122
# -----------------------------------------
7123
# Check to see if we can do hard links to lock some files if needed
7124
AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
7125
[AC_REQUIRE([_LT_AC_LOCK])dnl
7126
 
7127
hard_links="nottested"
7128
if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
7129
  # do not overwrite the value of need_locks provided by the user
7130
  AC_MSG_CHECKING([if we can lock with hard links])
7131
  hard_links=yes
7132
  $rm conftest*
7133
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
7134
  touch conftest.a
7135
  ln conftest.a conftest.b 2>&5 || hard_links=no
7136
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
7137
  AC_MSG_RESULT([$hard_links])
7138
  if test "$hard_links" = no; then
7139
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
7140
    need_locks=warn
7141
  fi
7142
else
7143
  need_locks=no
7144
fi
7145
])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
7146
 
7147
 
7148
# AC_LIBTOOL_OBJDIR
7149
# -----------------
7150
AC_DEFUN([AC_LIBTOOL_OBJDIR],
7151
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
7152
[rm -f .libs 2>/dev/null
7153
mkdir .libs 2>/dev/null
7154
if test -d .libs; then
7155
  lt_cv_objdir=.libs
7156
else
7157
  # MS-DOS does not allow filenames that begin with a dot.
7158
  lt_cv_objdir=_libs
7159
fi
7160
rmdir .libs 2>/dev/null])
7161
objdir=$lt_cv_objdir
7162
])# AC_LIBTOOL_OBJDIR
7163
 
7164
 
7165
# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
7166
# ----------------------------------------------
7167
# Check hardcoding attributes.
7168
AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
7169
[AC_MSG_CHECKING([how to hardcode library paths into programs])
7170
_LT_AC_TAGVAR(hardcode_action, $1)=
7171
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
7172
   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
7173
   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
7174
 
7175
  # We can hardcode non-existant directories.
7176
  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
7177
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
7178
     # have to relink, otherwise we might link with an installed library
7179
     # when we should be linking with a yet-to-be-installed one
7180
     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
7181
     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
7182
    # Linking always hardcodes the temporary library directory.
7183
    _LT_AC_TAGVAR(hardcode_action, $1)=relink
7184
  else
7185
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
7186
    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
7187
  fi
7188
else
7189
  # We cannot hardcode anything, or else we can only hardcode existing
7190
  # directories.
7191
  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
7192
fi
7193
AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
7194
 
7195
if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
7196
  # Fast installation is not supported
7197
  enable_fast_install=no
7198
elif test "$shlibpath_overrides_runpath" = yes ||
7199
     test "$enable_shared" = no; then
7200
  # Fast installation is not necessary
7201
  enable_fast_install=needless
7202
fi
7203
])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
7204
 
7205
 
7206
# AC_LIBTOOL_SYS_LIB_STRIP
7207
# ------------------------
7208
AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
7209
[striplib=
7210
old_striplib=
7211
AC_MSG_CHECKING([whether stripping libraries is possible])
7212
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
7213
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
7214
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
7215
  AC_MSG_RESULT([yes])
7216
else
7217
# FIXME - insert some real tests, host_os isn't really good enough
7218
  case $host_os in
7219
   darwin*)
7220
       if test -n "$STRIP" ; then
7221
         striplib="$STRIP -x"
7222
         AC_MSG_RESULT([yes])
7223
       else
7224
  AC_MSG_RESULT([no])
7225
fi
7226
       ;;
7227
   *)
7228
  AC_MSG_RESULT([no])
7229
    ;;
7230
  esac  
7231
fi
7232
])# AC_LIBTOOL_SYS_LIB_STRIP
7233
 
7234
 
7235
# AC_LIBTOOL_SYS_DYNAMIC_LINKER
7236
# -----------------------------
7237
# PORTME Fill in your ld.so characteristics
7238
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
7239
[AC_MSG_CHECKING([dynamic linker characteristics])
7240
library_names_spec=
7241
libname_spec='lib$name'
7242
soname_spec=
7243
shrext=".so"
7244
postinstall_cmds=
7245
postuninstall_cmds=
7246
finish_cmds=
7247
finish_eval=
7248
shlibpath_var=
7249
shlibpath_overrides_runpath=unknown
7250
version_type=none
7251
dynamic_linker="$host_os ld.so"
7252
sys_lib_dlsearch_path_spec="/lib /usr/lib"
7253
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
7254
need_lib_prefix=unknown
7255
hardcode_into_libs=no
7256
 
7257
# when you set need_version to no, make sure it does not cause -set_version
7258
# flags to be left without arguments
7259
need_version=unknown
7260
 
7261
case $host_os in
7262
aix3*)
7263
  version_type=linux
7264
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
7265
  shlibpath_var=LIBPATH
7266
 
7267
  # AIX 3 has no versioning support, so we append a major version to the name.
7268
  soname_spec='${libname}${release}${shared_ext}$major'
7269
  ;;
7270
 
7271
aix4* | aix5*)
7272
  version_type=linux
7273
  need_lib_prefix=no
7274
  need_version=no
7275
  hardcode_into_libs=yes
7276
  if test "$host_cpu" = ia64; then
7277
    # AIX 5 supports IA64
7278
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
7279
    shlibpath_var=LD_LIBRARY_PATH
7280
  else
7281
    # With GCC up to 2.95.x, collect2 would create an import file
7282
    # for dependence libraries.  The import file would start with
7283
    # the line `#! .'.  This would cause the generated library to
7284
    # depend on `.', always an invalid library.  This was fixed in
7285
    # development snapshots of GCC prior to 3.0.
7286
    case $host_os in
7287
      aix4 | aix4.[[01]] | aix4.[[01]].*)
7288
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
7289
	   echo ' yes '
7290
	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
7291
	:
7292
      else
7293
	can_build_shared=no
7294
      fi
7295
      ;;
7296
    esac
7297
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
7298
    # soname into executable. Probably we can add versioning support to
7299
    # collect2, so additional links can be useful in future.
7300
    if test "$aix_use_runtimelinking" = yes; then
7301
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
7302
      # instead of lib<name>.a to let people know that these are not
7303
      # typical AIX shared libraries.
7304
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7305
    else
7306
      # We preserve .a as extension for shared libraries through AIX4.2
7307
      # and later when we are not doing run time linking.
7308
      library_names_spec='${libname}${release}.a $libname.a'
7309
      soname_spec='${libname}${release}${shared_ext}$major'
7310
    fi
7311
    shlibpath_var=LIBPATH
7312
  fi
7313
  ;;
7314
 
7315
amigaos*)
7316
  library_names_spec='$libname.ixlibrary $libname.a'
7317
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
7318
  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'
7319
  ;;
7320
 
7321
beos*)
7322
  library_names_spec='${libname}${shared_ext}'
7323
  dynamic_linker="$host_os ld.so"
7324
  shlibpath_var=LIBRARY_PATH
7325
  ;;
7326
 
7327
bsdi4*)
7328
  version_type=linux
7329
  need_version=no
7330
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7331
  soname_spec='${libname}${release}${shared_ext}$major'
7332
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
7333
  shlibpath_var=LD_LIBRARY_PATH
7334
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
7335
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
7336
  # the default ld.so.conf also contains /usr/contrib/lib and
7337
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
7338
  # libtool to hard-code these into programs
7339
  ;;
7340
 
7341
cygwin* | mingw* | pw32*)
7342
  version_type=windows
7343
  shrext=".dll"
7344
  need_version=no
7345
  need_lib_prefix=no
7346
 
7347
  case $GCC,$host_os in
7348
  yes,cygwin* | yes,mingw* | yes,pw32*)
7349
    library_names_spec='$libname.dll.a'
7350
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
7351
    postinstall_cmds='base_file=`basename \${file}`~
7352
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
7353
      dldir=$destdir/`dirname \$dlpath`~
7354
      test -d \$dldir || mkdir -p \$dldir~
7355
      $install_prog $dir/$dlname \$dldir/$dlname'
7356
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
7357
      dlpath=$dir/\$dldll~
7358
       $rm \$dlpath'
7359
    shlibpath_overrides_runpath=yes
7360
 
7361
    case $host_os in
7362
    cygwin*)
7363
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
7364
      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7365
      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7366
      ;;
7367
    mingw*)
7368
      # MinGW DLLs use traditional 'lib' prefix
7369
      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7370
      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
7371
      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
7372
        # It is most probably a Windows format PATH printed by
7373
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
7374
        # path with ; separators, and with drive letters. We can handle the
7375
        # drive letters (cygwin fileutils understands them), so leave them,
7376
        # especially as we might pass files found there to a mingw objdump,
7377
        # which wouldn't understand a cygwinified path. Ahh.
7378
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
7379
      else
7380
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
7381
      fi
7382
      ;;
7383
    pw32*)
7384
      # pw32 DLLs use 'pw' prefix rather than 'lib'
7385
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
7386
      ;;
7387
    esac
7388
    ;;
7389
 
7390
  *)
7391
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
7392
    ;;
7393
  esac
7394
  dynamic_linker='Win32 ld.exe'
7395
  # FIXME: first we should search . and the directory the executable is in
7396
  shlibpath_var=PATH
7397
  ;;
7398
 
7399
darwin* | rhapsody*)
7400
  dynamic_linker="$host_os dyld"
7401
  version_type=darwin
7402
  need_lib_prefix=no
7403
  need_version=no
7404
  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
7405
  soname_spec='${libname}${release}${major}$shared_ext'
7406
  shlibpath_overrides_runpath=yes
7407
  shlibpath_var=DYLD_LIBRARY_PATH
7408
  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
7409
  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
7410
  if test "$GCC" = yes; then
7411
    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"`
7412
  else
7413
    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
7414
  fi
7415
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
7416
  ;;
7417
 
7418
dgux*)
7419
  version_type=linux
7420
  need_lib_prefix=no
7421
  need_version=no
7422
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
7423
  soname_spec='${libname}${release}${shared_ext}$major'
7424
  shlibpath_var=LD_LIBRARY_PATH
7425
  ;;
7426
 
7427
freebsd1*)
7428
  dynamic_linker=no
7429
  ;;
7430
 
7431
kfreebsd*-gnu*)
7432
  version_type=linux
7433
  need_lib_prefix=no
7434
  need_version=no
7435
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
7436
  soname_spec='${libname}${release}${shared_ext}$major'
7437
  shlibpath_var=LD_LIBRARY_PATH
7438
  shlibpath_overrides_runpath=no
7439
  hardcode_into_libs=yes
7440
  dynamic_linker='GNU ld.so'
7441
  ;;
7442
 
7443
freebsd*)
7444
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
7445
  version_type=freebsd-$objformat
7446
  case $version_type in
7447
    freebsd-elf*)
7448
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
7449
      need_version=no
7450
      need_lib_prefix=no
7451
      ;;
7452
    freebsd-*)
7453
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
7454
      need_version=yes
7455
      ;;
7456
  esac
7457
  shlibpath_var=LD_LIBRARY_PATH
7458
  case $host_os in
7459
  freebsd2*)
7460
    shlibpath_overrides_runpath=yes
7461
    ;;
7462
  freebsd3.[01]* | freebsdelf3.[01]*)
7463
    shlibpath_overrides_runpath=yes
7464
    hardcode_into_libs=yes
7465
    ;;
7466
  *) # from 3.2 on
7467
    shlibpath_overrides_runpath=no
7468
    hardcode_into_libs=yes
7469
    ;;
7470
  esac
7471
  ;;
7472
 
7473
gnu*)
7474
  version_type=linux
7475
  need_lib_prefix=no
7476
  need_version=no
7477
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
7478
  soname_spec='${libname}${release}${shared_ext}$major'
7479
  shlibpath_var=LD_LIBRARY_PATH
7480
  hardcode_into_libs=yes
7481
  ;;
7482
 
7483
hpux9* | hpux10* | hpux11*)
7484
  # Give a soname corresponding to the major version so that dld.sl refuses to
7485
  # link against other versions.
7486
  version_type=sunos
7487
  need_lib_prefix=no
7488
  need_version=no
7489
  case "$host_cpu" in
7490
  ia64*)
7491
    shrext='.so'
7492
    hardcode_into_libs=yes
7493
    dynamic_linker="$host_os dld.so"
7494
    shlibpath_var=LD_LIBRARY_PATH
7495
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7496
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7497
    soname_spec='${libname}${release}${shared_ext}$major'
7498
    if test "X$HPUX_IA64_MODE" = X32; then
7499
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
7500
    else
7501
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
7502
    fi
7503
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7504
    ;;
7505
   hppa*64*)
7506
     shrext='.sl'
7507
     hardcode_into_libs=yes
7508
     dynamic_linker="$host_os dld.sl"
7509
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
7510
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7511
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7512
     soname_spec='${libname}${release}${shared_ext}$major'
7513
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
7514
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7515
     ;;
7516
   *)
7517
    shrext='.sl'
7518
    dynamic_linker="$host_os dld.sl"
7519
    shlibpath_var=SHLIB_PATH
7520
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
7521
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7522
    soname_spec='${libname}${release}${shared_ext}$major'
7523
    ;;
7524
  esac
7525
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
7526
  postinstall_cmds='chmod 555 $lib'
7527
  ;;
7528
 
7529
irix5* | irix6* | nonstopux*)
7530
  case $host_os in
7531
    nonstopux*) version_type=nonstopux ;;
7532
    *)
7533
	if test "$lt_cv_prog_gnu_ld" = yes; then
7534
		version_type=linux
7535
	else
7536
		version_type=irix
7537
	fi ;;
7538
  esac
7539
  need_lib_prefix=no
7540
  need_version=no
7541
  soname_spec='${libname}${release}${shared_ext}$major'
7542
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
7543
  case $host_os in
7544
  irix5* | nonstopux*)
7545
    libsuff= shlibsuff=
7546
    ;;
7547
  *)
7548
    case $LD in # libtool.m4 will add one of these switches to LD
7549
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
7550
      libsuff= shlibsuff= libmagic=32-bit;;
7551
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
7552
      libsuff=32 shlibsuff=N32 libmagic=N32;;
7553
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
7554
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
7555
    *) libsuff= shlibsuff= libmagic=never-match;;
7556
    esac
7557
    ;;
7558
  esac
7559
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
7560
  shlibpath_overrides_runpath=no
7561
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
7562
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
7563
  hardcode_into_libs=yes
7564
  ;;
7565
 
7566
# No shared lib support for Linux oldld, aout, or coff.
7567
linux*oldld* | linux*aout* | linux*coff*)
7568
  dynamic_linker=no
7569
  ;;
7570
 
7571
# This must be Linux ELF.
7572
linux*)
7573
  version_type=linux
7574
  need_lib_prefix=no
7575
  need_version=no
7576
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7577
  soname_spec='${libname}${release}${shared_ext}$major'
7578
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
7579
  libsuff=
7580
  if test "x$LINUX_64_MODE" = x64; then
7581
    # Some platforms are per default 64-bit, so there's no /lib64
7582
    if test -d /lib64 -a ! -h /lib64; then
7583
      libsuff=64
7584
    fi
7585
  fi
7586
  shlibpath_var=LD_LIBRARY_PATH
7587
  shlibpath_overrides_runpath=no
7588
  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
7589
  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
7590
  # This implies no fast_install, which is unacceptable.
7591
  # Some rework will be needed to allow for fast_install
7592
  # before this can be enabled.
7593
  hardcode_into_libs=yes
7594
 
7595
  # We used to test for /lib/ld.so.1 and disable shared libraries on
7596
  # powerpc, because MkLinux only supported shared libraries with the
7597
  # GNU dynamic linker.  Since this was broken with cross compilers,
7598
  # most powerpc-linux boxes support dynamic linking these days and
7599
  # people can always --disable-shared, the test was removed, and we
7600
  # assume the GNU/Linux dynamic linker is in use.
7601
  dynamic_linker='GNU/Linux ld.so'
7602
  ;;
7603
 
7604
netbsd*)
7605
  version_type=sunos
7606
  need_lib_prefix=no
7607
  need_version=no
7608
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7609
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7610
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7611
    dynamic_linker='NetBSD (a.out) ld.so'
7612
  else
7613
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
7614
    soname_spec='${libname}${release}${shared_ext}$major'
7615
    dynamic_linker='NetBSD ld.elf_so'
7616
  fi
7617
  shlibpath_var=LD_LIBRARY_PATH
7618
  shlibpath_overrides_runpath=yes
7619
  hardcode_into_libs=yes
7620
  ;;
7621
 
7622
newsos6)
7623
  version_type=linux
7624
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7625
  shlibpath_var=LD_LIBRARY_PATH
7626
  shlibpath_overrides_runpath=yes
7627
  ;;
7628
 
7629
nto-qnx*)
7630
  version_type=linux
7631
  need_lib_prefix=no
7632
  need_version=no
7633
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7634
  soname_spec='${libname}${release}${shared_ext}$major'
7635
  shlibpath_var=LD_LIBRARY_PATH
7636
  shlibpath_overrides_runpath=yes
7637
  ;;
7638
 
7639
openbsd*)
7640
  version_type=sunos
7641
  need_lib_prefix=no
7642
  need_version=no
7643
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7644
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7645
  shlibpath_var=LD_LIBRARY_PATH
7646
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7647
    case $host_os in
7648
      openbsd2.[[89]] | openbsd2.[[89]].*)
7649
	shlibpath_overrides_runpath=no
7650
	;;
7651
      *)
7652
	shlibpath_overrides_runpath=yes
7653
	;;
7654
      esac
7655
  else
7656
    shlibpath_overrides_runpath=yes
7657
  fi
7658
  ;;
7659
 
7660
os2*)
7661
  libname_spec='$name'
7662
  shrext=".dll"
7663
  need_lib_prefix=no
7664
  library_names_spec='$libname${shared_ext} $libname.a'
7665
  dynamic_linker='OS/2 ld.exe'
7666
  shlibpath_var=LIBPATH
7667
  ;;
7668
 
7669
osf3* | osf4* | osf5*)
7670
  version_type=osf
7671
  need_lib_prefix=no
7672
  need_version=no
7673
  soname_spec='${libname}${release}${shared_ext}$major'
7674
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7675
  shlibpath_var=LD_LIBRARY_PATH
7676
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
7677
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
7678
  ;;
7679
 
7680
sco3.2v5*)
7681
  version_type=osf
7682
  soname_spec='${libname}${release}${shared_ext}$major'
7683
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7684
  shlibpath_var=LD_LIBRARY_PATH
7685
  ;;
7686
 
7687
solaris*)
7688
  version_type=linux
7689
  need_lib_prefix=no
7690
  need_version=no
7691
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7692
  soname_spec='${libname}${release}${shared_ext}$major'
7693
  shlibpath_var=LD_LIBRARY_PATH
7694
  shlibpath_overrides_runpath=yes
7695
  hardcode_into_libs=yes
7696
  # ldd complains unless libraries are executable
7697
  postinstall_cmds='chmod +x $lib'
7698
  ;;
7699
 
7700
sunos4*)
7701
  version_type=sunos
7702
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7703
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
7704
  shlibpath_var=LD_LIBRARY_PATH
7705
  shlibpath_overrides_runpath=yes
7706
  if test "$with_gnu_ld" = yes; then
7707
    need_lib_prefix=no
7708
  fi
7709
  need_version=yes
7710
  ;;
7711
 
7712
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7713
  version_type=linux
7714
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7715
  soname_spec='${libname}${release}${shared_ext}$major'
7716
  shlibpath_var=LD_LIBRARY_PATH
7717
  case $host_vendor in
7718
    sni)
7719
      shlibpath_overrides_runpath=no
7720
      need_lib_prefix=no
7721
      export_dynamic_flag_spec='${wl}-Blargedynsym'
7722
      runpath_var=LD_RUN_PATH
7723
      ;;
7724
    siemens)
7725
      need_lib_prefix=no
7726
      ;;
7727
    motorola)
7728
      need_lib_prefix=no
7729
      need_version=no
7730
      shlibpath_overrides_runpath=no
7731
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
7732
      ;;
7733
  esac
7734
  ;;
7735
 
7736
sysv4*MP*)
7737
  if test -d /usr/nec ;then
7738
    version_type=linux
7739
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
7740
    soname_spec='$libname${shared_ext}.$major'
7741
    shlibpath_var=LD_LIBRARY_PATH
7742
  fi
7743
  ;;
7744
 
7745
uts4*)
7746
  version_type=linux
7747
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7748
  soname_spec='${libname}${release}${shared_ext}$major'
7749
  shlibpath_var=LD_LIBRARY_PATH
7750
  ;;
7751
 
7752
*)
7753
  dynamic_linker=no
7754
  ;;
7755
esac
7756
AC_MSG_RESULT([$dynamic_linker])
7757
test "$dynamic_linker" = no && can_build_shared=no
7758
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
7759
 
7760
 
7761
# _LT_AC_TAGCONFIG
7762
# ----------------
7763
AC_DEFUN([_LT_AC_TAGCONFIG],
7764
[AC_ARG_WITH([tags],
7765
    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
7766
        [include additional configurations @<:@automatic@:>@])],
7767
    [tagnames="$withval"])
7768
 
7769
if test -f "$ltmain" && test -n "$tagnames"; then
7770
  if test ! -f "${ofile}"; then
7771
    AC_MSG_WARN([output file `$ofile' does not exist])
7772
  fi
7773
 
7774
  if test -z "$LTCC"; then
7775
    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
7776
    if test -z "$LTCC"; then
7777
      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
7778
    else
7779
      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
7780
    fi
7781
  fi
7782
 
7783
  # Extract list of available tagged configurations in $ofile.
7784
  # Note that this assumes the entire list is on one line.
7785
  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
7786
 
7787
  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7788
  for tagname in $tagnames; do
7789
    IFS="$lt_save_ifs"
7790
    # Check whether tagname contains only valid characters
7791
    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
7792
    "") ;;
7793
    *)  AC_MSG_ERROR([invalid tag name: $tagname])
7794
	;;
7795
    esac
7796
 
7797
    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
7798
    then
7799
      AC_MSG_ERROR([tag name \"$tagname\" already exists])
7800
    fi
7801
 
7802
    # Update the list of available tags.
7803
    if test -n "$tagname"; then
7804
      echo appending configuration tag \"$tagname\" to $ofile
7805
 
7806
      case $tagname in
7807
      CXX)
7808
	if test -n "$CXX" && test "X$CXX" != "Xno"; then
7809
	  AC_LIBTOOL_LANG_CXX_CONFIG
7810
	else
7811
	  tagname=""
7812
	fi
7813
	;;
7814
 
7815
      F77)
7816
	if test -n "$F77" && test "X$F77" != "Xno"; then
7817
	  AC_LIBTOOL_LANG_F77_CONFIG
7818
	else
7819
	  tagname=""
7820
	fi
7821
	;;
7822
 
7823
      GCJ)
7824
	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
7825
	  AC_LIBTOOL_LANG_GCJ_CONFIG
7826
	else
7827
	  tagname=""
7828
	fi
7829
	;;
7830
 
7831
      RC)
7832
	AC_LIBTOOL_LANG_RC_CONFIG
7833
	;;
7834
 
7835
      *)
7836
	AC_MSG_ERROR([Unsupported tag name: $tagname])
7837
	;;
7838
      esac
7839
 
7840
      # Append the new tag name to the list of available tags.
7841
      if test -n "$tagname" ; then
7842
      available_tags="$available_tags $tagname"
7843
    fi
7844
    fi
7845
  done
7846
  IFS="$lt_save_ifs"
7847
 
7848
  # Now substitute the updated list of available tags.
7849
  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
7850
    mv "${ofile}T" "$ofile"
7851
    chmod +x "$ofile"
7852
  else
7853
    rm -f "${ofile}T"
7854
    AC_MSG_ERROR([unable to update list of available tagged configurations.])
7855
  fi
7856
fi
7857
])# _LT_AC_TAGCONFIG
7858
 
7859
 
7860
# AC_LIBTOOL_DLOPEN
7861
# -----------------
7862
# enable checks for dlopen support
7863
AC_DEFUN([AC_LIBTOOL_DLOPEN],
7864
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
7865
])# AC_LIBTOOL_DLOPEN
7866
 
7867
 
7868
# AC_LIBTOOL_WIN32_DLL
7869
# --------------------
7870
# declare package support for building win32 dll's
7871
AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
7872
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
7873
])# AC_LIBTOOL_WIN32_DLL
7874
 
7875
 
7876
# AC_ENABLE_SHARED([DEFAULT])
7877
# ---------------------------
7878
# implement the --enable-shared flag
7879
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7880
AC_DEFUN([AC_ENABLE_SHARED],
7881
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
7882
AC_ARG_ENABLE([shared],
7883
    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7884
	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
7885
    [p=${PACKAGE-default}
7886
    case $enableval in
7887
    yes) enable_shared=yes ;;
7888
    no) enable_shared=no ;;
7889
    *)
7890
      enable_shared=no
7891
      # Look at the argument we got.  We use all the common list separators.
7892
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7893
      for pkg in $enableval; do
7894
	IFS="$lt_save_ifs"
7895
	if test "X$pkg" = "X$p"; then
7896
	  enable_shared=yes
7897
	fi
7898
      done
7899
      IFS="$lt_save_ifs"
7900
      ;;
7901
    esac],
7902
    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
7903
])# AC_ENABLE_SHARED
7904
 
7905
 
7906
# AC_DISABLE_SHARED
7907
# -----------------
7908
#- set the default shared flag to --disable-shared
7909
AC_DEFUN([AC_DISABLE_SHARED],
7910
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7911
AC_ENABLE_SHARED(no)
7912
])# AC_DISABLE_SHARED
7913
 
7914
 
7915
# AC_ENABLE_STATIC([DEFAULT])
7916
# ---------------------------
7917
# implement the --enable-static flag
7918
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7919
AC_DEFUN([AC_ENABLE_STATIC],
7920
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
7921
AC_ARG_ENABLE([static],
7922
    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7923
	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
7924
    [p=${PACKAGE-default}
7925
    case $enableval in
7926
    yes) enable_static=yes ;;
7927
    no) enable_static=no ;;
7928
    *)
7929
     enable_static=no
7930
      # Look at the argument we got.  We use all the common list separators.
7931
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7932
      for pkg in $enableval; do
7933
	IFS="$lt_save_ifs"
7934
	if test "X$pkg" = "X$p"; then
7935
	  enable_static=yes
7936
	fi
7937
      done
7938
      IFS="$lt_save_ifs"
7939
      ;;
7940
    esac],
7941
    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
7942
])# AC_ENABLE_STATIC
7943
 
7944
 
7945
# AC_DISABLE_STATIC
7946
# -----------------
7947
# set the default static flag to --disable-static
7948
AC_DEFUN([AC_DISABLE_STATIC],
7949
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7950
AC_ENABLE_STATIC(no)
7951
])# AC_DISABLE_STATIC
7952
 
7953
 
7954
# AC_ENABLE_FAST_INSTALL([DEFAULT])
7955
# ---------------------------------
7956
# implement the --enable-fast-install flag
7957
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7958
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
7959
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
7960
AC_ARG_ENABLE([fast-install],
7961
    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7962
    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7963
    [p=${PACKAGE-default}
7964
    case $enableval in
7965
    yes) enable_fast_install=yes ;;
7966
    no) enable_fast_install=no ;;
7967
    *)
7968
      enable_fast_install=no
7969
      # Look at the argument we got.  We use all the common list separators.
7970
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7971
      for pkg in $enableval; do
7972
	IFS="$lt_save_ifs"
7973
	if test "X$pkg" = "X$p"; then
7974
	  enable_fast_install=yes
7975
	fi
7976
      done
7977
      IFS="$lt_save_ifs"
7978
      ;;
7979
    esac],
7980
    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
7981
])# AC_ENABLE_FAST_INSTALL
7982
 
7983
 
7984
# AC_DISABLE_FAST_INSTALL
7985
# -----------------------
7986
# set the default to --disable-fast-install
7987
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
7988
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7989
AC_ENABLE_FAST_INSTALL(no)
7990
])# AC_DISABLE_FAST_INSTALL
7991
 
7992
 
7993
# AC_LIBTOOL_PICMODE([MODE])
7994
# --------------------------
7995
# implement the --with-pic flag
7996
# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7997
AC_DEFUN([AC_LIBTOOL_PICMODE],
7998
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7999
pic_mode=ifelse($#,1,$1,default)
8000
])# AC_LIBTOOL_PICMODE
8001
 
8002
 
8003
# AC_PROG_EGREP
8004
# -------------
8005
# This is predefined starting with Autoconf 2.54, so this conditional
8006
# definition can be removed once we require Autoconf 2.54 or later.
8007
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
8008
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
8009
   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
8010
    then ac_cv_prog_egrep='grep -E'
8011
    else ac_cv_prog_egrep='egrep'
8012
    fi])
8013
 EGREP=$ac_cv_prog_egrep
8014
 AC_SUBST([EGREP])
8015
])])
8016
 
8017
 
8018
# AC_PATH_TOOL_PREFIX
8019
# -------------------
8020
# find a file program which can recognise shared library
8021
AC_DEFUN([AC_PATH_TOOL_PREFIX],
8022
[AC_REQUIRE([AC_PROG_EGREP])dnl
8023
AC_MSG_CHECKING([for $1])
8024
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
8025
[case $MAGIC_CMD in
8026
[[\\/*] |  ?:[\\/]*])
8027
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8028
  ;;
8029
*)
8030
  lt_save_MAGIC_CMD="$MAGIC_CMD"
8031
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8032
dnl $ac_dummy forces splitting on constant user-supplied paths.
8033
dnl POSIX.2 word splitting is done only on the output of word expansions,
8034
dnl not every word.  This closes a longstanding sh security hole.
8035
  ac_dummy="ifelse([$2], , $PATH, [$2])"
8036
  for ac_dir in $ac_dummy; do
8037
    IFS="$lt_save_ifs"
8038
    test -z "$ac_dir" && ac_dir=.
8039
    if test -f $ac_dir/$1; then
8040
      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
8041
      if test -n "$file_magic_test_file"; then
8042
	case $deplibs_check_method in
8043
	"file_magic "*)
8044
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
8045
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8046
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8047
	    $EGREP "$file_magic_regex" > /dev/null; then
8048
	    :
8049
	  else
8050
	    cat <<EOF 1>&2
8051
 
8052
*** Warning: the command libtool uses to detect shared libraries,
8053
*** $file_magic_cmd, produces output that libtool cannot recognize.
8054
*** The result is that libtool may fail to recognize shared libraries
8055
*** as such.  This will affect the creation of libtool libraries that
8056
*** depend on shared libraries, but programs linked with such libtool
8057
*** libraries will work regardless of this problem.  Nevertheless, you
8058
*** may want to report the problem to your system manager and/or to
8059
*** bug-libtool@gnu.org
8060
 
8061
EOF
8062
	  fi ;;
8063
	esac
8064
      fi
8065
      break
8066
    fi
8067
  done
8068
  IFS="$lt_save_ifs"
8069
  MAGIC_CMD="$lt_save_MAGIC_CMD"
8070
  ;;
8071
esac])
8072
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8073
if test -n "$MAGIC_CMD"; then
8074
  AC_MSG_RESULT($MAGIC_CMD)
8075
else
8076
  AC_MSG_RESULT(no)
8077
fi
8078
])# AC_PATH_TOOL_PREFIX
8079
 
8080
 
8081
# AC_PATH_MAGIC
8082
# -------------
8083
# find a file program which can recognise a shared library
8084
AC_DEFUN([AC_PATH_MAGIC],
8085
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
8086
if test -z "$lt_cv_path_MAGIC_CMD"; then
8087
  if test -n "$ac_tool_prefix"; then
8088
    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
8089
  else
8090
    MAGIC_CMD=:
8091
  fi
8092
fi
8093
])# AC_PATH_MAGIC
8094
 
8095
 
8096
# AC_PROG_LD
8097
# ----------
8098
# find the pathname to the GNU or non-GNU linker
8099
AC_DEFUN([AC_PROG_LD],
8100
[AC_ARG_WITH([gnu-ld],
8101
    [AC_HELP_STRING([--with-gnu-ld],
8102
	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
8103
    [test "$withval" = no || with_gnu_ld=yes],
8104
    [with_gnu_ld=no])
8105
AC_REQUIRE([LT_AC_PROG_SED])dnl
8106
AC_REQUIRE([AC_PROG_CC])dnl
8107
AC_REQUIRE([AC_CANONICAL_HOST])dnl
8108
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8109
ac_prog=ld
8110
if test "$GCC" = yes; then
8111
  # Check if gcc -print-prog-name=ld gives a path.
8112
  AC_MSG_CHECKING([for ld used by $CC])
8113
  case $host in
8114
  *-*-mingw*)
8115
    # gcc leaves a trailing carriage return which upsets mingw
8116
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
8117
  *)
8118
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
8119
  esac
8120
  case $ac_prog in
8121
    # Accept absolute paths.
8122
    [[\\/]]* | ?:[[\\/]]*)
8123
      re_direlt='/[[^/]][[^/]]*/\.\./'
8124
      # Canonicalize the pathname of ld
8125
      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
8126
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
8127
	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
8128
      done
8129
      test -z "$LD" && LD="$ac_prog"
8130
      ;;
8131
  "")
8132
    # If it fails, then pretend we aren't using GCC.
8133
    ac_prog=ld
8134
    ;;
8135
  *)
8136
    # If it is relative, then search for the first ld in PATH.
8137
    with_gnu_ld=unknown
8138
    ;;
8139
  esac
8140
elif test "$with_gnu_ld" = yes; then
8141
  AC_MSG_CHECKING([for GNU ld])
8142
else
8143
  AC_MSG_CHECKING([for non-GNU ld])
8144
fi
8145
AC_CACHE_VAL(lt_cv_path_LD,
8146
[if test -z "$LD"; then
8147
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8148
  for ac_dir in $PATH; do
8149
    IFS="$lt_save_ifs"
8150
    test -z "$ac_dir" && ac_dir=.
8151
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
8152
      lt_cv_path_LD="$ac_dir/$ac_prog"
8153
      # Check to see if the program is GNU ld.  I'd rather use --version,
8154
      # but apparently some GNU ld's only accept -v.
8155
      # Break only if it was the GNU/non-GNU ld that we prefer.
8156
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
8157
      *GNU* | *'with BFD'*)
8158
	test "$with_gnu_ld" != no && break
8159
	;;
8160
      *)
8161
	test "$with_gnu_ld" != yes && break
8162
	;;
8163
      esac
8164
    fi
8165
  done
8166
  IFS="$lt_save_ifs"
8167
else
8168
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
8169
fi])
8170
LD="$lt_cv_path_LD"
8171
if test -n "$LD"; then
8172
  AC_MSG_RESULT($LD)
8173
else
8174
  AC_MSG_RESULT(no)
8175
fi
8176
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
8177
AC_PROG_LD_GNU
8178
])# AC_PROG_LD
8179
 
8180
 
8181
# AC_PROG_LD_GNU
8182
# --------------
8183
AC_DEFUN([AC_PROG_LD_GNU],
8184
[AC_REQUIRE([AC_PROG_EGREP])dnl
8185
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
8186
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
8187
case `$LD -v 2>&1 </dev/null` in
8188
*GNU* | *'with BFD'*)
8189
  lt_cv_prog_gnu_ld=yes
8190
  ;;
8191
*)
8192
  lt_cv_prog_gnu_ld=no
8193
  ;;
8194
esac])
8195
with_gnu_ld=$lt_cv_prog_gnu_ld
8196
])# AC_PROG_LD_GNU
8197
 
8198
 
8199
# AC_PROG_LD_RELOAD_FLAG
8200
# ----------------------
8201
# find reload flag for linker
8202
#   -- PORTME Some linkers may need a different reload flag.
8203
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
8204
[AC_CACHE_CHECK([for $LD option to reload object files],
8205
  lt_cv_ld_reload_flag,
8206
  [lt_cv_ld_reload_flag='-r'])
8207
reload_flag=$lt_cv_ld_reload_flag
8208
case $reload_flag in
8209
"" | " "*) ;;
8210
*) reload_flag=" $reload_flag" ;;
8211
esac
8212
reload_cmds='$LD$reload_flag -o $output$reload_objs'
8213
])# AC_PROG_LD_RELOAD_FLAG
8214
 
8215
 
8216
# AC_DEPLIBS_CHECK_METHOD
8217
# -----------------------
8218
# how to check for library dependencies
8219
#  -- PORTME fill in with the dynamic library characteristics
8220
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
8221
[AC_CACHE_CHECK([how to recognise dependent libraries],
8222
lt_cv_deplibs_check_method,
8223
[lt_cv_file_magic_cmd='$MAGIC_CMD'
8224
lt_cv_file_magic_test_file=
8225
lt_cv_deplibs_check_method='unknown'
8226
# Need to set the preceding variable on all platforms that support
8227
# interlibrary dependencies.
8228
# 'none' -- dependencies not supported.
8229
# `unknown' -- same as none, but documents that we really don't know.
8230
# 'pass_all' -- all dependencies passed with no checks.
8231
# 'test_compile' -- check by making test program.
8232
# 'file_magic [[regex]]' -- check by looking for files in library path
8233
# which responds to the $file_magic_cmd with a given extended regex.
8234
# If you have `file' or equivalent on your system and you're not sure
8235
# whether `pass_all' will *always* work, you probably want this one.
8236
 
8237
case $host_os in
8238
aix4* | aix5*)
8239
  lt_cv_deplibs_check_method=pass_all
8240
  ;;
8241
 
8242
beos*)
8243
  lt_cv_deplibs_check_method=pass_all
8244
  ;;
8245
 
8246
bsdi4*)
8247
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
8248
  lt_cv_file_magic_cmd='/usr/bin/file -L'
8249
  lt_cv_file_magic_test_file=/shlib/libc.so
8250
  ;;
8251
 
8252
cygwin*)
8253
  lt_cv_deplibs_check_method=pass_all
8254
  ;;
8255
 
8256
mingw* | pw32*)
8257
  # win32_libid is a shell function defined in ltmain.sh
8258
  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
8259
  lt_cv_file_magic_cmd='win32_libid'
8260
  ;;
8261
 
8262
darwin* | rhapsody*)
8263
  # this will be overwritten by pass_all, but leave it in just in case
8264
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
8265
  lt_cv_file_magic_cmd='/usr/bin/file -L'
8266
  case "$host_os" in
8267
  rhapsody* | darwin1.[[012]])
8268
    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
8269
    ;;
8270
  *) # Darwin 1.3 on
8271
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
8272
    ;;
8273
  esac
8274
  lt_cv_deplibs_check_method=pass_all
8275
  ;;
8276
 
8277
freebsd* | kfreebsd*-gnu)
8278
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8279
    case $host_cpu in
8280
    i*86 )
8281
      # Not sure whether the presence of OpenBSD here was a mistake.
8282
      # Let's accept both of them until this is cleared up.
8283
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
8284
      lt_cv_file_magic_cmd=/usr/bin/file
8285
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
8286
      ;;
8287
    esac
8288
  else
8289
    lt_cv_deplibs_check_method=pass_all
8290
  fi
8291
  ;;
8292
 
8293
gnu*)
8294
  lt_cv_deplibs_check_method=pass_all
8295
  ;;
8296
 
8297
hpux10.20* | hpux11*)
8298
  lt_cv_file_magic_cmd=/usr/bin/file
8299
  case "$host_cpu" in
8300
  ia64*)
8301
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
8302
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
8303
    ;;
8304
  hppa*64*)
8305
    [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]']
8306
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
8307
    ;;
8308
  *)
8309
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
8310
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
8311
    ;;
8312
  esac
8313
  ;;
8314
 
8315
irix5* | irix6* | nonstopux*)
8316
  case $host_os in
8317
  irix5* | nonstopux*)
8318
    # this will be overridden with pass_all, but let us keep it just in case
8319
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
8320
    ;;
8321
  *)
8322
    case $LD in
8323
    *-32|*"-32 ") libmagic=32-bit;;
8324
    *-n32|*"-n32 ") libmagic=N32;;
8325
    *-64|*"-64 ") libmagic=64-bit;;
8326
    *) libmagic=never-match;;
8327
    esac
8328
    # this will be overridden with pass_all, but let us keep it just in case
8329
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
8330
    ;;
8331
  esac
8332
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
8333
  lt_cv_deplibs_check_method=pass_all
8334
  ;;
8335
 
8336
# This must be Linux ELF.
8337
linux*)
8338
  case $host_cpu in
8339
  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
8340
    lt_cv_deplibs_check_method=pass_all ;;
8341
  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
8342
  arm* )
8343
    lt_cv_deplibs_check_method=pass_all ;;
8344
  *)
8345
    # glibc up to 2.1.1 does not perform some relocations on ARM
8346
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
8347
  esac
8348
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
8349
  ;;
8350
 
8351
netbsd*)
8352
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8353
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
8354
  else
8355
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
8356
  fi
8357
  ;;
8358
 
8359
newos6*)
8360
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
8361
  lt_cv_file_magic_cmd=/usr/bin/file
8362
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
8363
  ;;
8364
 
8365
nto-qnx*)
8366
  lt_cv_deplibs_check_method=unknown
8367
  ;;
8368
 
8369
openbsd*)
8370
  lt_cv_file_magic_cmd=/usr/bin/file
8371
  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
8372
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8373
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
8374
  else
8375
    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
8376
  fi
8377
  ;;
8378
 
8379
osf3* | osf4* | osf5*)
8380
  # this will be overridden with pass_all, but let us keep it just in case
8381
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
8382
  lt_cv_file_magic_test_file=/shlib/libc.so
8383
  lt_cv_deplibs_check_method=pass_all
8384
  ;;
8385
 
8386
sco3.2v5*)
8387
  lt_cv_deplibs_check_method=pass_all
8388
  ;;
8389
 
8390
solaris*)
8391
  lt_cv_deplibs_check_method=pass_all
8392
  lt_cv_file_magic_test_file=/lib/libc.so
8393
  ;;
8394
 
8395
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
8396
  case $host_vendor in
8397
  motorola)
8398
    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]]'
8399
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
8400
    ;;
8401
  ncr)
8402
    lt_cv_deplibs_check_method=pass_all
8403
    ;;
8404
  sequent)
8405
    lt_cv_file_magic_cmd='/bin/file'
8406
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
8407
    ;;
8408
  sni)
8409
    lt_cv_file_magic_cmd='/bin/file'
8410
    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
8411
    lt_cv_file_magic_test_file=/lib/libc.so
8412
    ;;
8413
  siemens)
8414
    lt_cv_deplibs_check_method=pass_all
8415
    ;;
8416
  esac
8417
  ;;
8418
 
8419
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
8420
  lt_cv_deplibs_check_method=pass_all
8421
  ;;
8422
esac
8423
])
8424
file_magic_cmd=$lt_cv_file_magic_cmd
8425
deplibs_check_method=$lt_cv_deplibs_check_method
8426
test -z "$deplibs_check_method" && deplibs_check_method=unknown
8427
])# AC_DEPLIBS_CHECK_METHOD
8428
 
8429
 
8430
# AC_PROG_NM
8431
# ----------
8432
# find the pathname to a BSD-compatible name lister
8433
AC_DEFUN([AC_PROG_NM],
8434
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
8435
[if test -n "$NM"; then
8436
  # Let the user override the test.
8437
  lt_cv_path_NM="$NM"
8438
else
8439
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8440
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
8441
    IFS="$lt_save_ifs"
8442
    test -z "$ac_dir" && ac_dir=.
8443
    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
8444
    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
8445
      # Check to see if the nm accepts a BSD-compat flag.
8446
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
8447
      #   nm: unknown option "B" ignored
8448
      # Tru64's nm complains that /dev/null is an invalid object file
8449
      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
8450
      */dev/null* | *'Invalid file or object type'*)
8451
	lt_cv_path_NM="$tmp_nm -B"
8452
	break
8453
        ;;
8454
      *)
8455
	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
8456
	*/dev/null*)
8457
	  lt_cv_path_NM="$tmp_nm -p"
8458
	  break
8459
	  ;;
8460
	*)
8461
	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
8462
	  continue # so that we can try to find one that supports BSD flags
8463
	  ;;
8464
	esac
8465
      esac
8466
    fi
8467
  done
8468
  IFS="$lt_save_ifs"
8469
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
8470
fi])
8471
NM="$lt_cv_path_NM"
8472
])# AC_PROG_NM
8473
 
8474
 
8475
# AC_CHECK_LIBM
8476
# -------------
8477
# check for math library
8478
AC_DEFUN([AC_CHECK_LIBM],
8479
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8480
LIBM=
8481
case $host in
8482
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
8483
  # These system don't have libm, or don't need it
8484
  ;;
8485
*-ncr-sysv4.3*)
8486
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
8487
  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
8488
  ;;
8489
*)
8490
  AC_CHECK_LIB(m, cos, LIBM="-lm")
8491
  ;;
8492
esac
8493
])# AC_CHECK_LIBM
8494
 
8495
 
8496
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
8497
# -----------------------------------
8498
# sets LIBLTDL to the link flags for the libltdl convenience library and
8499
# LTDLINCL to the include flags for the libltdl header and adds
8500
# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
8501
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8502
# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
8503
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
8504
# '${top_srcdir}/' (note the single quotes!).  If your package is not
8505
# flat and you're not using automake, define top_builddir and
8506
# top_srcdir appropriately in the Makefiles.
8507
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
8508
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8509
  case $enable_ltdl_convenience in
8510
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
8511
  "") enable_ltdl_convenience=yes
8512
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
8513
  esac
8514
  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
8515
  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8516
  # For backwards non-gettext consistent compatibility...
8517
  INCLTDL="$LTDLINCL"
8518
])# AC_LIBLTDL_CONVENIENCE
8519
 
8520
 
8521
# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
8522
# -----------------------------------
8523
# sets LIBLTDL to the link flags for the libltdl installable library and
8524
# LTDLINCL to the include flags for the libltdl header and adds
8525
# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
8526
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8527
# DIRECTORY is not provided and an installed libltdl is not found, it is
8528
# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
8529
# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
8530
# quotes!).  If your package is not flat and you're not using automake,
8531
# define top_builddir and top_srcdir appropriately in the Makefiles.
8532
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
8533
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
8534
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8535
  AC_CHECK_LIB(ltdl, lt_dlinit,
8536
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
8537
  [if test x"$enable_ltdl_install" = xno; then
8538
     AC_MSG_WARN([libltdl not installed, but installation disabled])
8539
   else
8540
     enable_ltdl_install=yes
8541
   fi
8542
  ])
8543
  if test x"$enable_ltdl_install" = x"yes"; then
8544
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
8545
    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
8546
    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8547
  else
8548
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
8549
    LIBLTDL="-lltdl"
8550
    LTDLINCL=
8551
  fi
8552
  # For backwards non-gettext consistent compatibility...
8553
  INCLTDL="$LTDLINCL"
8554
])# AC_LIBLTDL_INSTALLABLE
8555
 
8556
 
8557
# AC_LIBTOOL_CXX
8558
# --------------
8559
# enable support for C++ libraries
8560
AC_DEFUN([AC_LIBTOOL_CXX],
8561
[AC_REQUIRE([_LT_AC_LANG_CXX])
8562
])# AC_LIBTOOL_CXX
8563
 
8564
 
8565
# _LT_AC_LANG_CXX
8566
# ---------------
8567
AC_DEFUN([_LT_AC_LANG_CXX],
8568
[AC_REQUIRE([AC_PROG_CXX])
8569
AC_REQUIRE([AC_PROG_CXXCPP])
8570
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
8571
])# _LT_AC_LANG_CXX
8572
 
8573
 
8574
# AC_LIBTOOL_F77
8575
# --------------
8576
# enable support for Fortran 77 libraries
8577
AC_DEFUN([AC_LIBTOOL_F77],
8578
[AC_REQUIRE([_LT_AC_LANG_F77])
8579
])# AC_LIBTOOL_F77
8580
 
8581
 
8582
# _LT_AC_LANG_F77
8583
# ---------------
8584
AC_DEFUN([_LT_AC_LANG_F77],
8585
[AC_REQUIRE([AC_PROG_F77])
8586
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
8587
])# _LT_AC_LANG_F77
8588
 
8589
 
8590
# AC_LIBTOOL_GCJ
8591
# --------------
8592
# enable support for GCJ libraries
8593
AC_DEFUN([AC_LIBTOOL_GCJ],
8594
[AC_REQUIRE([_LT_AC_LANG_GCJ])
8595
])# AC_LIBTOOL_GCJ
8596
 
8597
 
8598
# _LT_AC_LANG_GCJ
8599
# ---------------
8600
AC_DEFUN([_LT_AC_LANG_GCJ],
8601
[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
8602
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
8603
    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
8604
      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
8605
	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
8606
	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
8607
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
8608
])# _LT_AC_LANG_GCJ
8609
 
8610
 
8611
# AC_LIBTOOL_RC
8612
# --------------
8613
# enable support for Windows resource files
8614
AC_DEFUN([AC_LIBTOOL_RC],
8615
[AC_REQUIRE([LT_AC_PROG_RC])
8616
_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
8617
])# AC_LIBTOOL_RC
8618
 
8619
 
8620
# AC_LIBTOOL_LANG_C_CONFIG
8621
# ------------------------
8622
# Ensure that the configuration vars for the C compiler are
8623
# suitably defined.  Those variables are subsequently used by
8624
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8625
AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
8626
AC_DEFUN([_LT_AC_LANG_C_CONFIG],
8627
[lt_save_CC="$CC"
8628
AC_LANG_PUSH(C)
8629
 
8630
# Source file extension for C test sources.
8631
ac_ext=c
8632
 
8633
# Object file extension for compiled C test sources.
8634
objext=o
8635
_LT_AC_TAGVAR(objext, $1)=$objext
8636
 
8637
# Code to be used in simple compile tests
8638
lt_simple_compile_test_code="int some_variable = 0;\n"
8639
 
8640
# Code to be used in simple link tests
8641
lt_simple_link_test_code='int main(){return(0);}\n'
8642
 
8643
_LT_AC_SYS_COMPILER
8644
 
8645
#
8646
# Check for any special shared library compilation flags.
8647
#
8648
_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
8649
if test "$GCC" = no; then
8650
  case $host_os in
8651
  sco3.2v5*)
8652
    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
8653
    ;;
8654
  esac
8655
fi
8656
if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
8657
  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
8658
  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
8659
  else
8660
    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
8661
    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
8662
  fi
8663
fi
8664
 
8665
 
8666
#
8667
# Check to make sure the static flag actually works.
8668
#
8669
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
8670
  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
8671
  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
8672
  [],
8673
  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
8674
 
8675
 
8676
## CAVEAT EMPTOR:
8677
## There is no encapsulation within the following macros, do not change
8678
## the running order or otherwise move them around unless you know exactly
8679
## what you are doing...
8680
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
8681
AC_LIBTOOL_PROG_COMPILER_PIC($1)
8682
AC_LIBTOOL_PROG_CC_C_O($1)
8683
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8684
AC_LIBTOOL_PROG_LD_SHLIBS($1)
8685
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8686
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8687
AC_LIBTOOL_SYS_LIB_STRIP
8688
AC_LIBTOOL_DLOPEN_SELF($1)
8689
 
8690
# Report which librarie types wil actually be built
8691
AC_MSG_CHECKING([if libtool supports shared libraries])
8692
AC_MSG_RESULT([$can_build_shared])
8693
 
8694
AC_MSG_CHECKING([whether to build shared libraries])
8695
test "$can_build_shared" = "no" && enable_shared=no
8696
 
8697
# On AIX, shared libraries and static libraries use the same namespace, and
8698
# are all built from PIC.
8699
case "$host_os" in
8700
aix3*)
8701
  test "$enable_shared" = yes && enable_static=no
8702
  if test -n "$RANLIB"; then
8703
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
8704
    postinstall_cmds='$RANLIB $lib'
8705
  fi
8706
  ;;
8707
 
8708
aix4*)
8709
  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8710
    test "$enable_shared" = yes && enable_static=no
8711
  fi
8712
  ;;
8713
  darwin* | rhapsody*)
8714
  if test "$GCC" = yes; then
8715
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8716
    case "$host_os" in
8717
    rhapsody* | darwin1.[[012]])
8718
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
8719
      ;;
8720
    *) # Darwin 1.3 on
8721
      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
8722
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8723
      else
8724
	case ${MACOSX_DEPLOYMENT_TARGET} in
8725
	  10.[012])
8726
	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8727
	    ;;
8728
	  10.*)
8729
	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
8730
	    ;;
8731
	esac
8732
      fi
8733
      ;;
8734
    esac
8735
    output_verbose_link_cmd='echo'
8736
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
8737
    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
8738
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8739
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8740
    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8741
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
8742
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8743
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8744
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8745
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8746
  else
8747
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8748
  fi  
8749
    ;;  
8750
esac
8751
AC_MSG_RESULT([$enable_shared])
8752
 
8753
AC_MSG_CHECKING([whether to build static libraries])
8754
# Make sure either enable_shared or enable_static is yes.
8755
test "$enable_shared" = yes || enable_static=yes
8756
AC_MSG_RESULT([$enable_static])
8757
 
8758
AC_LIBTOOL_CONFIG($1)
8759
 
8760
AC_LANG_POP
8761
CC="$lt_save_CC"
8762
])# AC_LIBTOOL_LANG_C_CONFIG
8763
 
8764
 
8765
# AC_LIBTOOL_LANG_CXX_CONFIG
8766
# --------------------------
8767
# Ensure that the configuration vars for the C compiler are
8768
# suitably defined.  Those variables are subsequently used by
8769
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8770
AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
8771
AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
8772
[AC_LANG_PUSH(C++)
8773
AC_REQUIRE([AC_PROG_CXX])
8774
AC_REQUIRE([AC_PROG_CXXCPP])
8775
 
8776
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8777
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
8778
_LT_AC_TAGVAR(always_export_symbols, $1)=no
8779
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
8780
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
8781
_LT_AC_TAGVAR(hardcode_direct, $1)=no
8782
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8783
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8784
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8785
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
8786
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
8787
_LT_AC_TAGVAR(module_cmds, $1)=
8788
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
8789
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
8790
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8791
_LT_AC_TAGVAR(no_undefined_flag, $1)=
8792
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8793
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8794
 
8795
# Dependencies to place before and after the object being linked:
8796
_LT_AC_TAGVAR(predep_objects, $1)=
8797
_LT_AC_TAGVAR(postdep_objects, $1)=
8798
_LT_AC_TAGVAR(predeps, $1)=
8799
_LT_AC_TAGVAR(postdeps, $1)=
8800
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
8801
 
8802
# Source file extension for C++ test sources.
8803
ac_ext=cc
8804
 
8805
# Object file extension for compiled C++ test sources.
8806
objext=o
8807
_LT_AC_TAGVAR(objext, $1)=$objext
8808
 
8809
# Code to be used in simple compile tests
8810
lt_simple_compile_test_code="int some_variable = 0;\n"
8811
 
8812
# Code to be used in simple link tests
8813
lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
8814
 
8815
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8816
_LT_AC_SYS_COMPILER
8817
 
8818
# Allow CC to be a program name with arguments.
8819
lt_save_CC=$CC
8820
lt_save_LD=$LD
8821
lt_save_GCC=$GCC
8822
GCC=$GXX
8823
lt_save_with_gnu_ld=$with_gnu_ld
8824
lt_save_path_LD=$lt_cv_path_LD
8825
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
8826
  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
8827
else
8828
  unset lt_cv_prog_gnu_ld
8829
fi
8830
if test -n "${lt_cv_path_LDCXX+set}"; then
8831
  lt_cv_path_LD=$lt_cv_path_LDCXX
8832
else
8833
  unset lt_cv_path_LD
8834
fi
8835
test -z "${LDCXX+set}" || LD=$LDCXX
8836
CC=${CXX-"c++"}
8837
compiler=$CC
8838
_LT_AC_TAGVAR(compiler, $1)=$CC
8839
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
8840
 
8841
# We don't want -fno-exception wen compiling C++ code, so set the
8842
# no_builtin_flag separately
8843
if test "$GXX" = yes; then
8844
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
8845
else
8846
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
8847
fi
8848
 
8849
if test "$GXX" = yes; then
8850
  # Set up default GNU C++ configuration
8851
 
8852
  AC_PROG_LD
8853
 
8854
  # Check if GNU C++ uses GNU ld as the underlying linker, since the
8855
  # archiving commands below assume that GNU ld is being used.
8856
  if test "$with_gnu_ld" = yes; then
8857
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
8858
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8859
 
8860
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8861
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8862
 
8863
    # If archive_cmds runs LD, not CC, wlarc should be empty
8864
    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
8865
    #     investigate it a little bit more. (MM)
8866
    wlarc='${wl}'
8867
 
8868
    # ancient GNU ld didn't support --whole-archive et. al.
8869
    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
8870
	grep 'no-whole-archive' > /dev/null; then
8871
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8872
    else
8873
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8874
    fi
8875
  else
8876
    with_gnu_ld=no
8877
    wlarc=
8878
 
8879
    # A generic and very simple default shared library creation
8880
    # command for GNU C++ for the case where it uses the native
8881
    # linker, instead of GNU ld.  If possible, this setting should
8882
    # overridden to take advantage of the native linker features on
8883
    # the platform it is being used on.
8884
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
8885
  fi
8886
 
8887
  # Commands to make compiler produce verbose output that lists
8888
  # what "hidden" libraries, object files and flags are used when
8889
  # linking a shared library.
8890
  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
8891
 
8892
else
8893
  GXX=no
8894
  with_gnu_ld=no
8895
  wlarc=
8896
fi
8897
 
8898
# PORTME: fill in a description of your system's C++ link characteristics
8899
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8900
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
8901
case $host_os in
8902
  aix3*)
8903
    # FIXME: insert proper C++ library support
8904
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8905
    ;;
8906
  aix4* | aix5*)
8907
    if test "$host_cpu" = ia64; then
8908
      # On IA64, the linker does run time linking by default, so we don't
8909
      # have to do anything special.
8910
      aix_use_runtimelinking=no
8911
      exp_sym_flag='-Bexport'
8912
      no_entry_flag=""
8913
    else
8914
      # KDE requires run time linking.  Make it the default.
8915
      aix_use_runtimelinking=yes
8916
      exp_sym_flag='-bexport'
8917
      no_entry_flag='-bnoentry'
8918
    fi
8919
 
8920
    # When large executables or shared objects are built, AIX ld can
8921
    # have problems creating the table of contents.  If linking a library
8922
    # or program results in "error TOC overflow" add -mminimal-toc to
8923
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8924
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8925
 
8926
    _LT_AC_TAGVAR(archive_cmds, $1)=''
8927
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8928
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
8929
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8930
 
8931
    if test "$GXX" = yes; then
8932
      case $host_os in aix4.[012]|aix4.[012].*)
8933
      # We only want to do this on AIX 4.2 and lower, the check
8934
      # below for broken collect2 doesn't work under 4.3+
8935
	collect2name=`${CC} -print-prog-name=collect2`
8936
	if test -f "$collect2name" && \
8937
	   strings "$collect2name" | grep resolve_lib_name >/dev/null
8938
	then
8939
	  # We have reworked collect2
8940
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8941
	else
8942
	  # We have old collect2
8943
	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
8944
	  # It fails to find uninstalled libraries when the uninstalled
8945
	  # path is not listed in the libpath.  Setting hardcode_minus_L
8946
	  # to unsupported forces relinking
8947
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8948
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8949
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8950
	fi
8951
      esac
8952
      shared_flag='-shared'
8953
    else
8954
      # not using gcc
8955
      if test "$host_cpu" = ia64; then
8956
	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8957
	# chokes on -Wl,-G. The following line is correct:
8958
	shared_flag='-G'
8959
      else
8960
	if test "$aix_use_runtimelinking" = yes; then
8961
	  shared_flag='-qmkshrobj ${wl}-G'
8962
	else
8963
	  shared_flag='-qmkshrobj'
8964
	fi
8965
      fi
8966
    fi
8967
 
8968
    # Let the compiler handle the export list.
8969
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
8970
    if test "$aix_use_runtimelinking" = yes; then
8971
      # Warning - without using the other runtime loading flags (-brtl),
8972
      # -berok will link without error, but may produce a broken library.
8973
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
8974
      # Determine the default libpath from the value encoded in an empty executable.
8975
      _LT_AC_SYS_LIBPATH_AIX
8976
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8977
 
8978
      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
8979
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8980
     else
8981
      if test "$host_cpu" = ia64; then
8982
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8983
	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8984
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8985
      else
8986
	# Determine the default libpath from the value encoded in an empty executable.
8987
	_LT_AC_SYS_LIBPATH_AIX
8988
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8989
	# Warning - without using the other run time loading flags,
8990
	# -berok will link without error, but may produce a broken library.
8991
	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8992
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8993
	# -bexpall does not export symbols beginning with underscore (_)
8994
	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
8995
	# Exported symbols can be pulled into shared objects from archives
8996
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
8997
	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8998
	# This is similar to how AIX traditionally builds it's shared libraries.
8999
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
9000
      fi
9001
    fi
9002
    ;;
9003
  chorus*)
9004
    case $cc_basename in
9005
      *)
9006
	# FIXME: insert proper C++ library support
9007
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9008
	;;
9009
    esac
9010
    ;;
9011
 
9012
  cygwin* | mingw* | pw32*)
9013
    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
9014
    # as there is no search path for DLLs.
9015
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9016
    _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
9017
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
9018
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9019
 
9020
    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
9021
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
9022
      # If the export-symbols file already is a .def file (1st line
9023
      # is EXPORTS), use it as is; otherwise, prepend...
9024
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9025
	cp $export_symbols $output_objdir/$soname.def;
9026
      else
9027
	echo EXPORTS > $output_objdir/$soname.def;
9028
	cat $export_symbols >> $output_objdir/$soname.def;
9029
      fi~
9030
      $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
9031
    else
9032
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
9033
    fi
9034
  ;;
9035
 
9036
  darwin* | rhapsody*)
9037
  if test "$GXX" = yes; then
9038
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9039
    case "$host_os" in
9040
    rhapsody* | darwin1.[[012]])
9041
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
9042
      ;;
9043
    *) # Darwin 1.3 on
9044
      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
9045
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
9046
      else
9047
	case ${MACOSX_DEPLOYMENT_TARGET} in
9048
	  10.[012])
9049
	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
9050
	    ;;
9051
	  10.*)
9052
	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
9053
	    ;;
9054
	esac
9055
      fi
9056
      ;;
9057
    esac
9058
    lt_int_apple_cc_single_mod=no
9059
    output_verbose_link_cmd='echo'
9060
    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
9061
      lt_int_apple_cc_single_mod=yes
9062
    fi
9063
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
9064
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
9065
    else
9066
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
9067
    fi
9068
    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
9069
 
9070
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
9071
    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
9072
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
9073
    else
9074
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
9075
    fi
9076
    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
9077
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
9078
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
9079
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9080
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
9081
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9082
  else
9083
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9084
  fi
9085
    ;;
9086
 
9087
  dgux*)
9088
    case $cc_basename in
9089
      ec++)
9090
	# FIXME: insert proper C++ library support
9091
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9092
	;;
9093
      ghcx)
9094
	# Green Hills C++ Compiler
9095
	# FIXME: insert proper C++ library support
9096
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9097
	;;
9098
      *)
9099
	# FIXME: insert proper C++ library support
9100
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9101
	;;
9102
    esac
9103
    ;;
9104
  freebsd[12]*)
9105
    # C++ shared libraries reported to be fairly broken before switch to ELF
9106
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9107
    ;;
9108
  freebsd-elf*)
9109
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9110
    ;;
9111
  freebsd* | kfreebsd*-gnu)
9112
    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
9113
    # conventions
9114
    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
9115
    ;;
9116
  gnu*)
9117
    ;;
9118
  hpux9*)
9119
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9120
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9121
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9122
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9123
    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9124
				# but as the default
9125
				# location of the library.
9126
 
9127
    case $cc_basename in
9128
    CC)
9129
      # FIXME: insert proper C++ library support
9130
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
9131
      ;;
9132
    aCC)
9133
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9134
      # Commands to make compiler produce verbose output that lists
9135
      # what "hidden" libraries, object files and flags are used when
9136
      # linking a shared library.
9137
      #
9138
      # There doesn't appear to be a way to prevent this compiler from
9139
      # explicitly linking system object files so we need to strip them
9140
      # from the output so that they don't get included in the library
9141
      # dependencies.
9142
      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
9143
      ;;
9144
    *)
9145
      if test "$GXX" = yes; then
9146
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9147
      else
9148
        # FIXME: insert proper C++ library support
9149
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
9150
      fi
9151
      ;;
9152
    esac
9153
    ;;
9154
  hpux10*|hpux11*)
9155
    if test $with_gnu_ld = no; then
9156
      case "$host_cpu" in
9157
      hppa*64*)
9158
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9159
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
9160
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9161
        ;;
9162
      ia64*)
9163
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9164
        ;;
9165
      *)
9166
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9167
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9168
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9169
        ;;
9170
      esac
9171
    fi
9172
    case "$host_cpu" in
9173
    hppa*64*)
9174
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
9175
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9176
      ;;
9177
    ia64*)
9178
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
9179
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9180
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9181
					      # but as the default
9182
					      # location of the library.
9183
      ;;
9184
    *)
9185
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9186
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9187
					      # but as the default
9188
					      # location of the library.
9189
      ;;
9190
    esac
9191
 
9192
    case $cc_basename in
9193
      CC)
9194
	# FIXME: insert proper C++ library support
9195
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9196
	;;
9197
      aCC)
9198
	case "$host_cpu" in
9199
	hppa*64*|ia64*)
9200
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
9201
	  ;;
9202
	*)
9203
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
9204
	  ;;
9205
	esac
9206
	# Commands to make compiler produce verbose output that lists
9207
	# what "hidden" libraries, object files and flags are used when
9208
	# linking a shared library.
9209
	#
9210
	# There doesn't appear to be a way to prevent this compiler from
9211
	# explicitly linking system object files so we need to strip them
9212
	# from the output so that they don't get included in the library
9213
	# dependencies.
9214
	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'
9215
	;;
9216
      *)
9217
	if test "$GXX" = yes; then
9218
	  if test $with_gnu_ld = no; then
9219
	    case "$host_cpu" in
9220
	    ia64*|hppa*64*)
9221
	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
9222
	      ;;
9223
	    *)
9224
	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
9225
	      ;;
9226
	    esac
9227
	  fi
9228
	else
9229
	  # FIXME: insert proper C++ library support
9230
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
9231
	fi
9232
	;;
9233
    esac
9234
    ;;
9235
  irix5* | irix6*)
9236
    case $cc_basename in
9237
      CC)
9238
	# SGI C++
9239
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
9240
 
9241
	# Archives containing C++ object files must be created using
9242
	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
9243
	# necessary to make sure instantiated templates are included
9244
	# in the archive.
9245
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
9246
	;;
9247
      *)
9248
	if test "$GXX" = yes; then
9249
	  if test "$with_gnu_ld" = no; then
9250
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
9251
	  else
9252
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
9253
	  fi
9254
	fi
9255
	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9256
	;;
9257
    esac
9258
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9259
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9260
    ;;
9261
  linux*)
9262
    case $cc_basename in
9263
      KCC)
9264
	# Kuck and Associates, Inc. (KAI) C++ Compiler
9265
 
9266
	# KCC will only create a shared library if the output file
9267
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
9268
	# to its proper name (with version) after linking.
9269
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
9270
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
9271
	# Commands to make compiler produce verbose output that lists
9272
	# what "hidden" libraries, object files and flags are used when
9273
	# linking a shared library.
9274
	#
9275
	# There doesn't appear to be a way to prevent this compiler from
9276
	# explicitly linking system object files so we need to strip them
9277
	# from the output so that they don't get included in the library
9278
	# dependencies.
9279
	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'
9280
 
9281
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
9282
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
9283
 
9284
	# Archives containing C++ object files must be created using
9285
	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
9286
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
9287
	;;
9288
      icpc)
9289
	# Intel C++
9290
	with_gnu_ld=yes
9291
	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9292
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
9293
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9294
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9295
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
9296
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
9297
	;;
9298
      cxx)
9299
	# Compaq C++
9300
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
9301
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
9302
 
9303
	runpath_var=LD_RUN_PATH
9304
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9305
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9306
 
9307
	# Commands to make compiler produce verbose output that lists
9308
	# what "hidden" libraries, object files and flags are used when
9309
	# linking a shared library.
9310
	#
9311
	# There doesn't appear to be a way to prevent this compiler from
9312
	# explicitly linking system object files so we need to strip them
9313
	# from the output so that they don't get included in the library
9314
	# dependencies.
9315
	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'
9316
	;;
9317
    esac
9318
    ;;
9319
  lynxos*)
9320
    # FIXME: insert proper C++ library support
9321
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9322
    ;;
9323
  m88k*)
9324
    # FIXME: insert proper C++ library support
9325
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9326
    ;;
9327
  mvs*)
9328
    case $cc_basename in
9329
      cxx)
9330
	# FIXME: insert proper C++ library support
9331
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9332
	;;
9333
      *)
9334
	# FIXME: insert proper C++ library support
9335
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9336
	;;
9337
    esac
9338
    ;;
9339
  netbsd*)
9340
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
9341
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
9342
      wlarc=
9343
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9344
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9345
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9346
    fi
9347
    # Workaround some broken pre-1.5 toolchains
9348
    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
9349
    ;;
9350
  osf3*)
9351
    case $cc_basename in
9352
      KCC)
9353
	# Kuck and Associates, Inc. (KAI) C++ Compiler
9354
 
9355
	# KCC will only create a shared library if the output file
9356
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
9357
	# to its proper name (with version) after linking.
9358
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
9359
 
9360
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9361
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9362
 
9363
	# Archives containing C++ object files must be created using
9364
	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
9365
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
9366
 
9367
	;;
9368
      RCC)
9369
	# Rational C++ 2.4.1
9370
	# FIXME: insert proper C++ library support
9371
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9372
	;;
9373
      cxx)
9374
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9375
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
9376
 
9377
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9378
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9379
 
9380
	# Commands to make compiler produce verbose output that lists
9381
	# what "hidden" libraries, object files and flags are used when
9382
	# linking a shared library.
9383
	#
9384
	# There doesn't appear to be a way to prevent this compiler from
9385
	# explicitly linking system object files so we need to strip them
9386
	# from the output so that they don't get included in the library
9387
	# dependencies.
9388
	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'
9389
	;;
9390
      *)
9391
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9392
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9393
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
9394
 
9395
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9396
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9397
 
9398
	  # Commands to make compiler produce verbose output that lists
9399
	  # what "hidden" libraries, object files and flags are used when
9400
	  # linking a shared library.
9401
	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
9402
 
9403
	else
9404
	  # FIXME: insert proper C++ library support
9405
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
9406
	fi
9407
	;;
9408
    esac
9409
    ;;
9410
  osf4* | osf5*)
9411
    case $cc_basename in
9412
      KCC)
9413
	# Kuck and Associates, Inc. (KAI) C++ Compiler
9414
 
9415
	# KCC will only create a shared library if the output file
9416
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
9417
	# to its proper name (with version) after linking.
9418
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
9419
 
9420
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9421
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9422
 
9423
	# Archives containing C++ object files must be created using
9424
	# the KAI C++ compiler.
9425
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
9426
	;;
9427
      RCC)
9428
	# Rational C++ 2.4.1
9429
	# FIXME: insert proper C++ library support
9430
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9431
	;;
9432
      cxx)
9433
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9434
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
9435
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
9436
	  echo "-hidden">> $lib.exp~
9437
	  $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
9438
	  $rm $lib.exp'
9439
 
9440
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9441
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9442
 
9443
	# Commands to make compiler produce verbose output that lists
9444
	# what "hidden" libraries, object files and flags are used when
9445
	# linking a shared library.
9446
	#
9447
	# There doesn't appear to be a way to prevent this compiler from
9448
	# explicitly linking system object files so we need to strip them
9449
	# from the output so that they don't get included in the library
9450
	# dependencies.
9451
	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'
9452
	;;
9453
      *)
9454
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9455
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9456
	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
9457
 
9458
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9459
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9460
 
9461
	  # Commands to make compiler produce verbose output that lists
9462
	  # what "hidden" libraries, object files and flags are used when
9463
	  # linking a shared library.
9464
	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
9465
 
9466
	else
9467
	  # FIXME: insert proper C++ library support
9468
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
9469
	fi
9470
	;;
9471
    esac
9472
    ;;
9473
  psos*)
9474
    # FIXME: insert proper C++ library support
9475
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9476
    ;;
9477
  sco*)
9478
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9479
    case $cc_basename in
9480
      CC)
9481
	# FIXME: insert proper C++ library support
9482
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9483
	;;
9484
      *)
9485
	# FIXME: insert proper C++ library support
9486
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9487
	;;
9488
    esac
9489
    ;;
9490
  sunos4*)
9491
    case $cc_basename in
9492
      CC)
9493
	# Sun C++ 4.x
9494
	# FIXME: insert proper C++ library support
9495
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9496
	;;
9497
      lcc)
9498
	# Lucid
9499
	# FIXME: insert proper C++ library support
9500
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9501
	;;
9502
      *)
9503
	# FIXME: insert proper C++ library support
9504
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9505
	;;
9506
    esac
9507
    ;;
9508
  solaris*)
9509
    case $cc_basename in
9510
      CC)
9511
	# Sun C++ 4.2, 5.x and Centerline C++
9512
	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
9513
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
9514
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9515
	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9516
 
9517
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9518
	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9519
	case $host_os in
9520
	  solaris2.[0-5] | solaris2.[0-5].*) ;;
9521
	  *)
9522
	    # The C++ compiler is used as linker so we must use $wl
9523
	    # flag to pass the commands to the underlying system
9524
	    # linker.
9525
	    # Supported since Solaris 2.6 (maybe 2.5.1?)
9526
	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9527
	    ;;
9528
	esac
9529
	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9530
 
9531
	# Commands to make compiler produce verbose output that lists
9532
	# what "hidden" libraries, object files and flags are used when
9533
	# linking a shared library.
9534
	#
9535
	# There doesn't appear to be a way to prevent this compiler from
9536
	# explicitly linking system object files so we need to strip them
9537
	# from the output so that they don't get included in the library
9538
	# dependencies.
9539
	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
9540
 
9541
	# Archives containing C++ object files must be created using
9542
	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
9543
	# necessary to make sure instantiated templates are included
9544
	# in the archive.
9545
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
9546
	;;
9547
      gcx)
9548
	# Green Hills C++ Compiler
9549
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9550
 
9551
	# The C++ compiler must be used to create the archive.
9552
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
9553
	;;
9554
      *)
9555
	# GNU C++ compiler with Solaris linker
9556
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9557
	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
9558
	  if $CC --version | grep -v '^2\.7' > /dev/null; then
9559
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9560
	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9561
		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9562
 
9563
	    # Commands to make compiler produce verbose output that lists
9564
	    # what "hidden" libraries, object files and flags are used when
9565
	    # linking a shared library.
9566
	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9567
	  else
9568
	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
9569
	    # platform.
9570
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9571
	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9572
		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9573
 
9574
	    # Commands to make compiler produce verbose output that lists
9575
	    # what "hidden" libraries, object files and flags are used when
9576
	    # linking a shared library.
9577
	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9578
	  fi
9579
 
9580
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
9581
	fi
9582
	;;
9583
    esac
9584
    ;;
9585
  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
9586
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9587
    ;;
9588
  tandem*)
9589
    case $cc_basename in
9590
      NCC)
9591
	# NonStop-UX NCC 3.20
9592
	# FIXME: insert proper C++ library support
9593
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9594
	;;
9595
      *)
9596
	# FIXME: insert proper C++ library support
9597
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9598
	;;
9599
    esac
9600
    ;;
9601
  vxworks*)
9602
    # FIXME: insert proper C++ library support
9603
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9604
    ;;
9605
  *)
9606
    # FIXME: insert proper C++ library support
9607
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
9608
    ;;
9609
esac
9610
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
9611
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9612
 
9613
_LT_AC_TAGVAR(GCC, $1)="$GXX"
9614
_LT_AC_TAGVAR(LD, $1)="$LD"
9615
 
9616
## CAVEAT EMPTOR:
9617
## There is no encapsulation within the following macros, do not change
9618
## the running order or otherwise move them around unless you know exactly
9619
## what you are doing...
9620
AC_LIBTOOL_POSTDEP_PREDEP($1)
9621
AC_LIBTOOL_PROG_COMPILER_PIC($1)
9622
AC_LIBTOOL_PROG_CC_C_O($1)
9623
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9624
AC_LIBTOOL_PROG_LD_SHLIBS($1)
9625
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9626
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9627
AC_LIBTOOL_SYS_LIB_STRIP
9628
AC_LIBTOOL_DLOPEN_SELF($1)
9629
 
9630
AC_LIBTOOL_CONFIG($1)
9631
 
9632
AC_LANG_POP
9633
CC=$lt_save_CC
9634
LDCXX=$LD
9635
LD=$lt_save_LD
9636
GCC=$lt_save_GCC
9637
with_gnu_ldcxx=$with_gnu_ld
9638
with_gnu_ld=$lt_save_with_gnu_ld
9639
lt_cv_path_LDCXX=$lt_cv_path_LD
9640
lt_cv_path_LD=$lt_save_path_LD
9641
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
9642
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
9643
])# AC_LIBTOOL_LANG_CXX_CONFIG
9644
 
9645
# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
9646
# ------------------------
9647
# Figure out "hidden" library dependencies from verbose
9648
# compiler output when linking a shared library.
9649
# Parse the compiler output and extract the necessary
9650
# objects, libraries and library flags.
9651
AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
9652
dnl we can't use the lt_simple_compile_test_code here,
9653
dnl because it contains code intended for an executable,
9654
dnl not a library.  It's possible we should let each
9655
dnl tag define a new lt_????_link_test_code variable,
9656
dnl but it's only used here...
9657
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
9658
int a;
9659
void foo (void) { a = 0; }
9660
EOF
9661
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
9662
class Foo
9663
{
9664
public:
9665
  Foo (void) { a = 0; }
9666
private:
9667
  int a;
9668
};
9669
EOF
9670
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
9671
      subroutine foo
9672
      implicit none
9673
      integer*4 a
9674
      a=0
9675
      return
9676
      end
9677
EOF
9678
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
9679
public class foo {
9680
  private int a;
9681
  public void bar (void) {
9682
    a = 0;
9683
  }
9684
};
9685
EOF
9686
])
9687
dnl Parse the compiler output and extract the necessary
9688
dnl objects, libraries and library flags.
9689
if AC_TRY_EVAL(ac_compile); then
9690
  # Parse the compiler output and extract the necessary
9691
  # objects, libraries and library flags.
9692
 
9693
  # Sentinel used to keep track of whether or not we are before
9694
  # the conftest object file.
9695
  pre_test_object_deps_done=no
9696
 
9697
  # The `*' in the case matches for architectures that use `case' in
9698
  # $output_verbose_cmd can trigger glob expansion during the loop
9699
  # eval without this substitution.
9700
  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
9701
 
9702
  for p in `eval $output_verbose_link_cmd`; do
9703
    case $p in
9704
 
9705
    -L* | -R* | -l*)
9706
       # Some compilers place space between "-{L,R}" and the path.
9707
       # Remove the space.
9708
       if test $p = "-L" \
9709
	  || test $p = "-R"; then
9710
	 prev=$p
9711
	 continue
9712
       else
9713
	 prev=
9714
       fi
9715
 
9716
       if test "$pre_test_object_deps_done" = no; then
9717
	 case $p in
9718
	 -L* | -R*)
9719
	   # Internal compiler library paths should come after those
9720
	   # provided the user.  The postdeps already come after the
9721
	   # user supplied libs so there is no need to process them.
9722
	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
9723
	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
9724
	   else
9725
	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
9726
	   fi
9727
	   ;;
9728
	 # The "-l" case would never come before the object being
9729
	 # linked, so don't bother handling this case.
9730
	 esac
9731
       else
9732
	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
9733
	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
9734
	 else
9735
	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
9736
	 fi
9737
       fi
9738
       ;;
9739
 
9740
    *.$objext|*.$libext)
9741
       # This assumes that the test object file only shows up
9742
       # once in the compiler output.
9743
       if test "$p" = "conftest.$objext"; then
9744
	 pre_test_object_deps_done=yes
9745
	 continue
9746
       fi
9747
 
9748
       if test "$pre_test_object_deps_done" = no; then
9749
	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
9750
	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
9751
	 else
9752
	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
9753
	 fi
9754
       else
9755
	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
9756
	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
9757
	 else
9758
	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
9759
	 fi
9760
       fi
9761
       ;;
9762
 
9763
    *) ;; # Ignore the rest.
9764
 
9765
    esac
9766
  done
9767
 
9768
  # Clean up.
9769
  rm -f a.out a.exe
9770
else
9771
  echo "libtool.m4: error: problem compiling $1 test program"
9772
fi
9773
 
9774
$rm -f confest.$objext
9775
 
9776
case " $_LT_AC_TAGVAR(postdeps, $1) " in
9777
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
9778
esac
9779
])# AC_LIBTOOL_POSTDEP_PREDEP
9780
 
9781
# AC_LIBTOOL_LANG_F77_CONFIG
9782
# ------------------------
9783
# Ensure that the configuration vars for the C compiler are
9784
# suitably defined.  Those variables are subsequently used by
9785
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9786
AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
9787
AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
9788
[AC_REQUIRE([AC_PROG_F77])
9789
AC_LANG_PUSH(Fortran 77)
9790
 
9791
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9792
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
9793
_LT_AC_TAGVAR(always_export_symbols, $1)=no
9794
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
9795
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
9796
_LT_AC_TAGVAR(hardcode_direct, $1)=no
9797
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
9798
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9799
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9800
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
9801
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
9802
_LT_AC_TAGVAR(module_cmds, $1)=
9803
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
9804
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
9805
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9806
_LT_AC_TAGVAR(no_undefined_flag, $1)=
9807
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
9808
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9809
 
9810
# Source file extension for f77 test sources.
9811
ac_ext=f
9812
 
9813
# Object file extension for compiled f77 test sources.
9814
objext=o
9815
_LT_AC_TAGVAR(objext, $1)=$objext
9816
 
9817
# Code to be used in simple compile tests
9818
lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
9819
 
9820
# Code to be used in simple link tests
9821
lt_simple_link_test_code="      program t\n      end\n"
9822
 
9823
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9824
_LT_AC_SYS_COMPILER
9825
 
9826
# Allow CC to be a program name with arguments.
9827
lt_save_CC="$CC"
9828
CC=${F77-"f77"}
9829
compiler=$CC
9830
_LT_AC_TAGVAR(compiler, $1)=$CC
9831
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
9832
 
9833
AC_MSG_CHECKING([if libtool supports shared libraries])
9834
AC_MSG_RESULT([$can_build_shared])
9835
 
9836
AC_MSG_CHECKING([whether to build shared libraries])
9837
test "$can_build_shared" = "no" && enable_shared=no
9838
 
9839
# On AIX, shared libraries and static libraries use the same namespace, and
9840
# are all built from PIC.
9841
case "$host_os" in
9842
aix3*)
9843
  test "$enable_shared" = yes && enable_static=no
9844
  if test -n "$RANLIB"; then
9845
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
9846
    postinstall_cmds='$RANLIB $lib'
9847
  fi
9848
  ;;
9849
aix4*)
9850
  test "$enable_shared" = yes && enable_static=no
9851
  ;;
9852
esac
9853
AC_MSG_RESULT([$enable_shared])
9854
 
9855
AC_MSG_CHECKING([whether to build static libraries])
9856
# Make sure either enable_shared or enable_static is yes.
9857
test "$enable_shared" = yes || enable_static=yes
9858
AC_MSG_RESULT([$enable_static])
9859
 
9860
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9861
 
9862
_LT_AC_TAGVAR(GCC, $1)="$G77"
9863
_LT_AC_TAGVAR(LD, $1)="$LD"
9864
 
9865
AC_LIBTOOL_PROG_COMPILER_PIC($1)
9866
AC_LIBTOOL_PROG_CC_C_O($1)
9867
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9868
AC_LIBTOOL_PROG_LD_SHLIBS($1)
9869
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9870
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9871
AC_LIBTOOL_SYS_LIB_STRIP
9872
 
9873
 
9874
AC_LIBTOOL_CONFIG($1)
9875
 
9876
AC_LANG_POP
9877
CC="$lt_save_CC"
9878
])# AC_LIBTOOL_LANG_F77_CONFIG
9879
 
9880
 
9881
# AC_LIBTOOL_LANG_GCJ_CONFIG
9882
# --------------------------
9883
# Ensure that the configuration vars for the C compiler are
9884
# suitably defined.  Those variables are subsequently used by
9885
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9886
AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
9887
AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
9888
[AC_LANG_SAVE
9889
 
9890
# Source file extension for Java test sources.
9891
ac_ext=java
9892
 
9893
# Object file extension for compiled Java test sources.
9894
objext=o
9895
_LT_AC_TAGVAR(objext, $1)=$objext
9896
 
9897
# Code to be used in simple compile tests
9898
lt_simple_compile_test_code="class foo {}\n"
9899
 
9900
# Code to be used in simple link tests
9901
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
9902
 
9903
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9904
_LT_AC_SYS_COMPILER
9905
 
9906
# Allow CC to be a program name with arguments.
9907
lt_save_CC="$CC"
9908
CC=${GCJ-"gcj"}
9909
compiler=$CC
9910
_LT_AC_TAGVAR(compiler, $1)=$CC
9911
 
9912
# GCJ did not exist at the time GCC didn't implicitly link libc in.
9913
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9914
 
9915
## CAVEAT EMPTOR:
9916
## There is no encapsulation within the following macros, do not change
9917
## the running order or otherwise move them around unless you know exactly
9918
## what you are doing...
9919
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
9920
AC_LIBTOOL_PROG_COMPILER_PIC($1)
9921
AC_LIBTOOL_PROG_CC_C_O($1)
9922
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9923
AC_LIBTOOL_PROG_LD_SHLIBS($1)
9924
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9925
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9926
AC_LIBTOOL_SYS_LIB_STRIP
9927
AC_LIBTOOL_DLOPEN_SELF($1)
9928
 
9929
AC_LIBTOOL_CONFIG($1)
9930
 
9931
AC_LANG_RESTORE
9932
CC="$lt_save_CC"
9933
])# AC_LIBTOOL_LANG_GCJ_CONFIG
9934
 
9935
 
9936
# AC_LIBTOOL_LANG_RC_CONFIG
9937
# --------------------------
9938
# Ensure that the configuration vars for the Windows resource compiler are
9939
# suitably defined.  Those variables are subsequently used by
9940
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9941
AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
9942
AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
9943
[AC_LANG_SAVE
9944
 
9945
# Source file extension for RC test sources.
9946
ac_ext=rc
9947
 
9948
# Object file extension for compiled RC test sources.
9949
objext=o
9950
_LT_AC_TAGVAR(objext, $1)=$objext
9951
 
9952
# Code to be used in simple compile tests
9953
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
9954
 
9955
# Code to be used in simple link tests
9956
lt_simple_link_test_code="$lt_simple_compile_test_code"
9957
 
9958
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9959
_LT_AC_SYS_COMPILER
9960
 
9961
# Allow CC to be a program name with arguments.
9962
lt_save_CC="$CC"
9963
CC=${RC-"windres"}
9964
compiler=$CC
9965
_LT_AC_TAGVAR(compiler, $1)=$CC
9966
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
9967
 
9968
AC_LIBTOOL_CONFIG($1)
9969
 
9970
AC_LANG_RESTORE
9971
CC="$lt_save_CC"
9972
])# AC_LIBTOOL_LANG_RC_CONFIG
9973
 
9974
 
9975
# AC_LIBTOOL_CONFIG([TAGNAME])
9976
# ----------------------------
9977
# If TAGNAME is not passed, then create an initial libtool script
9978
# with a default configuration from the untagged config vars.  Otherwise
9979
# add code to config.status for appending the configuration named by
9980
# TAGNAME from the matching tagged config vars.
9981
AC_DEFUN([AC_LIBTOOL_CONFIG],
9982
[# The else clause should only fire when bootstrapping the
9983
# libtool distribution, otherwise you forgot to ship ltmain.sh
9984
# with your package, and you will get complaints that there are
9985
# no rules to generate ltmain.sh.
9986
if test -f "$ltmain"; then
9987
  # See if we are running on zsh, and set the options which allow our commands through
9988
  # without removal of \ escapes.
9989
  if test -n "${ZSH_VERSION+set}" ; then
9990
    setopt NO_GLOB_SUBST
9991
  fi  
9992
  # Now quote all the things that may contain metacharacters while being
9993
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
9994
  # variables and quote the copies for generation of the libtool script.
9995
  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
9996
    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
9997
    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
9998
    deplibs_check_method reload_flag reload_cmds need_locks \
9999
    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
10000
    lt_cv_sys_global_symbol_to_c_name_address \
10001
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
10002
    old_postinstall_cmds old_postuninstall_cmds \
10003
    _LT_AC_TAGVAR(compiler, $1) \
10004
    _LT_AC_TAGVAR(CC, $1) \
10005
    _LT_AC_TAGVAR(LD, $1) \
10006
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
10007
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
10008
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
10009
    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
10010
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
10011
    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
10012
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
10013
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
10014
    _LT_AC_TAGVAR(old_archive_cmds, $1) \
10015
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
10016
    _LT_AC_TAGVAR(predep_objects, $1) \
10017
    _LT_AC_TAGVAR(postdep_objects, $1) \
10018
    _LT_AC_TAGVAR(predeps, $1) \
10019
    _LT_AC_TAGVAR(postdeps, $1) \
10020
    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
10021
    _LT_AC_TAGVAR(archive_cmds, $1) \
10022
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
10023
    _LT_AC_TAGVAR(postinstall_cmds, $1) \
10024
    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
10025
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
10026
    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
10027
    _LT_AC_TAGVAR(no_undefined_flag, $1) \
10028
    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
10029
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
10030
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
10031
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
10032
    _LT_AC_TAGVAR(hardcode_automatic, $1) \
10033
    _LT_AC_TAGVAR(module_cmds, $1) \
10034
    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
10035
    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
10036
    _LT_AC_TAGVAR(exclude_expsyms, $1) \
10037
    _LT_AC_TAGVAR(include_expsyms, $1); do
10038
 
10039
    case $var in
10040
    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
10041
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
10042
    _LT_AC_TAGVAR(archive_cmds, $1) | \
10043
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
10044
    _LT_AC_TAGVAR(module_cmds, $1) | \
10045
    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
10046
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
10047
    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
10048
    extract_expsyms_cmds | reload_cmds | finish_cmds | \
10049
    postinstall_cmds | postuninstall_cmds | \
10050
    old_postinstall_cmds | old_postuninstall_cmds | \
10051
    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
10052
      # Double-quote double-evaled strings.
10053
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
10054
      ;;
10055
    *)
10056
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
10057
      ;;
10058
    esac
10059
  done
10060
 
10061
  case $lt_echo in
10062
  *'\[$]0 --fallback-echo"')
10063
    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
10064
    ;;
10065
  esac
10066
 
10067
ifelse([$1], [],
10068
  [cfgfile="${ofile}T"
10069
  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
10070
  $rm -f "$cfgfile"
10071
  AC_MSG_NOTICE([creating $ofile])],
10072
  [cfgfile="$ofile"])
10073
 
10074
  cat <<__EOF__ >> "$cfgfile"
10075
ifelse([$1], [],
10076
[#! $SHELL
10077
 
10078
# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
10079
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
10080
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
10081
#
10082
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
10083
# Free Software Foundation, Inc.
10084
#
10085
# This file is part of GNU Libtool:
10086
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
10087
#
10088
# This program is free software; you can redistribute it and/or modify
10089
# it under the terms of the GNU General Public License as published by
10090
# the Free Software Foundation; either version 2 of the License, or
10091
# (at your option) any later version.
10092
#
10093
# This program is distributed in the hope that it will be useful, but
10094
# WITHOUT ANY WARRANTY; without even the implied warranty of
10095
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10096
# General Public License for more details.
10097
#
10098
# You should have received a copy of the GNU General Public License
10099
# along with this program; if not, write to the Free Software
10100
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
10101
#
10102
# As a special exception to the GNU General Public License, if you
10103
# distribute this file as part of a program that contains a
10104
# configuration script generated by Autoconf, you may include it under
10105
# the same distribution terms that you use for the rest of that program.
10106
 
10107
# A sed program that does not truncate output.
10108
SED=$lt_SED
10109
 
10110
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
10111
Xsed="$SED -e s/^X//"
10112
 
10113
# The HP-UX ksh and POSIX shell print the target directory to stdout
10114
# if CDPATH is set.
10115
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
10116
 
10117
# The names of the tagged configurations supported by this script.
10118
available_tags=
10119
 
10120
# ### BEGIN LIBTOOL CONFIG],
10121
[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
10122
 
10123
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10124
 
10125
# Shell to use when invoking shell scripts.
10126
SHELL=$lt_SHELL
10127
 
10128
# Whether or not to build shared libraries.
10129
build_libtool_libs=$enable_shared
10130
 
10131
# Whether or not to build static libraries.
10132
build_old_libs=$enable_static
10133
 
10134
# Whether or not to add -lc for building shared libraries.
10135
build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
10136
 
10137
# Whether or not to disallow shared libs when runtime libs are static
10138
allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
10139
 
10140
# Whether or not to optimize for fast installation.
10141
fast_install=$enable_fast_install
10142
 
10143
# The host system.
10144
host_alias=$host_alias
10145
host=$host
10146
 
10147
# An echo program that does not interpret backslashes.
10148
echo=$lt_echo
10149
 
10150
# The archiver.
10151
AR=$lt_AR
10152
AR_FLAGS=$lt_AR_FLAGS
10153
 
10154
# A C compiler.
10155
LTCC=$lt_LTCC
10156
 
10157
# A language-specific compiler.
10158
CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
10159
 
10160
# Is the compiler the GNU C compiler?
10161
with_gcc=$_LT_AC_TAGVAR(GCC, $1)
10162
 
10163
# An ERE matcher.
10164
EGREP=$lt_EGREP
10165
 
10166
# The linker used to build libraries.
10167
LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
10168
 
10169
# Whether we need hard or soft links.
10170
LN_S=$lt_LN_S
10171
 
10172
# A BSD-compatible nm program.
10173
NM=$lt_NM
10174
 
10175
# A symbol stripping program
10176
STRIP=$STRIP
10177
 
10178
# Used to examine libraries when file_magic_cmd begins "file"
10179
MAGIC_CMD=$MAGIC_CMD
10180
 
10181
# Used on cygwin: DLL creation program.
10182
DLLTOOL="$DLLTOOL"
10183
 
10184
# Used on cygwin: object dumper.
10185
OBJDUMP="$OBJDUMP"
10186
 
10187
# Used on cygwin: assembler.
10188
AS="$AS"
10189
 
10190
# The name of the directory that contains temporary libtool files.
10191
objdir=$objdir
10192
 
10193
# How to create reloadable object files.
10194
reload_flag=$lt_reload_flag
10195
reload_cmds=$lt_reload_cmds
10196
 
10197
# How to pass a linker flag through the compiler.
10198
wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
10199
 
10200
# Object file suffix (normally "o").
10201
objext="$ac_objext"
10202
 
10203
# Old archive suffix (normally "a").
10204
libext="$libext"
10205
 
10206
# Shared library suffix (normally ".so").
10207
shrext='$shrext'
10208
 
10209
# Executable file suffix (normally "").
10210
exeext="$exeext"
10211
 
10212
# Additional compiler flags for building library objects.
10213
pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
10214
pic_mode=$pic_mode
10215
 
10216
# What is the maximum length of a command?
10217
max_cmd_len=$lt_cv_sys_max_cmd_len
10218
 
10219
# Does compiler simultaneously support -c and -o options?
10220
compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
10221
 
10222
# Must we lock files when doing compilation ?
10223
need_locks=$lt_need_locks
10224
 
10225
# Do we need the lib prefix for modules?
10226
need_lib_prefix=$need_lib_prefix
10227
 
10228
# Do we need a version for libraries?
10229
need_version=$need_version
10230
 
10231
# Whether dlopen is supported.
10232
dlopen_support=$enable_dlopen
10233
 
10234
# Whether dlopen of programs is supported.
10235
dlopen_self=$enable_dlopen_self
10236
 
10237
# Whether dlopen of statically linked programs is supported.
10238
dlopen_self_static=$enable_dlopen_self_static
10239
 
10240
# Compiler flag to prevent dynamic linking.
10241
link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
10242
 
10243
# Compiler flag to turn off builtin functions.
10244
no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
10245
 
10246
# Compiler flag to allow reflexive dlopens.
10247
export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
10248
 
10249
# Compiler flag to generate shared objects directly from archives.
10250
whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
10251
 
10252
# Compiler flag to generate thread-safe objects.
10253
thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
10254
 
10255
# Library versioning type.
10256
version_type=$version_type
10257
 
10258
# Format of library name prefix.
10259
libname_spec=$lt_libname_spec
10260
 
10261
# List of archive names.  First name is the real one, the rest are links.
10262
# The last name is the one that the linker finds with -lNAME.
10263
library_names_spec=$lt_library_names_spec
10264
 
10265
# The coded name of the library, if different from the real name.
10266
soname_spec=$lt_soname_spec
10267
 
10268
# Commands used to build and install an old-style archive.
10269
RANLIB=$lt_RANLIB
10270
old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
10271
old_postinstall_cmds=$lt_old_postinstall_cmds
10272
old_postuninstall_cmds=$lt_old_postuninstall_cmds
10273
 
10274
# Create an old-style archive from a shared archive.
10275
old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
10276
 
10277
# Create a temporary old-style archive to link instead of a shared archive.
10278
old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
10279
 
10280
# Commands used to build and install a shared archive.
10281
archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
10282
archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
10283
postinstall_cmds=$lt_postinstall_cmds
10284
postuninstall_cmds=$lt_postuninstall_cmds
10285
 
10286
# Commands used to build a loadable module (assumed same as above if empty)
10287
module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
10288
module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
10289
 
10290
# Commands to strip libraries.
10291
old_striplib=$lt_old_striplib
10292
striplib=$lt_striplib
10293
 
10294
# Dependencies to place before the objects being linked to create a
10295
# shared library.
10296
predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
10297
 
10298
# Dependencies to place after the objects being linked to create a
10299
# shared library.
10300
postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
10301
 
10302
# Dependencies to place before the objects being linked to create a
10303
# shared library.
10304
predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
10305
 
10306
# Dependencies to place after the objects being linked to create a
10307
# shared library.
10308
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
10309
 
10310
# The library search path used internally by the compiler when linking
10311
# a shared library.
10312
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
10313
 
10314
# Method to check whether dependent libraries are shared objects.
10315
deplibs_check_method=$lt_deplibs_check_method
10316
 
10317
# Command to use when deplibs_check_method == file_magic.
10318
file_magic_cmd=$lt_file_magic_cmd
10319
 
10320
# Flag that allows shared libraries with undefined symbols to be built.
10321
allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
10322
 
10323
# Flag that forces no undefined symbols.
10324
no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
10325
 
10326
# Commands used to finish a libtool library installation in a directory.
10327
finish_cmds=$lt_finish_cmds
10328
 
10329
# Same as above, but a single script fragment to be evaled but not shown.
10330
finish_eval=$lt_finish_eval
10331
 
10332
# Take the output of nm and produce a listing of raw symbols and C names.
10333
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
10334
 
10335
# Transform the output of nm in a proper C declaration
10336
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
10337
 
10338
# Transform the output of nm in a C name address pair
10339
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
10340
 
10341
# This is the shared library runtime path variable.
10342
runpath_var=$runpath_var
10343
 
10344
# This is the shared library path variable.
10345
shlibpath_var=$shlibpath_var
10346
 
10347
# Is shlibpath searched before the hard-coded library search path?
10348
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
10349
 
10350
# How to hardcode a shared library path into an executable.
10351
hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
10352
 
10353
# Whether we should hardcode library paths into libraries.
10354
hardcode_into_libs=$hardcode_into_libs
10355
 
10356
# Flag to hardcode \$libdir into a binary during linking.
10357
# This must work even if \$libdir does not exist.
10358
hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
10359
 
10360
# If ld is used when linking, flag to hardcode \$libdir into
10361
# a binary during linking. This must work even if \$libdir does
10362
# not exist.
10363
hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
10364
 
10365
# Whether we need a single -rpath flag with a separated argument.
10366
hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
10367
 
10368
# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
10369
# resulting binary.
10370
hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
10371
 
10372
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
10373
# resulting binary.
10374
hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
10375
 
10376
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
10377
# the resulting binary.
10378
hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
10379
 
10380
# Set to yes if building a shared library automatically hardcodes DIR into the library
10381
# and all subsequent libraries and executables linked against it.
10382
hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
10383
 
10384
# Variables whose values should be saved in libtool wrapper scripts and
10385
# restored at relink time.
10386
variables_saved_for_relink="$variables_saved_for_relink"
10387
 
10388
# Whether libtool must link a program against all its dependency libraries.
10389
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
10390
 
10391
# Compile-time system search path for libraries
10392
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
10393
 
10394
# Run-time system search path for libraries
10395
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
10396
 
10397
# Fix the shell variable \$srcfile for the compiler.
10398
fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
10399
 
10400
# Set to yes if exported symbols are required.
10401
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
10402
 
10403
# The commands to list exported symbols.
10404
export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
10405
 
10406
# The commands to extract the exported symbol list from a shared archive.
10407
extract_expsyms_cmds=$lt_extract_expsyms_cmds
10408
 
10409
# Symbols that should not be listed in the preloaded symbols.
10410
exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
10411
 
10412
# Symbols that must always be exported.
10413
include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
10414
 
10415
ifelse([$1],[],
10416
[# ### END LIBTOOL CONFIG],
10417
[# ### END LIBTOOL TAG CONFIG: $tagname])
10418
 
10419
__EOF__
10420
 
10421
ifelse([$1],[], [
10422
  case $host_os in
10423
  aix3*)
10424
    cat <<\EOF >> "$cfgfile"
10425
 
10426
# AIX sometimes has problems with the GCC collect2 program.  For some
10427
# reason, if we set the COLLECT_NAMES environment variable, the problems
10428
# vanish in a puff of smoke.
10429
if test "X${COLLECT_NAMES+set}" != Xset; then
10430
  COLLECT_NAMES=
10431
  export COLLECT_NAMES
10432
fi
10433
EOF
10434
    ;;
10435
  esac
10436
 
10437
  # We use sed instead of cat because bash on DJGPP gets confused if
10438
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
10439
  # text mode, it properly converts lines to CR/LF.  This bash problem
10440
  # is reportedly fixed, but why not run on old versions too?
10441
  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
10442
 
10443
  mv -f "$cfgfile" "$ofile" || \
10444
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
10445
  chmod +x "$ofile"
10446
])
10447
else
10448
  # If there is no Makefile yet, we rely on a make rule to execute
10449
  # `config.status --recheck' to rerun these tests and create the
10450
  # libtool script then.
10451
  test -f Makefile && make "$ltmain"
10452
fi
10453
])# AC_LIBTOOL_CONFIG
10454
 
10455
 
10456
# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
10457
# -------------------------------------------
10458
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
10459
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
10460
 
10461
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
10462
 
10463
if test "$GCC" = yes; then
10464
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
10465
 
10466
  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
10467
    lt_cv_prog_compiler_rtti_exceptions,
10468
    [-fno-rtti -fno-exceptions], [],
10469
    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
10470
fi
10471
])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
10472
 
10473
 
10474
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
10475
# ---------------------------------
10476
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
10477
[AC_REQUIRE([AC_CANONICAL_HOST])
10478
AC_REQUIRE([AC_PROG_NM])
10479
AC_REQUIRE([AC_OBJEXT])
10480
# Check for command to grab the raw symbol name followed by C symbol from nm.
10481
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
10482
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
10483
[
10484
# These are sane defaults that work on at least a few old systems.
10485
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
10486
 
10487
# Character class describing NM global symbol codes.
10488
symcode='[[BCDEGRST]]'
10489
 
10490
# Regexp to match symbols that can be accessed directly from C.
10491
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
10492
 
10493
# Transform the above into a raw symbol and a C symbol.
10494
symxfrm='\1 \2\3 \3'
10495
 
10496
# Transform an extracted symbol line into a proper C declaration
10497
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
10498
 
10499
# Transform an extracted symbol line into symbol name and symbol address
10500
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'"
10501
 
10502
# Define system-specific variables.
10503
case $host_os in
10504
aix*)
10505
  symcode='[[BCDT]]'
10506
  ;;
10507
cygwin* | mingw* | pw32*)
10508
  symcode='[[ABCDGISTW]]'
10509
  ;;
10510
hpux*) # Its linker distinguishes data from code symbols
10511
  if test "$host_cpu" = ia64; then
10512
    symcode='[[ABCDEGRST]]'
10513
  fi
10514
  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
10515
  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'"
10516
  ;;
10517
irix* | nonstopux*)
10518
  symcode='[[BCDEGRST]]'
10519
  ;;
10520
osf*)
10521
  symcode='[[BCDEGQRST]]'
10522
  ;;
10523
solaris* | sysv5*)
10524
  symcode='[[BDT]]'
10525
  ;;
10526
sysv4)
10527
  symcode='[[DFNSTU]]'
10528
  ;;
10529
esac
10530
 
10531
# Handle CRLF in mingw tool chain
10532
opt_cr=
10533
case $build_os in
10534
mingw*)
10535
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
10536
  ;;
10537
esac
10538
 
10539
# If we're using GNU nm, then use its standard symbol codes.
10540
case `$NM -V 2>&1` in
10541
*GNU* | *'with BFD'*)
10542
  symcode='[[ABCDGISTW]]' ;;
10543
esac
10544
 
10545
# Try without a prefix undercore, then with it.
10546
for ac_symprfx in "" "_"; do
10547
 
10548
  # Write the raw and C identifiers.
10549
  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
10550
 
10551
  # Check to see that the pipe works correctly.
10552
  pipe_works=no
10553
 
10554
  rm -f conftest*
10555
  cat > conftest.$ac_ext <<EOF
10556
#ifdef __cplusplus
10557
extern "C" {
10558
#endif
10559
char nm_test_var;
10560
void nm_test_func(){}
10561
#ifdef __cplusplus
10562
}
10563
#endif
10564
int main(){nm_test_var='a';nm_test_func();return(0);}
10565
EOF
10566
 
10567
  if AC_TRY_EVAL(ac_compile); then
10568
    # Now try to grab the symbols.
10569
    nlist=conftest.nm
10570
    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
10571
      # Try sorting and uniquifying the output.
10572
      if sort "$nlist" | uniq > "$nlist"T; then
10573
	mv -f "$nlist"T "$nlist"
10574
      else
10575
	rm -f "$nlist"T
10576
      fi
10577
 
10578
      # Make sure that we snagged all the symbols we need.
10579
      if grep ' nm_test_var$' "$nlist" >/dev/null; then
10580
	if grep ' nm_test_func$' "$nlist" >/dev/null; then
10581
	  cat <<EOF > conftest.$ac_ext
10582
#ifdef __cplusplus
10583
extern "C" {
10584
#endif
10585
 
10586
EOF
10587
	  # Now generate the symbol file.
10588
	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
10589
 
10590
	  cat <<EOF >> conftest.$ac_ext
10591
#if defined (__STDC__) && __STDC__
10592
# define lt_ptr_t void *
10593
#else
10594
# define lt_ptr_t char *
10595
# define const
10596
#endif
10597
 
10598
/* The mapping between symbol names and symbols. */
10599
const struct {
10600
  const char *name;
10601
  lt_ptr_t address;
10602
}
10603
lt_preloaded_symbols[[]] =
10604
{
10605
EOF
10606
	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
10607
	  cat <<\EOF >> conftest.$ac_ext
10608
  {0, (lt_ptr_t) 0}
10609
};
10610
 
10611
#ifdef __cplusplus
10612
}
10613
#endif
10614
EOF
10615
	  # Now try linking the two files.
10616
	  mv conftest.$ac_objext conftstm.$ac_objext
10617
	  lt_save_LIBS="$LIBS"
10618
	  lt_save_CFLAGS="$CFLAGS"
10619
	  LIBS="conftstm.$ac_objext"
10620
	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
10621
	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
10622
	    pipe_works=yes
10623
	  fi
10624
	  LIBS="$lt_save_LIBS"
10625
	  CFLAGS="$lt_save_CFLAGS"
10626
	else
10627
	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
10628
	fi
10629
      else
10630
	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
10631
      fi
10632
    else
10633
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
10634
    fi
10635
  else
10636
    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
10637
    cat conftest.$ac_ext >&5
10638
  fi
10639
  rm -f conftest* conftst*
10640
 
10641
  # Do not use the global_symbol_pipe unless it works.
10642
  if test "$pipe_works" = yes; then
10643
    break
10644
  else
10645
    lt_cv_sys_global_symbol_pipe=
10646
  fi
10647
done
10648
])
10649
if test -z "$lt_cv_sys_global_symbol_pipe"; then
10650
  lt_cv_sys_global_symbol_to_cdecl=
10651
fi
10652
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
10653
  AC_MSG_RESULT(failed)
10654
else
10655
  AC_MSG_RESULT(ok)
10656
fi
10657
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
10658
 
10659
 
10660
# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
10661
# ---------------------------------------
10662
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
10663
[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
10664
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10665
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
10666
 
10667
AC_MSG_CHECKING([for $compiler option to produce PIC])
10668
 ifelse([$1],[CXX],[
10669
  # C++ specific cases for pic, static, wl, etc.
10670
  if test "$GXX" = yes; then
10671
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10672
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10673
 
10674
    case $host_os in
10675
    aix*)
10676
      # All AIX code is PIC.
10677
      if test "$host_cpu" = ia64; then
10678
	# AIX 5 now supports IA64 processor
10679
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10680
      fi
10681
      ;;
10682
    amigaos*)
10683
      # FIXME: we need at least 68020 code to build shared libraries, but
10684
      # adding the `-m68020' flag to GCC prevents building anything better,
10685
      # like `-m68040'.
10686
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10687
      ;;
10688
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10689
      # PIC is the default for these OSes.
10690
      ;;
10691
    mingw* | os2* | pw32*)
10692
      # This hack is so that the source file can tell whether it is being
10693
      # built for inclusion in a dll (and should export symbols for example).
10694
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10695
      ;;
10696
    darwin* | rhapsody*)
10697
      # PIC is the default on this platform
10698
      # Common symbols not allowed in MH_DYLIB files
10699
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10700
      ;;
10701
    *djgpp*)
10702
      # DJGPP does not support shared libraries at all
10703
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10704
      ;;
10705
    sysv4*MP*)
10706
      if test -d /usr/nec; then
10707
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10708
      fi
10709
      ;;
10710
    hpux*)
10711
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10712
      # not for PA HP-UX.
10713
      case "$host_cpu" in
10714
      hppa*64*|ia64*)
10715
	;;
10716
      *)
10717
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10718
	;;
10719
      esac
10720
      ;;
10721
    *)
10722
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10723
      ;;
10724
    esac
10725
  else
10726
    case $host_os in
10727
      aix4* | aix5*)
10728
	# All AIX code is PIC.
10729
	if test "$host_cpu" = ia64; then
10730
	  # AIX 5 now supports IA64 processor
10731
	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10732
	else
10733
	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10734
	fi
10735
	;;
10736
      chorus*)
10737
	case $cc_basename in
10738
	cxch68)
10739
	  # Green Hills C++ Compiler
10740
	  # _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"
10741
	  ;;
10742
	esac
10743
	;;
10744
      dgux*)
10745
	case $cc_basename in
10746
	  ec++)
10747
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10748
	    ;;
10749
	  ghcx)
10750
	    # Green Hills C++ Compiler
10751
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10752
	    ;;
10753
	  *)
10754
	    ;;
10755
	esac
10756
	;;
10757
      freebsd* | kfreebsd*-gnu)
10758
	# FreeBSD uses GNU C++
10759
	;;
10760
      hpux9* | hpux10* | hpux11*)
10761
	case $cc_basename in
10762
	  CC)
10763
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10764
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10765
	    if test "$host_cpu" != ia64; then
10766
	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10767
	    fi
10768
	    ;;
10769
	  aCC)
10770
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10771
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10772
	    case "$host_cpu" in
10773
	    hppa*64*|ia64*)
10774
	      # +Z the default
10775
	      ;;
10776
	    *)
10777
	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10778
	      ;;
10779
	    esac
10780
	    ;;
10781
	  *)
10782
	    ;;
10783
	esac
10784
	;;
10785
      irix5* | irix6* | nonstopux*)
10786
	case $cc_basename in
10787
	  CC)
10788
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10789
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10790
	    # CC pic flag -KPIC is the default.
10791
	    ;;
10792
	  *)
10793
	    ;;
10794
	esac
10795
	;;
10796
      linux*)
10797
	case $cc_basename in
10798
	  KCC)
10799
	    # KAI C++ Compiler
10800
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10801
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10802
	    ;;
10803
	  icpc)
10804
	    # Intel C++
10805
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10806
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10807
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10808
	    ;; 
10809
	  cxx)
10810
	    # Compaq C++
10811
	    # Make sure the PIC flag is empty.  It appears that all Alpha
10812
	    # Linux and Compaq Tru64 Unix objects are PIC.
10813
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10814
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10815
	    ;;
10816
	  *)
10817
	    ;;
10818
	esac
10819
	;;
10820
      lynxos*)
10821
	;;
10822
      m88k*)
10823
	;;
10824
      mvs*)
10825
	case $cc_basename in
10826
	  cxx)
10827
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
10828
	    ;;
10829
	  *)
10830
	    ;;
10831
	esac
10832
	;;
10833
      netbsd*)
10834
	;;
10835
      osf3* | osf4* | osf5*)
10836
	case $cc_basename in
10837
	  KCC)
10838
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10839
	    ;;
10840
	  RCC)
10841
	    # Rational C++ 2.4.1
10842
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10843
	    ;;
10844
	  cxx)
10845
	    # Digital/Compaq C++
10846
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10847
	    # Make sure the PIC flag is empty.  It appears that all Alpha
10848
	    # Linux and Compaq Tru64 Unix objects are PIC.
10849
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10850
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10851
	    ;;
10852
	  *)
10853
	    ;;
10854
	esac
10855
	;;
10856
      psos*)
10857
	;;
10858
      sco*)
10859
	case $cc_basename in
10860
	  CC)
10861
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10862
	    ;;
10863
	  *)
10864
	    ;;
10865
	esac
10866
	;;
10867
      solaris*)
10868
	case $cc_basename in
10869
	  CC)
10870
	    # Sun C++ 4.2, 5.x and Centerline C++
10871
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10872
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10873
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
10874
	    ;;
10875
	  gcx)
10876
	    # Green Hills C++ Compiler
10877
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
10878
	    ;;
10879
	  *)
10880
	    ;;
10881
	esac
10882
	;;
10883
      sunos4*)
10884
	case $cc_basename in
10885
	  CC)
10886
	    # Sun C++ 4.x
10887
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10888
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10889
	    ;;
10890
	  lcc)
10891
	    # Lucid
10892
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10893
	    ;;
10894
	  *)
10895
	    ;;
10896
	esac
10897
	;;
10898
      tandem*)
10899
	case $cc_basename in
10900
	  NCC)
10901
	    # NonStop-UX NCC 3.20
10902
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10903
	    ;;
10904
	  *)
10905
	    ;;
10906
	esac
10907
	;;
10908
      unixware*)
10909
	;;
10910
      vxworks*)
10911
	;;
10912
      *)
10913
	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10914
	;;
10915
    esac
10916
  fi
10917
],
10918
[
10919
  if test "$GCC" = yes; then
10920
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10921
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10922
 
10923
    case $host_os in
10924
      aix*)
10925
      # All AIX code is PIC.
10926
      if test "$host_cpu" = ia64; then
10927
	# AIX 5 now supports IA64 processor
10928
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10929
      fi
10930
      ;;
10931
 
10932
    amigaos*)
10933
      # FIXME: we need at least 68020 code to build shared libraries, but
10934
      # adding the `-m68020' flag to GCC prevents building anything better,
10935
      # like `-m68040'.
10936
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10937
      ;;
10938
 
10939
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10940
      # PIC is the default for these OSes.
10941
      ;;
10942
 
10943
    mingw* | pw32* | os2*)
10944
      # This hack is so that the source file can tell whether it is being
10945
      # built for inclusion in a dll (and should export symbols for example).
10946
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10947
      ;;
10948
 
10949
    darwin* | rhapsody*)
10950
      # PIC is the default on this platform
10951
      # Common symbols not allowed in MH_DYLIB files
10952
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10953
      ;;
10954
 
10955
    msdosdjgpp*)
10956
      # Just because we use GCC doesn't mean we suddenly get shared libraries
10957
      # on systems that don't support them.
10958
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10959
      enable_shared=no
10960
      ;;
10961
 
10962
    sysv4*MP*)
10963
      if test -d /usr/nec; then
10964
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10965
      fi
10966
      ;;
10967
 
10968
    hpux*)
10969
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10970
      # not for PA HP-UX.
10971
      case "$host_cpu" in
10972
      hppa*64*|ia64*)
10973
	# +Z the default
10974
	;;
10975
      *)
10976
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10977
	;;
10978
      esac
10979
      ;;
10980
 
10981
    *)
10982
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10983
      ;;
10984
    esac
10985
  else
10986
    # PORTME Check for flag to pass linker flags through the system compiler.
10987
    case $host_os in
10988
    aix*)
10989
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10990
      if test "$host_cpu" = ia64; then
10991
	# AIX 5 now supports IA64 processor
10992
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10993
      else
10994
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10995
      fi
10996
      ;;
10997
 
10998
    mingw* | pw32* | os2*)
10999
      # This hack is so that the source file can tell whether it is being
11000
      # built for inclusion in a dll (and should export symbols for example).
11001
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
11002
      ;;
11003
 
11004
    hpux9* | hpux10* | hpux11*)
11005
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11006
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
11007
      # not for PA HP-UX.
11008
      case "$host_cpu" in
11009
      hppa*64*|ia64*)
11010
	# +Z the default
11011
	;;
11012
      *)
11013
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
11014
	;;
11015
      esac
11016
      # Is there a better lt_prog_compiler_static that works with the bundled CC?
11017
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
11018
      ;;
11019
 
11020
    irix5* | irix6* | nonstopux*)
11021
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11022
      # PIC (with -KPIC) is the default.
11023
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
11024
      ;;
11025
 
11026
    newsos6)
11027
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
11028
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11029
      ;;
11030
 
11031
    linux*)
11032
      case $CC in
11033
      icc* | ecc*)
11034
	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11035
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
11036
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
11037
        ;;
11038
      ccc*)
11039
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11040
        # All Alpha code is PIC.
11041
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
11042
        ;;
11043
      esac
11044
      ;;
11045
 
11046
    osf3* | osf4* | osf5*)
11047
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11048
      # All OSF/1 code is PIC.
11049
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
11050
      ;;
11051
 
11052
    sco3.2v5*)
11053
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
11054
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
11055
      ;;
11056
 
11057
    solaris*)
11058
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11059
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
11060
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11061
      ;;
11062
 
11063
    sunos4*)
11064
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
11065
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
11066
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11067
      ;;
11068
 
11069
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
11070
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
11071
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
11072
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11073
      ;;
11074
 
11075
    sysv4*MP*)
11076
      if test -d /usr/nec ;then
11077
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
11078
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11079
      fi
11080
      ;;
11081
 
11082
    uts4*)
11083
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
11084
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
11085
      ;;
11086
 
11087
    *)
11088
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
11089
      ;;
11090
    esac
11091
  fi
11092
])
11093
AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
11094
 
11095
#
11096
# Check to make sure the PIC flag actually works.
11097
#
11098
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
11099
  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
11100
    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
11101
    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
11102
    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
11103
     "" | " "*) ;;
11104
     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
11105
     esac],
11106
    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
11107
     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
11108
fi
11109
case "$host_os" in
11110
  # For platforms which do not support PIC, -DPIC is meaningless:
11111
  *djgpp*)
11112
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
11113
    ;;
11114
  *)
11115
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
11116
    ;;
11117
esac
11118
])
11119
 
11120
 
11121
# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
11122
# ------------------------------------
11123
# See if the linker supports building shared libraries.
11124
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
11125
[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
11126
ifelse([$1],[CXX],[
11127
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
11128
  case $host_os in
11129
  aix4* | aix5*)
11130
    # If we're using GNU nm, then we don't want the "-C" option.
11131
    # -C means demangle to AIX nm, but means don't demangle with GNU nm
11132
    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
11133
      _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'
11134
    else
11135
      _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'
11136
    fi
11137
    ;;
11138
  pw32*)
11139
    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
11140
  ;;
11141
  cygwin* | mingw*)
11142
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
11143
  ;;
11144
  *)
11145
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
11146
  ;;
11147
  esac
11148
],[
11149
  runpath_var=
11150
  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
11151
  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11152
  _LT_AC_TAGVAR(archive_cmds, $1)=
11153
  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
11154
  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
11155
  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
11156
  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
11157
  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
11158
  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
11159
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
11160
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
11161
  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
11162
  _LT_AC_TAGVAR(hardcode_direct, $1)=no
11163
  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
11164
  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11165
  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
11166
  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
11167
  _LT_AC_TAGVAR(module_cmds, $1)=
11168
  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
11169
  _LT_AC_TAGVAR(always_export_symbols, $1)=no
11170
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
11171
  # include_expsyms should be a list of space-separated symbols to be *always*
11172
  # included in the symbol list
11173
  _LT_AC_TAGVAR(include_expsyms, $1)=
11174
  # exclude_expsyms can be an extended regexp of symbols to exclude
11175
  # it will be wrapped by ` (' and `)$', so one must not match beginning or
11176
  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
11177
  # as well as any symbol that contains `d'.
11178
  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
11179
  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
11180
  # platforms (ab)use it in PIC code, but their linkers get confused if
11181
  # the symbol is explicitly referenced.  Since portable code cannot
11182
  # rely on this symbol name, it's probably fine to never include it in
11183
  # preloaded symbol tables.
11184
  extract_expsyms_cmds=
11185
 
11186
  case $host_os in
11187
  cygwin* | mingw* | pw32*)
11188
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
11189
    # When not using gcc, we currently assume that we are using
11190
    # Microsoft Visual C++.
11191
    if test "$GCC" != yes; then
11192
      with_gnu_ld=no
11193
    fi
11194
    ;;
11195
  openbsd*)
11196
    with_gnu_ld=no
11197
    ;;
11198
  esac
11199
 
11200
  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
11201
  if test "$with_gnu_ld" = yes; then
11202
    # If archive_cmds runs LD, not CC, wlarc should be empty
11203
    wlarc='${wl}'
11204
 
11205
    # See if GNU ld supports shared libraries.
11206
    case $host_os in
11207
    aix3* | aix4* | aix5*)
11208
      # On AIX/PPC, the GNU linker is very broken
11209
      if test "$host_cpu" != ia64; then
11210
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
11211
	cat <<EOF 1>&2
11212
 
11213
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
11214
*** to be unable to reliably create shared libraries on AIX.
11215
*** Therefore, libtool is disabling shared libraries support.  If you
11216
*** really care for shared libraries, you may want to modify your PATH
11217
*** so that a non-GNU linker is found, and then restart.
11218
 
11219
EOF
11220
      fi
11221
      ;;
11222
 
11223
    amigaos*)
11224
      _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)'
11225
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11226
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11227
 
11228
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
11229
      # that the semantics of dynamic libraries on AmigaOS, at least up
11230
      # to version 4, is to share data among multiple programs linked
11231
      # with the same dynamic library.  Since this doesn't match the
11232
      # behavior of shared libraries on other platforms, we can't use
11233
      # them.
11234
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
11235
      ;;
11236
 
11237
    beos*)
11238
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11239
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11240
	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
11241
	# support --undefined.  This deserves some investigation.  FIXME
11242
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11243
      else
11244
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
11245
      fi
11246
      ;;
11247
 
11248
    cygwin* | mingw* | pw32*)
11249
      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
11250
      # as there is no search path for DLLs.
11251
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11252
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
11253
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
11254
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
11255
      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
11256
 
11257
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
11258
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
11259
	# If the export-symbols file already is a .def file (1st line
11260
	# is EXPORTS), use it as is; otherwise, prepend...
11261
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
11262
	  cp $export_symbols $output_objdir/$soname.def;
11263
	else
11264
	  echo EXPORTS > $output_objdir/$soname.def;
11265
	  cat $export_symbols >> $output_objdir/$soname.def;
11266
	fi~
11267
	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
11268
      else
11269
	ld_shlibs=no
11270
      fi
11271
      ;;
11272
 
11273
    netbsd*)
11274
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
11275
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
11276
	wlarc=
11277
      else
11278
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11279
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
11280
      fi
11281
      ;;
11282
 
11283
    solaris* | sysv5*)
11284
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
11285
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
11286
	cat <<EOF 1>&2
11287
 
11288
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
11289
*** create shared libraries on Solaris systems.  Therefore, libtool
11290
*** is disabling shared libraries support.  We urge you to upgrade GNU
11291
*** binutils to release 2.9.1 or newer.  Another option is to modify
11292
*** your PATH or compiler configuration so that the native linker is
11293
*** used, and then restart.
11294
 
11295
EOF
11296
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11297
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11298
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
11299
      else
11300
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
11301
      fi
11302
      ;;
11303
 
11304
    sunos4*)
11305
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11306
      wlarc=
11307
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11308
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11309
      ;;
11310
 
11311
    *)
11312
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11313
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11314
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
11315
      else
11316
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
11317
      fi
11318
      ;;
11319
    esac
11320
 
11321
    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
11322
      runpath_var=LD_RUN_PATH
11323
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
11324
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11325
      # ancient GNU ld didn't support --whole-archive et. al.
11326
      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
11327
 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11328
      else
11329
  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
11330
      fi
11331
    fi
11332
  else
11333
    # PORTME fill in a description of your system's linker (not GNU ld)
11334
    case $host_os in
11335
    aix3*)
11336
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11337
      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
11338
      _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'
11339
      # Note: this linker hardcodes the directories in LIBPATH if there
11340
      # are no directories specified by -L.
11341
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11342
      if test "$GCC" = yes && test -z "$link_static_flag"; then
11343
	# Neither direct hardcoding nor static linking is supported with a
11344
	# broken collect2.
11345
	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
11346
      fi
11347
      ;;
11348
 
11349
    aix4* | aix5*)
11350
      if test "$host_cpu" = ia64; then
11351
	# On IA64, the linker does run time linking by default, so we don't
11352
	# have to do anything special.
11353
	aix_use_runtimelinking=no
11354
	exp_sym_flag='-Bexport'
11355
	no_entry_flag=""
11356
      else
11357
	# If we're using GNU nm, then we don't want the "-C" option.
11358
	# -C means demangle to AIX nm, but means don't demangle with GNU nm
11359
	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
11360
	  _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'
11361
	else
11362
	  _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'
11363
	fi
11364
 
11365
	# KDE requires run time linking.  Make it the default.
11366
	aix_use_runtimelinking=yes
11367
	exp_sym_flag='-bexport'
11368
	no_entry_flag='-bnoentry'
11369
      fi
11370
 
11371
      # When large executables or shared objects are built, AIX ld can
11372
      # have problems creating the table of contents.  If linking a library
11373
      # or program results in "error TOC overflow" add -mminimal-toc to
11374
      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
11375
      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
11376
 
11377
      _LT_AC_TAGVAR(archive_cmds, $1)=''
11378
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11379
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
11380
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11381
 
11382
      if test "$GCC" = yes; then
11383
	case $host_os in aix4.[012]|aix4.[012].*)
11384
	# We only want to do this on AIX 4.2 and lower, the check
11385
	# below for broken collect2 doesn't work under 4.3+
11386
	  collect2name=`${CC} -print-prog-name=collect2`
11387
	  if test -f "$collect2name" && \
11388
  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
11389
	  then
11390
  	  # We have reworked collect2
11391
  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11392
	  else
11393
  	  # We have old collect2
11394
  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
11395
  	  # It fails to find uninstalled libraries when the uninstalled
11396
  	  # path is not listed in the libpath.  Setting hardcode_minus_L
11397
  	  # to unsupported forces relinking
11398
  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11399
  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11400
  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
11401
	  fi
11402
	esac
11403
	shared_flag='-shared'
11404
      else
11405
	# not using gcc
11406
	if test "$host_cpu" = ia64; then
11407
  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
11408
  	# chokes on -Wl,-G. The following line is correct:
11409
	  shared_flag='-G'
11410
	else
11411
  	if test "$aix_use_runtimelinking" = yes; then
11412
	    shared_flag='-qmkshrobj ${wl}-G'
11413
	  else
11414
	    shared_flag='-qmkshrobj'
11415
  	fi
11416
	fi
11417
      fi
11418
 
11419
      # Let the compiler handle the export list.
11420
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
11421
      if test "$aix_use_runtimelinking" = yes; then
11422
	# Warning - without using the other runtime loading flags (-brtl),
11423
	# -berok will link without error, but may produce a broken library.
11424
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
11425
       # Determine the default libpath from the value encoded in an empty executable.
11426
	_LT_AC_SYS_LIBPATH_AIX
11427
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11428
	_LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
11429
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
11430
       else
11431
	if test "$host_cpu" = ia64; then
11432
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
11433
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
11434
	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
11435
	else
11436
	 # Determine the default libpath from the value encoded in an empty executable.
11437
	 _LT_AC_SYS_LIBPATH_AIX
11438
	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11439
	  # Warning - without using the other run time loading flags,
11440
	  # -berok will link without error, but may produce a broken library.
11441
	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
11442
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
11443
	  # -bexpall does not export symbols beginning with underscore (_)
11444
	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
11445
	  # Exported symbols can be pulled into shared objects from archives
11446
	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
11447
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11448
	  # This is similar to how AIX traditionally builds it's shared libraries.
11449
	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
11450
	fi
11451
      fi
11452
      ;;
11453
 
11454
    amigaos*)
11455
      _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)'
11456
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11457
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11458
      # see comment about different semantics on the GNU ld section
11459
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
11460
      ;;
11461
 
11462
    bsdi4*)
11463
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
11464
      ;;
11465
 
11466
    cygwin* | mingw* | pw32*)
11467
      # When not using gcc, we currently assume that we are using
11468
      # Microsoft Visual C++.
11469
      # hardcode_libdir_flag_spec is actually meaningless, as there is
11470
      # no search path for DLLs.
11471
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
11472
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
11473
      # Tell ltmain to make .lib files, not .a files.
11474
      libext=lib
11475
      # Tell ltmain to make .dll files, not .so files.
11476
      shrext=".dll"
11477
      # FIXME: Setting linknames here is a bad hack.
11478
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
11479
      # The linker will automatically build a .lib file if we build a DLL.
11480
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
11481
      # FIXME: Should let the user specify the lib program.
11482
      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
11483
      fix_srcfile_path='`cygpath -w "$srcfile"`'
11484
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
11485
      ;;
11486
 
11487
    darwin* | rhapsody*)
11488
    if test "$GXX" = yes ; then
11489
      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
11490
      case "$host_os" in
11491
      rhapsody* | darwin1.[[012]])
11492
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
11493
	;;
11494
      *) # Darwin 1.3 on
11495
	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
11496
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11497
	else
11498
	  case ${MACOSX_DEPLOYMENT_TARGET} in
11499
	    10.[012])
11500
	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11501
	      ;;
11502
	    10.*)
11503
	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
11504
	      ;;
11505
	  esac
11506
	fi
11507
	;;
11508
      esac
11509
    	lt_int_apple_cc_single_mod=no
11510
    	output_verbose_link_cmd='echo'
11511
    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
11512
    	  lt_int_apple_cc_single_mod=yes
11513
    	fi
11514
    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11515
    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
11516
    	else
11517
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
11518
      fi
11519
      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
11520
      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
11521
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11522
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11523
        else
11524
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11525
        fi
11526
          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11527
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
11528
      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
11529
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11530
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
11531
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11532
    else  
11533
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
11534
    fi  
11535
      ;;
11536
 
11537
    dgux*)
11538
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11539
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11540
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11541
      ;;
11542
 
11543
    freebsd1*)
11544
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
11545
      ;;
11546
 
11547
    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
11548
    # support.  Future versions do this automatically, but an explicit c++rt0.o
11549
    # does not break anything, and helps significantly (at the cost of a little
11550
    # extra space).
11551
    freebsd2.2*)
11552
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
11553
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11554
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11555
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11556
      ;;
11557
 
11558
    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
11559
    freebsd2*)
11560
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11561
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11562
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11563
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11564
      ;;
11565
 
11566
    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
11567
    freebsd* | kfreebsd*-gnu)
11568
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
11569
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11570
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11571
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11572
      ;;
11573
 
11574
    hpux9*)
11575
      if test "$GCC" = yes; then
11576
	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
11577
      else
11578
	_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'
11579
      fi
11580
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11581
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11582
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11583
 
11584
      # hardcode_minus_L: Not really in the search PATH,
11585
      # but as the default location of the library.
11586
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11587
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11588
      ;;
11589
 
11590
    hpux10* | hpux11*)
11591
      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
11592
	case "$host_cpu" in
11593
	hppa*64*|ia64*)
11594
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11595
	  ;;
11596
	*)
11597
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
11598
	  ;;
11599
	esac
11600
      else
11601
	case "$host_cpu" in
11602
	hppa*64*|ia64*)
11603
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
11604
	  ;;
11605
	*)
11606
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
11607
	  ;;
11608
	esac
11609
      fi
11610
      if test "$with_gnu_ld" = no; then
11611
	case "$host_cpu" in
11612
	hppa*64*)
11613
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11614
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
11615
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11616
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
11617
	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11618
	  ;;
11619
	ia64*)
11620
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11621
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
11622
	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11623
 
11624
	  # hardcode_minus_L: Not really in the search PATH,
11625
	  # but as the default location of the library.
11626
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11627
	  ;;
11628
	*)
11629
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11630
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11631
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11632
	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11633
 
11634
	  # hardcode_minus_L: Not really in the search PATH,
11635
	  # but as the default location of the library.
11636
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11637
	  ;;
11638
	esac
11639
      fi
11640
      ;;
11641
 
11642
    irix5* | irix6* | nonstopux*)
11643
      if test "$GCC" = yes; then
11644
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11645
      else
11646
	_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'
11647
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
11648
      fi
11649
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11650
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11651
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11652
      ;;
11653
 
11654
    netbsd*)
11655
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
11656
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
11657
      else
11658
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
11659
      fi
11660
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11661
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11662
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11663
      ;;
11664
 
11665
    newsos6)
11666
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11667
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11668
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11669
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11670
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11671
      ;;
11672
 
11673
    openbsd*)
11674
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11675
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11676
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11677
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11678
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11679
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11680
      else
11681
       case $host_os in
11682
	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
11683
	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11684
	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11685
	   ;;
11686
	 *)
11687
	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11688
	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11689
	   ;;
11690
       esac
11691
      fi
11692
      ;;
11693
 
11694
    os2*)
11695
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11696
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11697
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11698
      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
11699
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
11700
      ;;
11701
 
11702
    osf3*)
11703
      if test "$GCC" = yes; then
11704
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11705
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11706
      else
11707
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11708
	_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'
11709
      fi
11710
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11711
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11712
      ;;
11713
 
11714
    osf4* | osf5*)	# as osf3* with the addition of -msym flag
11715
      if test "$GCC" = yes; then
11716
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11717
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11718
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11719
      else
11720
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11721
	_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'
11722
	_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~
11723
	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
11724
 
11725
	# Both c and cxx compiler support -rpath directly
11726
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11727
      fi
11728
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11729
      ;;
11730
 
11731
    sco3.2v5*)
11732
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11733
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11734
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
11735
      runpath_var=LD_RUN_PATH
11736
      hardcode_runpath_var=yes
11737
      ;;
11738
 
11739
    solaris*)
11740
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11741
      if test "$GCC" = yes; then
11742
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11743
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11744
	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
11745
      else
11746
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11747
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11748
  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11749
      fi
11750
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11751
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11752
      case $host_os in
11753
      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11754
      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
11755
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
11756
      esac
11757
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11758
      ;;
11759
 
11760
    sunos4*)
11761
      if test "x$host_vendor" = xsequent; then
11762
	# Use $CC to link under sequent, because it throws in some extra .o
11763
	# files that make .init and .fini sections work.
11764
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
11765
      else
11766
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
11767
      fi
11768
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11769
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11770
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11771
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11772
      ;;
11773
 
11774
    sysv4)
11775
      case $host_vendor in
11776
	sni)
11777
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11778
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
11779
	;;
11780
	siemens)
11781
	  ## LD is ld it makes a PLAMLIB
11782
	  ## CC just makes a GrossModule.
11783
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11784
	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
11785
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
11786
        ;;
11787
	motorola)
11788
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11789
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
11790
	;;
11791
      esac
11792
      runpath_var='LD_RUN_PATH'
11793
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11794
      ;;
11795
 
11796
    sysv4.3*)
11797
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11798
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11799
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
11800
      ;;
11801
 
11802
    sysv4*MP*)
11803
      if test -d /usr/nec; then
11804
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11805
	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11806
	runpath_var=LD_RUN_PATH
11807
	hardcode_runpath_var=yes
11808
	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
11809
      fi
11810
      ;;
11811
 
11812
    sysv4.2uw2*)
11813
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11814
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11815
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
11816
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11817
      hardcode_runpath_var=yes
11818
      runpath_var=LD_RUN_PATH
11819
      ;;
11820
 
11821
   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
11822
      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
11823
      if test "$GCC" = yes; then
11824
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11825
      else
11826
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11827
      fi
11828
      runpath_var='LD_RUN_PATH'
11829
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11830
      ;;
11831
 
11832
    sysv5*)
11833
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11834
      # $CC -shared without GNU ld will not create a library from C++
11835
      # object files and a static libstdc++, better avoid it by now
11836
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11837
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11838
  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11839
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
11840
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11841
      runpath_var='LD_RUN_PATH'
11842
      ;;
11843
 
11844
    uts4*)
11845
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11846
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11847
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11848
      ;;
11849
 
11850
    *)
11851
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
11852
      ;;
11853
    esac
11854
  fi
11855
])
11856
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
11857
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
11858
 
11859
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11860
if test "$GCC" = yes; then
11861
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11862
fi
11863
 
11864
#
11865
# Do we need to explicitly link libc?
11866
#
11867
case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
11868
x|xyes)
11869
  # Assume -lc should be added
11870
  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11871
 
11872
  if test "$enable_shared" = yes && test "$GCC" = yes; then
11873
    case $_LT_AC_TAGVAR(archive_cmds, $1) in
11874
    *'~'*)
11875
      # FIXME: we may have to deal with multi-command sequences.
11876
      ;;
11877
    '$CC '*)
11878
      # Test whether the compiler implicitly links with -lc since on some
11879
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
11880
      # to ld, don't add -lc before -lgcc.
11881
      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
11882
      $rm conftest*
11883
      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
11884
 
11885
      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
11886
        soname=conftest
11887
        lib=conftest
11888
        libobjs=conftest.$ac_objext
11889
        deplibs=
11890
        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
11891
        compiler_flags=-v
11892
        linker_flags=-v
11893
        verstring=
11894
        output_objdir=.
11895
        libname=conftest
11896
        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
11897
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
11898
        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
11899
        then
11900
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
11901
        else
11902
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11903
        fi
11904
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
11905
      else
11906
        cat conftest.err 1>&5
11907
      fi
11908
      $rm conftest*
11909
      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
11910
      ;;
11911
    esac
11912
  fi
11913
  ;;
11914
esac
11915
])# AC_LIBTOOL_PROG_LD_SHLIBS
11916
 
11917
 
11918
# _LT_AC_FILE_LTDLL_C
11919
# -------------------
11920
# Be careful that the start marker always follows a newline.
11921
AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
11922
# /* ltdll.c starts here */
11923
# #define WIN32_LEAN_AND_MEAN
11924
# #include <windows.h>
11925
# #undef WIN32_LEAN_AND_MEAN
11926
# #include <stdio.h>
11927
#
11928
# #ifndef __CYGWIN__
11929
# #  ifdef __CYGWIN32__
11930
# #    define __CYGWIN__ __CYGWIN32__
11931
# #  endif
11932
# #endif
11933
#
11934
# #ifdef __cplusplus
11935
# extern "C" {
11936
# #endif
11937
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
11938
# #ifdef __cplusplus
11939
# }
11940
# #endif
11941
#
11942
# #ifdef __CYGWIN__
11943
# #include <cygwin/cygwin_dll.h>
11944
# DECLARE_CYGWIN_DLL( DllMain );
11945
# #endif
11946
# HINSTANCE __hDllInstance_base;
11947
#
11948
# BOOL APIENTRY
11949
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
11950
# {
11951
#   __hDllInstance_base = hInst;
11952
#   return TRUE;
11953
# }
11954
# /* ltdll.c ends here */
11955
])# _LT_AC_FILE_LTDLL_C
11956
 
11957
 
11958
# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
11959
# ---------------------------------
11960
AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
11961
 
11962
 
11963
# old names
11964
AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
11965
AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
11966
AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
11967
AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11968
AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
11969
AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
11970
AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
11971
 
11972
# This is just to silence aclocal about the macro not being used
11973
ifelse([AC_DISABLE_FAST_INSTALL])
11974
 
11975
AC_DEFUN([LT_AC_PROG_GCJ],
11976
[AC_CHECK_TOOL(GCJ, gcj, no)
11977
  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
11978
  AC_SUBST(GCJFLAGS)
11979
])
11980
 
11981
AC_DEFUN([LT_AC_PROG_RC],
11982
[AC_CHECK_TOOL(RC, windres, no)
11983
])
11984
 
11985
############################################################
11986
# NOTE: This macro has been submitted for inclusion into   #
11987
#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11988
#  a released version of Autoconf we should remove this    #
11989
#  macro and use it instead.                               #
11990
############################################################
11991
# LT_AC_PROG_SED
11992
# --------------
11993
# Check for a fully-functional sed program, that truncates
11994
# as few characters as possible.  Prefer GNU sed if found.
11995
AC_DEFUN([LT_AC_PROG_SED],
11996
[AC_MSG_CHECKING([for a sed that does not truncate output])
11997
AC_CACHE_VAL(lt_cv_path_SED,
11998
[# Loop through the user's path and test for sed and gsed.
11999
# Then use that list of sed's as ones to test for truncation.
12000
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12001
for as_dir in $PATH
12002
do
12003
  IFS=$as_save_IFS
12004
  test -z "$as_dir" && as_dir=.
12005
  for lt_ac_prog in sed gsed; do
12006
    for ac_exec_ext in '' $ac_executable_extensions; do
12007
      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
12008
        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
12009
      fi
12010
    done
12011
  done
12012
done
12013
lt_ac_max=0
12014
lt_ac_count=0
12015
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
12016
# along with /bin/sed that truncates output.
12017
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
12018
  test ! -f $lt_ac_sed && break
12019
  cat /dev/null > conftest.in
12020
  lt_ac_count=0
12021
  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
12022
  # Check for GNU sed and select it if it is found.
12023
  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
12024
    lt_cv_path_SED=$lt_ac_sed
12025
    break
12026
  fi
12027
  while true; do
12028
    cat conftest.in conftest.in >conftest.tmp
12029
    mv conftest.tmp conftest.in
12030
    cp conftest.in conftest.nl
12031
    echo >>conftest.nl
12032
    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
12033
    cmp -s conftest.out conftest.nl || break
12034
    # 10000 chars as input seems more than enough
12035
    test $lt_ac_count -gt 10 && break
12036
    lt_ac_count=`expr $lt_ac_count + 1`
12037
    if test $lt_ac_count -gt $lt_ac_max; then
12038
      lt_ac_max=$lt_ac_count
12039
      lt_cv_path_SED=$lt_ac_sed
12040
    fi
12041
  done
12042
done
12043
])
12044
SED=$lt_cv_path_SED
12045
AC_MSG_RESULT([$SED])
12046
])