The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
18054 hornik 1
### R.m4 -- extra macros for configuring R		-*- Autoconf -*-
14199 hornik 2
###
27343 hornik 3
### Copyright (C) 1998-2003 R Core Team
14199 hornik 4
###
5
### This file is part of R.
6
###
7
### R is free software; you can redistribute it and/or modify it under
8
### the terms of the GNU General Public License as published by the Free
9
### Software Foundation; either version 2 of the License, or (at your
10
### option) any later version.
11
###
12
### R is distributed in the hope that it will be useful, but WITHOUT ANY
13
### WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
### FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
### License for more details.
16
###
17
### You should have received a copy of the GNU General Public License
18
### along with R; if not, you can obtain it via the World Wide Web at
19
### `http://www.gnu.org/copyleft/gpl.html', or by writing to the Free
20
### Software Foundation, 59 Temple Place -- Suite 330, Boston, MA
21
### 02111-3307, USA.
22
 
18428 hornik 23
### * General support macros
24
 
14199 hornik 25
## R_ARG_USE
17898 hornik 26
## ---------
14199 hornik 27
AC_DEFUN([R_ARG_USE],
17898 hornik 28
[if test "${withval}" = no; then
18752 hornik 29
  use_$1=no
17898 hornik 30
else
18752 hornik 31
  use_$1=yes
17898 hornik 32
fi
33
])# R_ARG_USE
34
 
21702 hornik 35
## R_SH_VAR_ADD(VARIABLE, VALUE, [SEPARATOR = " "])
36
## ---------------------------------------------------
37
## Set sh variable VARIABLE to VALUE if empty (or undefined), or append
38
## VALUE to the value of VARIABLE, separated by SEPARATOR.
39
## Currently, safe only if all arguments are literals.
40
## Useful mostly when we do not know whether VARIABLE is empty or not.
41
## Should maybe also have a fourth argument to control whether adding
42
## happens by appending (default) or prepending ...
43
AC_DEFUN([R_SH_VAR_ADD],
44
[separator="$3"
45
test -z "${separator}" && separator=" "
46
if test -z "${[$1]}"; then
47
  $1="$2"
48
else
49
  $1="${[$1]}${separator}$2"
50
fi])# R_SH_VAR_ADD
51
 
18428 hornik 52
### * Programs
53
 
14199 hornik 54
## R_PROG_AR
17898 hornik 55
## ---------
14199 hornik 56
AC_DEFUN([R_PROG_AR],
17898 hornik 57
[AC_CHECK_PROGS(AR, [${AR} ar])
58
: ${ARFLAGS="rc"}
59
AC_SUBST(ARFLAGS)
60
])# R_PROG_AR
61
 
18254 hornik 62
## R_PROG_INSTALL
63
## --------------
64
## Find a good install program.
65
## We like to provide INSTALL in the top-level Makeconf.
66
## Hence, if AC_PROG_INSTALL ends up with the 'tools/install-sh' script,
67
## we need to ensure a relative path (i.e., in case we build in srcdir)
68
## gets prefixed by top_srcdir.  (This would not be necessary if we had
69
## '@INSTALL@' in each Makefile.in, but we prefer to share ...)
70
AC_DEFUN([R_PROG_INSTALL],
71
[AC_REQUIRE([AC_PROG_INSTALL])
72
case "${INSTALL}" in
73
  [[\\/]]* | ?:[[\\/]]* ) # absolute
74
    ;;
75
  *)
76
    INSTALL="\$\(top_srcdir\)/tools/install-sh -c"
77
    ;;
78
esac
22270 ripley 79
case "${host_os}" in
80
  hpux*)
81
    ## On some versions of HP-UX (seen on both 10.20 and 11.0) we end up
82
    ## a broken install (seen in /opt/imake/bin) which has the default
83
    ## permissions wrong (PR#2091).  Let's just always use install-sh on
84
    ## HP-UX.
85
    INSTALL="\$\(top_srcdir\)/tools/install-sh -c"
86
    ;;
87
esac
18254 hornik 88
])# R_PROG_INSTALL
89
 
15168 pd 90
## R_PROG_PAGER
17898 hornik 91
## ------------
92
AC_DEFUN([R_PROG_PAGER],
93
[AC_PATH_PROGS(PAGER, [${PAGER} less more page pg], false)
94
if test "${PAGER}" = false; then
95
  warn_pager="I could not determine a pager"
18054 hornik 96
  AC_MSG_WARN([${warn_pager}])
17898 hornik 97
fi
98
])# R_PROG_PAGER
99
 
14199 hornik 100
## R_PROG_PERL
17898 hornik 101
## -----------
14199 hornik 102
AC_DEFUN([R_PROG_PERL],
17898 hornik 103
[AC_PATH_PROGS(PERL, [${PERL} perl])
104
if test -n "${PERL}"; then
105
  _R_PROG_PERL_VERSION
106
else
18298 hornik 107
  ## <NOTE>
108
  ## Need a full path for '@PERL@' substitutions when starting Perl
109
  ## scripts with a line of the form '#! FOO'.
17898 hornik 110
  AC_PATH_PROGS(FALSE, false)
111
  PERL="${FALSE}"
18298 hornik 112
  ## </NOTE>
17898 hornik 113
fi
114
if test "${r_cv_prog_perl_v5}" = yes; then
115
  NO_PERL5=false
116
else
117
  warn_perl5="you cannot build the object documentation system"
18054 hornik 118
  AC_MSG_WARN([${warn_perl5}])
17898 hornik 119
  NO_PERL5=true
120
fi
121
AC_SUBST(NO_PERL5)
122
])# R_PROG_PERL
123
 
124
## _R_PROG_PERL_VERSION
125
## --------------------
18298 hornik 126
## Building the R documentation system (Rdconv and friends) requires
22426 hornik 127
## Perl version 5.004 or better.
18298 hornik 128
## Set shell variable r_cv_prog_perl_v5 to 'yes' if a recent enough
129
## Perl is found, and to 'no' otherwise.
17898 hornik 130
AC_DEFUN([_R_PROG_PERL_VERSION],
22426 hornik 131
[AC_CACHE_CHECK([whether perl version is at least 5.004],
18298 hornik 132
                [r_cv_prog_perl_v5],
22426 hornik 133
[if ${PERL} -e 'require 5.004 or exit 1'; then
17898 hornik 134
  r_cv_prog_perl_v5=yes
135
else
136
  r_cv_prog_perl_v5=no
137
fi])
138
])# _R_PROG_PERL_VERSION
139
 
14199 hornik 140
## R_PROG_TEXMF
17898 hornik 141
## ------------
14199 hornik 142
AC_DEFUN([R_PROG_TEXMF],
17898 hornik 143
[AC_REQUIRE([R_PROG_PERL])
144
AC_PATH_PROGS(DVIPS, [${DVIPS} dvips], false)
145
AC_PATH_PROGS(TEX, [${TEX} tex], false)
146
AC_PATH_PROGS(LATEX, [${LATEX} latex], false)
20516 hornik 147
if test -z "${ac_cv_path_TEX}" ; then
17898 hornik 148
  warn_dvi="you cannot build DVI versions of the R manuals"
20516 hornik 149
elif test -z "${ac_cv_path_LATEX}"; then
150
  warn_dvi="you cannot build DVI versions of all the help pages"
151
fi
152
if test -n "${warn_dvi}"; then
18054 hornik 153
  AC_MSG_WARN([${warn_dvi}])
17898 hornik 154
fi
155
AC_PATH_PROGS(MAKEINDEX, [${MAKEINDEX} makeindex], false)
156
AC_PATH_PROGS(PDFTEX, [${PDFTEX} pdftex], false)
157
AC_PATH_PROGS(PDFLATEX, [${PDFLATEX} pdflatex], false)
20516 hornik 158
if test -z "${ac_cv_path_PDFTEX}" ; then
17898 hornik 159
  warn_pdf="you cannot build PDF versions of the R manuals"
20516 hornik 160
elif test -z "${ac_cv_path_PDFLATEX}" ; then
161
  warn_pdf="you cannot build PDF versions of all the help pages"
162
fi
163
if test -n "${warn_pdf}"; then
18054 hornik 164
  AC_MSG_WARN([${warn_pdf}])
17898 hornik 165
fi
166
AC_PATH_PROGS(MAKEINFO_CMD, [${MAKEINFO} makeinfo])
18298 hornik 167
## This test admittedly looks a bit strange ... see R_PROG_PERL.
17898 hornik 168
if test "${PERL}" = "${FALSE}"; then
169
  AC_PATH_PROGS(INSTALL_INFO, [${INSTALL_INFO} install-info], false)
170
else
171
  INSTALL_INFO="\$(PERL) \$(top_srcdir)/tools/install-info.pl"
172
  AC_SUBST(INSTALL_INFO)
173
fi
174
: ${R_RD4DVI="ae"}
175
AC_SUBST(R_RD4DVI)
176
: ${R_RD4PDF="ae,hyper"}
177
AC_SUBST(R_RD4PDF)
178
])# R_PROG_TEXMF
179
 
16214 hornik 180
## R_PROG_MAKEINFO
17898 hornik 181
## ---------------
16214 hornik 182
AC_DEFUN([R_PROG_MAKEINFO],
183
## This used to be part of R_PROG_TEXMF, where it really belongs.
27343 hornik 184
## Unfortunately, AC_PROG_LIBTOOL unconditionally overwrites MAKEINFO
16214 hornik 185
## by makeinfo or missing.  To allow users to pass a MAKEINFO setting to
27343 hornik 186
## configure, we thus have to run R_PROG_TEXMF before AC_PROG_LIBTOOL,
16214 hornik 187
## save the result to something not overwritten (hence MAKEINFO_CMD),
188
## and finally set MAKEINFO according to our needs.
189
[AC_REQUIRE([R_PROG_TEXMF])
27343 hornik 190
AC_REQUIRE([AC_PROG_LIBTOOL])
17898 hornik 191
if test -n "${MAKEINFO_CMD}"; then
192
  _R_PROG_MAKEINFO_VERSION
193
fi
194
if test "${r_cv_prog_makeinfo_v4}" != yes; then
195
  warn_info="you cannot build info versions of the R manuals"
18054 hornik 196
  AC_MSG_WARN([${warn_info}])
17898 hornik 197
  MAKEINFO=false
198
else
199
  MAKEINFO="${MAKEINFO_CMD}"
200
fi
201
])# R_PROG_MAKEINFO
202
 
203
## _R_PROG_MAKEINFO_VERSION
204
## ------------------------
18298 hornik 205
## Building the R Texinfo manuals requires Makeinfo v4 or better.
206
## Set shell variable r_cv_prog_makeinfo_v4 to 'yes' if a recent
207
## enough Makeinfo is found, and to 'no' otherwise.
17898 hornik 208
AC_DEFUN([_R_PROG_MAKEINFO_VERSION],
209
[AC_CACHE_CHECK([whether makeinfo version is at least 4],
18298 hornik 210
                [r_cv_prog_makeinfo_v4],
17898 hornik 211
[makeinfo_version=`${MAKEINFO_CMD} --version | \
212
  grep "^makeinfo" | sed 's/[[^)]]*) \(.\).*/\1/'`
213
if test -z "${makeinfo_version}"; then
214
  r_cv_prog_makeinfo_v4=no
215
elif test ${makeinfo_version} -lt 4; then
216
  r_cv_prog_makeinfo_v4=no
217
else
218
  r_cv_prog_makeinfo_v4=yes
219
fi])
220
])# _R_PROG_MAKEINFO_VERSION
221
 
20638 hornik 222
## R_PROG_BROWSER
223
## --------------
224
AC_DEFUN([R_PROG_BROWSER],
22313 ripley 225
[if test -z "${R_BROWSER}"; then
226
  AC_PATH_PROGS(R_BROWSER, [netscape mozilla galeon kfmclient opera gnome-moz-remote open])
227
fi
20709 hornik 228
if test -z "${R_BROWSER}"; then
229
  warn_browser="I could not determine a browser"
230
  AC_MSG_WARN([${warn_browser}])
22313 ripley 231
else
232
  AC_MSG_RESULT([using default browser ... ${R_BROWSER}])
20709 hornik 233
fi
20638 hornik 234
AC_SUBST(R_BROWSER)
235
])# R_BROWSER
236
 
22326 hornik 237
## R_PROG_PDFVIEWER
238
## ----------------
239
## Try to determine a PDF viewer.
240
## According to Jeff Gentry <jgentry@jimmy.harvard.edu>, 'acroread4' is
241
## the FreeBSD acroread port.
242
AC_DEFUN([R_PROG_PDFVIEWER],
243
[AC_PATH_PROGS(R_PDFVIEWER,
244
               [${R_PDFVIEWER} acroread acroread4 xpdf gv gnome-gv kghostview open])
245
if test -z "${R_PDFVIEWER}"; then
246
  warn_pdfviewer="I could not determine a PDF viewer"
247
  AC_MSG_WARN([${warn_pdfviewer}])
248
fi
249
AC_SUBST(R_PDFVIEWER)
250
])# R_PDFVIEWER
251
 
18428 hornik 252
### * C compiler and its characteristics.
253
 
21603 ripley 254
## R_PROG_CPP_CPPFLAGS
255
## -------------------
256
## In case of gcc, check whether the C preprocessor complains about
257
## having '/usr/local/include' in its header search path (no matter how
258
## it came there).  GCC 3.1 and 3.2 (at least) give warnings about
259
## 'changing search order for system directory "/usr/local/include" as
260
## it has already been specified as a non-system directory' which are at
261
## least quite annoying.
262
## <NOTE>
263
## We currently do not distinguish whether '/usr/local/include' was
264
## added as the R default, or by an explicit CPPFLAGS arg to configure.
265
## If we wanted to, we should change
266
##     : ${CPPFLAGS="-I/usr/local/include"}
267
## in 'configure.ac' by something like
21702 hornik 268
##     : ${CPPFLAGS=${r_default_CPPFLAGS="-I/usr/local/include"}}
269
## and test whether r_default_CPPFLAGS is non-empty.
21603 ripley 270
## </NOTE>
271
AC_DEFUN([R_PROG_CPP_CPPFLAGS],
272
[AC_REQUIRE([AC_PROG_CC])
273
AC_REQUIRE([AC_PROG_CPP])
274
if test "${GCC}" = yes; then
275
  AC_LANG_PUSH(C)
276
  AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
277
  if ${CPP} ${CPPFLAGS} conftest.${ac_ext} 2>&1 1>/dev/null | \
278
      grep 'warning:.*system directory.*/usr/local/include' >/dev/null; then
279
    CPPFLAGS=`echo ${CPPFLAGS} | \
280
      sed 's|\(.*\)-I/usr/local/include *\(.*\)|\1\2|'`
281
  fi
282
  rm -f conftest.${ac_ext}
283
  AC_LANG_POP(C)
284
fi])# R_PROG_CPP_CPPFLAGS
285
 
14199 hornik 286
## R_PROG_CC_M
17898 hornik 287
## -----------
22850 hornik 288
## Check whether we can figure out C Make dependencies.
14199 hornik 289
AC_DEFUN([R_PROG_CC_M],
22850 hornik 290
[AC_MSG_CHECKING([whether we can compute C Make dependencies])
291
AC_CACHE_VAL([r_cv_prog_cc_m],
17898 hornik 292
[echo "#include <math.h>" > conftest.c
22850 hornik 293
## No real point in using AC_LANG_* and ${ac_ext}, as we need to create
294
## hard-wired suffix rules.
295
## Another obvious candidate to try is '${MAKEDEPEND-makedepend} -f-'.
296
## However, this does not work out of the box when srcdir and builddir
297
## are different, as it creates dependencies of the form
298
##   ${srcdir}/foo.o: /path/to/bar.h
299
## Could be made to work, of course ...
300
## Note also that it does not create a 'conftest.o: conftest.c' line.
22943 hornik 301
## For gcc 3.2 or better, we want to use '-MM' in case this works.
302
cc_minus_MM=false
303
if test "${GCC}" = yes; then
304
  gcc_version=`${CC} -v 2>&1 | grep "^.*g.. version" | \
305
    sed -e 's/^.*g.. version *//'`
306
  case "${gcc_version}" in
307
    1.*|2.*|3.[[01]]*) ;;
308
    *) cc_minus_MM="${CC} -MM" ;;
309
  esac
310
fi
311
for prog in "${cc_minus_MM}" "${CC} -M" "${CPP} -M" "cpp -M"; do
22850 hornik 312
  if ${prog} conftest.c 2>/dev/null | \
313
      grep 'conftest.o: conftest.c' >/dev/null; then
314
    r_cv_prog_cc_m="${prog}"
315
    break
316
  fi
317
done])
318
if test -z "${r_cv_prog_cc_m}"; then
319
  AC_MSG_RESULT([no])
17898 hornik 320
else
22850 hornik 321
  AC_MSG_RESULT([yes, using ${r_cv_prog_cc_m}])
322
fi
17898 hornik 323
])# R_PROG_CC_M
324
 
14199 hornik 325
## R_PROG_CC_C_O_LO
17898 hornik 326
## ----------------
20516 hornik 327
## Check whether the C compiler supports '-c -o FILE.lo'.
14199 hornik 328
AC_DEFUN([R_PROG_CC_C_O_LO],
18190 hornik 329
[AC_CACHE_CHECK([whether ${CC} supports -c -o FILE.lo],
18298 hornik 330
                [r_cv_prog_cc_c_o_lo],
18054 hornik 331
[test -d TMP || mkdir TMP
332
echo "int some_variable = 0;" > conftest.c
333
## No real point in using AC_LANG_* and ${ac_ext}, as we need to create
334
## hard-wired suffix rules. 
335
ac_try='${CC} ${CFLAGS} -c conftest.c -o TMP/conftest.lo 1>&AS_MESSAGE_LOG_FD'
336
if AC_TRY_EVAL(ac_try) \
337
    && test -f TMP/conftest.lo \
338
    && AC_TRY_EVAL(ac_try); then
339
  r_cv_prog_cc_c_o_lo=yes
340
else
341
  r_cv_prog_cc_c_o_lo=no
342
fi
18190 hornik 343
rm -rf conftest* TMP])
344
])# R_PROG_CC_C_O_LO
345
 
346
## R_PROG_CC_MAKEFRAG
347
## ------------------
18298 hornik 348
## Generate a Make fragment with suffix rules for the C compiler.
349
## Used for both building R (Makeconf) and add-ons (etc/Makeconf).
24449 ripley 350
## NB test -d .libs || mkdir .libs can be run more than once
351
##    and hence race when a parallel make is used
18190 hornik 352
AC_DEFUN([R_PROG_CC_MAKEFRAG],
21702 hornik 353
[r_cc_rules_frag=Makefrag.cc
18190 hornik 354
AC_REQUIRE([R_PROG_CC_M])
355
AC_REQUIRE([R_PROG_CC_C_O_LO])
21702 hornik 356
cat << \EOF > ${r_cc_rules_frag}
18190 hornik 357
.c.o:
358
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $[@]
359
EOF
22850 hornik 360
if test -n "${r_cv_prog_cc_m}"; then
361
  cat << EOF >> ${r_cc_rules_frag}
18190 hornik 362
.c.d:
22850 hornik 363
	@echo "making \$[@] from \$<"
364
	@${r_cv_prog_cc_m} \$(ALL_CPPFLAGS) $< | \\
365
	  sed -e 's/^\([[^:]]*\)\.o\([[ 	]]\)*:/\1.o \1.lo\2:/' > \$[@]
18190 hornik 366
EOF
367
else
21702 hornik 368
  cat << \EOF >> ${r_cc_rules_frag}
18190 hornik 369
.c.d:
370
	@echo > $[@]
371
EOF
372
fi
18054 hornik 373
if test "${r_cv_prog_cc_c_o_lo}" = yes; then
21702 hornik 374
  cat << \EOF >> ${r_cc_rules_frag}
14199 hornik 375
.c.lo:
376
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $< -o $[@]
377
EOF
18054 hornik 378
else
21702 hornik 379
  cat << \EOF >> ${r_cc_rules_frag}
14199 hornik 380
.c.lo:
24449 ripley 381
	@-test -d .libs || mkdir .libs
14199 hornik 382
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $< -o .libs/$[*].o
383
	mv .libs/$[*].o $[*].lo
384
EOF
18054 hornik 385
fi
21702 hornik 386
AC_SUBST_FILE(r_cc_rules_frag)
18190 hornik 387
])# R_PROG_CC_MAKEFRAG
17898 hornik 388
 
18298 hornik 389
## R_PROG_CC_FLAG(FLAG, [ACTION-IF-TRUE])
390
## ---------------------------------------
391
## Check whether the C compiler handles command line option FLAG,
392
## and set shell variable r_cv_prog_cc_flag_SFLAG accordingly (where
393
## SFLAG is a shell-safe transliteration of FLAG).
394
## In addition, execute ACTION-IF-TRUE in case of success.
14199 hornik 395
AC_DEFUN([R_PROG_CC_FLAG],
21702 hornik 396
[ac_safe=AS_TR_SH($1)
20516 hornik 397
AC_MSG_CHECKING([whether ${CC} accepts $1])
18298 hornik 398
AC_CACHE_VAL([r_cv_prog_cc_flag_${ac_safe}],
17898 hornik 399
[AC_LANG_PUSH(C)
18190 hornik 400
r_save_CFLAGS="${CFLAGS}"
17898 hornik 401
CFLAGS="${CFLAGS} $1"
22444 hornik 402
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
403
               [eval "r_cv_prog_cc_flag_${ac_safe}=yes"],
404
               [eval "r_cv_prog_cc_flag_${ac_safe}=no"])
18190 hornik 405
CFLAGS="${r_save_CFLAGS}"
17898 hornik 406
AC_LANG_POP(C)
407
])
408
if eval "test \"`echo '$r_cv_prog_cc_flag_'$ac_safe`\" = yes"; then
18054 hornik 409
  AC_MSG_RESULT([yes])
17898 hornik 410
  [$2]
411
else
18054 hornik 412
  AC_MSG_RESULT([no])
17898 hornik 413
fi
414
])# R_PROG_CC_FLAG
415
 
18190 hornik 416
## R_PROG_CC_FLAG_D__NO_MATH_INLINES
417
## ---------------------------
418
## In current glibc, inline version [x86] of exp is broken.
419
## We fix this by adding '-D__NO_MATH_INLINES' to R_XTRA_CFLAGS rather
420
## than AC_DEFINE(__NO_MATH_INLINES) as the former also takes care of
421
## compiling C code for add-on packages.
422
AC_DEFUN([R_PROG_CC_FLAG_D__NO_MATH_INLINES],
423
[AC_EGREP_CPP([yes],
424
[#include <math.h>
425
#if defined(__GLIBC__)
426
  yes
427
#endif
428
],
21702 hornik 429
              [R_SH_VAR_ADD(R_XTRA_CFLAGS, [-D__NO_MATH_INLINES])])
18190 hornik 430
])# R_PROG_CC_FLAG_D__NO_MATH_INLINES
431
 
18428 hornik 432
## R_C_OPTIEEE
433
## -----------
24001 hornik 434
## Check whether the C compiler needs '-OPT:IEEE_NaN_inf=ON' to
18428 hornik 435
## correctly deal with IEEE NaN/Inf.
436
## This flag is needed for the native SGI C compiler.
437
## If needed, add the flag to R_XTRA_CFLAGS.
438
AC_DEFUN([R_C_OPTIEEE],
439
[AC_CACHE_CHECK([whether C compiler needs -OPT:IEEE_NaN_inf=ON],
440
                [r_cv_c_optieee],
22444 hornik 441
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
442
#include <math.h>
18428 hornik 443
#include <ieeefp.h>
444
int main () {
445
  double x = 0;
446
  fpsetmask(0); x = x / x; exit (x != x);
22444 hornik 447
}
448
]])],
449
              [r_cv_c_optieee=yes],
450
              [r_cv_c_optieee=no],
451
              [r_cv_c_optieee=no])])
18428 hornik 452
if test "${r_cv_c_optieee}" = yes; then
21702 hornik 453
  R_SH_VAR_ADD(R_XTRA_CFLAGS, [-OPT:IEEE_NaN_inf=ON])
18428 hornik 454
fi
455
])# R_C_OPTIEEE
456
 
457
### * C++ compiler and its characteristics.
458
 
15232 hornik 459
## R_PROG_CXX_M
17898 hornik 460
## ------------
20516 hornik 461
## Check whether the C++ compiler accepts '-M' for generating
462
## dependencies.
15232 hornik 463
AC_DEFUN([R_PROG_CXX_M],
18054 hornik 464
[AC_REQUIRE([R_PROG_CC_M])
465
AC_CACHE_CHECK([whether ${CXX} accepts -M for generating dependencies],
18298 hornik 466
               [r_cv_prog_cxx_m],
18054 hornik 467
[echo "#include <math.h>" > conftest.cc
468
## No real point in using AC_LANG_* and ${ac_ext}, as we need to create
469
## hard-wired suffix rules.  We could be a bit more careful as we
470
## actually only test suffix '.cc'. 
471
if test -n "`${CXX} -M conftest.cc 2>/dev/null | grep conftest`"; then
472
  r_cv_prog_cxx_m=yes
473
else
474
  r_cv_prog_cxx_m=no
18190 hornik 475
fi])
17898 hornik 476
])# R_PROG_CXX_M
477
 
15232 hornik 478
## R_PROG_CXX_C_O_LO
17898 hornik 479
## -----------------
20516 hornik 480
## Check whether the C++ compiler supports '-c -o FILE.lo'.
15232 hornik 481
AC_DEFUN([R_PROG_CXX_C_O_LO],
18054 hornik 482
[cxx_o_lo_rules_frag=Makefrag.cxx
483
AC_CACHE_CHECK([whether ${CXX} supports -c -o FILE.lo],
18298 hornik 484
               [r_cv_prog_cxx_c_o_lo],
18054 hornik 485
[test -d TMP || mkdir TMP
486
echo "int some_variable = 0;" > conftest.cc
487
## No real point in using AC_LANG_* and ${ac_ext}, as we need to create
488
## hard-wired suffix rules.  We could be a bit more careful as we
489
## actually only test suffix '.cc'.
490
ac_try='${CXX} ${CXXFLAGS} -c conftest.cc -o TMP/conftest.lo 1>&AS_MESSAGE_LOG_FD'
491
if AC_TRY_EVAL(ac_try) \
492
    && test -f TMP/conftest.lo \
493
    && AC_TRY_EVAL(ac_try); then
494
  r_cv_prog_cxx_c_o_lo=yes
495
else
496
  r_cv_prog_cxx_c_o_lo=no
497
fi
18190 hornik 498
rm -rf conftest* TMP])
499
])# R_PROG_CXX_C_O_LO
500
 
501
## R_PROG_CXX_MAKEFRAG
18298 hornik 502
## -------------------
503
## Generate a Make fragment with suffix rules for the C++ compiler.
504
## Used for both building R (Makeconf) and add-ons (etc/Makeconf).
18190 hornik 505
AC_DEFUN([R_PROG_CXX_MAKEFRAG],
21702 hornik 506
[r_cxx_rules_frag=Makefrag.cxx
18190 hornik 507
AC_REQUIRE([R_PROG_CXX_M])
508
AC_REQUIRE([R_PROG_CXX_C_O_LO])
21702 hornik 509
cat << \EOF > ${r_cxx_rules_frag}
18190 hornik 510
.cc.o:
511
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@]
512
.cpp.o:
513
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@]
514
.C.o:
515
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@]
516
EOF
517
if test "${r_cv_prog_cxx_m}" = yes; then
21702 hornik 518
  cat << \EOF >> ${r_cxx_rules_frag}
18190 hornik 519
.cc.d:
520
	@echo "making $[@] from $<"
521
	@$(CXX) -M $(ALL_CPPFLAGS) $< | \
522
	  sed -e 's/^\([[^:]]*\)\.o\([[ 	]]\)*:/\1.o \1.lo\2:/' > $[@]
523
.cpp.d:
524
	@echo "making $[@] from $<"
525
	@$(CXX) -M $(ALL_CPPFLAGS) $< | \
526
	  sed -e 's/^\([[^:]]*\)\.o\([[ 	]]\)*:/\1.o \1.lo\2:/' > $[@]
527
.C.d:
528
	@echo "making $[@] from $<"
529
	@$(CXX) -M $(ALL_CPPFLAGS) $< | \
530
	  sed -e 's/^\([[^:]]*\)\.o\([[ 	]]\)*:/\1.o \1.lo\2:/' > $[@]
531
EOF
532
else
21702 hornik 533
  cat << \EOF >> ${r_cxx_rules_frag}
18190 hornik 534
.cc.d:
535
	@echo > $[@]
536
.cpp.d:
537
	@echo > $[@]
538
.C.d:
539
	@echo > $[@]
540
EOF
541
fi
18054 hornik 542
if test "${r_cv_prog_cxx_c_o_lo}" = yes; then
21702 hornik 543
  cat << \EOF >> ${r_cxx_rules_frag}
15232 hornik 544
.cc.lo:
545
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o $[@]
546
.cpp.lo:
547
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o $[@]
548
.C.lo:
549
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o $[@]
550
EOF
18054 hornik 551
else
21702 hornik 552
  cat << \EOF >> ${r_cxx_rules_frag}
15232 hornik 553
.cc.lo:
554
	@test -d .libs || mkdir .libs
555
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o .libs/$[*].o
556
	mv .libs/$[*].o $[*].lo
557
.cpp.lo:
558
	@test -d .libs || mkdir .libs
559
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o .libs/$[*].o
560
	mv .libs/$[*].o $[*].lo
561
.C.lo:
562
	@test -d .libs || mkdir .libs
563
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS_LO) -c $< -o .libs/$[*].o
564
	mv .libs/$[*].o $[*].lo
565
EOF
18054 hornik 566
fi
21702 hornik 567
AC_SUBST_FILE(r_cxx_rules_frag)
18190 hornik 568
])# R_PROG_CXX_MAKEFRAG
17898 hornik 569
 
14199 hornik 570
## R_PROG_CXX_FLAG
17898 hornik 571
## ---------------
18298 hornik 572
## Check whether the C++ compiler handles command line option FLAG,
573
## and set shell variable r_cv_prog_cc_flag_SFLAG accordingly (where
574
## SFLAG is a shell-safe transliteration of FLAG).
575
## In addition, execute ACTION-IF-TRUE in case of success.
14199 hornik 576
AC_DEFUN([R_PROG_CXX_FLAG],
21702 hornik 577
[ac_safe=AS_TR_SH($1)
17898 hornik 578
AC_MSG_CHECKING([whether ${CXX-c++} accepts $1])
18298 hornik 579
AC_CACHE_VAL([r_cv_prog_cxx_flag_${ac_safe}],
17898 hornik 580
[AC_LANG_PUSH(C++)
18190 hornik 581
r_save_CXXFLAGS="${CXXFLAGS}"
17898 hornik 582
CXXFLAGS="${CXXFLAGS} $1"
22444 hornik 583
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
584
               [eval "r_cv_prog_cxx_flag_${ac_safe}=yes"],
585
               [eval "r_cv_prog_cxx_flag_${ac_safe}=no"])
18190 hornik 586
CXXFLAGS="${r_save_CXXFLAGS}"
17898 hornik 587
AC_LANG_POP(C++)
588
])
589
if eval "test \"`echo '$r_cv_prog_cxx_flag_'$ac_safe`\" = yes"; then
18054 hornik 590
  AC_MSG_RESULT([yes])
17898 hornik 591
  [$2]
592
else
18054 hornik 593
  AC_MSG_RESULT([no])
17898 hornik 594
fi
595
])# R_PROG_CXX_FLAG
596
 
20516 hornik 597
### * Fortran 77 compiler/converter and its characteristics.
18428 hornik 598
 
14199 hornik 599
## R_PROG_F77_OR_F2C
17898 hornik 600
## -----------------
14199 hornik 601
## Find a Fortran 77 compiler, or f2c.
602
##
20516 hornik 603
## If we have not been forced to use a particular Fortran compiler, try
14199 hornik 604
## to find one using one of the several common names.  The list is based
16990 hornik 605
## on what the current autoconf CVS contains.  This says,
606
##
607
## <Quote>
608
## Compilers are ordered by
14199 hornik 609
##  1. F77, F90, F95
610
##  2. Good/tested native compilers, bad/untested native compilers
611
##  3. Wrappers around f2c go last.
612
##
18832 hornik 613
## 'fort77' and fc' are wrappers around 'f2c', 'fort77' being better.
614
## It is believed that under HP-UX 'fort77' is the name of the native
14199 hornik 615
## compiler.  On some Cray systems, fort77 is a native compiler.
21630 hornik 616
## frt is the Fujitsu F77 compiler.
14199 hornik 617
## pgf77 and pgf90 are the Portland Group F77 and F90 compilers.
618
## xlf/xlf90/xlf95 are IBM (AIX) F77/F90/F95 compilers.
619
## lf95 is the Lahey-Fujitsu compiler.
620
## fl32 is the Microsoft Fortran "PowerStation" compiler.
621
## af77 is the Apogee F77 compiler for Intergraph hardware running CLIX.
622
## epcf90 is the "Edinburgh Portable Compiler" F90.
21630 hornik 623
## fort is the Compaq Fortran 90 (now 95) compiler for Tru64 and
624
## Linux/Alpha.
16990 hornik 625
## </Quote>
14199 hornik 626
##
16990 hornik 627
## In fact, on HP-UX fort77 is the POSIX-compatible native compiler and
628
## f77 is not: hence we need look for fort77 first!
17898 hornik 629
AC_DEFUN([R_PROG_F77_OR_F2C],
27343 hornik 630
[AC_BEFORE([$0], [AC_PROG_LIBTOOL])
631
if test -n "${F77}" && test -n "${F2C}"; then
19127 hornik 632
  warn_F77_and_F2C="both 'F77' and 'F2C' given.
20516 hornik 633
Using the given Fortran 77 compiler ..."
19127 hornik 634
  AC_MSG_WARN([${warn_F77_and_F2C}])
635
  F2C=
636
fi
18950 hornik 637
if test -n "${F77}"; then
14199 hornik 638
  AC_MSG_RESULT([defining F77 to be ${F77}])
19127 hornik 639
elif test -z "${F2C}"; then
14199 hornik 640
  F77=
17311 hornik 641
  case "${host_os}" in
642
    hpux*)
21630 hornik 643
      AC_CHECK_PROGS(F77, [g77 fort77 f77 xlf frt pgf77 fl32 af77 f90 \
644
                           xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc])
16990 hornik 645
      ;;
646
    *)
21630 hornik 647
      AC_CHECK_PROGS(F77, [g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 \
648
                           xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc])
16990 hornik 649
      ;;
650
  esac
14199 hornik 651
  if test -z "${F77}"; then
652
    AC_CHECK_PROG(F2C, f2c, f2c, [])
653
  fi
19127 hornik 654
else
655
  AC_MSG_RESULT([defining F2C to be ${F2C}])
14199 hornik 656
fi
18190 hornik 657
if test -n "${F77}"; then
20516 hornik 658
  ## If the above 'found' a Fortran 77 compiler, we run AC_PROG_F77 as
18298 hornik 659
  ## this does additional testing (GNU, '-g', ...).
18190 hornik 660
  AC_PROG_F77
661
elif test -z "${F2C}"; then
662
  AC_MSG_ERROR([Neither an F77 compiler nor f2c found])
663
fi
17898 hornik 664
])# R_PROG_F77_OR_F2C
665
 
18054 hornik 666
## R_PROG_F77_FLIBS
667
## ----------------
668
## Run AC_F77_LIBRARY_LDFLAGS, and fix some known problems with FLIBS.
669
AC_DEFUN([R_PROG_F77_FLIBS],
21726 hornik 670
[AC_BEFORE([$0], [AC_F77_LIBRARY_LDFLAGS])
671
## Currently (Autoconf 2.50 or better, it seems) FLIBS also contains all
672
## elements of LIBS when AC_F77_LIBRARY_LDFLAGS is run.  This is because
673
## _AC_PROG_F77_V_OUTPUT() uses 'eval $ac_link' for obtaining verbose
674
## linker output, and AC_LANG(Fortran 77) sets up ac_link to contain
675
## LIBS.  Most likely a bug, and a nuisance in any case ... 
676
## But we cannot simply eliminate the elements in FLIBS duplicated from
677
## LIBS (e.g. '-lm' should be preserved).  Hence, we try to call
678
## AC_F77_LIBRARY_LDFLAGS() with LIBS temporarily set to empty.
679
r_save_LIBS="${LIBS}"
680
LIBS=
681
AC_F77_LIBRARY_LDFLAGS
682
LIBS="${r_save_LIBS}"
21459 pd 683
## Currently g77 on Darwin links against '-lcrt1.o' (and for GCC 3.1 or
684
## better also against '-lcrtbegin.o'), which (unlike '-lcrt0.o') are
685
## not stripped by AC_F77_LIBRARY_LDFLAGS.  This in particular causes
686
## R_PROG_F77_CC_COMPAT to fail.  Hence, we make sure all -lcrt*.o are
687
## removed.
26438 hornik 688
##
18774 hornik 689
## Native f90 on HPUX 11 comes up with '-l:libF90.a' causing trouble
690
## when using gcc for linking.  The '-l:' construction is similar to
691
## plain '-l' except that search order (archive/shared) given by '-a'
18950 hornik 692
## is not important.  We escape such flags via '-Wl,' in case of gcc.
18832 hornik 693
## Note that the current Autoconf CVS uses _AC_LINKER_OPTION for a
694
## similar purpose when computing FLIBS: this uses '-Xlinker' escapes
18950 hornik 695
## for gcc and does nothing otherwise.  Note also that we cannot simply
696
## unconditionally escape with '${wl}' from libtool as on HPUX we need
697
## SHLIB_LD=ld for native C compilers (problem with non-PIC 'crt0.o',
698
## see 'Individual platform overrides' in section 'DLL stuff' in file
699
## 'configure.ac'.
26438 hornik 700
##
701
## Using the Intel Fortran compiler (ifc) one typically gets incorrect
702
## flags, as the output from _AC_PROG_F77_V_OUTPUT() contains double
703
## quoted options, e.g. "-mGLOB_options_string=......", see also e.g.
704
## http://www.octave.org/octave-lists/archive/octave-maintainers.2002/msg00038.html.
705
## One possible solution is to change AC_F77_LIBRARY_LDFLAGS() to remove
706
## double quotes for ifc, as it already does for the Cray cft90.  As we
707
## prefer not to overload Autoconf code, we try to fix things here ...
18054 hornik 708
flibs=
18950 hornik 709
if test "${GCC}" = yes; then
710
  linker_option="-Wl,"
711
else
712
  linker_option=
713
fi
18054 hornik 714
for arg in ${FLIBS}; do
715
  case "${arg}" in
21459 pd 716
    -lcrt*.o)
18054 hornik 717
      ;;
26453 hornik 718
    -[[a-zA-Z]]/*\" | -[[a-zA-Z]]*\\) # ifc
26438 hornik 719
      ;;
18774 hornik 720
    -l:*)
18950 hornik 721
      flibs="${flibs} ${linker_option}${arg}"
18774 hornik 722
      ;;
18054 hornik 723
    *)
724
      flibs="${flibs} ${arg}"
725
      ;;
726
  esac
727
done
728
FLIBS="${flibs}"
729
## Versions of g77 up to 3.0.x only have a non-PIC (static) -lg2c which
730
## on some platforms means one cannot build dynamically loadable modules
20516 hornik 731
## containing Fortran code.  (g77 3.1 will have a shared -lg2c too.)  As
18054 hornik 732
## a workaround, Debian provides -lg2c-pic which holds pic objects only,
733
## and we should use in case we can find it ...
734
if test "${G77}" = yes; then
18060 hornik 735
  r_save_LIBS="${LIBS}"
21459 pd 736
  flibs=`echo "${FLIBS}" | sed 's/-lg2c/-lg2c-pic/'`
24220 hornik 737
  LIBS="${flibs} ${LIBS}"
18060 hornik 738
  AC_LANG_PUSH(C)
22444 hornik 739
  AC_LINK_IFELSE([AC_LANG_PROGRAM()], [FLIBS="${flibs}"], [])
18060 hornik 740
  AC_LANG_POP(C)
741
  LIBS="${r_save_LIBS}"
18054 hornik 742
fi
743
])# R_PROG_F77_FLIBS
744
 
17898 hornik 745
## R_PROG_F77_APPEND_UNDERSCORE
746
## ----------------------------
18190 hornik 747
## See if the Fortran 77 compiler appends underscores.
748
## What we really should do is determine how to properly mangle the 
749
## names of C/C++ identifiers (potentially containing underscores) so
750
## that they match the name-mangling scheme used by the Fortran 77
751
## compiler.  Autoconf 2.50 or better has macros F77_FUNC(name, NAME)
752
## and F77_FUNC_(name, NAME) for this.  However, the F77_* macros in
753
## the R API have one argument only and therefore cannot deal with 
754
## Fortran 77 compilers which convert to upper case or add an extra
755
## underscore for identifiers containing underscores.  We give an error
20516 hornik 756
## in the former case; as ISO Fortran 77 does not allow underscores in
18200 hornik 757
## function names, we do nothing about the latter.
14199 hornik 758
AC_DEFUN([R_PROG_F77_APPEND_UNDERSCORE],
18190 hornik 759
[AC_REQUIRE([AC_F77_WRAPPERS])
760
## DANGER!  We really needs the results of _AC_F77_NAME_MANGLING as
761
## stored in the cache var ac_cv_f77_mangling which is not documented
762
## and hence may change ...
18298 hornik 763
case "${ac_cv_f77_mangling}" in
18190 hornik 764
  "upper "*)
20516 hornik 765
    AC_MSG_WARN([Fortran compiler uses uppercase external names])
766
    AC_MSG_ERROR([cannot use Fortran])
18190 hornik 767
    ;;
768
esac
21956 hornik 769
AC_MSG_CHECKING([whether ${F77} appends underscores to external names])
18298 hornik 770
AC_CACHE_VAL([r_cv_prog_f77_append_underscore],
771
[case "${ac_cv_f77_mangling}" in
18190 hornik 772
  *", underscore, "*)
773
    r_cv_prog_f77_append_underscore=yes
774
    ;;
775
  *", no underscore, "*)
18054 hornik 776
    r_cv_prog_f77_append_underscore=no
18190 hornik 777
    ;;
778
esac])
21956 hornik 779
if test -n "${r_cv_prog_f77_append_underscore}"; then
780
  AC_MSG_RESULT([${r_cv_prog_f77_append_underscore}])
781
else
782
  AC_MSG_RESULT([unknown])
20516 hornik 783
  AC_MSG_ERROR([cannot use Fortran])
18054 hornik 784
fi
785
if test "${r_cv_prog_f77_append_underscore}" = yes; then
786
  AC_DEFINE(HAVE_F77_UNDERSCORE, 1,
787
            [Define if your Fortran compiler appends an underscore to
788
             external names.])
789
fi
17898 hornik 790
])# R_PROG_F77_APPEND_UNDERSCORE
791
 
21949 ripley 792
## R_PROG_F77_CAN_RUN
793
## --------------------
794
## Check whether the C/Fortran set up produces runnable code, as
795
## a preliminary to the compatibility tests.
796
## May fail if Fortran shared libraries are not in the library path.
797
AC_DEFUN([R_PROG_F77_CAN_RUN],
798
[AC_REQUIRE([AC_CHECK_LIBM])
799
AC_MSG_CHECKING([whether mixed C/Fortran code can be run])
800
AC_CACHE_VAL([r_cv_prog_f77_can_run],
801
[cat > conftestf.f <<EOF
802
      subroutine cftest(a, b, x, y)
803
      integer a(3), b(2)
804
      double precision x(3), y(3)
805
      end
806
EOF
807
${F77} ${FFLAGS} -c conftestf.f 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
808
## Yes we need to double quote this ...
809
[cat > conftest.c <<EOF
810
#include <math.h>
811
#include "confdefs.h"
812
#ifdef HAVE_F77_UNDERSCORE
813
# define F77_SYMBOL(x)   x ## _
814
#else
815
# define F77_SYMBOL(x)   x
816
#endif
817
int main () {
818
  exit(0);
819
}
820
EOF]
821
if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
822
  ## <NOTE>
823
  ## This should really use MAIN_LD, and hence come after this is
824
  ## determined (and necessary additions to MAIN_LDFLAGS were made).
825
  ## But it seems that we currently can always use the C compiler.
826
  ## Also, to be defensive there should be a similar test with SHLIB_LD
827
  ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to
828
  ## use ld for SHLIB_LD) ...
829
  if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \
830
       conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \
831
       ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
832
  ## </NOTE>
833
  then
834
    output=`./conftest${ac_exeext} 2>&1`
835
    if test ${?} = 0; then
836
      r_cv_prog_f77_can_run=yes
837
    fi
838
  fi
839
fi
840
])
841
rm -rf conftest conftest.* conftestf.* core
842
if test -n "${r_cv_prog_f77_can_run}"; then
843
  AC_MSG_RESULT([yes])
844
else
845
  AC_MSG_WARN([cannot run mixed C/Fortan code])
846
  AC_MSG_ERROR([Maybe check LDFLAGS for paths to Fortran libraries?])
847
fi
848
])# R_PROG_F77_CAN_RUN
849
 
17898 hornik 850
## R_PROG_F77_CC_COMPAT
851
## --------------------
20516 hornik 852
## Check whether the Fortran 77 and C compilers agree on int and double.
14199 hornik 853
AC_DEFUN([R_PROG_F77_CC_COMPAT],
18054 hornik 854
[AC_REQUIRE([AC_CHECK_LIBM])
20516 hornik 855
AC_MSG_CHECKING([whether ${F77} and ${CC} agree on int and double])
18298 hornik 856
AC_CACHE_VAL([r_cv_prog_f77_cc_compat],
18054 hornik 857
[cat > conftestf.f <<EOF
14199 hornik 858
      subroutine cftest(a, b, x, y)
859
      integer a(3), b(2)
860
      double precision x(3), y(3)
861
 
862
      b(1) = a(3)/a(2)
863
      b(2) = a(3) - a(1)*a(2)
864
      y(1) = dble(a(3))/x(2)
865
      y(2) = x(3)*x(1)
866
      y(3) = (x(2)/x(1)) ** a(1)
867
      end
868
EOF
18054 hornik 869
${F77} ${FFLAGS} -c conftestf.f 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
20516 hornik 870
## Yes we need to double quote this ...
18054 hornik 871
[cat > conftest.c <<EOF
14199 hornik 872
#include <math.h>
873
#include "confdefs.h"
874
#ifdef HAVE_F77_UNDERSCORE
875
# define F77_SYMBOL(x)   x ## _
876
#else
877
# define F77_SYMBOL(x)   x
878
#endif
879
 
880
extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y);
881
 
882
int main () {
883
  int a[3] = {17, 237, 2000000000}, b[2], res = 0;
884
  double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3];
885
  double eps = 1e-6;
886
  double zres[3];
887
  int i, bres[2];
888
 
889
  zres[0] = (double) a[2]/x[1];
890
  zres[1] = x[2]*x[0];
891
  zres[2] = pow(x[1]/x[0], 17.0);
892
  bres[0] = a[2]/a[1];
893
  bres[1] = a[2] - a[0]*a[1];
894
  F77_SYMBOL(cftest)(a, b, x, z);
895
  if(b[0] != bres[0]) res++;
896
  if(b[1] != bres[1]) res++;
897
  for(i = 0; i < 3; i++)
898
    if(fabs(z[i]/zres[i] - 1) > eps) res++;
899
  printf("number of errors %d\n", res);
18190 hornik 900
  exit(res);
14199 hornik 901
}
15232 hornik 902
EOF]
20516 hornik 903
if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
904
  ## <NOTE>
18054 hornik 905
  ## This should really use MAIN_LD, and hence come after this is
20516 hornik 906
  ## determined (and necessary additions to MAIN_LDFLAGS were made).
907
  ## But it seems that we currently can always use the C compiler.
908
  ## Also, to be defensive there should be a similar test with SHLIB_LD
909
  ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to
910
  ## use ld for SHLIB_LD) ...
911
  if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \
18054 hornik 912
       conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \
913
       ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
20516 hornik 914
  ## </NOTE>
18054 hornik 915
  then
916
    output=`./conftest${ac_exeext} 2>&1`
917
    if test ${?} = 0; then
918
      r_cv_prog_f77_cc_compat=yes
919
    fi
14199 hornik 920
  fi
18054 hornik 921
fi
922
])
923
rm -rf conftest conftest.* conftestf.* core
924
if test -n "${r_cv_prog_f77_cc_compat}"; then
925
  AC_MSG_RESULT([yes])
926
else
20516 hornik 927
  AC_MSG_WARN([${F77} and ${CC} disagree on int and double])
18054 hornik 928
  AC_MSG_ERROR([Maybe change CFLAGS or FFLAGS?])
929
fi
17898 hornik 930
])# R_PROG_F77_CC_COMPAT
931
 
932
## R_PROG_F77_CC_COMPAT_COMPLEX
933
## ----------------------------
20516 hornik 934
## Check whether the Fortran 77 and C compilers agree on double complex.
14206 ripley 935
AC_DEFUN([R_PROG_F77_CC_COMPAT_COMPLEX],
18054 hornik 936
[AC_REQUIRE([AC_CHECK_LIBM])
20516 hornik 937
AC_MSG_CHECKING([whether ${F77} and ${CC} agree on double complex])
18298 hornik 938
AC_CACHE_VAL([r_cv_prog_f77_cc_compat_complex],
18054 hornik 939
[cat > conftestf.f <<EOF
14206 ripley 940
      subroutine cftest(x)
941
      complex*16 x(3)
14287 ripley 942
      integer i
14206 ripley 943
 
944
c a few tests of constructs that are sometimes missing
945
      if(x(1) .eq. x(1)) i = 0
946
      x(1) = x(1)*x(2) + x(3)
947
      end
948
EOF
18054 hornik 949
${F77} ${FFLAGS} -c conftestf.f 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
20516 hornik 950
## Yes we need to double quote this ...
18054 hornik 951
[cat > conftest.c <<EOF
14206 ripley 952
#include <math.h>
953
#include "confdefs.h"
954
#ifdef HAVE_F77_UNDERSCORE
955
# define F77_SYMBOL(x)   x ## _
956
#else
957
# define F77_SYMBOL(x)   x
958
#endif
959
 
960
typedef struct {
961
        double r;
962
        double i;
963
} Rcomplex;
964
 
965
extern void F77_SYMBOL(cftest)(Rcomplex *x);
966
 
967
int main () {
968
    Rcomplex z[3];
969
 
970
    z[0].r = 3.14159265;
971
    z[0].i = 2.172;
972
    z[1].i = 3.14159265;
973
    z[1].r = 2.172;
974
    z[2].r = 123.456;
975
    z[2].i = 0.123456;
976
    F77_SYMBOL(cftest)(z);
977
    printf("%f %f\n", z[0].r, z[0].i);
978
    if(fabs(z[0].r - 123.456) < 1e-4 && fabs(z[0].i - 14.71065) < 1e-4)
18190 hornik 979
	exit(0);
980
    else exit(1);
14206 ripley 981
}
15232 hornik 982
EOF]
20516 hornik 983
if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
984
  ## <NOTE>
18054 hornik 985
  ## This should really use MAIN_LD, and hence come after this is
20516 hornik 986
  ## determined (and necessary additions to MAIN_LDFLAGS were made).
987
  ## But it seems that we currently can always use the C compiler.
988
  ## Also, to be defensive there should be a similar test with SHLIB_LD
989
  ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to
990
  ## use ld for SHLIB_LD) ...
991
  if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \
18054 hornik 992
       conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \
993
       ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
20516 hornik 994
  ## </NOTE>
18054 hornik 995
  then
996
    output=`./conftest${ac_exeext} 2>&1`
997
    if test ${?} = 0; then
18190 hornik 998
      r_cv_prog_f77_cc_compat_complex=yes
18054 hornik 999
    fi
14206 ripley 1000
  fi
18054 hornik 1001
fi
1002
])
1003
rm -rf conftest conftest.* conftestf.* core
18190 hornik 1004
if test -n "${r_cv_prog_f77_cc_compat_complex}"; then
18054 hornik 1005
  AC_MSG_RESULT([yes])
1006
  AC_DEFINE(HAVE_DOUBLE_COMPLEX, 1,
1007
            [Define if C's Rcomplex and Fortran's COMPLEX*16 can be
1008
             interchanged, and can do arithmetic on the latter.])
1009
else
20516 hornik 1010
  warn_f77_cc_double_complex="${F77} and ${CC} disagree on double complex"
1011
  AC_MSG_WARN([${warn_f77_cc_double_complex}])
18054 hornik 1012
fi
1013
AC_SUBST(HAVE_DOUBLE_COMPLEX)
17898 hornik 1014
])# R_PROG_F77_CC_COMPAT_COMPLEX
1015
 
1016
## R_PROG_F77_C_O_LO
1017
## -----------------
20516 hornik 1018
## Check whether the Fortran compiler supports '-c -o FILE.lo'.
14199 hornik 1019
AC_DEFUN([R_PROG_F77_C_O_LO],
1020
[AC_CACHE_CHECK([whether ${F77} supports -c -o FILE.lo],
18298 hornik 1021
                [r_cv_prog_f77_c_o_lo],
18054 hornik 1022
[test -d TMP || mkdir TMP
1023
cat > conftest.f <<EOF
14199 hornik 1024
      program conftest
1025
      end
1026
EOF
18054 hornik 1027
ac_try='${F77} ${FFLAGS} -c conftest.f -o TMP/conftest.lo 1>&AS_MESSAGE_LOG_FD'
1028
if AC_TRY_EVAL(ac_try) \
1029
    && test -f TMP/conftest.lo \
1030
    && AC_TRY_EVAL(ac_try); then
1031
  r_cv_prog_f77_c_o_lo=yes
1032
else
1033
  r_cv_prog_f77_c_o_lo=no
1034
fi
18190 hornik 1035
rm -rf conftest* TMP])
17898 hornik 1036
])# R_PROG_F77_C_O_LO
1037
 
18054 hornik 1038
## R_PROG_F77_MAKEFRAG
1039
## -------------------
20516 hornik 1040
## Generate a Make fragment with suffix rules for Fortran 77 source
1041
## files when using a Fortran 77 compiler.
18298 hornik 1042
## Used for both building R (Makeconf) and add-ons (etc/Makeconf).
18054 hornik 1043
AC_DEFUN([R_PROG_F77_MAKEFRAG],
1044
[AC_REQUIRE([R_PROG_F77_C_O_LO])
21702 hornik 1045
r_f77_rules_frag=Makefrag.f77
1046
cat << \EOF > ${r_f77_rules_frag}
18054 hornik 1047
.f.c:
1048
.f.o:
18887 hornik 1049
	$(F77) $(ALL_FFLAGS) -c $< -o $[@]
18054 hornik 1050
EOF
1051
if test "${r_cv_prog_f77_c_o_lo}" = yes; then
21702 hornik 1052
  cat << \EOF >> ${r_f77_rules_frag}
18054 hornik 1053
.f.lo:
18887 hornik 1054
	$(F77) $(ALL_FFLAGS_LO) -c $< -o $[@]
18054 hornik 1055
EOF
1056
else
21702 hornik 1057
  cat << \EOF >> ${r_f77_rules_frag}
18054 hornik 1058
.f.lo:
1059
	@test -d .libs || mkdir .libs
18887 hornik 1060
	$(F77) $(ALL_FFLAGS_LO) -c $< -o .libs/$[*].o
18054 hornik 1061
	mv .libs/$[*].o $[*].lo
1062
EOF
1063
fi
21702 hornik 1064
AC_SUBST_FILE(r_f77_rules_frag)
18054 hornik 1065
])# R_PROG_F77_MAKEFRAG
1066
 
19070 hornik 1067
## R_PROG_F77_FLAG(FLAG, [ACTION-IF-TRUE])
1068
## ---------------------------------------
20516 hornik 1069
## Check whether the Fortran 77 compiler handles command line option
19070 hornik 1070
## FLAG, and set shell variable r_cv_prog_f77_flag_SFLAG accordingly
1071
## (where SFLAG is a shell-safe transliteration of FLAG).
1072
## In addition, execute ACTION-IF-TRUE in case of success.
1073
AC_DEFUN([R_PROG_F77_FLAG],
21702 hornik 1074
[ac_safe=AS_TR_SH($1)
20516 hornik 1075
AC_MSG_CHECKING([whether ${F77} accepts $1])
19070 hornik 1076
AC_CACHE_VAL([r_cv_prog_f77_flag_${ac_safe}],
1077
[AC_LANG_PUSH(Fortran 77)
1078
r_save_FFLAGS="${FFLAGS}"
1079
FFLAGS="${FFLAGS} $1"
22444 hornik 1080
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
19127 hornik 1081
               [eval "r_cv_prog_f77_flag_${ac_safe}=yes"],
1082
               [eval "r_cv_prog_f77_flag_${ac_safe}=no"])
19070 hornik 1083
FFLAGS="${r_save_FFLAGS}"
1084
AC_LANG_POP(Fortran 77)
1085
])
1086
if eval "test \"`echo '$r_cv_prog_f77_flag_'$ac_safe`\" = yes"; then
1087
  AC_MSG_RESULT([yes])
1088
  [$2]
1089
else
1090
  AC_MSG_RESULT([no])
1091
fi
1092
])# R_PROG_F77_FLAG
1093
 
14199 hornik 1094
## R_PROG_F2C_FLIBS
17898 hornik 1095
## ----------------
14199 hornik 1096
AC_DEFUN([R_PROG_F2C_FLIBS],
18054 hornik 1097
[AC_REQUIRE([AC_PROG_RANLIB])
1098
AC_REQUIRE([AC_CHECK_LIBM])
18298 hornik 1099
AC_CACHE_VAL([r_cv_f2c_flibs],
1100
[
1101
## <FIXME>
1102
## Why do we need this?  What about AC_F77_DUMMY_MAIN?
1103
## This seems to be necessary on some Linux system. -- you bet! -pd
18054 hornik 1104
AC_LANG_PUSH(C)
1105
cat > conftest.${ac_ext} << EOF
18190 hornik 1106
int MAIN_ () { exit(0); }
1107
int MAIN__ () { exit(0); }
14199 hornik 1108
EOF
18054 hornik 1109
if AC_TRY_EVAL(ac_compile); then
1110
  ${AR} ${ARFLAGS} libconftest.a conftest.${ac_objext} 1>&AS_MESSAGE_LOG_FD
22503 hornik 1111
  ${RANLIB} libconftest.a 1>&AS_MESSAGE_LOG_FD
18054 hornik 1112
fi
1113
AC_LANG_POP(C)
18298 hornik 1114
## </FIXME>
1115
AC_CHECK_LIB(f2c, f_open, 
1116
             [flibs=-lf2c],
1117
             [flibs=],
1118
             [-L. -lconftest ${LIBM}])
18054 hornik 1119
rm -f libconftest*
1120
if test -z "${flibs}"; then
18298 hornik 1121
  AC_CHECK_LIB(F77, d_sin, [flibs=-lF77], [flibs=], [${LIBM}])
18054 hornik 1122
  if test -n "${flibs}"; then
18298 hornik 1123
    AC_CHECK_LIB(I77, f_rew, [flibs="${flibs} -lI77"], [flibs=], [-lF77])
18054 hornik 1124
  fi
1125
fi
1126
r_cv_f2c_flibs="${flibs}"])
1127
FLIBS="${r_cv_f2c_flibs}"
1128
if test -z "${FLIBS}"; then
1129
  warn_f2c_flibs="I found f2c but not libf2c, or libF77 and libI77"
1130
  AC_MSG_WARN([${warn_f2c_flibs}])
1131
else
1132
  FLIBS="${FLIBS} ${LIBM}"
1133
fi
17898 hornik 1134
])# R_PROG_F2C_FLIBS
1135
 
18054 hornik 1136
## R_PROG_F2C_MAKEFRAG
1137
## -------------------
20516 hornik 1138
## Generate a Make fragment with suffix rules for Fortran 77 source
1139
## files when using f2c, the Fortran-to-C converter.
18298 hornik 1140
## Used for both building R (Makeconf) and add-ons (etc/Makeconf).
18054 hornik 1141
AC_DEFUN([R_PROG_F2C_MAKEFRAG],
1142
[AC_REQUIRE([R_PROG_CC_C_O_LO])
21702 hornik 1143
r_f77_rules_frag=Makefrag.f77
1144
cat << \EOF > ${r_f77_rules_frag}
18054 hornik 1145
.f.o:
1146
	$(F2C) $(F2CFLAGS) < $< > $[*].c
1147
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $[*].c -o $[@]
1148
	@rm -f $[*].c
1149
.f.lo:
1150
	$(F2C) $(F2CFLAGS) < $< > $[*].c
1151
EOF
1152
if test "${r_cv_prog_cc_c_o_lo}" = yes; then
21702 hornik 1153
  cat << \EOF >> ${r_f77_rules_frag}
18054 hornik 1154
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $[*].c -o $[@]
1155
EOF
1156
else
21702 hornik 1157
  cat << \EOF >> ${r_f77_rules_frag}
18054 hornik 1158
	@test -d .libs || mkdir .libs
1159
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $[*].c -o .libs/$[*].o
1160
	mv .libs/$[*].o $[*].lo
1161
EOF
1162
fi
21702 hornik 1163
cat << \EOF >> ${r_f77_rules_frag}
18054 hornik 1164
	@rm -f $[*].c
1165
EOF
21702 hornik 1166
AC_SUBST_FILE(r_f77_rules_frag)
18054 hornik 1167
])# R_PROG_F2C_MAKEFRAG
1168
 
18428 hornik 1169
### * Library functions
1170
 
14199 hornik 1171
## R_FUNC___SETFPUCW
17898 hornik 1172
## -----------------
14199 hornik 1173
AC_DEFUN([R_FUNC___SETFPUCW],
18054 hornik 1174
[AC_CHECK_FUNC(__setfpucw, 
1175
[AC_CACHE_CHECK([whether __setfpucw is needed],
18298 hornik 1176
	        [r_cv_func___setfpucw_needed],
22444 hornik 1177
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1178
int main () {
14199 hornik 1179
#include <fpu_control.h>
1180
#if defined(_FPU_DEFAULT) && defined(_FPU_IEEE)
18190 hornik 1181
  exit(_FPU_DEFAULT != _FPU_IEEE);
14199 hornik 1182
#endif
18190 hornik 1183
  exit(0);
22444 hornik 1184
}
1185
]])],
1186
              [r_cv_func___setfpucw_needed=no],
1187
              [r_cv_func___setfpucw_needed=yes],
1188
              [r_cv_func___setfpucw_needed=no])])
18298 hornik 1189
if test "x${r_cv_func___setfpucw_needed}" = xyes; then
18054 hornik 1190
  AC_DEFINE(NEED___SETFPUCW, 1,
1191
	    [Define if your system needs __setfpucw() to control
1192
             FPU rounding. 
1193
             This was used to control floating point precision,
1194
             rounding and floating point exceptions on older Linux
1195
             systems. 
1196
             As of GLIBC 2.1 this function is not used anymore.])
18298 hornik 1197
fi])
17898 hornik 1198
])# R_FUNC___SETFPUCW
1199
 
14199 hornik 1200
## R_FUNC_CALLOC
17898 hornik 1201
## -------------
14199 hornik 1202
AC_DEFUN([R_FUNC_CALLOC],
18298 hornik 1203
[AC_CACHE_CHECK([for working calloc], [r_cv_func_calloc_works],
22444 hornik 1204
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1205
#include <stdlib.h>
14199 hornik 1206
int main () {
1207
  int *p = calloc(0, sizeof(int));
18190 hornik 1208
  exit(p == 0);
22444 hornik 1209
}
1210
]])],
1211
               [r_cv_func_calloc_works=yes],
1212
               [r_cv_func_calloc_works=no],
1213
               [r_cv_func_calloc_works=no])])
15254 hornik 1214
if test "x${r_cv_func_calloc_works}" = xyes; then
17898 hornik 1215
  AC_DEFINE(HAVE_WORKING_CALLOC, 1,
1216
            [Define if calloc(0) returns a null pointer.])
15254 hornik 1217
fi
17898 hornik 1218
])# R_FUNC_CALLOC
1219
 
14199 hornik 1220
## R_FUNC_FINITE
17898 hornik 1221
## -------------
14199 hornik 1222
AC_DEFUN([R_FUNC_FINITE],
18298 hornik 1223
[AC_CACHE_CHECK([for working finite], [r_cv_func_finite_works],
22444 hornik 1224
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1225
#include <math.h>
14199 hornik 1226
#include "confdefs.h"
1227
int main () {
1228
#ifdef HAVE_FINITE
18190 hornik 1229
  exit(finite(1./0.) | finite(0./0.) | finite(-1./0.));
14199 hornik 1230
#else
18190 hornik 1231
  exit(1);
14199 hornik 1232
#endif
22444 hornik 1233
}
1234
]])],
1235
               [r_cv_func_finite_works=yes],
1236
               [r_cv_func_finite_works=no],
1237
               [r_cv_func_finite_works=no])])
15333 hornik 1238
if test "x${r_cv_func_finite_works}" = xyes; then
17898 hornik 1239
  AC_DEFINE(HAVE_WORKING_FINITE, 1,
1240
            [Define if finite() is correct for -Inf/NaN/Inf.])
15254 hornik 1241
fi
17898 hornik 1242
])# R_FUNC_FINITE
1243
 
14199 hornik 1244
## R_FUNC_LOG
17898 hornik 1245
## ----------
14199 hornik 1246
AC_DEFUN([R_FUNC_LOG],
18298 hornik 1247
[AC_CACHE_CHECK([for working log], [r_cv_func_log_works],
22444 hornik 1248
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1249
#include <math.h>
14199 hornik 1250
#include "confdefs.h"
1251
int main () {
1252
#ifdef HAVE_ISNAN
18190 hornik 1253
  exit(!(log(0.) == -1. / 0. && isnan(log(-1.))));
14199 hornik 1254
#else
18190 hornik 1255
  exit(log(0.) != -1. / 0);
14199 hornik 1256
#endif
22444 hornik 1257
}
1258
]])],
1259
               [r_cv_func_log_works=yes],
1260
               [r_cv_func_log_works=no],
1261
               [r_cv_func_log_works=no])])
15254 hornik 1262
if test "x${r_cv_func_log_works}" = xyes; then
17898 hornik 1263
  AC_DEFINE(HAVE_WORKING_LOG, 1,
1264
            [Define if log() is correct for 0/-1.])
15254 hornik 1265
fi
17898 hornik 1266
])# R_FUNC_LOG
1267
 
25944 hornik 1268
## R_FUNC_LOG1P
1269
## ------------
1270
## Suggested by Nelson H. F. Beebe <beebe@math.utah.edu> to deal with
1271
## inaccuracies on at least NetBSD 1.6 and OpenBSD 3.2.
25950 ripley 1272
## However, don't test all the way into denormalized x (he had k > -1074)
25944 hornik 1273
AC_DEFUN([R_FUNC_LOG1P],
1274
[AC_CACHE_CHECK([for working log1p], [r_cv_func_log1p_works],
1275
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1276
#include <math.h>
1277
#include "confdefs.h"
1278
int main () {
1279
#ifdef HAVE_LOG1P
1280
  int k;
1281
  double d;
1282
  double x;
1283
  /* log(1+x) = x - (1/2)x^2 + (1/3)x^3 - (1/4)x^4 ... */
1284
  /*          = x for x sufficiently small */
25950 ripley 1285
  x = pow(2.0, -53.0);
1286
  for(k = -54; k > -1022; --k) {	
1287
    x /= 2.0;
25944 hornik 1288
    if(x == 0.0)
1289
      exit(0);			/* OK: reached underflow limit */
1290
    d = log1p(x);
1291
    if(d == 0.0)
1292
      exit(1);			/* ERROR: inaccurate log1p() */
1293
    if(d != x)
1294
      exit(1);			/* ERROR: inaccurate log1p() */
1295
  }	
1296
  exit(0);
1297
#else
1298
  exit(1);
1299
#endif
1300
}
1301
]])],
1302
               [r_cv_func_log1p_works=yes],
1303
               [r_cv_func_log1p_works=no],
1304
               [r_cv_func_log1p_works=no])])
1305
if test "x${r_cv_func_log1p_works}" = xyes; then
1306
  AC_DEFINE(HAVE_WORKING_LOG1P, 1,
1307
            [Define if log1p() exists and is accurate enough.])
25952 ripley 1308
  RMATH_HAVE_WORKING_LOG1P="# define HAVE_WORKING_LOG1P 1"
1309
else
1310
  RMATH_HAVE_WORKING_LOG1P="# undef HAVE_WORKING_LOG1P"
25944 hornik 1311
fi
25952 ripley 1312
AC_SUBST(RMATH_HAVE_WORKING_LOG1P)
25944 hornik 1313
])# R_FUNC_LOG1P
1314
 
15168 pd 1315
## R_FUNC_STRPTIME
17898 hornik 1316
## ---------------
15168 pd 1317
AC_DEFUN([R_FUNC_STRPTIME],
18298 hornik 1318
[AC_CACHE_CHECK([for working strptime], [r_cv_func_strptime_works],
22444 hornik 1319
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
27301 ripley 1320
#include <stdlib.h>
1321
#if defined(HAVE_GLIBC2) && !defined(__USE_XOPEN)
1322
#define __USE_XOPEN
1323
#endif
22444 hornik 1324
#include <time.h>
15168 pd 1325
int main () {
1326
#ifdef HAVE_STRPTIME
1327
  struct tm tm;
27301 ripley 1328
  char *p, *q;
15168 pd 1329
 
1330
  p = strptime("1960-01-01", "%Y-%m-%d", &tm);
27301 ripley 1331
  q = strptime("2003-02-40", "%Y-%m-%d", &tm);
1332
  exit(p == 0 || q);
15168 pd 1333
#else
18190 hornik 1334
  exit(1);
15168 pd 1335
#endif
22444 hornik 1336
}
1337
]])],
1338
               [r_cv_func_strptime_works=yes],
1339
               [r_cv_func_strptime_works=no],
1340
               [r_cv_func_strptime_works=no])])
15254 hornik 1341
if test "x${r_cv_func_strptime_works}" = xyes; then
17898 hornik 1342
  AC_DEFINE(HAVE_WORKING_STRPTIME, 1,
27301 ripley 1343
            [Define if strptime() exists, validates and does not fail pre-1970.])
15254 hornik 1344
fi
17898 hornik 1345
])# R_FUNC_STRPTIME
1346
 
18428 hornik 1347
### * Headers
1348
 
14199 hornik 1349
## R_HEADER_SETJMP
17898 hornik 1350
## ---------------
14199 hornik 1351
AC_DEFUN([R_HEADER_SETJMP],
17898 hornik 1352
[AC_CACHE_CHECK([whether setjmp.h is POSIX.1 compatible], 
1353
                [r_cv_header_setjmp_posix],
22444 hornik 1354
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1355
[[#include <setjmp.h>]],
1356
[[sigjmp_buf b;
20976 hornik 1357
sigsetjmp(b, 0);
22444 hornik 1358
siglongjmp(b, 1);]])],
1359
                   [r_cv_header_setjmp_posix=yes],
1360
                   [r_cv_header_setjmp_posix=no])])
17898 hornik 1361
if test "${r_cv_header_setjmp_posix}" = yes; then
1362
  AC_DEFINE(HAVE_POSIX_SETJMP, 1,
1363
            [Define if you have POSIX.1 compatible sigsetjmp/siglongjmp.])
1364
fi
1365
])# R_HEADER_SETJMP
1366
 
14199 hornik 1367
## R_HEADER_GLIBC2
17898 hornik 1368
## ---------------
14199 hornik 1369
AC_DEFUN([R_HEADER_GLIBC2],
17898 hornik 1370
[AC_CACHE_CHECK([for GNU C library with version >= 2],
18298 hornik 1371
                [r_cv_header_glibc2],
17898 hornik 1372
[AC_EGREP_CPP([yes],
1373
[#include <stdio.h>
14199 hornik 1374
#if defined __GLIBC__ && __GLIBC__ >= 2
1375
  yes
17898 hornik 1376
#endif
1377
],
1378
              [r_cv_header_glibc2=yes],
1379
              [r_cv_header_glibc2=no],
1380
              [r_cv_header_glibc2=no])
1381
])
1382
if test "${r_cv_header_glibc2}" = yes; then
1383
  AC_DEFINE(HAVE_GLIBC2, 1,
1384
            [Define if you have the GNU C library version >= 2.
1385
             This is needed to fix a problem with getting the prototype
1386
             of strptime().])
1387
fi
1388
])# R_HEADER_GLIBC2
1389
 
14199 hornik 1390
## R_TYPE_SOCKLEN
17898 hornik 1391
## --------------
1392
AC_DEFUN([R_TYPE_SOCKLEN],
18661 ripley 1393
[AC_MSG_CHECKING([for type of socket length])
1394
AC_CACHE_VAL([r_cv_type_socklen],
20976 hornik 1395
[for t in socklen_t size_t int; do
22444 hornik 1396
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1397
#include <stddef.h>
14199 hornik 1398
#include <sys/types.h>
18661 ripley 1399
#ifdef HAVE_SYS_SOCKET_H
22444 hornik 1400
# include <sys/socket.h>
18661 ripley 1401
#endif
1402
#ifdef Win32
22444 hornik 1403
# include <winsock.h>
18661 ripley 1404
#endif
22444 hornik 1405
]],
1406
[[(void)getsockopt (1, 1, 1, NULL, (${t} *)NULL)]])],
1407
                    [r_cv_type_socklen=${t}; break],
1408
                    [r_cv_type_socklen=])
20976 hornik 1409
done])
22653 ripley 1410
## size_t works on Windows but is unsigned and int is correct
1411
case "${host_os}" in
1412
  cygwin*|mingw*|windows*|winnt)
1413
    r_cv_type_socklen=int
1414
    ;;
1415
esac
14199 hornik 1416
if test "x${r_cv_type_socklen}" = x; then
17311 hornik 1417
  warn_type_socklen="could not determine type of socket length"
18054 hornik 1418
  AC_MSG_WARN([${warn_type_socklen}])
14199 hornik 1419
else
1420
  AC_MSG_RESULT([${r_cv_type_socklen} *])
1421
fi
17898 hornik 1422
AC_DEFINE_UNQUOTED(SOCKLEN_T, ${r_cv_type_socklen},
1423
                   [Type for socket lengths: socklen_t, sock_t, int?])
1424
])# R_TYPE_SOCKLEN
1425
 
18428 hornik 1426
### * System services
17898 hornik 1427
 
21630 hornik 1428
## R_X11
1429
## -----
1430
AC_DEFUN([R_X11],
1431
[AC_PATH_XTRA			# standard X11 search macro
1432
if test -z "${no_x}"; then
1433
  ## We force the use of -lX11 (perhaps this is not necessary?).
1434
  X_LIBS="${X_LIBS} -lX11"
1435
  use_X11="yes"
1436
  AC_DEFINE(HAVE_X11, 1,
1437
            [Define if you have the X11 headers and libraries, and want
1438
             the X11 GUI to be built.])
1439
else
1440
  use_X11="no"
1441
fi])# R_X11
1442
 
14199 hornik 1443
## R_GNOME
17898 hornik 1444
## -------
18054 hornik 1445
AC_DEFUN([R_GNOME], 
1446
[if test ${want_gnome} = yes; then
18298 hornik 1447
  GNOME_INIT_HOOK([], [cont])
18054 hornik 1448
  if test "${GNOMEUI_LIBS}"; then
18298 hornik 1449
    AM_PATH_LIBGLADE([use_gnome="yes"
1450
                      GNOME_IF_FILES="gnome-interface.glade"],
1451
                     [warn_libglade_version="GNOME support requires libglade version >= 0.3"
1452
                      AC_MSG_WARN([${warn_libglade_version}])],
1453
                     [gnome])
14199 hornik 1454
  fi
18054 hornik 1455
fi
1456
if test "${use_gnome}" != yes; then
1457
  use_gnome="no"
1458
  GNOME_IF_FILES=
1459
else
1460
  AC_DEFINE(HAVE_GNOME, 1,
21151 hornik 1461
            [Define if you have the GNOME headers and libraries,
18054 hornik 1462
             and want the GNOME GUI to be built.])
1463
fi
1464
AC_SUBST(HAVE_GNOME)
1465
AC_SUBST(GNOME_IF_FILES)
17898 hornik 1466
])# R_GNOME
1467
 
21630 hornik 1468
## R_AQUA
1469
## ------
20976 hornik 1470
AC_DEFUN([R_AQUA],
1471
[use_aqua=no
1472
if test "${want_aqua}" = yes; then
1473
  case "${host_os}" in
1474
    darwin*)
1475
      use_aqua=yes
1476
      ;;
1477
  esac
1478
fi
21151 hornik 1479
if test "${use_aqua}" = yes; then
1480
  AC_DEFINE(HAVE_AQUA, 1,
1481
            [Define if you have the Aqua headers and libraries,
1482
             and want the Aqua GUI to be built.])
1483
fi
20976 hornik 1484
])# R_AQUA
1485
 
17311 hornik 1486
## R_IEEE_754
17898 hornik 1487
## ----------
17311 hornik 1488
AC_DEFUN([R_IEEE_754],
18054 hornik 1489
[AC_CHECK_FUNCS([finite isnan])
1490
AC_CHECK_DECLS([isfinite, isnan], , , [#include <math.h>])
17311 hornik 1491
AC_CACHE_CHECK([whether you have IEEE 754 floating-point arithmetic],
18298 hornik 1492
               [r_cv_ieee_754],
17311 hornik 1493
[if (test "${ac_cv_func_finite}" = yes \
18054 hornik 1494
      || test "${ac_cv_have_decl_isfinite}" = yes) \
17311 hornik 1495
    && (test "${ac_cv_func_isnan}" = yes \
18054 hornik 1496
      || test "${ac_cv_have_decl_isnan}" = yes); then
17311 hornik 1497
  r_cv_ieee_754=yes
1498
else
1499
  r_cv_ieee_754=no
1500
fi])
1501
if test "${r_cv_ieee_754}" = yes; then
17898 hornik 1502
  AC_DEFINE(IEEE_754, 1,
1503
            [Define if you have IEEE 754 floating point arithmetic.])
17311 hornik 1504
fi
17898 hornik 1505
])# R_IEEE_754
1506
 
14199 hornik 1507
## R_BSD_NETWORKING
17898 hornik 1508
## ----------------
1509
AC_DEFUN([R_BSD_NETWORKING],
1510
[AC_CACHE_CHECK([for BSD networking],
18298 hornik 1511
                [r_cv_bsd_networking],
17898 hornik 1512
[if test "${ac_cv_header_netdb_h}" = yes \
1513
     && test "${ac_cv_header_netinet_in_h}" = yes \
1514
     && test "${ac_cv_header_sys_socket_h}" = yes \
1515
     && test "${ac_cv_search_connect}" != no \
1516
     && test "${ac_cv_search_gethostbyname}" !=  no; then
1517
  r_cv_bsd_networking=yes
1518
else
18054 hornik 1519
  r_cv_bsd_networking=no
17898 hornik 1520
fi])
14199 hornik 1521
if test "${r_cv_bsd_networking}" = yes; then
17898 hornik 1522
  AC_DEFINE(HAVE_BSD_NETWORKING, 1,
1523
            [Define if you have BSD networking headers and libraries.])
1524
  AC_DEFINE(HAVE_SOCKETS, 1,
1525
            [Define if you have support for sockets.])
1526
  AC_DEFINE(HAVE_INTERNET, 1,
1527
            [Define if you have support for ftp/http access.])
1528
  AC_DEFINE(SUPPORT_LIBXML, 1,
1529
            [Define if you provide support for the libxml ftp/http
1530
	     functions.])
14199 hornik 1531
fi
17898 hornik 1532
])# R_BSD_NETWORKING
1533
 
14199 hornik 1534
## R_BITMAPS
17898 hornik 1535
## ---------
18298 hornik 1536
## Here we only need any old -lz, and don't need zlib.h.
1537
## However, we do need recent enough libpng and jpeg, and so check both
1538
## the header versions and for key routines in the library.
1539
## The png code will do a run-time check of the consistency of libpng
1540
## versions.
18190 hornik 1541
AC_DEFUN([R_BITMAPS],
1542
[BITMAP_LIBS=
22181 ripley 1543
if test "${use_jpeglib}" = yes; then
1544
  _R_HEADER_JPEGLIB
1545
  have_jpeg=${r_cv_header_jpeglib_h}
1546
  if test "${have_jpeg}" = yes; then
1547
    AC_CHECK_LIB(jpeg, jpeg_destroy_compress, 
1548
		 [have_jpeg=yes],
1549
		 [have_jpeg=no],
1550
		 [${LIBS}])
1551
  fi
1552
  if test "${have_jpeg}" = yes; then
1553
    BITMAP_LIBS="-ljpeg"
1554
    AC_DEFINE(HAVE_JPEG, 1,
1555
	      [Define if you have the JPEG headers and libraries.])
1556
  fi
18190 hornik 1557
fi
22181 ripley 1558
if test "${use_libpng}" = yes; then
1559
  AC_CHECK_LIB(z, main, [have_png=yes], [have_png=no])
1560
  if test "${have_png}" = yes; then
1561
    _R_HEADER_PNG
1562
    have_png=${r_cv_header_png_h}
1563
  fi
1564
  if test "${have_png}" = yes; then
1565
    AC_CHECK_LIB(png, png_create_write_struct,
1566
		 [have_png=yes],
1567
		 [have_png=no],
1568
		 [-lz ${LIBS}])
1569
  fi
1570
  if test "${have_png}" = yes; then
1571
    BITMAP_LIBS="${BITMAP_LIBS} -lpng -lz"
1572
    AC_DEFINE(HAVE_PNG, 1,
1573
	      [Define if you have the PNG headers and libraries.])
1574
  fi
18190 hornik 1575
fi
1576
AC_SUBST(BITMAP_LIBS)
1577
])# R_BITMAPS
1578
 
1579
## _R_HEADER_JPEGLIB
1580
## -----------------
18428 hornik 1581
## Set shell variable r_cv_header_jpeglib_h to 'yes' if a recent enough
18190 hornik 1582
## jpeglib.h is found, and to 'no' otherwise.
1583
AC_DEFUN([_R_HEADER_JPEGLIB],
1584
[AC_CACHE_CHECK([if jpeglib version >= 6b],
18428 hornik 1585
                [r_cv_header_jpeglib_h],
18190 hornik 1586
AC_EGREP_CPP([yes],
1587
[#include <jpeglib.h>
14682 hornik 1588
#if (JPEG_LIB_VERSION >= 62)
1589
  yes
18190 hornik 1590
#endif
1591
],
18428 hornik 1592
             [r_cv_header_jpeglib_h=yes],
1593
             [r_cv_header_jpeglib_h=no]))
18190 hornik 1594
])# _R_HEADER_JPEGLIB
1595
 
1596
## _R_HEADER_PNG
1597
## -------------
18428 hornik 1598
## Set shell variable r_cv_header_png_h to 'yes' if a recent enough
18190 hornik 1599
## 'png.h' is found, and to 'no' otherwise.
1600
AC_DEFUN([_R_HEADER_PNG],
1601
[AC_CACHE_CHECK([if libpng version >= 1.0.5], 
18428 hornik 1602
                [r_cv_header_png_h],
18190 hornik 1603
AC_EGREP_CPP([yes],
1604
[#include <png.h>
14682 hornik 1605
#if (PNG_LIBPNG_VER >= 10005)
1606
  yes
18190 hornik 1607
#endif
1608
],
18428 hornik 1609
             [r_cv_header_png_h=yes],
1610
             [r_cv_header_png_h=no]))
18190 hornik 1611
])# _R_HEADER_PNG
17898 hornik 1612
 
18428 hornik 1613
## _R_PATH_TCL_CONFIG
1614
## ------------------
1615
## Try finding tclConfig.sh in common library directories and their
1616
## tcl$x.$y subdirectories.  Set shell variable r_cv_path_TCL_CONFIG
1617
## to the entire path of the script if found, and leave it empty
1618
## otherwise.
1619
AC_DEFUN([_R_PATH_TCL_CONFIG],
1620
[AC_MSG_CHECKING([for tclConfig.sh in library (sub)directories])
1621
AC_CACHE_VAL([r_cv_path_TCL_CONFIG],
28320 pd 1622
[for ldir in /opt/lib /sw/lib /usr/local/lib /usr/lib /lib /usr/lib64 ; do
18428 hornik 1623
  for dir in \
18453 hornik 1624
      ${ldir} \
18507 hornik 1625
      `ls -d ${ldir}/tcl[[8-9]].[[0-9]]* 2>/dev/null | sort -r`; do
18428 hornik 1626
    if test -f ${dir}/tclConfig.sh; then
1627
      r_cv_path_TCL_CONFIG="${dir}/tclConfig.sh"
1628
      break 2
1629
    fi
1630
  done
1631
done])
1632
if test -n "${r_cv_path_TCL_CONFIG}"; then
1633
  AC_MSG_RESULT([${r_cv_path_TCL_CONFIG}])
1634
else
1635
  AC_MSG_RESULT([no])
1636
fi
1637
])# _R_PATH_TCL_CONFIG
1638
 
1639
## _R_PATH_TK_CONFIG
1640
## ------------------
1641
## Try finding tkConfig.sh in common library directories and their
1642
## tk$x.$y subdirectories.  Set shell variable r_cv_path_TK_CONFIG
1643
## to the entire path of the script if found, and leave it empty
1644
## otherwise.
1645
AC_DEFUN([_R_PATH_TK_CONFIG],
1646
[AC_MSG_CHECKING([for tkConfig.sh in library (sub)directories])
1647
AC_CACHE_VAL([r_cv_path_TK_CONFIG],
28320 pd 1648
[for ldir in /opt/lib /sw/lib /usr/local/lib /usr/lib /lib /usr/lib64 ; do
18428 hornik 1649
  for dir in \
18453 hornik 1650
      ${ldir} \
18507 hornik 1651
      `ls -d ${ldir}/tk[[8-9]].[[0-9]]* 2>/dev/null | sort -r`; do
18428 hornik 1652
    if test -f ${dir}/tkConfig.sh; then
1653
      r_cv_path_TK_CONFIG="${dir}/tkConfig.sh"
1654
      break 2
1655
    fi
1656
  done
1657
done])
1658
if test -n "${r_cv_path_TK_CONFIG}"; then
1659
  AC_MSG_RESULT([${r_cv_path_TK_CONFIG}])
1660
else
1661
  AC_MSG_RESULT([no])
1662
fi
1663
])# _R_PATH_TK_CONFIG
1664
 
17898 hornik 1665
## _R_TCLTK_CONFIG
1666
## ---------------
18428 hornik 1667
## Try finding the tclConfig.sh and tkConfig.sh scripts in PATH as well
1668
## as in common library directories and their tcl/tk subdirectories.
1669
## Set shell variables TCL_CONFIG and TK_CONFIG to the entire paths to
1670
## the scripts if found and check that the corresponding Tcl/Tk versions
1671
## are at least 8; if not, set shell variable have_tcltk to 'no'.
17898 hornik 1672
AC_DEFUN([_R_TCLTK_CONFIG],
18428 hornik 1673
[AC_PATH_PROGS(TCL_CONFIG, [${TCL_CONFIG} tclConfig.sh])
1674
if test -z "${TCL_CONFIG}"; then
1675
  _R_PATH_TCL_CONFIG
1676
  if test -n "${r_cv_path_TCL_CONFIG}"; then
1677
    TCL_CONFIG="${r_cv_path_TCL_CONFIG}"
1678
  fi
1679
fi
1680
AC_PATH_PROGS(TK_CONFIG, [${TK_CONFIG} tkConfig.sh])
1681
if test -z "${TK_CONFIG}"; then
1682
  _R_PATH_TK_CONFIG
1683
  if test -n "${r_cv_path_TK_CONFIG}"; then
1684
    TK_CONFIG="${r_cv_path_TK_CONFIG}"
1685
  fi
1686
fi
17898 hornik 1687
if test -z "${TCLTK_CPPFLAGS}" \
1688
    || test -z "${TCLTK_LIBS}"; then
14199 hornik 1689
  ## Check whether the versions found via the *Config.sh files are at
1690
  ## least 8; otherwise, issue a warning and turn off Tcl/Tk support.
1691
  ## Note that in theory a system could have outdated versions of the
1692
  ## *Config.sh scripts and yet up-to-date installations of Tcl/Tk in
1693
  ## standard places ...
1694
  if test -n "${TCL_CONFIG}"; then
1695
    . ${TCL_CONFIG}
1696
    if test ${TCL_MAJOR_VERSION} -lt 8; then
1697
      warn_tcltk_version="Tcl/Tk support requires Tcl version >= 8"
18054 hornik 1698
      AC_MSG_WARN([${warn_tcltk_version}])
14199 hornik 1699
      have_tcltk=no
1700
    fi
1701
  fi
15232 hornik 1702
  if test -n "${TK_CONFIG}" \
1703
      && test -z "${warn_tcltk_version}"; then
14199 hornik 1704
    . ${TK_CONFIG}
1705
    if test ${TK_MAJOR_VERSION} -lt 8; then
1706
      warn_tcltk_version="Tcl/Tk support requires Tk version >= 8"
18054 hornik 1707
      AC_MSG_WARN([${warn_tcltk_version}])
14199 hornik 1708
      have_tcltk=no
1709
    fi
1710
  fi
20516 hornik 1711
  if test -n "${TCL_CONFIG}" \
1712
      && test -n "${TK_CONFIG}" \
1713
      && test -z "${warn_tcltk_version}"; then
1714
    if test ${TCL_MAJOR_VERSION} -ne ${TK_MAJOR_VERSION} \
1715
      || test ${TCL_MINOR_VERSION} -ne ${TK_MINOR_VERSION}; then
1716
     warn_tcltk_version="Tcl and Tk major or minor versions disagree"
1717
      AC_MSG_WARN([${warn_tcltk_version}])
1718
      have_tcltk=no
1719
    fi
1720
  fi
14199 hornik 1721
fi
17898 hornik 1722
])# _R_TCLTK_CONFIG
1723
 
18428 hornik 1724
## _R_HEADER_TCL
1725
## -------------
1726
## Set shell variable 'r_cv_header_tcl_h' to 'yes' if a recent enough
1727
## 'tcl.h' is found, and to 'no' otherwise.
1728
AC_DEFUN([_R_HEADER_TCL],
1729
[AC_CACHE_CHECK([for tcl.h], [r_cv_header_tcl_h],
1730
[AC_EGREP_CPP([yes],
1731
[#include <tcl.h>
1732
#if (TCL_MAJOR_VERSION >= 8)
1733
  yes
1734
#endif
1735
],
1736
             [r_cv_header_tcl_h=yes],
1737
             [r_cv_header_tcl_h=no])])
1738
])# _R_HEADER_TCL
1739
 
1740
## _R_HEADER_TK
1741
## -------------
1742
## Set shell variable 'r_cv_header_tk_h' to 'yes' if a recent enough
1743
## 'tk.h' is found, and to 'no' otherwise.
1744
AC_DEFUN([_R_HEADER_TK],
1745
[AC_CACHE_CHECK([for tk.h], [r_cv_header_tk_h],
1746
[AC_EGREP_CPP([yes],
1747
[#include <tk.h>
1748
#if (TK_MAJOR_VERSION >= 8)
1749
  yes
1750
#endif
1751
],
1752
             [r_cv_header_tk_h=yes],
1753
             [r_cv_header_tk_h=no])])
1754
])# _R_HEADER_TK
1755
 
17898 hornik 1756
## _R_TCLTK_CPPFLAGS
1757
## -----------------
14199 hornik 1758
## Need to ensure that we can find the tcl.h and tk.h headers, which
1759
## may be in non-standard and/or version-dependent directories, such as
1760
## on FreeBSD systems.
1761
##
1762
## The logic is as follows.  If TCLTK_CPPFLAGS was specified, then we
1763
## do not investigate any further.  Otherwise, if we still think we
1764
## have Tcl/Tk, then first try via the corresponding *Config.sh file,
1765
## or else try the obvious.
17898 hornik 1766
AC_DEFUN([_R_TCLTK_CPPFLAGS],
1767
[AC_REQUIRE([_R_TCLTK_CONFIG])
14199 hornik 1768
if test -z "${TCLTK_CPPFLAGS}"; then
1769
  ## We have to do the work.
1770
  if test "${have_tcltk}" = yes; then
1771
    ## Part 1.  Check for tcl.h.
1772
    found_tcl_h=no
1773
    if test -n "${TCL_CONFIG}"; then
1774
      . ${TCL_CONFIG}
1775
      ## Look for tcl.h in
1776
      ##   ${TCL_PREFIX}/include/tcl${TCL_VERSION}
1777
      ##   ${TCL_PREFIX}/include
19407 hornik 1778
      ## Also look in
1779
      ##   ${TCL_PREFIX}/include/tcl${TCL_VERSION}/generic
1780
      ## to deal with current FreeBSD layouts.  These also link the real
1781
      ## thing to the version subdir, but the link cannot be used as it
1782
      ## fails to include 'tclDecls.h' which is not linked.  Hence we
1783
      ## must look for the real thing first.  Argh ...
18428 hornik 1784
      for dir in \
19407 hornik 1785
          ${TCL_PREFIX}/include/tcl${TCL_VERSION}/generic \
18428 hornik 1786
          ${TCL_PREFIX}/include/tcl${TCL_VERSION} \
1787
          ${TCL_PREFIX}/include; do 
1788
        AC_CHECK_HEADER([${dir}/tcl.h],
1789
                        [TCLTK_CPPFLAGS="-I${dir}"
1790
                         found_tcl_h=yes
1791
                         break])
1792
      done
14199 hornik 1793
    fi
1794
    if test "${found_tcl_h}" = no; then
18428 hornik 1795
      _R_HEADER_TCL
1796
      if test "${r_cv_header_tcl_h}" = yes; then
1797
        found_tcl_h=yes
1798
      else
1799
        have_tcltk=no
1800
      fi
14199 hornik 1801
    fi
1802
  fi
1803
  if test "${have_tcltk}" = yes; then
1804
    ## Part 2.  Check for tk.h.
1805
    found_tk_h=no
1806
    if test -n "${TK_CONFIG}"; then
1807
      . ${TK_CONFIG}
1808
      ## Look for tk.h in
1809
      ##   ${TK_PREFIX}/include/tk${TK_VERSION}
1810
      ##   ${TK_PREFIX}/include
18428 hornik 1811
      ## Also look in
1812
      ##   ${TK_PREFIX}/include/tcl${TK_VERSION}
1813
      ## to compensate for Debian madness ...
19407 hornik 1814
      ## Also look in
1815
      ##   ${TK_PREFIX}/include/tk${TK_VERSION}/generic
1816
      ## to deal with current FreeBSD layouts.  See above for details.
20516 hornik 1817
      ##
14199 hornik 1818
      ## As the AC_CHECK_HEADER test tries including the header file and
1819
      ## tk.h includes tcl.h and X11/Xlib.h, we need to change CPPFLAGS
1820
      ## for the check.
18190 hornik 1821
      r_save_CPPFLAGS="${CPPFLAGS}"
14199 hornik 1822
      CPPFLAGS="${CPPFLAGS} ${TK_XINCLUDES} ${TCLTK_CPPFLAGS}"
18428 hornik 1823
      for dir in \
19407 hornik 1824
          ${TK_PREFIX}/include/tk${TK_VERSION}/generic \
18428 hornik 1825
          ${TK_PREFIX}/include/tk${TK_VERSION} \
1826
          ${TK_PREFIX}/include/tcl${TK_VERSION} \
1827
          ${TK_PREFIX}/include; do 
1828
        AC_CHECK_HEADER([${dir}/tk.h],
1829
                        [TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} -I${dir}"
1830
                         found_tk_h=yes
1831
                         break])
1832
      done
18190 hornik 1833
      CPPFLAGS="${r_save_CPPFLAGS}"
14199 hornik 1834
    fi
1835
    if test "${found_tk_h}" = no; then
18428 hornik 1836
      _R_HEADER_TK
1837
      if test "{r_cv_header_tk_h}" = yes; then
1838
        found_tk_h=yes
1839
      else
1840
        have_tcltk=no
1841
      fi
14199 hornik 1842
    fi
1843
  fi
17898 hornik 1844
fi
24640 hornik 1845
if test "${have_tcltk}" = yes; then
1846
  if test -n "${TK_XINCLUDES}"; then
1847
    TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} ${TK_XINCLUDES}"
1848
  else
1849
    TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} ${X_CFLAGS}"
1850
  fi
1851
fi
17898 hornik 1852
])# _R_TCLTK_CPPFLAGS
1853
 
1854
## _R_TCLTK_LIBS
1855
## -------------
14199 hornik 1856
## Find the tcl and tk libraries.
17898 hornik 1857
AC_DEFUN([_R_TCLTK_LIBS],
14199 hornik 1858
[AC_REQUIRE([AC_PATH_XTRA])
17898 hornik 1859
AC_REQUIRE([_R_TCLTK_CONFIG])
14199 hornik 1860
if test -z "${TCLTK_LIBS}"; then
1861
  ## We have to do the work.
1862
  if test "${have_tcltk}" = yes; then
1863
    ## Part 1.  Try finding the tcl library.
1864
    if test -n "${TCL_CONFIG}"; then
1865
      . ${TCL_CONFIG}
1866
      TCLTK_LIBS="${TCL_LIB_SPEC}"
1867
    else
1868
      AC_CHECK_LIB(tcl, Tcl_CreateInterp,
18190 hornik 1869
                   [TCLTK_LIBS=-ltcl],
1870
                   [have_tcltk=no])
14199 hornik 1871
    fi
1872
  fi
1873
  if test "${have_tcltk}" = yes; then
1874
    ## Part 2.  Try finding the tk library.
1875
    if test -n "${TK_CONFIG}"; then
1876
      . ${TK_CONFIG}
1877
      TCLTK_LIBS="${TCLTK_LIBS} ${TK_LIB_SPEC} ${TK_LIBS}"
1878
    else
18190 hornik 1879
      AC_CHECK_LIB(tk, Tk_Init, , , [${TCLTK_LIBS}])
14199 hornik 1880
      if test "${ac_cv_lib_tk_Tk_Init}" = no; then
1881
	## Grr, simple -ltk does not work.
1882
	## But maybe we simply need to add X11 libs.
18190 hornik 1883
        ## Note that we cannot simply repeat the above test with extra
1884
        ## libs, because AC_CHECK_LIB uses the corresponding cache var
1885
        ## (ac_cv_lib_tk_Tk_Init in our case) if set.  As using unset
1886
        ## is not portable shell programming according to the Autoconf
1887
        ## docs, we use Tk_SafeInit in the test with X11 libs added.
1888
	AC_CHECK_LIB(tk, Tk_SafeInit,
1889
                     [TCLTK_LIBS="${TCLTK_LIBS} -ltk ${X_LIBS}"],
1890
	             [have_tcltk=no],
1891
                     [${TCLTK_LIBS} ${X_LIBS}])
14199 hornik 1892
      fi
1893
    fi
1894
  fi
15876 pd 1895
  ## Postprocessing for AIX.
18832 hornik 1896
  ## On AIX, the *_LIB_SPEC variables need to contain '-bI:' flags for
15876 pd 1897
  ## the Tcl export file.  These are really flags for ld rather than the
18832 hornik 1898
  ## C/C++ compilers, and hence may need protection via '-Wl,'.
15876 pd 1899
  ## We have two ways of doing that:
18832 hornik 1900
  ## * Recording whether '-Wl,' is needed for the C or C++ compilers,
15876 pd 1901
  ##   and getting this info into the TCLTK_LIBS make variable ... mess!
18832 hornik 1902
  ## * Protecting all entries in TCLTK_LIBS that do not start with '-l'
1903
  ##   or '-L' with '-Wl,' (hoping that all compilers understand this).
15876 pd 1904
  ##   Easy, hence ...
17311 hornik 1905
  case "${host_os}" in
1906
    aix*)
15876 pd 1907
      orig_TCLTK_LIBS="${TCLTK_LIBS}"
1908
      TCLTK_LIBS=
1909
      for flag in ${orig_TCLTK_LIBS}; do
1910
        case "${flag}" in
1911
	  -l*|-L*|-Wl,*) ;;
1912
	  *) flag="-Wl,${flag}" ;;
1913
	esac
1914
	TCLTK_LIBS="${TCLTK_LIBS} ${flag}"
1915
      done
1916
      ;;
1917
  esac
24640 hornik 1918
  ## Force evaluation ('-ltcl8.3${TCL_DBGX}' and friends ...).
1919
  eval "TCLTK_LIBS=\"${TCLTK_LIBS}\""
14199 hornik 1920
fi
17898 hornik 1921
])# _R_TCLTK_LIBS
1922
 
24640 hornik 1923
## _R_TCLTK_WORKS
1924
## --------------
1925
## Check whether compiling and linking code using Tcl/Tk works.
1926
## Set shell variable r_cv_tcltk_works to 'yes' or 'no' accordingly.
1927
AC_DEFUN([_R_TCLTK_WORKS],
1928
[AC_CACHE_CHECK([whether compiling/linking Tcl/Tk code works],
1929
                [r_cv_tcltk_works],
1930
[AC_LANG_PUSH(C)
1931
r_save_CPPFLAGS="${CPPFLAGS}"
1932
r_save_LIBS="${LIBS}"
1933
CPPFLAGS="${CPPFLAGS} ${TCLTK_CPPFLAGS}"
1934
LIBS="${LIBS} ${TCLTK_LIBS}"
1935
AC_LINK_IFELSE([AC_LANG_PROGRAM(
1936
[[#include <tcl.h>
1937
#include <tk.h>
1938
]],
1939
[[static char * p1 = (char *) Tcl_Init;
1940
static char * p2 = (char *) Tk_Init;
1941
]])],
1942
r_cv_tcltk_works=yes,
1943
r_cv_tcltk_works=no)
1944
CPPFLAGS="${r_save_CPPFLAGS}"
1945
LIBS="${r_save_LIBS}"
1946
AC_LANG_POP(C)])
1947
])# _R_TCLTK_WORKS
1948
 
17898 hornik 1949
## R_TCLTK
1950
## -------
14199 hornik 1951
AC_DEFUN([R_TCLTK],
1952
[if test "${want_tcltk}" = yes; then
1953
  have_tcltk=yes
24640 hornik 1954
  ## (Note that the subsequent 3 macros assume that have_tcltk has been
1955
  ## set appropriately.)
17898 hornik 1956
  _R_TCLTK_CONFIG
1957
  _R_TCLTK_CPPFLAGS  
1958
  _R_TCLTK_LIBS
24640 hornik 1959
  if test "${have_tcltk}" = yes; then
1960
    _R_TCLTK_WORKS
1961
    have_tcltk=${r_cv_tcltk_works}
1962
  fi
14199 hornik 1963
else
1964
  have_tcltk=no
1965
  ## Just making sure.
1966
  TCLTK_CPPFLAGS=
1967
  TCLTK_LIBS=
1968
fi
1969
if test "${have_tcltk}" = yes; then
17898 hornik 1970
  AC_DEFINE(HAVE_TCLTK, 1,
1971
            [Define if you have the Tcl/Tk headers and libraries and
1972
	     want Tcl/Tk support to be built.])
14199 hornik 1973
  use_tcltk=yes
1974
else
1975
  use_tcltk=no
1976
fi
1977
AC_SUBST(TCLTK_CPPFLAGS)
1978
AC_SUBST(TCLTK_LIBS)
1979
AC_SUBST(use_tcltk)
17898 hornik 1980
])# R_TCLTK
1981
 
1982
## R_BLAS_LIBS
1983
## -----------
18254 hornik 1984
## Look for a library that implements the BLAS linear-algebra interface
1985
## (see http://www.netlib.org/blas/).  On success, sets BLAS_LIBS to the
1986
## requisite library linkages.
1987
##
1988
## This is based on ACX_BLAS by Steven G. Johnson <stevenj@alum.mit.edu>
1989
## from the Official Autoconf Macro Archive
23060 ripley 1990
## (http://www.gnu.org/software/ac-archive/htmldoc/acx_blas.m4),
18254 hornik 1991
## with the following changes:
18298 hornik 1992
## * We also handle HPUX .sl command line specifications.
18254 hornik 1993
## * We explictly deal with the case of f2c.  Most likely pointless.
20516 hornik 1994
## * We only care about the Fortran 77 interface to Atlas, hence do not
18298 hornik 1995
##   test for -lcblas.
18254 hornik 1996
## * We do not use BLAS libs that caused problems in the past: Alpha
1997
##   CXML and DXML, and SGI SCSL and SGIMATH (marked with COMMENT tags).
24220 hornik 1998
## * As we link with $BLAS_LIBS $FLIBS $LIBS (in that order), we use the
1999
##   same order in the tests.
18254 hornik 2000
## * We do not use ACTION-IF-FOUND and ACTION-IF-NOT-FOUND.
23060 ripley 2001
## The sunperf test calls the library as now required.
18254 hornik 2002
## Based on acx_blas.m4 version 1.2 (2001-12-13)
2003
AC_DEFUN([R_BLAS_LIBS],
2004
[AC_REQUIRE([R_PROG_F77_FLIBS])
2005
AC_REQUIRE([R_PROG_F77_APPEND_UNDERSCORE])
2006
AC_REQUIRE([R_PROG_F2C_FLIBS])
2007
 
2008
acx_blas_ok=no
2009
case "${with_blas}" in
2010
  yes | "") ;;
2011
  no) acx_blas_ok=disable ;;
18298 hornik 2012
  -* | */* | *.a | *.so | *.so.* | *.sl | *.sl.* | *.o)
2013
    BLAS_LIBS="${with_blas}" 
2014
    ;;
18254 hornik 2015
  *) BLAS_LIBS="-l${with_blas}" ;;
2016
esac
2017
 
14199 hornik 2018
if test "${r_cv_prog_f77_append_underscore}" = yes \
2019
  || test -n "${F2C}"; then
18254 hornik 2020
  dgemm=dgemm_
2021
  sgemm=sgemm_
27252 ripley 2022
  xerbla=xerbla_
14199 hornik 2023
else
18254 hornik 2024
  dgemm=dgemm
2025
  sgemm=sgemm
27252 ripley 2026
  xerbla=xerbla
14199 hornik 2027
fi
2028
 
18254 hornik 2029
acx_blas_save_LIBS="${LIBS}"
24220 hornik 2030
LIBS="${FLIBS} ${LIBS}"
18254 hornik 2031
 
2032
## First, check BLAS_LIBS environment variable
2033
if test "${acx_blas_ok}" = no; then
2034
  if test "x${BLAS_LIBS}" != x; then
24001 hornik 2035
    r_save_LIBS="${LIBS}"; LIBS="${BLAS_LIBS} ${LIBS}"
18254 hornik 2036
    AC_MSG_CHECKING([for ${sgemm} in ${BLAS_LIBS}])
27252 ripley 2037
    AC_TRY_LINK([void ${xerbla}(char *srname, int *info){}], ${sgemm}(),
2038
      [acx_blas_ok=yes], [BLAS_LIBS=""])
23221 hornik 2039
    AC_MSG_RESULT([${acx_blas_ok}])
24001 hornik 2040
    LIBS="${r_save_LIBS}"
14199 hornik 2041
  fi
2042
fi
2043
 
18254 hornik 2044
## BLAS linked to by default?  (happens on some supercomputers)
2045
if test "${acx_blas_ok}" = no; then
2046
  AC_CHECK_FUNC(${sgemm}, [acx_blas_ok=yes])
14199 hornik 2047
fi
2048
 
24001 hornik 2049
## BLAS in ATLAS library?  (http://math-atlas.sourceforge.net/)
18254 hornik 2050
if test "${acx_blas_ok}" = no; then
2051
  AC_CHECK_LIB(atlas, ATL_xerbla,
2052
               [AC_CHECK_LIB(f77blas, ${sgemm},
18298 hornik 2053
                             [acx_blas_ok=yes
2054
                              BLAS_LIBS="-lf77blas -latlas"],
18254 hornik 2055
			     [], [-latlas])])
2056
fi
14199 hornik 2057
 
24001 hornik 2058
## BLAS in PhiPACK libraries?  (requires generic BLAS lib, too)
18254 hornik 2059
if test "${acx_blas_ok}" = no; then
2060
  AC_CHECK_LIB(blas, ${sgemm},
2061
	       [AC_CHECK_LIB(dgemm, $dgemm,
2062
		             [AC_CHECK_LIB(sgemm, ${sgemm},
2063
			                   [acx_blas_ok=yes
2064
                                            BLAS_LIBS="-lsgemm -ldgemm -lblas"],
2065
			                   [], [-lblas])],
2066
			     [], [-lblas])])
2067
fi
14199 hornik 2068
 
18254 hornik 2069
## <COMMENT>
2070
## ## BLAS in Alpha CXML library?
2071
## if test "${acx_blas_ok}" = no; then
2072
##   AC_CHECK_LIB(cxml, ${sgemm},
2073
##                [acx_blas_ok=yes; BLAS_LIBS="-lcxml"])
2074
## fi
2075
## </COMMENT>
2076
 
2077
## <COMMENT>
2078
## # BLAS in Alpha DXML library? (now called CXML, see above)
2079
## if test "${acx_blas_ok}" = no; then
2080
##   AC_CHECK_LIB(dxml, ${sgemm},
2081
##                [acx_blas_ok=yes; BLAS_LIBS="-ldxml"])
2082
## fi
2083
## </COMMENT>
2084
 
2085
## BLAS in Sun Performance library?
23060 ripley 2086
## Some versions require -xlic_lib=sunperf: -lsunperf will not work
23221 hornik 2087
## Not sure whether -lsunmath is required, but it helps anyway
18254 hornik 2088
if test "${acx_blas_ok}" = no; then
2089
  if test "x$GCC" != xyes; then # only works with Sun CC
23060 ripley 2090
     AC_MSG_CHECKING([for ${sgemm} in -lsunperf])
23221 hornik 2091
     r_save_LIBS="${LIBS}"
24220 hornik 2092
     LIBS="-xlic_lib=sunperf -lsunmath ${LIBS}"
23060 ripley 2093
     AC_TRY_LINK_FUNC([${sgemm}], [R_sunperf=yes], [R_sunperf=no])
2094
     if test "${R_sunperf}" = yes; then
2095
        BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
2096
	acx_blas_ok=yes
2097
     fi
23221 hornik 2098
     LIBS="${r_save_LIBS}"
2099
     AC_MSG_RESULT([${acx_blas_ok}])
14199 hornik 2100
  fi
2101
fi
2102
 
18254 hornik 2103
## <COMMENT>
2104
## ## BLAS in SCSL library?  (SGI/Cray Scientific Library)
2105
## if test "${acx_blas_ok}" = no; then
2106
##   AC_CHECK_LIB(scs, ${sgemm},
2107
##                [acx_blas_ok=yes; BLAS_LIBS="-lscs"])
2108
## fi
2109
## </COMMENT>
2110
 
2111
## <COMMENT>
2112
## ## BLAS in SGIMATH library?
2113
## if test "${acx_blas_ok}" = no; then
2114
##   AC_CHECK_LIB(complib.sgimath, ${sgemm},
2115
##                [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
2116
## fi
2117
## </COMMENT>
14199 hornik 2118
 
18254 hornik 2119
## BLAS in IBM ESSL library? (requires generic BLAS lib, too)
2120
if test "${acx_blas_ok}" = no; then
2121
  AC_CHECK_LIB(blas, ${sgemm},
2122
	       [AC_CHECK_LIB(essl, ${sgemm},
2123
			     [acx_blas_ok=yes
2124
                              BLAS_LIBS="-lessl -lblas"],
2125
			     [], [-lblas ${FLIBS}])])
14199 hornik 2126
fi
2127
 
18254 hornik 2128
## Generic BLAS library?
2129
if test "${acx_blas_ok}" = no; then
2130
  AC_CHECK_LIB(blas, ${sgemm},
2131
               [acx_blas_ok=yes; BLAS_LIBS="-lblas"])
14199 hornik 2132
fi
2133
 
18254 hornik 2134
LIBS="${acx_blas_save_LIBS}"
14199 hornik 2135
 
2136
AC_SUBST(BLAS_LIBS)
17898 hornik 2137
])# R_BLAS_LIBS
2138
 
22133 ripley 2139
## R_LAPACK_LIBS
2140
## -------------
24001 hornik 2141
## Look for a library that implements LAPACK (see
2142
## http://www.netlib.org/lapack/).  On success, sets LAPACK_LIBS to the
2143
## requisite library linkages.  Only used by the lapack module at
2144
## present. 
2145
##
2146
## This is roughly based on ACX_LAPACK by Steven G. Johnson
2147
## <stevenj@alum.mit.edu> from the Official Autoconf Macro Archive
2148
## (http://www.gnu.org/software/ac-archive/htmldoc/acx_lapack.m4),
2149
## with the following changes:
2150
## * We also handle HPUX .sl command line specifications.
2151
## * We explictly deal with the case of f2c.  Most likely pointless.
2152
## * We test for a LAPACK_LIBS environment variable after checking
24220 hornik 2153
##   whether LAPACK is already linked (see below).
24001 hornik 2154
## * We do not test for the generic lapack_rs6k library (why not?).
24220 hornik 2155
## * As we link with $LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS (in that
2156
##   order), we use the same order in the tests.
24001 hornik 2157
## * We do not use ACTION-IF-FOUND and ACTION-IF-NOT-FOUND.
2158
## Note that Debian ATLAS has LAPACK libs in /usr/lib/atlas (or $arch
2159
## variants) which should be used if ATLAS is used for BLAS, and not
2160
## found at configure time but used at run time ...
24220 hornik 2161
## Note also that (see R-admin) that our main intention is to allow a
2162
## LAPACK-containing BLAS to be used ... there are too many slow or
2163
## broken LAPACKs out there.
24001 hornik 2164
## Based on acx_lapack.m4 version 1.3 (2002-03-12).
2165
 
22133 ripley 2166
AC_DEFUN([R_LAPACK_LIBS],
2167
[AC_REQUIRE([R_PROG_F77_FLIBS])
2168
AC_REQUIRE([R_PROG_F77_APPEND_UNDERSCORE])
2169
AC_REQUIRE([R_PROG_F2C_FLIBS])
24001 hornik 2170
AC_REQUIRE([R_BLAS_LIBS])
22133 ripley 2171
 
2172
acx_lapack_ok=no
2173
case "${with_lapack}" in
2174
  yes | "") ;;
2175
  no) acx_lapack_ok=disable ;;
2176
  -* | */* | *.a | *.so | *.so.* | *.sl | *.sl.* | *.o)
2177
    LAPACK_LIBS="${with_lapack}" 
2178
    ;;
2179
  *) LAPACK_LIBS="-l${with_lapack}" ;;
2180
esac
2181
 
2182
if test "${r_cv_prog_f77_append_underscore}" = yes \
2183
  || test -n "${F2C}"; then
2184
  zgeev=zgeev_
2185
else
2186
  zgeev=zgeev
2187
fi
2188
 
24001 hornik 2189
# We cannot use LAPACK if BLAS is not found
2190
if test "x${acx_blas_ok}" != xyes; then
2191
  acx_lapack_ok=noblas
2192
fi
2193
 
22133 ripley 2194
acx_lapack_save_LIBS="${LIBS}"
24220 hornik 2195
LIBS="${BLAS_LIBS} ${FLIBS} ${LIBS}"
22133 ripley 2196
 
2197
## LAPACK linked to by default?  (Could be in the BLAS libs.)
2198
if test "${acx_lapack_ok}" = no; then
2199
  AC_CHECK_FUNC(${zgeev}, [acx_lapack_ok=yes])
2200
fi
2201
 
2202
## Next, check LAPACK_LIBS environment variable
2203
if test "${acx_lapack_ok}" = no; then
2204
  if test "x${LAPACK_LIBS}" != x; then
24001 hornik 2205
    r_save_LIBS="${LIBS}"; LIBS="${LAPACK_LIBS} ${LIBS}"
22133 ripley 2206
    AC_MSG_CHECKING([for ${zgeev} in ${LAPACK_LIBS}])
2207
    AC_TRY_LINK_FUNC(${zgeev}, [acx_lapack_ok=yes], [LAPACK_LIBS=""])
23221 hornik 2208
    AC_MSG_RESULT([${acx_lapack_ok}])
24001 hornik 2209
    LIBS="${r_save_LIBS}"
22133 ripley 2210
  fi
2211
fi
2212
 
2213
## LAPACK in Sun Performance library?
24001 hornik 2214
## No longer test here as will be picked up by the default test.
22133 ripley 2215
 
2216
## Generic LAPACK library?
2217
if test "${acx_lapack_ok}" = no; then
2218
  AC_CHECK_LIB(lapack, ${zgeev},
2219
               [acx_lapack_ok=yes; LAPACK_LIBS="-llapack"])
2220
fi
2221
 
2222
LIBS="${acx_lapack_save_LIBS}"
2223
 
22142 ripley 2224
if test "${acx_lapack_ok}" = yes; then
2225
  AC_DEFINE(HAVE_LAPACK, 1,
2226
            [Define if external LAPACK is available.])
2227
fi
2228
 
22133 ripley 2229
AC_SUBST(LAPACK_LIBS)
2230
])# R_LAPACK_LIBS
2231
 
17898 hornik 2232
## R_XDR
2233
## -----
15168 pd 2234
## Try finding XDR library functions and headers.
20516 hornik 2235
## FreeBSD in particular needs rpc/types.h before rpc/xdr.h.
18054 hornik 2236
AC_DEFUN([R_XDR],
19519 hornik 2237
[AC_CHECK_HEADER(rpc/types.h)
2238
if test "${ac_cv_header_rpc_types_h}" = yes ; then
2239
  AC_CHECK_HEADER(rpc/xdr.h, , , [#include <rpc/types.h>])
2240
fi
2241
AC_CACHE_CHECK([for XDR support],
18298 hornik 2242
                [r_cv_xdr],
19519 hornik 2243
[if test "${ac_cv_header_rpc_types_h}" = yes \
2244
     && test "${ac_cv_header_rpc_xdr_h}" = yes \
2245
     && test "${ac_cv_search_xdr_string}" != no ; then
2246
  r_cv_xdr=yes
2247
else
2248
  r_cv_xdr=no
2249
fi
19492 ripley 2250
])
18298 hornik 2251
AM_CONDITIONAL(BUILD_XDR, [test "x${r_cv_xdr}" = xno])
17898 hornik 2252
])# R_XDR
2253
 
2254
## R_ZLIB
2255
## ------
15168 pd 2256
## Try finding zlib library and headers.
24174 ripley 2257
## We check that both are installed, and that the header >= 1.1.4
19363 ripley 2258
## and that gzeof is in the library (which suggests the library
15168 pd 2259
## is also recent enough).
18190 hornik 2260
AC_DEFUN([R_ZLIB],
22181 ripley 2261
[if test "x${use_zlib}" = xyes; then
2262
  AC_CHECK_LIB(z, gzeof, [have_zlib=yes], [have_zlib=no])
2263
  if test "${have_zlib}" = yes; then
2264
    AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
2265
  fi
2266
  if test "${have_zlib}" = yes; then
2267
    _R_HEADER_ZLIB
2268
    have_zlib=${r_cv_header_zlib_h}
2269
  fi
2270
else
2271
  have_zlib="no"
18190 hornik 2272
fi
2273
AC_MSG_CHECKING([whether zlib support needs to be compiled])
2274
if test "${have_zlib}" = yes; then
2275
  AC_MSG_RESULT([no])
2276
  LIBS="-lz ${LIBS}"
2277
else
2278
  AC_MSG_RESULT([yes])
2279
  _R_ZLIB_MMAP
2280
fi
18200 hornik 2281
AM_CONDITIONAL(BUILD_ZLIB, [test "x${have_zlib}" = xno])
2282
AM_CONDITIONAL(USE_MMAP_ZLIB,
2283
[test "x${have_zlib}" = xno && test "x${r_cv_zlib_mmap}" = xyes])
18190 hornik 2284
])# R_ZLIB
2285
 
2286
## _R_HEADER_ZLIB
2287
## --------------
18428 hornik 2288
## Set shell variable r_cv_header_zlib_h to 'yes' if a recent enough
18190 hornik 2289
## zlib.h is found, and to 'no' otherwise.
2290
AC_DEFUN([_R_HEADER_ZLIB],
24174 ripley 2291
[AC_CACHE_CHECK([if zlib version >= 1.1.4],
18428 hornik 2292
                [r_cv_header_zlib_h],
22444 hornik 2293
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
2294
#include <string.h>
14682 hornik 2295
#include <zlib.h>
2296
int main() {
2297
#ifdef ZLIB_VERSION
24174 ripley 2298
  exit(strcmp(ZLIB_VERSION, "1.1.4") < 0);
14682 hornik 2299
#else
18190 hornik 2300
  exit(1);
14682 hornik 2301
#endif
22444 hornik 2302
}
2303
]])],
2304
              [r_cv_header_zlib_h=yes],
2305
              [r_cv_header_zlib_h=no],
2306
              [r_cv_header_zlib_h=no])])
18190 hornik 2307
])# _R_HEADER_ZLIB
2308
 
2309
## _R_ZLIB_MMAP
2310
## ------------
2311
AC_DEFUN([_R_ZLIB_MMAP],
2312
[AC_CACHE_CHECK([mmap support for zlib],
18298 hornik 2313
                [r_cv_zlib_mmap],
22444 hornik 2314
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
2315
#include <sys/types.h>
17798 ripley 2316
#include <sys/mman.h>
2317
#include <sys/stat.h>
2318
caddr_t hello() {
18190 hornik 2319
  exit(mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0)); 
22444 hornik 2320
}
2321
]])],
2322
              [r_cv_zlib_mmap=no],
2323
              [r_cv_zlib_mmap=yes],
2324
              [r_cv_zlib_mmap=yes])])
18190 hornik 2325
])# _R_ZLIB_MMAP
17898 hornik 2326
 
19612 ripley 2327
## R_PCRE
2328
## ------
19668 ripley 2329
## Try finding pcre library and headers.
20516 hornik 2330
## RedHat puts the headers in /usr/include/pcre.
19612 ripley 2331
AC_DEFUN([R_PCRE],
22181 ripley 2332
[if test "x${use_pcre}" = xyes; then
2333
  AC_CHECK_LIB(pcre, pcre_fullinfo, [have_pcre=yes], [have_pcre=no])
2334
  if test "${have_pcre}" = yes; then
2335
    AC_CHECK_HEADERS(pcre.h pcre/pcre.h)
2336
    if test "${ac_cv_header_pcre_h}" = no \
2337
	&& test "${ac_cv_header_pcre_pcre_h}" = no; then
2338
      have_pcre=no
2339
    fi
19612 ripley 2340
  fi
22181 ripley 2341
else
2342
  have_pcre=no
19612 ripley 2343
fi
26762 ripley 2344
if test "x${have_pcre}" = xyes; then
26751 ripley 2345
AC_CACHE_CHECK([if PCRE version >= 4.0], [r_have_pcre4],
2346
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
2347
#ifdef HAVE_PCRE_PCRE_H
2348
#include <pcre/pcre.h>
2349
#else
2350
#ifdef HAVE_PCRE_H
2351
#include <pcre.h>
2352
#endif
2353
#endif
2354
int main() {
2355
#ifdef PCRE_MAJOR
2356
  exit(PCRE_MAJOR<4);
2357
#else
2358
  exit(1);
2359
#endif
2360
}
2361
]])], [r_have_pcre4=yes], [r_have_pcre4=no], [r_have_pcre4=no])])
2362
fi
26762 ripley 2363
if test "x${r_have_pcre4}" = xyes; then
19668 ripley 2364
  LIBS="-lpcre ${LIBS}"
19612 ripley 2365
fi
22118 ripley 2366
AC_MSG_CHECKING([whether PCRE support needs to be compiled])
26751 ripley 2367
if test "x${r_have_pcre4}" = xyes; then
22118 ripley 2368
  AC_MSG_RESULT([no])
2369
else
2370
  AC_MSG_RESULT([yes])
2371
fi
26762 ripley 2372
AM_CONDITIONAL(BUILD_PCRE, [test "x${r_have_pcre4}" != xyes])
19612 ripley 2373
])# R_PCRE
2374
 
18618 ripley 2375
## R_BZLIB
21305 hornik 2376
## -------
18618 ripley 2377
## Try finding bzlib library and headers.
2378
## We check that both are installed,
2379
## and that BZ2_bzlibVersion is in the library.
2380
AC_DEFUN([R_BZLIB],
22181 ripley 2381
[if test "x${use_bzlib}" = xyes; then
2382
  AC_CHECK_LIB(bz2, BZ2_bzlibVersion, [have_bzlib=yes], [have_bzlib=no])
2383
  if test "${have_bzlib}" = yes; then
2384
    AC_CHECK_HEADER(bzlib.h, [have_bzlib=yes], [have_bzlib=no])
2385
  fi
2386
else
2387
  have_bzlib=no
18618 ripley 2388
fi
22118 ripley 2389
AC_MSG_CHECKING([whether bzip2 support needs to be compiled])
2390
if test "x${have_bzlib}" = xyes; then
2391
  AC_MSG_RESULT([no])
22121 ripley 2392
  LIBS="-lbz2 ${LIBS}"
22118 ripley 2393
else
2394
  AC_MSG_RESULT([yes])
18618 ripley 2395
fi
22118 ripley 2396
AM_CONDITIONAL(BUILD_BZLIB, [test "x${have_bzlib}" = xno])
18618 ripley 2397
])# R_BZLIB
2398
 
15333 hornik 2399
## R_SYS_POSIX_LEAPSECONDS
17898 hornik 2400
## -----------------------
15333 hornik 2401
## See if your system time functions do not count leap seconds, as
2402
## required by POSIX.
2403
AC_DEFUN([R_SYS_POSIX_LEAPSECONDS],
2404
[AC_CACHE_CHECK([whether leap seconds are treated according to POSIX],
18298 hornik 2405
                [r_cv_sys_posix_leapseconds],
22444 hornik 2406
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
15168 pd 2407
#include <stdlib.h>
14199 hornik 2408
#include <time.h>
2409
#include <stdio.h>
2410
#include "confdefs.h"
2411
 
2412
int main () {
2413
  struct tm *tm;
2414
  time_t ct;
2415
 
2416
  ctime(&ct);
2417
  ct = ct - (ct % 60);
2418
  tm = gmtime(&ct);
15168 pd 2419
  if(tm->tm_sec == 0) exit(1); else exit(0);
22444 hornik 2420
}
2421
]])],
2422
              [r_cv_sys_posix_leapseconds=no],
2423
              [r_cv_sys_posix_leapseconds=yes],
2424
              [r_cv_sys_posix_leapseconds=yes])])
15333 hornik 2425
if test "x${r_cv_sys_posix_leapseconds}" = xyes; then
17898 hornik 2426
  AC_DEFINE(HAVE_POSIX_LEAPSECONDS, 1,
2427
            [Define if your system time functions do not count leap
2428
	     seconds, as required by POSIX.])
15333 hornik 2429
fi
17898 hornik 2430
])# R_SYS_POSIX_LEAPSECONDS
18428 hornik 2431
 
21305 hornik 2432
### * Miscellaneous
2433
 
2434
## R_RECOMMENDED_PACKAGES
2435
## ----------------------
2436
## See if the sources for the recommended packages are available.
2437
AC_DEFUN([R_RECOMMENDED_PACKAGES],
2438
[AC_CACHE_CHECK([for recommended packages],
2439
                [r_cv_misc_recommended_packages],
2440
[r_cv_misc_recommended_packages=yes
25402 hornik 2441
recommended_pkgs=`grep '^R_PKGS_RECOMMENDED_SOURCES *=' \
2442
  ${srcdir}/share/make/vars.mk | sed 's/.*=//'`
21305 hornik 2443
for pkg in ${recommended_pkgs}; do
2444
  n_pkg=`ls ${srcdir}/src/library/Recommended/${pkg}_*.tar.gz | wc -l`
2445
  if test ${n_pkg} -ne 1; then
2446
    r_cv_misc_recommended_packages=no
2447
    break
2448
  fi
2449
done])
2450
use_recommended_packages=${r_cv_misc_recommended_packages}
2451
])# R_RECOMMENDED_PACKAGES
2452
 
18428 hornik 2453
### Local variables: ***
2454
### mode: outline-minor ***
2455
### outline-regexp: "### [*]+" ***
2456
### End: ***
14199 hornik 2457
dnl
2458
dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
2459
dnl
2460
dnl if failflag is "failure" it aborts if gnorba is not found.
2461
dnl
2462
 
2463
AC_DEFUN([GNOME_GNORBA_HOOK],[
2464
	GNOME_ORBIT_HOOK([],$2)
2465
	AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
2466
		gnome_cv_gnorba_found=no
2467
		if test x$gnome_cv_orbit_found = xyes; then
2468
			GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
2469
			GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
2470
			if test -n "$GNORBA_LIBS"; then
2471
				gnome_cv_gnorba_found=yes
2472
			fi
2473
		fi
2474
	])
2475
	AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
2476
	if test x$gnome_cv_orbit_found = xyes; then
2477
		$1
2478
		GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
2479
		GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
2480
		AC_SUBST(GNORBA_CFLAGS)
2481
		AC_SUBST(GNORBA_LIBS)
2482
	else
2483
	    	if test x$2 = xfailure; then
2484
			AC_MSG_ERROR(gnorba library not installed or installation problem)
2485
	    	fi
2486
	fi
2487
])
2488
 
2489
AC_DEFUN([GNOME_GNORBA_CHECK], [
2490
	GNOME_GNORBA_HOOK([],failure)
2491
])
2492
dnl
2493
dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
2494
dnl
2495
dnl if failflag is "failure" it aborts if orbit is not found.
2496
dnl
2497
 
2498
AC_DEFUN([GNOME_ORBIT_HOOK],[
2499
	AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
2500
	AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
2501
	AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
2502
		if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
2503
			gnome_cv_orbit_found=no
2504
		else
2505
			gnome_cv_orbit_found=yes
2506
		fi
2507
	])
2508
	AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
2509
	if test x$gnome_cv_orbit_found = xyes; then
2510
		$1
2511
		ORBIT_CFLAGS=`orbit-config --cflags client server`
2512
		ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
2513
		AC_SUBST(ORBIT_CFLAGS)
2514
		AC_SUBST(ORBIT_LIBS)
2515
	else
2516
    		if test x$2 = xfailure; then
2517
			AC_MSG_ERROR(ORBit not installed or installation problem)
2518
    		fi
2519
	fi
2520
])
2521
 
2522
AC_DEFUN([GNOME_ORBIT_CHECK], [
2523
	GNOME_ORBIT_HOOK([],failure)
2524
])
2525
dnl
2526
dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
2527
dnl
2528
dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
2529
dnl is not found. 
2530
dnl
2531
 
2532
AC_DEFUN([GNOME_INIT_HOOK],[
2533
	AC_SUBST(GNOME_LIBS)
2534
	AC_SUBST(GNOMEUI_LIBS)
2535
	AC_SUBST(GNOMEGNORBA_LIBS)
2536
	AC_SUBST(GTKXMHTML_LIBS)
2537
	AC_SUBST(ZVT_LIBS)
2538
	AC_SUBST(GNOME_LIBDIR)
2539
	AC_SUBST(GNOME_INCLUDEDIR)
2540
 
2541
	AC_ARG_WITH(gnome-includes,
2542
        [  --with-gnome-includes=DIR
2543
                          specify location of GNOME headers []], [
2544
	CPPFLAGS="$CPPFLAGS -I$withval"
2545
	])
2546
 
2547
	AC_ARG_WITH(gnome-libs,
2548
        [  --with-gnome-libs=DIR   specify location of GNOME libs []], [
2549
	LIBS="$LIBS -L$withval"
2550
	gnome_prefix=$withval
2551
	])
2552
 
2553
	if test "x$want_gnome" = xyes; then
2554
 
2555
	    AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
2556
	    if test "$GNOME_CONFIG" = "no"; then
2557
	      no_gnome_config="yes"
2558
	    else
2559
	      AC_MSG_CHECKING(if $GNOME_CONFIG works)
2560
	      if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
2561
	        AC_MSG_RESULT(yes)
2562
	        GNOME_GNORBA_HOOK([],$2)
2563
	        GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
2564
	        GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
2565
	        GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
2566
	        GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
2567
		ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
2568
	        GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
2569
	        GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
2570
                $1
2571
	      else
2572
	        AC_MSG_RESULT(no)
2573
	        no_gnome_config="yes"
2574
              fi
2575
            fi
2576
 
18428 hornik 2577
	    if test x$gnome_prefix = x; then
2578
	      if test x$exec_prefix = xNONE; then
14199 hornik 2579
	        if test x$prefix = xNONE; then
2580
		    gnome_prefix=$ac_default_prefix/lib
2581
	        else
2582
 		    gnome_prefix=$prefix/lib
2583
	        fi
18428 hornik 2584
	      else
14199 hornik 2585
	        gnome_prefix=`eval echo \`echo $libdir\``
18428 hornik 2586
	      fi
14199 hornik 2587
	    fi
2588
 
2589
	    if test "$no_gnome_config" = "yes"; then
2590
              AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
2591
	      if test -f $gnome_prefix/gnomeConf.sh; then
2592
	        AC_MSG_RESULT(found)
2593
	        echo "loading gnome configuration from" \
2594
		     "$gnome_prefix/gnomeConf.sh"
2595
	        . $gnome_prefix/gnomeConf.sh
2596
	        $1
2597
	      else
2598
	        AC_MSG_RESULT(not found)
2599
 	        if test x$2 = xfail; then
2600
	          AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
2601
 	        fi
2602
	      fi
2603
            fi
2604
	fi
2605
 
2606
	if test -n "$3"; then
2607
	  n="$3"
2608
	  for i in $n; do
2609
	    AC_MSG_CHECKING(extra library \"$i\")
2610
	    case $i in 
2611
	      applets)
2612
		AC_SUBST(GNOME_APPLETS_LIBS)
2613
		GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
2614
		AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
2615
	      capplet)
2616
		AC_SUBST(GNOME_CAPPLET_LIBS)
2617
		GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
2618
		AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
2619
	      *)
2620
		AC_MSG_RESULT(unknown library)
2621
	    esac
2622
	  done
2623
	fi
2624
])
2625
 
2626
dnl
2627
dnl GNOME_INIT ([additional-inits])
2628
dnl
2629
 
2630
AC_DEFUN([GNOME_INIT],[
2631
	GNOME_INIT_HOOK([],fail,$1)
2632
])
2633
# a macro to get the libs/cflags for libglade
2634
# serial 1
2635
 
2636
dnl AM_PATH_LIBGLADE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]])
2637
dnl Test to see if libglade is installed, and define LIBGLADE_CFLAGS, LIBS
2638
dnl
2639
AC_DEFUN(AM_PATH_LIBGLADE,
2640
[dnl
2641
dnl Get the cflags and libraries from the libglade-config script
2642
dnl
2643
AC_ARG_WITH(libglade-config,
2644
[  --with-libglade-config=LIBGLADE_CONFIG
2645
                          specify location of libglade-config []],
2646
LIBGLADE_CONFIG="$withval")
2647
 
2648
module_args=
2649
for module in . $3; do
2650
  case "$module" in
2651
    gnome)
2652
      module_args="$module_args gnome"
2653
      ;;
2654
    bonobo)
2655
      module_args="$module_args bonobo"
2656
      ;;
2657
    gnomedb)
2658
      module_args="$module_args gnomedb"
2659
      ;;
2660
  esac
2661
done
2662
 
2663
AC_PATH_PROG(LIBGLADE_CONFIG, libglade-config, no)
2664
AC_MSG_CHECKING(for libglade)
2665
if test "$LIBGLADE_CONFIG" = "no"; then
2666
  AC_MSG_RESULT(no)
2667
  ifelse([$2], , :, [$2])
2668
else
2669
  if $LIBGLADE_CONFIG --check $module_args; then
2670
    LIBGLADE_CFLAGS=`$LIBGLADE_CONFIG --cflags $module_args`
2671
    LIBGLADE_LIBS=`$LIBGLADE_CONFIG --libs $module_args`
2672
    AC_MSG_RESULT(yes)
2673
    ifelse([$1], , :, [$1])
2674
  else
2675
    echo "*** libglade was not compiled with support for $module_args" 1>&2
2676
    AC_MSG_RESULT(no)
2677
    ifelse([$2], , :, [$2])
2678
  fi
2679
fi
2680
AC_SUBST(LIBGLADE_CFLAGS)
2681
AC_SUBST(LIBGLADE_LIBS)
2682
])
27343 hornik 2683
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
14199 hornik 2684
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
2685
## Free Software Foundation, Inc.
2686
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2687
##
2688
## This program is free software; you can redistribute it and/or modify
2689
## it under the terms of the GNU General Public License as published by
2690
## the Free Software Foundation; either version 2 of the License, or
2691
## (at your option) any later version.
2692
##
2693
## This program is distributed in the hope that it will be useful, but
2694
## WITHOUT ANY WARRANTY; without even the implied warranty of
2695
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2696
## General Public License for more details.
2697
##
2698
## You should have received a copy of the GNU General Public License
2699
## along with this program; if not, write to the Free Software
2700
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2701
##
2702
## As a special exception to the GNU General Public License, if you
2703
## distribute this file as part of a program that contains a
2704
## configuration script generated by Autoconf, you may include it under
2705
## the same distribution terms that you use for the rest of that program.
2706
 
27343 hornik 2707
# serial 47 AC_PROG_LIBTOOL
19221 hornik 2708
 
27343 hornik 2709
 
2710
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
2711
# -----------------------------------------------------------
2712
# If this macro is not defined by Autoconf, define it here.
2713
m4_ifdef([AC_PROVIDE_IFELSE],
2714
         [],
2715
         [m4_define([AC_PROVIDE_IFELSE],
2716
	         [m4_ifdef([AC_PROVIDE_$1],
2717
		           [$2], [$3])])])
2718
 
2719
 
2720
# AC_PROG_LIBTOOL
2721
# ---------------
14199 hornik 2722
AC_DEFUN([AC_PROG_LIBTOOL],
27343 hornik 2723
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
2724
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
2725
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
2726
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
2727
    [AC_LIBTOOL_CXX],
2728
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
2729
  ])])
2730
dnl And a similar setup for Fortran 77 support
2731
  AC_PROVIDE_IFELSE([AC_PROG_F77],
2732
    [AC_LIBTOOL_F77],
2733
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
2734
])])
2735
 
2736
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
2737
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
2738
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
2739
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2740
    [AC_LIBTOOL_GCJ],
2741
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2742
      [AC_LIBTOOL_GCJ],
2743
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
2744
	[AC_LIBTOOL_GCJ],
2745
      [ifdef([AC_PROG_GCJ],
2746
	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
2747
       ifdef([A][M_PROG_GCJ],
2748
	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
2749
       ifdef([LT_AC_PROG_GCJ],
2750
	     [define([LT_AC_PROG_GCJ],
2751
		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
2752
])])# AC_PROG_LIBTOOL
2753
 
2754
 
2755
# _AC_PROG_LIBTOOL
2756
# ----------------
2757
AC_DEFUN([_AC_PROG_LIBTOOL],
14199 hornik 2758
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
27343 hornik 2759
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
2760
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
2761
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
14199 hornik 2762
 
2763
# This can be used to rebuild libtool when needed
2764
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
2765
 
2766
# Always use our own libtool.
2767
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2768
AC_SUBST(LIBTOOL)dnl
2769
 
2770
# Prevent multiple expansion
2771
define([AC_PROG_LIBTOOL], [])
27343 hornik 2772
])# _AC_PROG_LIBTOOL
14199 hornik 2773
 
27343 hornik 2774
 
2775
# AC_LIBTOOL_SETUP
2776
# ----------------
14199 hornik 2777
AC_DEFUN([AC_LIBTOOL_SETUP],
27343 hornik 2778
[AC_PREREQ(2.50)dnl
14199 hornik 2779
AC_REQUIRE([AC_ENABLE_SHARED])dnl
2780
AC_REQUIRE([AC_ENABLE_STATIC])dnl
2781
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
2782
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2783
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2784
AC_REQUIRE([AC_PROG_CC])dnl
2785
AC_REQUIRE([AC_PROG_LD])dnl
2786
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
2787
AC_REQUIRE([AC_PROG_NM])dnl
22044 hornik 2788
 
14199 hornik 2789
AC_REQUIRE([AC_PROG_LN_S])dnl
2790
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
27343 hornik 2791
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
14199 hornik 2792
AC_REQUIRE([AC_OBJEXT])dnl
2793
AC_REQUIRE([AC_EXEEXT])dnl
2794
dnl
2795
 
27343 hornik 2796
AC_LIBTOOL_SYS_MAX_CMD_LEN
2797
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
2798
AC_LIBTOOL_OBJDIR
2799
 
2800
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
14199 hornik 2801
_LT_AC_PROG_ECHO_BACKSLASH
27343 hornik 2802
 
2803
case $host_os in
2804
aix3*)
2805
  # AIX sometimes has problems with the GCC collect2 program.  For some
2806
  # reason, if we set the COLLECT_NAMES environment variable, the problems
2807
  # vanish in a puff of smoke.
2808
  if test "X${COLLECT_NAMES+set}" != Xset; then
2809
    COLLECT_NAMES=
2810
    export COLLECT_NAMES
14199 hornik 2811
  fi
2812
  ;;
2813
esac
2814
 
27343 hornik 2815
# Sed substitution that helps us do robust quoting.  It backslashifies
2816
# metacharacters that are still active within double-quoted strings.
2817
Xsed='sed -e s/^X//'
2818
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
14199 hornik 2819
 
27343 hornik 2820
# Same as above, but do not quote variable references.
2821
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
14199 hornik 2822
 
27343 hornik 2823
# Sed substitution to delay expansion of an escaped shell variable in a
2824
# double_quote_subst'ed string.
2825
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
14199 hornik 2826
 
27343 hornik 2827
# Sed substitution to avoid accidental globbing in evaled expressions
2828
no_glob_subst='s/\*/\\\*/g'
14199 hornik 2829
 
27343 hornik 2830
# Constants:
2831
rm="rm -f"
14199 hornik 2832
 
27343 hornik 2833
# Global variables:
2834
default_ofile=libtool
2835
can_build_shared=yes
14199 hornik 2836
 
27343 hornik 2837
# All known linkers require a `.a' archive for static linking (except M$VC,
2838
# which needs '.lib').
2839
libext=a
2840
ltmain="$ac_aux_dir/ltmain.sh"
2841
ofile="$default_ofile"
2842
with_gnu_ld="$lt_cv_prog_gnu_ld"
14199 hornik 2843
 
27343 hornik 2844
AC_CHECK_TOOL(AR, ar, false)
2845
AC_CHECK_TOOL(RANLIB, ranlib, :)
2846
AC_CHECK_TOOL(STRIP, strip, :)
14199 hornik 2847
 
27343 hornik 2848
old_CC="$CC"
2849
old_CFLAGS="$CFLAGS"
14199 hornik 2850
 
27343 hornik 2851
# Set sane defaults for various variables
2852
test -z "$AR" && AR=ar
2853
test -z "$AR_FLAGS" && AR_FLAGS=cru
2854
test -z "$AS" && AS=as
2855
test -z "$CC" && CC=cc
2856
test -z "$LTCC" && LTCC=$CC
2857
test -z "$DLLTOOL" && DLLTOOL=dlltool
2858
test -z "$LD" && LD=ld
2859
test -z "$LN_S" && LN_S="ln -s"
2860
test -z "$MAGIC_CMD" && MAGIC_CMD=file
2861
test -z "$NM" && NM=nm
2862
test -z "$SED" && SED=sed
2863
test -z "$OBJDUMP" && OBJDUMP=objdump
2864
test -z "$RANLIB" && RANLIB=:
2865
test -z "$STRIP" && STRIP=:
2866
test -z "$ac_objext" && ac_objext=o
14199 hornik 2867
 
27343 hornik 2868
# Determine commands to create old-style static archives.
2869
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
2870
old_postinstall_cmds='chmod 644 $oldlib'
2871
old_postuninstall_cmds=
19221 hornik 2872
 
27343 hornik 2873
if test -n "$RANLIB"; then
2874
  case $host_os in
2875
  openbsd*)
2876
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
2877
    ;;
2878
  *)
2879
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
2880
    ;;
2881
  esac
2882
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
19221 hornik 2883
fi
2884
 
27343 hornik 2885
# Only perform the check for file, if the check method requires it
2886
case $deplibs_check_method in
2887
file_magic*)
2888
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2889
    AC_PATH_MAGIC
2890
  fi
14199 hornik 2891
  ;;
2892
esac
2893
 
27343 hornik 2894
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
2895
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
2896
enable_win32_dll=yes, enable_win32_dll=no)
14199 hornik 2897
 
27343 hornik 2898
AC_ARG_ENABLE([libtool-lock],
2899
    [AC_HELP_STRING([--disable-libtool-lock],
2900
	[avoid locking (might break parallel builds)])])
2901
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
14199 hornik 2902
 
27343 hornik 2903
AC_ARG_WITH([pic],
2904
    [AC_HELP_STRING([--with-pic],
2905
	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
2906
    [pic_mode="$withval"],
2907
    [pic_mode=default])
2908
test -z "$pic_mode" && pic_mode=default
14199 hornik 2909
 
27343 hornik 2910
# Use C for the default configuration in the libtool script
2911
tagname=
2912
AC_LIBTOOL_LANG_C_CONFIG
2913
_LT_AC_TAGCONFIG
2914
])# AC_LIBTOOL_SETUP
14199 hornik 2915
 
2916
 
27343 hornik 2917
# _LT_AC_SYS_COMPILER
2918
# -------------------
2919
AC_DEFUN([_LT_AC_SYS_COMPILER],
2920
[AC_REQUIRE([AC_PROG_CC])dnl
14199 hornik 2921
 
27343 hornik 2922
# If no C compiler was specified, use CC.
2923
LTCC=${LTCC-"$CC"}
14199 hornik 2924
 
27343 hornik 2925
# Allow CC to be a program name with arguments.
2926
compiler=$CC
2927
])# _LT_AC_SYS_COMPILER
14199 hornik 2928
 
2929
 
27343 hornik 2930
# _LT_AC_SYS_LIBPATH_AIX
2931
# ----------------------
2932
# Links a minimal program and checks the executable
2933
# for the system default hardcoded library path. In most cases,
2934
# this is /usr/lib:/lib, but when the MPI compilers are used
2935
# the location of the communication and MPI libs are included too.
2936
# If we don't find anything, use the default library path according
2937
# to the aix ld manual.
2938
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
2939
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
2940
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
2941
}'`
2942
# Check for a 64-bit object if we didn't find anything.
2943
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; }
2944
}'`; fi],[])
2945
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
2946
])# _LT_AC_SYS_LIBPATH_AIX
14199 hornik 2947
 
2948
 
27343 hornik 2949
# _LT_AC_SHELL_INIT(ARG)
2950
# ----------------------
2951
AC_DEFUN([_LT_AC_SHELL_INIT],
2952
[ifdef([AC_DIVERSION_NOTICE],
2953
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
2954
	 [AC_DIVERT_PUSH(NOTICE)])
2955
$1
2956
AC_DIVERT_POP
2957
])# _LT_AC_SHELL_INIT
14199 hornik 2958
 
2959
 
2960
# _LT_AC_PROG_ECHO_BACKSLASH
2961
# --------------------------
2962
# Add some code to the start of the generated configure script which
19221 hornik 2963
# will find an echo command which doesn't interpret backslashes.
14199 hornik 2964
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
27343 hornik 2965
[_LT_AC_SHELL_INIT([
14199 hornik 2966
# Check that we are running under the correct shell.
2967
SHELL=${CONFIG_SHELL-/bin/sh}
2968
 
2969
case X$ECHO in
2970
X*--fallback-echo)
2971
  # Remove one level of quotation (which was required for Make).
2972
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
2973
  ;;
2974
esac
2975
 
2976
echo=${ECHO-echo}
2977
if test "X[$]1" = X--no-reexec; then
2978
  # Discard the --no-reexec flag, and continue.
2979
  shift
2980
elif test "X[$]1" = X--fallback-echo; then
2981
  # Avoid inline document here, it may be left over
2982
  :
27343 hornik 2983
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
14199 hornik 2984
  # Yippee, $echo works!
2985
  :
2986
else
2987
  # Restart under the correct shell.
2988
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
2989
fi
2990
 
2991
if test "X[$]1" = X--fallback-echo; then
2992
  # used as fallback echo
2993
  shift
2994
  cat <<EOF
27343 hornik 2995
[$]*
14199 hornik 2996
EOF
2997
  exit 0
2998
fi
2999
 
3000
# The HP-UX ksh and POSIX shell print the target directory to stdout
3001
# if CDPATH is set.
3002
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
3003
 
3004
if test -z "$ECHO"; then
3005
if test "X${echo_test_string+set}" != Xset; then
3006
# find a string as large as possible, as long as the shell can cope with it
3007
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
3008
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
3009
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
3010
       echo_test_string="`eval $cmd`" &&
3011
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
3012
    then
3013
      break
3014
    fi
3015
  done
3016
fi
3017
 
3018
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
3019
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
3020
   test "X$echo_testing_string" = "X$echo_test_string"; then
3021
  :
3022
else
3023
  # The Solaris, AIX, and Digital Unix default echo programs unquote
3024
  # backslashes.  This makes it impossible to quote backslashes using
3025
  #   echo "$something" | sed 's/\\/\\\\/g'
3026
  #
3027
  # So, first we look for a working echo in the user's PATH.
3028
 
27343 hornik 3029
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
14199 hornik 3030
  for dir in $PATH /usr/ucb; do
27343 hornik 3031
    IFS="$lt_save_ifs"
14199 hornik 3032
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
3033
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
3034
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
3035
       test "X$echo_testing_string" = "X$echo_test_string"; then
3036
      echo="$dir/echo"
3037
      break
3038
    fi
3039
  done
27343 hornik 3040
  IFS="$lt_save_ifs"
14199 hornik 3041
 
3042
  if test "X$echo" = Xecho; then
3043
    # We didn't find a better echo, so look for alternatives.
3044
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
3045
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
3046
       test "X$echo_testing_string" = "X$echo_test_string"; then
3047
      # This shell has a builtin print -r that does the trick.
3048
      echo='print -r'
3049
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
3050
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
14248 hornik 3051
      # If we have ksh, try running configure again with it.
14199 hornik 3052
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3053
      export ORIGINAL_CONFIG_SHELL
3054
      CONFIG_SHELL=/bin/ksh
3055
      export CONFIG_SHELL
3056
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
3057
    else
3058
      # Try using printf.
3059
      echo='printf %s\n'
3060
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
3061
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
3062
	 test "X$echo_testing_string" = "X$echo_test_string"; then
3063
	# Cool, printf works
3064
	:
3065
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3066
	   test "X$echo_testing_string" = 'X\t' &&
3067
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3068
	   test "X$echo_testing_string" = "X$echo_test_string"; then
3069
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
3070
	export CONFIG_SHELL
3071
	SHELL="$CONFIG_SHELL"
3072
	export SHELL
3073
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
3074
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3075
	   test "X$echo_testing_string" = 'X\t' &&
3076
	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3077
	   test "X$echo_testing_string" = "X$echo_test_string"; then
3078
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
3079
      else
3080
	# maybe with a smaller string...
3081
	prev=:
3082
 
3083
	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
3084
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
3085
	  then
3086
	    break
3087
	  fi
3088
	  prev="$cmd"
3089
	done
3090
 
3091
	if test "$prev" != 'sed 50q "[$]0"'; then
3092
	  echo_test_string=`eval $prev`
3093
	  export echo_test_string
3094
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
3095
	else
3096
	  # Oops.  We lost completely, so just stick with echo.
3097
	  echo=echo
3098
	fi
3099
      fi
3100
    fi
3101
  fi
3102
fi
3103
fi
3104
 
3105
# Copy echo and quote the copy suitably for passing to libtool from
3106
# the Makefile, instead of quoting the original, which is used later.
3107
ECHO=$echo
3108
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
3109
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
3110
fi
3111
 
3112
AC_SUBST(ECHO)
27343 hornik 3113
])])# _LT_AC_PROG_ECHO_BACKSLASH
14199 hornik 3114
 
27343 hornik 3115
 
3116
# _LT_AC_LOCK
3117
# -----------
3118
AC_DEFUN([_LT_AC_LOCK],
3119
[AC_ARG_ENABLE([libtool-lock],
3120
    [AC_HELP_STRING([--disable-libtool-lock],
3121
	[avoid locking (might break parallel builds)])])
3122
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
3123
 
3124
# Some flags need to be propagated to the compiler or linker for good
3125
# libtool support.
3126
case $host in
3127
ia64-*-hpux*)
3128
  # Find out which ABI we are using.
3129
  echo 'int i;' > conftest.$ac_ext
3130
  if AC_TRY_EVAL(ac_compile); then
3131
    case `/usr/bin/file conftest.$ac_objext` in
3132
    *ELF-32*)
3133
      HPUX_IA64_MODE="32"
3134
      ;;
3135
    *ELF-64*)
3136
      HPUX_IA64_MODE="64"
3137
      ;;
3138
    esac
3139
  fi
3140
  rm -rf conftest*
3141
  ;;
3142
*-*-irix6*)
3143
  # Find out which ABI we are using.
3144
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
3145
  if AC_TRY_EVAL(ac_compile); then
3146
   if test "$lt_cv_prog_gnu_ld" = yes; then
3147
    case `/usr/bin/file conftest.$ac_objext` in
3148
    *32-bit*)
3149
      LD="${LD-ld} -melf32bsmip"
3150
      ;;
3151
    *N32*)
3152
      LD="${LD-ld} -melf32bmipn32"
3153
      ;;
3154
    *64-bit*)
3155
      LD="${LD-ld} -melf64bmip"
3156
      ;;
3157
    esac
3158
   else
3159
    case `/usr/bin/file conftest.$ac_objext` in
3160
    *32-bit*)
3161
      LD="${LD-ld} -32"
3162
      ;;
3163
    *N32*)
3164
      LD="${LD-ld} -n32"
3165
      ;;
3166
    *64-bit*)
3167
      LD="${LD-ld} -64"
3168
      ;;
3169
    esac
3170
   fi
3171
  fi
3172
  rm -rf conftest*
3173
  ;;
3174
 
3175
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
3176
  # Find out which ABI we are using.
3177
  echo 'int i;' > conftest.$ac_ext
3178
  if AC_TRY_EVAL(ac_compile); then
3179
    case "`/usr/bin/file conftest.o`" in
3180
    *32-bit*)
3181
      case $host in
3182
        x86_64-*linux*)
3183
          LD="${LD-ld} -m elf_i386"
3184
          ;;
3185
        ppc64-*linux*)
3186
          LD="${LD-ld} -m elf32ppclinux"
3187
          ;;
3188
        s390x-*linux*)
3189
          LD="${LD-ld} -m elf_s390"
3190
          ;;
3191
        sparc64-*linux*)
3192
          LD="${LD-ld} -m elf32_sparc"
3193
          ;;
3194
      esac
3195
      ;;
3196
    *64-bit*)
3197
      case $host in
3198
        x86_64-*linux*)
3199
          LD="${LD-ld} -m elf_x86_64"
3200
          ;;
3201
        ppc*-*linux*|powerpc*-*linux*)
3202
          LD="${LD-ld} -m elf64ppc"
3203
          ;;
3204
        s390*-*linux*)
3205
          LD="${LD-ld} -m elf64_s390"
3206
          ;;
3207
        sparc*-*linux*)
3208
          LD="${LD-ld} -m elf64_sparc"
3209
          ;;
3210
      esac
3211
      ;;
3212
    esac
3213
  fi
3214
  rm -rf conftest*
3215
  ;;
3216
 
3217
*-*-sco3.2v5*)
3218
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3219
  SAVE_CFLAGS="$CFLAGS"
3220
  CFLAGS="$CFLAGS -belf"
3221
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
3222
    [AC_LANG_PUSH(C)
3223
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
3224
     AC_LANG_POP])
3225
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3226
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3227
    CFLAGS="$SAVE_CFLAGS"
3228
  fi
3229
  ;;
3230
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
3231
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
3232
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
3233
  AC_CHECK_TOOL(AS, as, false)
3234
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
3235
  ;;
3236
  ])
3237
esac
3238
 
3239
need_locks="$enable_libtool_lock"
3240
 
3241
])# _LT_AC_LOCK
3242
 
3243
 
3244
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3245
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
3246
# ----------------------------------------------------------------
3247
# Check whether the given compiler option works
3248
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
3249
[AC_CACHE_CHECK([$1], [$2],
3250
  [$2=no
3251
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
3252
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
3253
   lt_compiler_flag="$3"
3254
   # Insert the option either (1) after the last *FLAGS variable, or
3255
   # (2) before a word containing "conftest.", or (3) at the end.
3256
   # Note that $ac_compile itself does not contain backslashes and begins
3257
   # with a dollar sign (not a hyphen), so the echo should work correctly.
3258
   # The option is referenced via a variable to avoid confusing sed.
3259
   lt_compile=`echo "$ac_compile" | $SED \
3260
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
3261
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3262
   -e 's:$: $lt_compiler_flag:'`
3263
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3264
   (eval "$lt_compile" 2>conftest.err)
3265
   ac_status=$?
3266
   cat conftest.err >&AS_MESSAGE_LOG_FD
3267
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3268
   if (exit $ac_status) && test -s "$ac_outfile"; then
3269
     # The compiler can only warn and ignore the option if not recognized
3270
     # So say no if there are warnings
3271
     if test ! -s conftest.err; then
3272
       $2=yes
3273
     fi
3274
   fi
3275
   $rm conftest*
3276
])
3277
 
3278
if test x"[$]$2" = xyes; then
3279
    ifelse([$5], , :, [$5])
3280
else
3281
    ifelse([$6], , :, [$6])
3282
fi
3283
])# AC_LIBTOOL_COMPILER_OPTION
3284
 
3285
 
3286
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3287
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
3288
# ------------------------------------------------------------
3289
# Check whether the given compiler option works
3290
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
3291
[AC_CACHE_CHECK([$1], [$2],
3292
  [$2=no
3293
   save_LDFLAGS="$LDFLAGS"
3294
   LDFLAGS="$LDFLAGS $3"
3295
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
3296
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
3297
     # The compiler can only warn and ignore the option if not recognized
3298
     # So say no if there are warnings
3299
     if test -s conftest.err; then
3300
       # Append any errors to the config.log.
3301
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
3302
     else
3303
       $2=yes
3304
     fi
3305
   fi
3306
   $rm conftest*
3307
   LDFLAGS="$save_LDFLAGS"
3308
])
3309
 
3310
if test x"[$]$2" = xyes; then
3311
    ifelse([$4], , :, [$4])
3312
else
3313
    ifelse([$5], , :, [$5])
3314
fi
3315
])# AC_LIBTOOL_LINKER_OPTION
3316
 
3317
 
3318
# AC_LIBTOOL_SYS_MAX_CMD_LEN
3319
# --------------------------
3320
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
3321
[# find the maximum length of command line arguments
3322
AC_MSG_CHECKING([the maximum length of command line arguments])
3323
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
3324
  i=0
3325
  testring="ABCD"
3326
 
3327
  case $build_os in
3328
  msdosdjgpp*)
3329
    # On DJGPP, this test can blow up pretty badly due to problems in libc
3330
    # (any single argument exceeding 2000 bytes causes a buffer overrun
3331
    # during glob expansion).  Even if it were fixed, the result of this
3332
    # check would be larger than it should be.
3333
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
3334
    ;;
3335
 
3336
  gnu*)
3337
    # Under GNU Hurd, this test is not required because there is
3338
    # no limit to the length of command line arguments.
3339
    # Libtool will interpret -1 as no limit whatsoever
3340
    lt_cv_sys_max_cmd_len=-1;
3341
    ;;
3342
 
3343
  cygwin* | mingw*)
3344
    # On Win9x/ME, this test blows up -- it succeeds, but takes
3345
    # about 5 minutes as the teststring grows exponentially.
3346
    # Worse, since 9x/ME are not pre-emptively multitasking,
3347
    # you end up with a "frozen" computer, even though with patience
3348
    # the test eventually succeeds (with a max line length of 256k).
3349
    # Instead, let's just punt: use the minimum linelength reported by
3350
    # all of the supported platforms: 8192 (on NT/2K/XP).
3351
    lt_cv_sys_max_cmd_len=8192;
3352
    ;;
3353
 
3354
 *)
3355
    # If test is not a shell built-in, we'll probably end up computing a
3356
    # maximum length that is only half of the actual maximum length, but
3357
    # we can't tell.
3358
    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
3359
	       = "XX$testring") >/dev/null 2>&1 &&
3360
	    new_result=`expr "X$testring" : ".*" 2>&1` &&
3361
	    lt_cv_sys_max_cmd_len=$new_result &&
3362
	    test $i != 17 # 1/2 MB should be enough
3363
    do
3364
      i=`expr $i + 1`
3365
      testring=$testring$testring
3366
    done
3367
    testring=
3368
    # Add a significant safety factor because C++ compilers can tack on massive
3369
    # amounts of additional arguments before passing them to the linker.
3370
    # It appears as though 1/2 is a usable value.
3371
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
3372
    ;;
3373
  esac
3374
])
3375
if test -n $lt_cv_sys_max_cmd_len ; then
3376
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
3377
else
3378
  AC_MSG_RESULT(none)
3379
fi
3380
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
3381
 
3382
 
3383
# _LT_AC_CHECK_DLFCN
3384
# --------------------
3385
AC_DEFUN([_LT_AC_CHECK_DLFCN],
3386
[AC_CHECK_HEADERS(dlfcn.h)dnl
3387
])# _LT_AC_CHECK_DLFCN
3388
 
3389
 
14199 hornik 3390
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
3391
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
3392
# ------------------------------------------------------------------
19221 hornik 3393
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
27343 hornik 3394
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
3395
if test "$cross_compiling" = yes; then :
14199 hornik 3396
  [$4]
3397
else
3398
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
3399
  lt_status=$lt_dlunknown
3400
  cat > conftest.$ac_ext <<EOF
3401
[#line __oline__ "configure"
3402
#include "confdefs.h"
3403
 
3404
#if HAVE_DLFCN_H
3405
#include <dlfcn.h>
3406
#endif
3407
 
3408
#include <stdio.h>
3409
 
3410
#ifdef RTLD_GLOBAL
3411
#  define LT_DLGLOBAL		RTLD_GLOBAL
3412
#else
3413
#  ifdef DL_GLOBAL
3414
#    define LT_DLGLOBAL		DL_GLOBAL
3415
#  else
3416
#    define LT_DLGLOBAL		0
3417
#  endif
3418
#endif
3419
 
3420
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
3421
   find out it does not work in some platform. */
3422
#ifndef LT_DLLAZY_OR_NOW
3423
#  ifdef RTLD_LAZY
3424
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
3425
#  else
3426
#    ifdef DL_LAZY
3427
#      define LT_DLLAZY_OR_NOW		DL_LAZY
3428
#    else
3429
#      ifdef RTLD_NOW
3430
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
3431
#      else
3432
#        ifdef DL_NOW
3433
#          define LT_DLLAZY_OR_NOW	DL_NOW
3434
#        else
3435
#          define LT_DLLAZY_OR_NOW	0
3436
#        endif
3437
#      endif
3438
#    endif
3439
#  endif
3440
#endif
3441
 
3442
#ifdef __cplusplus
3443
extern "C" void exit (int);
3444
#endif
3445
 
3446
void fnord() { int i=42;}
3447
int main ()
3448
{
3449
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
3450
  int status = $lt_dlunknown;
3451
 
3452
  if (self)
3453
    {
3454
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
3455
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
3456
      /* dlclose (self); */
3457
    }
3458
 
3459
    exit (status);
3460
}]
3461
EOF
3462
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
3463
    (./conftest; exit; ) 2>/dev/null
3464
    lt_status=$?
3465
    case x$lt_status in
3466
      x$lt_dlno_uscore) $1 ;;
3467
      x$lt_dlneed_uscore) $2 ;;
3468
      x$lt_unknown|x*) $3 ;;
3469
    esac
3470
  else :
3471
    # compilation failed
3472
    $3
3473
  fi
3474
fi
3475
rm -fr conftest*
3476
])# _LT_AC_TRY_DLOPEN_SELF
3477
 
27343 hornik 3478
 
14199 hornik 3479
# AC_LIBTOOL_DLOPEN_SELF
3480
# -------------------
19221 hornik 3481
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
27343 hornik 3482
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
3483
if test "x$enable_dlopen" != xyes; then
14199 hornik 3484
  enable_dlopen=unknown
3485
  enable_dlopen_self=unknown
3486
  enable_dlopen_self_static=unknown
3487
else
3488
  lt_cv_dlopen=no
3489
  lt_cv_dlopen_libs=
3490
 
3491
  case $host_os in
3492
  beos*)
3493
    lt_cv_dlopen="load_add_on"
3494
    lt_cv_dlopen_libs=
3495
    lt_cv_dlopen_self=yes
3496
    ;;
3497
 
27343 hornik 3498
  mingw* | pw32*)
14199 hornik 3499
    lt_cv_dlopen="LoadLibrary"
3500
    lt_cv_dlopen_libs=
3501
   ;;
3502
 
27343 hornik 3503
  cygwin*)
3504
    lt_cv_dlopen="dlopen"
3505
    lt_cv_dlopen_libs=
3506
   ;;
3507
 
3508
  darwin*)
3509
  # if libdl is installed we need to link against it
3510
    AC_CHECK_LIB([dl], [dlopen],
3511
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
3512
    lt_cv_dlopen="dyld"
3513
    lt_cv_dlopen_libs=
3514
    lt_cv_dlopen_self=yes
3515
    ])
3516
   ;;
3517
 
14199 hornik 3518
  *)
19221 hornik 3519
    AC_CHECK_FUNC([shl_load],
27343 hornik 3520
	  [lt_cv_dlopen="shl_load"],
19221 hornik 3521
      [AC_CHECK_LIB([dld], [shl_load],
27343 hornik 3522
	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
19221 hornik 3523
	[AC_CHECK_FUNC([dlopen],
3524
	      [lt_cv_dlopen="dlopen"],
3525
	  [AC_CHECK_LIB([dl], [dlopen],
27343 hornik 3526
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19221 hornik 3527
	    [AC_CHECK_LIB([svld], [dlopen],
27343 hornik 3528
		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19221 hornik 3529
	      [AC_CHECK_LIB([dld], [dld_link],
27343 hornik 3530
		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
19221 hornik 3531
	      ])
14199 hornik 3532
	    ])
19221 hornik 3533
	  ])
3534
	])
14199 hornik 3535
      ])
3536
    ;;
3537
  esac
3538
 
3539
  if test "x$lt_cv_dlopen" != xno; then
3540
    enable_dlopen=yes
3541
  else
3542
    enable_dlopen=no
3543
  fi
3544
 
3545
  case $lt_cv_dlopen in
3546
  dlopen)
3547
    save_CPPFLAGS="$CPPFLAGS"
3548
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3549
 
3550
    save_LDFLAGS="$LDFLAGS"
3551
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3552
 
3553
    save_LIBS="$LIBS"
3554
    LIBS="$lt_cv_dlopen_libs $LIBS"
3555
 
3556
    AC_CACHE_CHECK([whether a program can dlopen itself],
3557
	  lt_cv_dlopen_self, [dnl
3558
	  _LT_AC_TRY_DLOPEN_SELF(
3559
	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3560
	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3561
    ])
3562
 
3563
    if test "x$lt_cv_dlopen_self" = xyes; then
3564
      LDFLAGS="$LDFLAGS $link_static_flag"
3565
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3566
    	  lt_cv_dlopen_self_static, [dnl
3567
	  _LT_AC_TRY_DLOPEN_SELF(
3568
	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3569
	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3570
      ])
3571
    fi
3572
 
3573
    CPPFLAGS="$save_CPPFLAGS"
3574
    LDFLAGS="$save_LDFLAGS"
3575
    LIBS="$save_LIBS"
3576
    ;;
3577
  esac
3578
 
3579
  case $lt_cv_dlopen_self in
3580
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3581
  *) enable_dlopen_self=unknown ;;
3582
  esac
3583
 
3584
  case $lt_cv_dlopen_self_static in
3585
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3586
  *) enable_dlopen_self_static=unknown ;;
3587
  esac
3588
fi
3589
])# AC_LIBTOOL_DLOPEN_SELF
3590
 
3591
 
27343 hornik 3592
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
3593
# ---------------------------------
3594
# Check to see if options -c and -o are simultaneously supported by compiler
3595
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
3596
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
3597
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3598
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3599
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3600
   $rm -r conftest 2>/dev/null
3601
   mkdir conftest
3602
   cd conftest
3603
   mkdir out
3604
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
14199 hornik 3605
 
27343 hornik 3606
   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
3607
   # that will create temporary files in the current directory regardless of
3608
   # the output directory.  Thus, making CWD read-only will cause this test
3609
   # to fail, enabling locking or at least warning the user not to do parallel
3610
   # builds.
3611
   chmod -w .
14199 hornik 3612
 
27343 hornik 3613
   lt_compiler_flag="-o out/conftest2.$ac_objext"
3614
   # Insert the option either (1) after the last *FLAGS variable, or
3615
   # (2) before a word containing "conftest.", or (3) at the end.
3616
   # Note that $ac_compile itself does not contain backslashes and begins
3617
   # with a dollar sign (not a hyphen), so the echo should work correctly.
3618
   lt_compile=`echo "$ac_compile" | $SED \
3619
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
3620
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3621
   -e 's:$: $lt_compiler_flag:'`
3622
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3623
   (eval "$lt_compile" 2>out/conftest.err)
3624
   ac_status=$?
3625
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3626
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3627
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3628
   then
3629
     # The compiler can only warn and ignore the option if not recognized
3630
     # So say no if there are warnings
3631
     if test ! -s out/conftest.err; then
3632
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3633
     fi
3634
   fi
3635
   chmod u+w .
3636
   $rm conftest* out/*
3637
   rmdir out
3638
   cd ..
3639
   rmdir conftest
3640
   $rm conftest*
14199 hornik 3641
])
27343 hornik 3642
])# AC_LIBTOOL_PROG_CC_C_O
14199 hornik 3643
 
3644
 
27343 hornik 3645
# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
3646
# -----------------------------------------
3647
# Check to see if we can do hard links to lock some files if needed
3648
AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
3649
[AC_REQUIRE([_LT_AC_LOCK])dnl
14199 hornik 3650
 
3651
hard_links="nottested"
27343 hornik 3652
if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
14199 hornik 3653
  # do not overwrite the value of need_locks provided by the user
3654
  AC_MSG_CHECKING([if we can lock with hard links])
3655
  hard_links=yes
3656
  $rm conftest*
3657
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3658
  touch conftest.a
3659
  ln conftest.a conftest.b 2>&5 || hard_links=no
3660
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3661
  AC_MSG_RESULT([$hard_links])
3662
  if test "$hard_links" = no; then
27343 hornik 3663
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
14199 hornik 3664
    need_locks=warn
3665
  fi
3666
else
3667
  need_locks=no
3668
fi
27343 hornik 3669
])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
14199 hornik 3670
 
3671
 
27343 hornik 3672
# AC_LIBTOOL_OBJDIR
3673
# -----------------
3674
AC_DEFUN([AC_LIBTOOL_OBJDIR],
3675
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3676
[rm -f .libs 2>/dev/null
3677
mkdir .libs 2>/dev/null
3678
if test -d .libs; then
3679
  lt_cv_objdir=.libs
3680
else
3681
  # MS-DOS does not allow filenames that begin with a dot.
3682
  lt_cv_objdir=_libs
14199 hornik 3683
fi
27343 hornik 3684
rmdir .libs 2>/dev/null])
3685
objdir=$lt_cv_objdir
3686
])# AC_LIBTOOL_OBJDIR
14199 hornik 3687
 
3688
 
27343 hornik 3689
# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
3690
# ----------------------------------------------
14199 hornik 3691
# Check hardcoding attributes.
27343 hornik 3692
AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
3693
[AC_MSG_CHECKING([how to hardcode library paths into programs])
3694
_LT_AC_TAGVAR(hardcode_action, $1)=
3695
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
3696
   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
3697
   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
14199 hornik 3698
 
3699
  # We can hardcode non-existant directories.
27343 hornik 3700
  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
14199 hornik 3701
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3702
     # have to relink, otherwise we might link with an installed library
3703
     # when we should be linking with a yet-to-be-installed one
27343 hornik 3704
     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3705
     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
14199 hornik 3706
    # Linking always hardcodes the temporary library directory.
27343 hornik 3707
    _LT_AC_TAGVAR(hardcode_action, $1)=relink
14199 hornik 3708
  else
3709
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
27343 hornik 3710
    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
14199 hornik 3711
  fi
3712
else
3713
  # We cannot hardcode anything, or else we can only hardcode existing
3714
  # directories.
27343 hornik 3715
  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
14199 hornik 3716
fi
27343 hornik 3717
AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
14199 hornik 3718
 
27343 hornik 3719
if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
3720
  # Fast installation is not supported
3721
  enable_fast_install=no
3722
elif test "$shlibpath_overrides_runpath" = yes ||
3723
     test "$enable_shared" = no; then
3724
  # Fast installation is not necessary
3725
  enable_fast_install=needless
3726
fi
3727
])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
3728
 
3729
 
3730
# AC_LIBTOOL_SYS_LIB_STRIP
3731
# ------------------------
3732
AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
3733
[striplib=
14199 hornik 3734
old_striplib=
3735
AC_MSG_CHECKING([whether stripping libraries is possible])
3736
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
3737
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3738
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3739
  AC_MSG_RESULT([yes])
3740
else
27343 hornik 3741
# FIXME - insert some real tests, host_os isn't really good enough
3742
  case $host_os in
3743
   darwin*)
3744
       if test -n "$STRIP" ; then
3745
         striplib="$STRIP -x"
3746
         AC_MSG_RESULT([yes])
3747
       else
14199 hornik 3748
  AC_MSG_RESULT([no])
3749
fi
27343 hornik 3750
       ;;
3751
   *)
3752
  AC_MSG_RESULT([no])
3753
    ;;
3754
  esac  
3755
fi
3756
])# AC_LIBTOOL_SYS_LIB_STRIP
14199 hornik 3757
 
3758
 
27343 hornik 3759
# AC_LIBTOOL_SYS_DYNAMIC_LINKER
3760
# -----------------------------
14199 hornik 3761
# PORTME Fill in your ld.so characteristics
27343 hornik 3762
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
3763
[AC_MSG_CHECKING([dynamic linker characteristics])
14199 hornik 3764
library_names_spec=
3765
libname_spec='lib$name'
3766
soname_spec=
27343 hornik 3767
shrext=".so"
14199 hornik 3768
postinstall_cmds=
3769
postuninstall_cmds=
3770
finish_cmds=
3771
finish_eval=
3772
shlibpath_var=
3773
shlibpath_overrides_runpath=unknown
3774
version_type=none
3775
dynamic_linker="$host_os ld.so"
3776
sys_lib_dlsearch_path_spec="/lib /usr/lib"
27343 hornik 3777
if test "$GCC" = yes; then
3778
  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
3779
  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
3780
    # if the path contains ";" then we assume it to be the separator
3781
    # otherwise default to the standard path separator (i.e. ":") - it is
3782
    # assumed that no part of a normal pathname contains ";" but that should
3783
    # okay in the real world where ";" in dirpaths is itself problematic.
3784
    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3785
  else
3786
    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
3787
  fi
3788
else
3789
  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3790
fi
3791
need_lib_prefix=unknown
3792
hardcode_into_libs=no
14199 hornik 3793
 
27343 hornik 3794
# when you set need_version to no, make sure it does not cause -set_version
3795
# flags to be left without arguments
3796
need_version=unknown
3797
 
14199 hornik 3798
case $host_os in
3799
aix3*)
3800
  version_type=linux
27343 hornik 3801
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
14199 hornik 3802
  shlibpath_var=LIBPATH
3803
 
27343 hornik 3804
  # AIX 3 has no versioning support, so we append a major version to the name.
3805
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 3806
  ;;
3807
 
14248 hornik 3808
aix4* | aix5*)
14199 hornik 3809
  version_type=linux
24001 hornik 3810
  need_lib_prefix=no
3811
  need_version=no
3812
  hardcode_into_libs=yes
14248 hornik 3813
  if test "$host_cpu" = ia64; then
3814
    # AIX 5 supports IA64
27343 hornik 3815
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
14248 hornik 3816
    shlibpath_var=LD_LIBRARY_PATH
3817
  else
3818
    # With GCC up to 2.95.x, collect2 would create an import file
3819
    # for dependence libraries.  The import file would start with
3820
    # the line `#! .'.  This would cause the generated library to
3821
    # depend on `.', always an invalid library.  This was fixed in
3822
    # development snapshots of GCC prior to 3.0.
3823
    case $host_os in
19221 hornik 3824
      aix4 | aix4.[[01]] | aix4.[[01]].*)
27343 hornik 3825
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3826
	   echo ' yes '
3827
	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
3828
	:
3829
      else
3830
	can_build_shared=no
3831
      fi
3832
      ;;
14248 hornik 3833
    esac
27343 hornik 3834
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3835
    # soname into executable. Probably we can add versioning support to
3836
    # collect2, so additional links can be useful in future.
14248 hornik 3837
    if test "$aix_use_runtimelinking" = yes; then
19221 hornik 3838
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3839
      # instead of lib<name>.a to let people know that these are not
3840
      # typical AIX shared libraries.
27343 hornik 3841
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14199 hornik 3842
    else
14248 hornik 3843
      # We preserve .a as extension for shared libraries through AIX4.2
3844
      # and later when we are not doing run time linking.
3845
      library_names_spec='${libname}${release}.a $libname.a'
27343 hornik 3846
      soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 3847
    fi
14248 hornik 3848
    shlibpath_var=LIBPATH
3849
  fi
14199 hornik 3850
  ;;
3851
 
3852
amigaos*)
3853
  library_names_spec='$libname.ixlibrary $libname.a'
3854
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
19221 hornik 3855
  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'
14199 hornik 3856
  ;;
3857
 
3858
beos*)
27343 hornik 3859
  library_names_spec='${libname}${shared_ext}'
14199 hornik 3860
  dynamic_linker="$host_os ld.so"
3861
  shlibpath_var=LIBRARY_PATH
3862
  ;;
3863
 
3864
bsdi4*)
3865
  version_type=linux
3866
  need_version=no
27343 hornik 3867
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3868
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 3869
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3870
  shlibpath_var=LD_LIBRARY_PATH
3871
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3872
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3873
  # the default ld.so.conf also contains /usr/contrib/lib and
3874
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3875
  # libtool to hard-code these into programs
3876
  ;;
3877
 
3878
cygwin* | mingw* | pw32*)
3879
  version_type=windows
27343 hornik 3880
  shrext=".dll"
14199 hornik 3881
  need_version=no
3882
  need_lib_prefix=no
27343 hornik 3883
 
14199 hornik 3884
  case $GCC,$host_os in
27343 hornik 3885
  yes,cygwin* | yes,mingw* | yes,pw32*)
14199 hornik 3886
    library_names_spec='$libname.dll.a'
27343 hornik 3887
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3888
    postinstall_cmds='base_file=`basename \${file}`~
3889
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
14199 hornik 3890
      dldir=$destdir/`dirname \$dlpath`~
3891
      test -d \$dldir || mkdir -p \$dldir~
27343 hornik 3892
      $install_prog $dir/$dlname \$dldir/$dlname'
3893
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
14199 hornik 3894
      dlpath=$dir/\$dldll~
3895
       $rm \$dlpath'
27343 hornik 3896
    shlibpath_overrides_runpath=yes
3897
 
3898
    case $host_os in
3899
    cygwin*)
3900
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3901
      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3902
      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
3903
      ;;
3904
    mingw*)
3905
      # MinGW DLLs use traditional 'lib' prefix
3906
      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3907
      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
3908
      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
3909
        # It is most probably a Windows format PATH printed by
3910
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
3911
        # path with ; separators, and with drive letters. We can handle the
3912
        # drive letters (cygwin fileutils understands them), so leave them,
3913
        # especially as we might pass files found there to a mingw objdump,
3914
        # which wouldn't understand a cygwinified path. Ahh.
3915
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3916
      else
3917
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
3918
      fi
3919
      ;;
3920
    pw32*)
3921
      # pw32 DLLs use 'pw' prefix rather than 'lib'
3922
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
3923
      ;;
3924
    esac
14199 hornik 3925
    ;;
27343 hornik 3926
 
14199 hornik 3927
  *)
27343 hornik 3928
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
14199 hornik 3929
    ;;
3930
  esac
3931
  dynamic_linker='Win32 ld.exe'
3932
  # FIXME: first we should search . and the directory the executable is in
3933
  shlibpath_var=PATH
3934
  ;;
3935
 
3936
darwin* | rhapsody*)
3937
  dynamic_linker="$host_os dyld"
3938
  version_type=darwin
3939
  need_lib_prefix=no
3940
  need_version=no
14248 hornik 3941
  # FIXME: Relying on posixy $() will cause problems for
3942
  #        cross-compilation, but unfortunately the echo tests do not
3943
  #        yet detect zsh echo's removal of \ escapes.
27343 hornik 3944
  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3945
  soname_spec='${libname}${release}${major}$shared_ext'
14199 hornik 3946
  shlibpath_overrides_runpath=yes
3947
  shlibpath_var=DYLD_LIBRARY_PATH
27343 hornik 3948
  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
3949
  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
3950
  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
3951
  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"`
3952
  fi
3953
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
14199 hornik 3954
  ;;
3955
 
27343 hornik 3956
dgux*)
24001 hornik 3957
  version_type=linux
3958
  need_lib_prefix=no
3959
  need_version=no
27343 hornik 3960
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3961
  soname_spec='${libname}${release}${shared_ext}$major'
24001 hornik 3962
  shlibpath_var=LD_LIBRARY_PATH
3963
  ;;
3964
 
27343 hornik 3965
freebsd1*)
3966
  dynamic_linker=no
3967
  ;;
3968
 
14199 hornik 3969
freebsd*)
3970
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3971
  version_type=freebsd-$objformat
3972
  case $version_type in
3973
    freebsd-elf*)
27343 hornik 3974
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
14199 hornik 3975
      need_version=no
3976
      need_lib_prefix=no
3977
      ;;
3978
    freebsd-*)
27343 hornik 3979
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
14199 hornik 3980
      need_version=yes
3981
      ;;
3982
  esac
3983
  shlibpath_var=LD_LIBRARY_PATH
3984
  case $host_os in
3985
  freebsd2*)
3986
    shlibpath_overrides_runpath=yes
3987
    ;;
27343 hornik 3988
  freebsd3.[01]* | freebsdelf3.[01]*)
3989
    shlibpath_overrides_runpath=yes
3990
    hardcode_into_libs=yes
3991
    ;;
3992
  *) # from 3.2 on
14199 hornik 3993
    shlibpath_overrides_runpath=no
3994
    hardcode_into_libs=yes
3995
    ;;
3996
  esac
3997
  ;;
3998
 
3999
gnu*)
4000
  version_type=linux
4001
  need_lib_prefix=no
4002
  need_version=no
27343 hornik 4003
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
4004
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 4005
  shlibpath_var=LD_LIBRARY_PATH
4006
  hardcode_into_libs=yes
4007
  ;;
4008
 
4009
hpux9* | hpux10* | hpux11*)
4010
  # Give a soname corresponding to the major version so that dld.sl refuses to
4011
  # link against other versions.
4012
  version_type=sunos
4013
  need_lib_prefix=no
4014
  need_version=no
27343 hornik 4015
  case "$host_cpu" in
4016
  ia64*)
4017
    shrext='.so'
4018
    hardcode_into_libs=yes
4019
    dynamic_linker="$host_os dld.so"
4020
    shlibpath_var=LD_LIBRARY_PATH
4021
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4022
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4023
    soname_spec='${libname}${release}${shared_ext}$major'
4024
    if test "X$HPUX_IA64_MODE" = X32; then
4025
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
4026
    else
4027
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
4028
    fi
4029
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4030
    ;;
4031
   hppa*64*)
4032
     shrext='.sl'
4033
     hardcode_into_libs=yes
4034
     dynamic_linker="$host_os dld.sl"
4035
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
4036
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4037
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4038
     soname_spec='${libname}${release}${shared_ext}$major'
4039
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
4040
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4041
     ;;
4042
   *)
4043
    shrext='.sl'
4044
    dynamic_linker="$host_os dld.sl"
4045
    shlibpath_var=SHLIB_PATH
4046
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
4047
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4048
    soname_spec='${libname}${release}${shared_ext}$major'
4049
    ;;
4050
  esac
14199 hornik 4051
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
4052
  postinstall_cmds='chmod 555 $lib'
4053
  ;;
4054
 
22044 hornik 4055
irix5* | irix6* | nonstopux*)
4056
  case $host_os in
4057
    nonstopux*) version_type=nonstopux ;;
27343 hornik 4058
    *)
4059
	if test "$lt_cv_prog_gnu_ld" = yes; then
4060
		version_type=linux
4061
	else
4062
		version_type=irix
4063
	fi ;;
22044 hornik 4064
  esac
14199 hornik 4065
  need_lib_prefix=no
4066
  need_version=no
27343 hornik 4067
  soname_spec='${libname}${release}${shared_ext}$major'
4068
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
14199 hornik 4069
  case $host_os in
22044 hornik 4070
  irix5* | nonstopux*)
14199 hornik 4071
    libsuff= shlibsuff=
4072
    ;;
4073
  *)
4074
    case $LD in # libtool.m4 will add one of these switches to LD
27343 hornik 4075
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
4076
      libsuff= shlibsuff= libmagic=32-bit;;
4077
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
4078
      libsuff=32 shlibsuff=N32 libmagic=N32;;
4079
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
4080
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
14199 hornik 4081
    *) libsuff= shlibsuff= libmagic=never-match;;
4082
    esac
4083
    ;;
4084
  esac
4085
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
4086
  shlibpath_overrides_runpath=no
4087
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
4088
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
27343 hornik 4089
  hardcode_into_libs=yes
14199 hornik 4090
  ;;
4091
 
4092
# No shared lib support for Linux oldld, aout, or coff.
27343 hornik 4093
linux*oldld* | linux*aout* | linux*coff*)
14199 hornik 4094
  dynamic_linker=no
4095
  ;;
4096
 
4097
# This must be Linux ELF.
27343 hornik 4098
linux*)
14199 hornik 4099
  version_type=linux
4100
  need_lib_prefix=no
4101
  need_version=no
27343 hornik 4102
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4103
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 4104
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
4105
  shlibpath_var=LD_LIBRARY_PATH
4106
  shlibpath_overrides_runpath=no
4107
  # This implies no fast_install, which is unacceptable.
4108
  # Some rework will be needed to allow for fast_install
4109
  # before this can be enabled.
4110
  hardcode_into_libs=yes
4111
 
4112
  # We used to test for /lib/ld.so.1 and disable shared libraries on
4113
  # powerpc, because MkLinux only supported shared libraries with the
4114
  # GNU dynamic linker.  Since this was broken with cross compilers,
4115
  # most powerpc-linux boxes support dynamic linking these days and
4116
  # people can always --disable-shared, the test was removed, and we
4117
  # assume the GNU/Linux dynamic linker is in use.
4118
  dynamic_linker='GNU/Linux ld.so'
4119
  ;;
4120
 
4121
netbsd*)
4122
  version_type=sunos
14248 hornik 4123
  need_lib_prefix=no
4124
  need_version=no
14199 hornik 4125
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
27343 hornik 4126
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
14199 hornik 4127
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4128
    dynamic_linker='NetBSD (a.out) ld.so'
4129
  else
27343 hornik 4130
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
4131
    soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 4132
    dynamic_linker='NetBSD ld.elf_so'
4133
  fi
4134
  shlibpath_var=LD_LIBRARY_PATH
4135
  shlibpath_overrides_runpath=yes
4136
  hardcode_into_libs=yes
4137
  ;;
4138
 
4139
newsos6)
4140
  version_type=linux
27343 hornik 4141
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14199 hornik 4142
  shlibpath_var=LD_LIBRARY_PATH
4143
  shlibpath_overrides_runpath=yes
4144
  ;;
4145
 
27343 hornik 4146
nto-qnx)
4147
  version_type=linux
4148
  need_lib_prefix=no
4149
  need_version=no
4150
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4151
  soname_spec='${libname}${release}${shared_ext}$major'
4152
  shlibpath_var=LD_LIBRARY_PATH
4153
  shlibpath_overrides_runpath=yes
4154
  ;;
4155
 
14199 hornik 4156
openbsd*)
4157
  version_type=sunos
19221 hornik 4158
  need_lib_prefix=no
4159
  need_version=no
27343 hornik 4160
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4161
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4162
  shlibpath_var=LD_LIBRARY_PATH
19221 hornik 4163
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27343 hornik 4164
    case $host_os in
4165
      openbsd2.[[89]] | openbsd2.[[89]].*)
4166
	shlibpath_overrides_runpath=no
4167
	;;
4168
      *)
4169
	shlibpath_overrides_runpath=yes
4170
	;;
4171
      esac
19221 hornik 4172
  else
4173
    shlibpath_overrides_runpath=yes
14199 hornik 4174
  fi
4175
  ;;
4176
 
4177
os2*)
4178
  libname_spec='$name'
27343 hornik 4179
  shrext=".dll"
14199 hornik 4180
  need_lib_prefix=no
27343 hornik 4181
  library_names_spec='$libname${shared_ext} $libname.a'
14199 hornik 4182
  dynamic_linker='OS/2 ld.exe'
4183
  shlibpath_var=LIBPATH
4184
  ;;
4185
 
4186
osf3* | osf4* | osf5*)
4187
  version_type=osf
27343 hornik 4188
  need_lib_prefix=no
14199 hornik 4189
  need_version=no
27343 hornik 4190
  soname_spec='${libname}${release}${shared_ext}$major'
4191
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14199 hornik 4192
  shlibpath_var=LD_LIBRARY_PATH
4193
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
4194
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
4195
  ;;
4196
 
4197
sco3.2v5*)
4198
  version_type=osf
27343 hornik 4199
  soname_spec='${libname}${release}${shared_ext}$major'
4200
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14199 hornik 4201
  shlibpath_var=LD_LIBRARY_PATH
4202
  ;;
4203
 
4204
solaris*)
4205
  version_type=linux
4206
  need_lib_prefix=no
4207
  need_version=no
27343 hornik 4208
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4209
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 4210
  shlibpath_var=LD_LIBRARY_PATH
4211
  shlibpath_overrides_runpath=yes
4212
  hardcode_into_libs=yes
4213
  # ldd complains unless libraries are executable
4214
  postinstall_cmds='chmod +x $lib'
4215
  ;;
4216
 
4217
sunos4*)
4218
  version_type=sunos
27343 hornik 4219
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
14199 hornik 4220
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
4221
  shlibpath_var=LD_LIBRARY_PATH
4222
  shlibpath_overrides_runpath=yes
4223
  if test "$with_gnu_ld" = yes; then
4224
    need_lib_prefix=no
4225
  fi
4226
  need_version=yes
4227
  ;;
4228
 
4229
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4230
  version_type=linux
27343 hornik 4231
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4232
  soname_spec='${libname}${release}${shared_ext}$major'
14199 hornik 4233
  shlibpath_var=LD_LIBRARY_PATH
4234
  case $host_vendor in
4235
    sni)
4236
      shlibpath_overrides_runpath=no
22044 hornik 4237
      need_lib_prefix=no
4238
      export_dynamic_flag_spec='${wl}-Blargedynsym'
4239
      runpath_var=LD_RUN_PATH
14199 hornik 4240
      ;;
22044 hornik 4241
    siemens)
4242
      need_lib_prefix=no
4243
      ;;
14199 hornik 4244
    motorola)
4245
      need_lib_prefix=no
4246
      need_version=no
4247
      shlibpath_overrides_runpath=no
4248
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
4249
      ;;
4250
  esac
4251
  ;;
4252
 
4253
sysv4*MP*)
4254
  if test -d /usr/nec ;then
4255
    version_type=linux
27343 hornik 4256
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
4257
    soname_spec='$libname${shared_ext}.$major'
14199 hornik 4258
    shlibpath_var=LD_LIBRARY_PATH
4259
  fi
4260
  ;;
4261
 
27343 hornik 4262
uts4*)
4263
  version_type=linux
4264
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4265
  soname_spec='${libname}${release}${shared_ext}$major'
4266
  shlibpath_var=LD_LIBRARY_PATH
4267
  ;;
4268
 
14199 hornik 4269
*)
4270
  dynamic_linker=no
4271
  ;;
4272
esac
4273
AC_MSG_RESULT([$dynamic_linker])
4274
test "$dynamic_linker" = no && can_build_shared=no
27343 hornik 4275
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
14199 hornik 4276
 
4277
 
27343 hornik 4278
# _LT_AC_TAGCONFIG
4279
# ----------------
4280
AC_DEFUN([_LT_AC_TAGCONFIG],
4281
[AC_ARG_WITH([tags],
4282
    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
4283
        [include additional configurations @<:@automatic@:>@])],
4284
    [tagnames="$withval"])
19221 hornik 4285
 
27343 hornik 4286
if test -f "$ltmain" && test -n "$tagnames"; then
4287
  if test ! -f "${ofile}"; then
4288
    AC_MSG_WARN([output file `$ofile' does not exist])
19221 hornik 4289
  fi
4290
 
27343 hornik 4291
  if test -z "$LTCC"; then
4292
    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
4293
    if test -z "$LTCC"; then
4294
      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
4295
    else
4296
      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
4297
    fi
19221 hornik 4298
  fi
4299
 
27343 hornik 4300
  # Extract list of available tagged configurations in $ofile.
4301
  # Note that this assumes the entire list is on one line.
4302
  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
19221 hornik 4303
 
27343 hornik 4304
  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4305
  for tagname in $tagnames; do
4306
    IFS="$lt_save_ifs"
4307
    # Check whether tagname contains only valid characters
4308
    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
4309
    "") ;;
4310
    *)  AC_MSG_ERROR([invalid tag name: $tagname])
4311
	;;
4312
    esac
14199 hornik 4313
 
27343 hornik 4314
    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
4315
    then
4316
      AC_MSG_ERROR([tag name \"$tagname\" already exists])
4317
    fi
14199 hornik 4318
 
27343 hornik 4319
    # Update the list of available tags.
4320
    if test -n "$tagname"; then
4321
      echo appending configuration tag \"$tagname\" to $ofile
14199 hornik 4322
 
27343 hornik 4323
      case $tagname in
4324
      CXX)
4325
	if test -n "$CXX" && test "X$CXX" != "Xno"; then
4326
	  AC_LIBTOOL_LANG_CXX_CONFIG
4327
	else
4328
	  tagname=""
4329
	fi
4330
	;;
14199 hornik 4331
 
27343 hornik 4332
      F77)
4333
	if test -n "$F77" && test "X$F77" != "Xno"; then
4334
	  AC_LIBTOOL_LANG_F77_CONFIG
4335
	else
4336
	  tagname=""
4337
	fi
4338
	;;
14199 hornik 4339
 
27343 hornik 4340
      GCJ)
4341
	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
4342
	  AC_LIBTOOL_LANG_GCJ_CONFIG
4343
	else
4344
	  tagname=""
4345
	fi
4346
	;;
14199 hornik 4347
 
27343 hornik 4348
      RC)
4349
	AC_LIBTOOL_LANG_RC_CONFIG
4350
	;;
14199 hornik 4351
 
27343 hornik 4352
      *)
4353
	AC_MSG_ERROR([Unsupported tag name: $tagname])
4354
	;;
4355
      esac
14199 hornik 4356
 
27343 hornik 4357
      # Append the new tag name to the list of available tags.
4358
      if test -n "$tagname" ; then
4359
      available_tags="$available_tags $tagname"
4360
    fi
4361
    fi
14199 hornik 4362
  done
27343 hornik 4363
  IFS="$lt_save_ifs"
14199 hornik 4364
 
27343 hornik 4365
  # Now substitute the updated list of available tags.
4366
  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
4367
    mv "${ofile}T" "$ofile"
4368
    chmod +x "$ofile"
4369
  else
4370
    rm -f "${ofile}T"
4371
    AC_MSG_ERROR([unable to update list of available tagged configurations.])
4372
  fi
14199 hornik 4373
fi
27343 hornik 4374
])# _LT_AC_TAGCONFIG
14199 hornik 4375
 
4376
 
27343 hornik 4377
# AC_LIBTOOL_DLOPEN
4378
# -----------------
4379
# enable checks for dlopen support
4380
AC_DEFUN([AC_LIBTOOL_DLOPEN],
4381
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
4382
])# AC_LIBTOOL_DLOPEN
14199 hornik 4383
 
4384
 
27343 hornik 4385
# AC_LIBTOOL_WIN32_DLL
4386
# --------------------
4387
# declare package support for building win32 dll's
4388
AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
4389
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
4390
])# AC_LIBTOOL_WIN32_DLL
14199 hornik 4391
 
4392
 
27343 hornik 4393
# AC_ENABLE_SHARED([DEFAULT])
4394
# ---------------------------
4395
# implement the --enable-shared flag
4396
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
14199 hornik 4397
AC_DEFUN([AC_ENABLE_SHARED],
4398
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
27343 hornik 4399
AC_ARG_ENABLE([shared],
4400
    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
4401
	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
4402
    [p=${PACKAGE-default}
4403
    case $enableval in
4404
    yes) enable_shared=yes ;;
4405
    no) enable_shared=no ;;
4406
    *)
4407
      enable_shared=no
4408
      # Look at the argument we got.  We use all the common list separators.
4409
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4410
      for pkg in $enableval; do
4411
	IFS="$lt_save_ifs"
4412
	if test "X$pkg" = "X$p"; then
4413
	  enable_shared=yes
4414
	fi
4415
      done
4416
      IFS="$lt_save_ifs"
4417
      ;;
4418
    esac],
4419
    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
4420
])# AC_ENABLE_SHARED
14199 hornik 4421
 
27343 hornik 4422
 
4423
# AC_DISABLE_SHARED
4424
# -----------------
4425
#- set the default shared flag to --disable-shared
14199 hornik 4426
AC_DEFUN([AC_DISABLE_SHARED],
4427
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
27343 hornik 4428
AC_ENABLE_SHARED(no)
4429
])# AC_DISABLE_SHARED
14199 hornik 4430
 
27343 hornik 4431
 
4432
# AC_ENABLE_STATIC([DEFAULT])
4433
# ---------------------------
4434
# implement the --enable-static flag
4435
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
14199 hornik 4436
AC_DEFUN([AC_ENABLE_STATIC],
4437
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
27343 hornik 4438
AC_ARG_ENABLE([static],
4439
    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
4440
	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
4441
    [p=${PACKAGE-default}
4442
    case $enableval in
4443
    yes) enable_static=yes ;;
4444
    no) enable_static=no ;;
4445
    *)
4446
     enable_static=no
4447
      # Look at the argument we got.  We use all the common list separators.
4448
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4449
      for pkg in $enableval; do
4450
	IFS="$lt_save_ifs"
4451
	if test "X$pkg" = "X$p"; then
4452
	  enable_static=yes
4453
	fi
4454
      done
4455
      IFS="$lt_save_ifs"
4456
      ;;
4457
    esac],
4458
    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
4459
])# AC_ENABLE_STATIC
14199 hornik 4460
 
27343 hornik 4461
 
4462
# AC_DISABLE_STATIC
4463
# -----------------
4464
# set the default static flag to --disable-static
14199 hornik 4465
AC_DEFUN([AC_DISABLE_STATIC],
4466
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
27343 hornik 4467
AC_ENABLE_STATIC(no)
4468
])# AC_DISABLE_STATIC
14199 hornik 4469
 
4470
 
27343 hornik 4471
# AC_ENABLE_FAST_INSTALL([DEFAULT])
4472
# ---------------------------------
4473
# implement the --enable-fast-install flag
4474
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
14199 hornik 4475
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4476
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
27343 hornik 4477
AC_ARG_ENABLE([fast-install],
4478
    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
4479
    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
4480
    [p=${PACKAGE-default}
4481
    case $enableval in
4482
    yes) enable_fast_install=yes ;;
4483
    no) enable_fast_install=no ;;
4484
    *)
4485
      enable_fast_install=no
4486
      # Look at the argument we got.  We use all the common list separators.
4487
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4488
      for pkg in $enableval; do
4489
	IFS="$lt_save_ifs"
4490
	if test "X$pkg" = "X$p"; then
4491
	  enable_fast_install=yes
4492
	fi
4493
      done
4494
      IFS="$lt_save_ifs"
4495
      ;;
4496
    esac],
4497
    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
4498
])# AC_ENABLE_FAST_INSTALL
14199 hornik 4499
 
27343 hornik 4500
 
4501
# AC_DISABLE_FAST_INSTALL
4502
# -----------------------
4503
# set the default to --disable-fast-install
14199 hornik 4504
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4505
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
27343 hornik 4506
AC_ENABLE_FAST_INSTALL(no)
4507
])# AC_DISABLE_FAST_INSTALL
14199 hornik 4508
 
27343 hornik 4509
 
4510
# AC_LIBTOOL_PICMODE([MODE])
4511
# --------------------------
4512
# implement the --with-pic flag
4513
# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
14199 hornik 4514
AC_DEFUN([AC_LIBTOOL_PICMODE],
4515
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
27343 hornik 4516
pic_mode=ifelse($#,1,$1,default)
4517
])# AC_LIBTOOL_PICMODE
14199 hornik 4518
 
4519
 
27343 hornik 4520
# AC_PROG_EGREP
4521
# -------------
4522
# This is predefined starting with Autoconf 2.54, so this conditional
4523
# definition can be removed once we require Autoconf 2.54 or later.
4524
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
4525
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
4526
   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
4527
    then ac_cv_prog_egrep='grep -E'
4528
    else ac_cv_prog_egrep='egrep'
4529
    fi])
4530
 EGREP=$ac_cv_prog_egrep
4531
 AC_SUBST([EGREP])
4532
])])
4533
 
4534
 
4535
# AC_PATH_TOOL_PREFIX
4536
# -------------------
4537
# find a file program which can recognise shared library
14199 hornik 4538
AC_DEFUN([AC_PATH_TOOL_PREFIX],
27343 hornik 4539
[AC_REQUIRE([AC_PROG_EGREP])dnl
4540
AC_MSG_CHECKING([for $1])
14199 hornik 4541
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4542
[case $MAGIC_CMD in
27343 hornik 4543
[[\\/*] |  ?:[\\/]*])
14199 hornik 4544
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4545
  ;;
27343 hornik 4546
*)
4547
  lt_save_MAGIC_CMD="$MAGIC_CMD"
4548
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
14199 hornik 4549
dnl $ac_dummy forces splitting on constant user-supplied paths.
4550
dnl POSIX.2 word splitting is done only on the output of word expansions,
4551
dnl not every word.  This closes a longstanding sh security hole.
4552
  ac_dummy="ifelse([$2], , $PATH, [$2])"
4553
  for ac_dir in $ac_dummy; do
27343 hornik 4554
    IFS="$lt_save_ifs"
14199 hornik 4555
    test -z "$ac_dir" && ac_dir=.
4556
    if test -f $ac_dir/$1; then
4557
      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4558
      if test -n "$file_magic_test_file"; then
4559
	case $deplibs_check_method in
4560
	"file_magic "*)
4561
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4562
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4563
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
27343 hornik 4564
	    $EGREP "$file_magic_regex" > /dev/null; then
14199 hornik 4565
	    :
4566
	  else
4567
	    cat <<EOF 1>&2
4568
 
4569
*** Warning: the command libtool uses to detect shared libraries,
4570
*** $file_magic_cmd, produces output that libtool cannot recognize.
4571
*** The result is that libtool may fail to recognize shared libraries
4572
*** as such.  This will affect the creation of libtool libraries that
4573
*** depend on shared libraries, but programs linked with such libtool
4574
*** libraries will work regardless of this problem.  Nevertheless, you
4575
*** may want to report the problem to your system manager and/or to
4576
*** bug-libtool@gnu.org
4577
 
4578
EOF
4579
	  fi ;;
4580
	esac
4581
      fi
4582
      break
4583
    fi
4584
  done
27343 hornik 4585
  IFS="$lt_save_ifs"
4586
  MAGIC_CMD="$lt_save_MAGIC_CMD"
14199 hornik 4587
  ;;
4588
esac])
4589
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4590
if test -n "$MAGIC_CMD"; then
4591
  AC_MSG_RESULT($MAGIC_CMD)
4592
else
4593
  AC_MSG_RESULT(no)
4594
fi
27343 hornik 4595
])# AC_PATH_TOOL_PREFIX
14199 hornik 4596
 
4597
 
27343 hornik 4598
# AC_PATH_MAGIC
4599
# -------------
4600
# find a file program which can recognise a shared library
14199 hornik 4601
AC_DEFUN([AC_PATH_MAGIC],
27343 hornik 4602
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
14199 hornik 4603
if test -z "$lt_cv_path_MAGIC_CMD"; then
4604
  if test -n "$ac_tool_prefix"; then
27343 hornik 4605
    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
14199 hornik 4606
  else
4607
    MAGIC_CMD=:
4608
  fi
4609
fi
27343 hornik 4610
])# AC_PATH_MAGIC
14199 hornik 4611
 
4612
 
27343 hornik 4613
# AC_PROG_LD
4614
# ----------
4615
# find the path to the GNU or non-GNU linker
14199 hornik 4616
AC_DEFUN([AC_PROG_LD],
27343 hornik 4617
[AC_ARG_WITH([gnu-ld],
4618
    [AC_HELP_STRING([--with-gnu-ld],
4619
	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4620
    [test "$withval" = no || with_gnu_ld=yes],
4621
    [with_gnu_ld=no])
4622
AC_REQUIRE([LT_AC_PROG_SED])dnl
14199 hornik 4623
AC_REQUIRE([AC_PROG_CC])dnl
4624
AC_REQUIRE([AC_CANONICAL_HOST])dnl
4625
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4626
ac_prog=ld
4627
if test "$GCC" = yes; then
4628
  # Check if gcc -print-prog-name=ld gives a path.
27343 hornik 4629
  AC_MSG_CHECKING([for ld used by $CC])
14199 hornik 4630
  case $host in
4631
  *-*-mingw*)
4632
    # gcc leaves a trailing carriage return which upsets mingw
4633
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4634
  *)
4635
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4636
  esac
4637
  case $ac_prog in
4638
    # Accept absolute paths.
27343 hornik 4639
    [[\\/]]* | ?:[[\\/]]*)
19221 hornik 4640
      re_direlt='/[[^/]][[^/]]*/\.\./'
14199 hornik 4641
      # Canonicalize the path of ld
27343 hornik 4642
      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
14199 hornik 4643
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
27343 hornik 4644
	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
14199 hornik 4645
      done
4646
      test -z "$LD" && LD="$ac_prog"
4647
      ;;
4648
  "")
4649
    # If it fails, then pretend we aren't using GCC.
4650
    ac_prog=ld
4651
    ;;
4652
  *)
4653
    # If it is relative, then search for the first ld in PATH.
4654
    with_gnu_ld=unknown
4655
    ;;
4656
  esac
4657
elif test "$with_gnu_ld" = yes; then
4658
  AC_MSG_CHECKING([for GNU ld])
4659
else
4660
  AC_MSG_CHECKING([for non-GNU ld])
4661
fi
4662
AC_CACHE_VAL(lt_cv_path_LD,
4663
[if test -z "$LD"; then
27343 hornik 4664
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
14199 hornik 4665
  for ac_dir in $PATH; do
27343 hornik 4666
    IFS="$lt_save_ifs"
14199 hornik 4667
    test -z "$ac_dir" && ac_dir=.
4668
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4669
      lt_cv_path_LD="$ac_dir/$ac_prog"
4670
      # Check to see if the program is GNU ld.  I'd rather use --version,
4671
      # but apparently some GNU ld's only accept -v.
4672
      # Break only if it was the GNU/non-GNU ld that we prefer.
27343 hornik 4673
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4674
      *GNU* | *'with BFD'*)
14199 hornik 4675
	test "$with_gnu_ld" != no && break
27343 hornik 4676
	;;
4677
      *)
14199 hornik 4678
	test "$with_gnu_ld" != yes && break
27343 hornik 4679
	;;
4680
      esac
14199 hornik 4681
    fi
4682
  done
27343 hornik 4683
  IFS="$lt_save_ifs"
14199 hornik 4684
else
4685
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4686
fi])
4687
LD="$lt_cv_path_LD"
4688
if test -n "$LD"; then
4689
  AC_MSG_RESULT($LD)
4690
else
4691
  AC_MSG_RESULT(no)
4692
fi
4693
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4694
AC_PROG_LD_GNU
27343 hornik 4695
])# AC_PROG_LD
14199 hornik 4696
 
27343 hornik 4697
 
4698
# AC_PROG_LD_GNU
4699
# --------------
14199 hornik 4700
AC_DEFUN([AC_PROG_LD_GNU],
27343 hornik 4701
[AC_REQUIRE([AC_PROG_EGREP])dnl
4702
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
14199 hornik 4703
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
27343 hornik 4704
case `"$LD" -v 2>&1 </dev/null` in
4705
*GNU* | *'with BFD'*)
14199 hornik 4706
  lt_cv_prog_gnu_ld=yes
27343 hornik 4707
  ;;
4708
*)
14199 hornik 4709
  lt_cv_prog_gnu_ld=no
27343 hornik 4710
  ;;
4711
esac])
14199 hornik 4712
with_gnu_ld=$lt_cv_prog_gnu_ld
27343 hornik 4713
])# AC_PROG_LD_GNU
14199 hornik 4714
 
27343 hornik 4715
 
4716
# AC_PROG_LD_RELOAD_FLAG
4717
# ----------------------
4718
# find reload flag for linker
14199 hornik 4719
#   -- PORTME Some linkers may need a different reload flag.
4720
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
27343 hornik 4721
[AC_CACHE_CHECK([for $LD option to reload object files],
4722
  lt_cv_ld_reload_flag,
4723
  [lt_cv_ld_reload_flag='-r'])
14199 hornik 4724
reload_flag=$lt_cv_ld_reload_flag
27343 hornik 4725
case $reload_flag in
4726
"" | " "*) ;;
4727
*) reload_flag=" $reload_flag" ;;
4728
esac
4729
reload_cmds='$LD$reload_flag -o $output$reload_objs'
4730
])# AC_PROG_LD_RELOAD_FLAG
14199 hornik 4731
 
27343 hornik 4732
 
4733
# AC_DEPLIBS_CHECK_METHOD
4734
# -----------------------
4735
# how to check for library dependencies
14199 hornik 4736
#  -- PORTME fill in with the dynamic library characteristics
4737
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
22044 hornik 4738
[AC_CACHE_CHECK([how to recognise dependent libraries],
14199 hornik 4739
lt_cv_deplibs_check_method,
4740
[lt_cv_file_magic_cmd='$MAGIC_CMD'
4741
lt_cv_file_magic_test_file=
4742
lt_cv_deplibs_check_method='unknown'
4743
# Need to set the preceding variable on all platforms that support
4744
# interlibrary dependencies.
4745
# 'none' -- dependencies not supported.
4746
# `unknown' -- same as none, but documents that we really don't know.
4747
# 'pass_all' -- all dependencies passed with no checks.
4748
# 'test_compile' -- check by making test program.
19221 hornik 4749
# 'file_magic [[regex]]' -- check by looking for files in library path
27343 hornik 4750
# which responds to the $file_magic_cmd with a given extended regex.
14199 hornik 4751
# If you have `file' or equivalent on your system and you're not sure
4752
# whether `pass_all' will *always* work, you probably want this one.
4753
 
4754
case $host_os in
14248 hornik 4755
aix4* | aix5*)
14199 hornik 4756
  lt_cv_deplibs_check_method=pass_all
4757
  ;;
4758
 
4759
beos*)
4760
  lt_cv_deplibs_check_method=pass_all
4761
  ;;
4762
 
4763
bsdi4*)
19221 hornik 4764
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
14199 hornik 4765
  lt_cv_file_magic_cmd='/usr/bin/file -L'
4766
  lt_cv_file_magic_test_file=/shlib/libc.so
4767
  ;;
4768
 
4769
cygwin* | mingw* | pw32*)
27343 hornik 4770
  # win32_libid is a shell function defined in ltmain.sh
4771
  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4772
  lt_cv_file_magic_cmd='win32_libid'
14199 hornik 4773
  ;;
4774
 
4775
darwin* | rhapsody*)
27343 hornik 4776
  # this will be overwritten by pass_all, but leave it in just in case
14248 hornik 4777
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
14199 hornik 4778
  lt_cv_file_magic_cmd='/usr/bin/file -L'
4779
  case "$host_os" in
19221 hornik 4780
  rhapsody* | darwin1.[[012]])
27343 hornik 4781
    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
14199 hornik 4782
    ;;
4783
  *) # Darwin 1.3 on
4784
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4785
    ;;
4786
  esac
27343 hornik 4787
  lt_cv_deplibs_check_method=pass_all
14199 hornik 4788
  ;;
4789
 
4790
freebsd*)
4791
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4792
    case $host_cpu in
4793
    i*86 )
4794
      # Not sure whether the presence of OpenBSD here was a mistake.
4795
      # Let's accept both of them until this is cleared up.
19221 hornik 4796
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
14199 hornik 4797
      lt_cv_file_magic_cmd=/usr/bin/file
4798
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4799
      ;;
4800
    esac
4801
  else
4802
    lt_cv_deplibs_check_method=pass_all
4803
  fi
4804
  ;;
4805
 
4806
gnu*)
4807
  lt_cv_deplibs_check_method=pass_all
4808
  ;;
4809
 
27343 hornik 4810
hpux10.20* | hpux11*)
14199 hornik 4811
  lt_cv_file_magic_cmd=/usr/bin/file
27343 hornik 4812
  case "$host_cpu" in
4813
  ia64*)
4814
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4815
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4816
    ;;
4817
  hppa*64*)
4818
    [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]']
4819
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4820
    ;;
4821
  *)
4822
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4823
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4824
    ;;
4825
  esac
14199 hornik 4826
  ;;
4827
 
22044 hornik 4828
irix5* | irix6* | nonstopux*)
14199 hornik 4829
  case $host_os in
22044 hornik 4830
  irix5* | nonstopux*)
14199 hornik 4831
    # this will be overridden with pass_all, but let us keep it just in case
4832
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4833
    ;;
4834
  *)
4835
    case $LD in
4836
    *-32|*"-32 ") libmagic=32-bit;;
4837
    *-n32|*"-n32 ") libmagic=N32;;
4838
    *-64|*"-64 ") libmagic=64-bit;;
4839
    *) libmagic=never-match;;
4840
    esac
4841
    # this will be overridden with pass_all, but let us keep it just in case
19221 hornik 4842
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
14199 hornik 4843
    ;;
4844
  esac
4845
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4846
  lt_cv_deplibs_check_method=pass_all
4847
  ;;
4848
 
4849
# This must be Linux ELF.
27343 hornik 4850
linux*)
14199 hornik 4851
  case $host_cpu in
27343 hornik 4852
  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
14199 hornik 4853
    lt_cv_deplibs_check_method=pass_all ;;
4854
  *)
4855
    # glibc up to 2.1.1 does not perform some relocations on ARM
19221 hornik 4856
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
14199 hornik 4857
  esac
4858
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4859
  ;;
4860
 
4861
netbsd*)
4862
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
27343 hornik 4863
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
14199 hornik 4864
  else
27343 hornik 4865
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
14199 hornik 4866
  fi
4867
  ;;
4868
 
4869
newos6*)
19221 hornik 4870
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
14199 hornik 4871
  lt_cv_file_magic_cmd=/usr/bin/file
4872
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4873
  ;;
4874
 
27343 hornik 4875
nto-qnx)
4876
  lt_cv_deplibs_check_method=unknown
4877
  ;;
4878
 
19221 hornik 4879
openbsd*)
4880
  lt_cv_file_magic_cmd=/usr/bin/file
4881
  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4882
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4883
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
4884
  else
4885
    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4886
  fi
4887
  ;;
4888
 
14199 hornik 4889
osf3* | osf4* | osf5*)
4890
  # this will be overridden with pass_all, but let us keep it just in case
4891
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4892
  lt_cv_file_magic_test_file=/shlib/libc.so
4893
  lt_cv_deplibs_check_method=pass_all
4894
  ;;
4895
 
4896
sco3.2v5*)
4897
  lt_cv_deplibs_check_method=pass_all
4898
  ;;
4899
 
4900
solaris*)
4901
  lt_cv_deplibs_check_method=pass_all
4902
  lt_cv_file_magic_test_file=/lib/libc.so
4903
  ;;
4904
 
4905
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4906
  case $host_vendor in
4907
  motorola)
19221 hornik 4908
    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]]'
14199 hornik 4909
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4910
    ;;
4911
  ncr)
4912
    lt_cv_deplibs_check_method=pass_all
4913
    ;;
4914
  sequent)
4915
    lt_cv_file_magic_cmd='/bin/file'
19221 hornik 4916
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
14199 hornik 4917
    ;;
4918
  sni)
4919
    lt_cv_file_magic_cmd='/bin/file'
19221 hornik 4920
    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
14199 hornik 4921
    lt_cv_file_magic_test_file=/lib/libc.so
4922
    ;;
22044 hornik 4923
  siemens)
4924
    lt_cv_deplibs_check_method=pass_all
4925
    ;;
14199 hornik 4926
  esac
4927
  ;;
27343 hornik 4928
 
4929
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
4930
  lt_cv_deplibs_check_method=pass_all
4931
  ;;
14199 hornik 4932
esac
4933
])
4934
file_magic_cmd=$lt_cv_file_magic_cmd
4935
deplibs_check_method=$lt_cv_deplibs_check_method
27343 hornik 4936
test -z "$deplibs_check_method" && deplibs_check_method=unknown
4937
])# AC_DEPLIBS_CHECK_METHOD
14199 hornik 4938
 
4939
 
27343 hornik 4940
# AC_PROG_NM
4941
# ----------
4942
# find the path to a BSD-compatible name lister
14199 hornik 4943
AC_DEFUN([AC_PROG_NM],
27343 hornik 4944
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
14199 hornik 4945
[if test -n "$NM"; then
4946
  # Let the user override the test.
4947
  lt_cv_path_NM="$NM"
4948
else
27343 hornik 4949
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
14199 hornik 4950
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
27343 hornik 4951
    IFS="$lt_save_ifs"
14199 hornik 4952
    test -z "$ac_dir" && ac_dir=.
27343 hornik 4953
    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
4954
    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
14199 hornik 4955
      # Check to see if the nm accepts a BSD-compat flag.
4956
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4957
      #   nm: unknown option "B" ignored
4958
      # Tru64's nm complains that /dev/null is an invalid object file
27343 hornik 4959
      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4960
      */dev/null* | *'Invalid file or object type'*)
14199 hornik 4961
	lt_cv_path_NM="$tmp_nm -B"
4962
	break
27343 hornik 4963
        ;;
4964
      *)
4965
	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4966
	*/dev/null*)
4967
	  lt_cv_path_NM="$tmp_nm -p"
4968
	  break
4969
	  ;;
4970
	*)
4971
	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4972
	  continue # so that we can try to find one that supports BSD flags
4973
	  ;;
4974
	esac
4975
      esac
14199 hornik 4976
    fi
4977
  done
27343 hornik 4978
  IFS="$lt_save_ifs"
14199 hornik 4979
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4980
fi])
4981
NM="$lt_cv_path_NM"
27343 hornik 4982
])# AC_PROG_NM
14199 hornik 4983
 
27343 hornik 4984
 
4985
# AC_CHECK_LIBM
4986
# -------------
4987
# check for math library
14199 hornik 4988
AC_DEFUN([AC_CHECK_LIBM],
4989
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4990
LIBM=
4991
case $host in
27343 hornik 4992
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
4993
  # These system don't have libm, or don't need it
14199 hornik 4994
  ;;
4995
*-ncr-sysv4.3*)
4996
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
27343 hornik 4997
  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
14199 hornik 4998
  ;;
4999
*)
27343 hornik 5000
  AC_CHECK_LIB(m, cos, LIBM="-lm")
14199 hornik 5001
  ;;
5002
esac
27343 hornik 5003
])# AC_CHECK_LIBM
14199 hornik 5004
 
27343 hornik 5005
 
5006
# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
5007
# -----------------------------------
5008
# sets LIBLTDL to the link flags for the libltdl convenience library and
5009
# LTDLINCL to the include flags for the libltdl header and adds
5010
# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
5011
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
5012
# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
5013
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
14199 hornik 5014
# '${top_srcdir}/' (note the single quotes!).  If your package is not
5015
# flat and you're not using automake, define top_builddir and
5016
# top_srcdir appropriately in the Makefiles.
5017
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
5018
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5019
  case $enable_ltdl_convenience in
5020
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
5021
  "") enable_ltdl_convenience=yes
5022
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
5023
  esac
5024
  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
22044 hornik 5025
  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5026
  # For backwards non-gettext consistent compatibility...
5027
  INCLTDL="$LTDLINCL"
27343 hornik 5028
])# AC_LIBLTDL_CONVENIENCE
14199 hornik 5029
 
27343 hornik 5030
 
5031
# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
5032
# -----------------------------------
5033
# sets LIBLTDL to the link flags for the libltdl installable library and
5034
# LTDLINCL to the include flags for the libltdl header and adds
5035
# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
5036
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
5037
# DIRECTORY is not provided and an installed libltdl is not found, it is
5038
# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
5039
# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
5040
# quotes!).  If your package is not flat and you're not using automake,
5041
# define top_builddir and top_srcdir appropriately in the Makefiles.
14199 hornik 5042
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
5043
AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
5044
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
27343 hornik 5045
  AC_CHECK_LIB(ltdl, lt_dlinit,
14199 hornik 5046
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
5047
  [if test x"$enable_ltdl_install" = xno; then
5048
     AC_MSG_WARN([libltdl not installed, but installation disabled])
5049
   else
5050
     enable_ltdl_install=yes
5051
   fi
5052
  ])
5053
  if test x"$enable_ltdl_install" = x"yes"; then
5054
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
5055
    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
22044 hornik 5056
    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
14199 hornik 5057
  else
5058
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
5059
    LIBLTDL="-lltdl"
22044 hornik 5060
    LTDLINCL=
14199 hornik 5061
  fi
22044 hornik 5062
  # For backwards non-gettext consistent compatibility...
5063
  INCLTDL="$LTDLINCL"
27343 hornik 5064
])# AC_LIBLTDL_INSTALLABLE
5065
 
5066
 
5067
# AC_LIBTOOL_CXX
5068
# --------------
5069
# enable support for C++ libraries
5070
AC_DEFUN([AC_LIBTOOL_CXX],
5071
[AC_REQUIRE([_LT_AC_LANG_CXX])
5072
])# AC_LIBTOOL_CXX
5073
 
5074
 
5075
# _LT_AC_LANG_CXX
5076
# ---------------
5077
AC_DEFUN([_LT_AC_LANG_CXX],
5078
[AC_REQUIRE([AC_PROG_CXX])
5079
AC_REQUIRE([AC_PROG_CXXCPP])
5080
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`])
5081
])# _LT_AC_LANG_CXX
5082
 
5083
 
5084
# AC_LIBTOOL_F77
5085
# --------------
5086
# enable support for Fortran 77 libraries
5087
AC_DEFUN([AC_LIBTOOL_F77],
5088
[AC_REQUIRE([_LT_AC_LANG_F77])
5089
])# AC_LIBTOOL_F77
5090
 
5091
 
5092
# _LT_AC_LANG_F77
5093
# ---------------
5094
AC_DEFUN([_LT_AC_LANG_F77],
5095
[AC_REQUIRE([AC_PROG_F77])
5096
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`])
5097
])# _LT_AC_LANG_F77
5098
 
5099
 
5100
# AC_LIBTOOL_GCJ
5101
# --------------
5102
# enable support for GCJ libraries
5103
AC_DEFUN([AC_LIBTOOL_GCJ],
5104
[AC_REQUIRE([_LT_AC_LANG_GCJ])
5105
])# AC_LIBTOOL_GCJ
5106
 
5107
 
5108
# _LT_AC_LANG_GCJ
5109
# ---------------
5110
AC_DEFUN([_LT_AC_LANG_GCJ],
5111
[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
5112
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
5113
    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
5114
      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
5115
	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
5116
	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
5117
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
5118
])# _LT_AC_LANG_GCJ
5119
 
5120
 
5121
# AC_LIBTOOL_RC
5122
# --------------
5123
# enable support for Windows resource files
5124
AC_DEFUN([AC_LIBTOOL_RC],
5125
[AC_REQUIRE([LT_AC_PROG_RC])
5126
_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`])
5127
])# AC_LIBTOOL_RC
5128
 
5129
 
5130
# AC_LIBTOOL_LANG_C_CONFIG
5131
# ------------------------
5132
# Ensure that the configuration vars for the C compiler are
5133
# suitably defined.  Those variables are subsequently used by
5134
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5135
AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
5136
AC_DEFUN([_LT_AC_LANG_C_CONFIG],
5137
[lt_save_CC="$CC"
5138
AC_LANG_PUSH(C)
5139
 
5140
# Source file extension for C test sources.
5141
ac_ext=c
5142
 
5143
# Object file extension for compiled C test sources.
5144
objext=o
5145
_LT_AC_TAGVAR(objext, $1)=$objext
5146
 
5147
# Code to be used in simple compile tests
5148
lt_simple_compile_test_code="int some_variable = 0;\n"
5149
 
5150
# Code to be used in simple link tests
5151
lt_simple_link_test_code='int main(){return(0);}\n'
5152
 
5153
_LT_AC_SYS_COMPILER
5154
 
5155
#
5156
# Check for any special shared library compilation flags.
5157
#
5158
_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
5159
if test "$GCC" = no; then
5160
  case $host_os in
5161
  sco3.2v5*)
5162
    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
5163
    ;;
5164
  esac
5165
fi
5166
if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
5167
  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
5168
  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
5169
  else
5170
    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
5171
    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
5172
  fi
5173
fi
5174
 
5175
 
5176
#
5177
# Check to make sure the static flag actually works.
5178
#
5179
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
5180
  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
5181
  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
5182
  [],
5183
  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5184
 
5185
 
5186
## CAVEAT EMPTOR:
5187
## There is no encapsulation within the following macros, do not change
5188
## the running order or otherwise move them around unless you know exactly
5189
## what you are doing...
5190
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
5191
AC_LIBTOOL_PROG_COMPILER_PIC($1)
5192
AC_LIBTOOL_PROG_CC_C_O($1)
5193
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5194
AC_LIBTOOL_PROG_LD_SHLIBS($1)
5195
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
5196
AC_LIBTOOL_SYS_LIB_STRIP
5197
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5198
AC_LIBTOOL_DLOPEN_SELF($1)
5199
 
5200
# Report which librarie types wil actually be built
5201
AC_MSG_CHECKING([if libtool supports shared libraries])
5202
AC_MSG_RESULT([$can_build_shared])
5203
 
5204
AC_MSG_CHECKING([whether to build shared libraries])
5205
test "$can_build_shared" = "no" && enable_shared=no
5206
 
5207
# On AIX, shared libraries and static libraries use the same namespace, and
5208
# are all built from PIC.
5209
case "$host_os" in
5210
aix3*)
5211
  test "$enable_shared" = yes && enable_static=no
5212
  if test -n "$RANLIB"; then
5213
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
5214
    postinstall_cmds='$RANLIB $lib'
5215
  fi
5216
  ;;
5217
 
5218
aix4*)
5219
  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5220
    test "$enable_shared" = yes && enable_static=no
5221
  fi
5222
  ;;
5223
  darwin* | rhapsody*)
5224
  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
5225
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5226
    case "$host_os" in
5227
    rhapsody* | darwin1.[[012]])
5228
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
5229
      ;;
5230
    *) # Darwin 1.3 on
5231
      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
5232
      ;;
5233
    esac
5234
    # FIXME: Relying on posixy $() will cause problems for
5235
    #        cross-compilation, but unfortunately the echo tests do not
5236
    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5237
    #	       `"' quotes if we put them in here... so don't!
5238
		output_verbose_link_cmd='echo'
5239
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
5240
    _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
5241
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
5242
		  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5243
		  _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5244
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
5245
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5246
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5247
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
5248
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5249
    fi
5250
    ;;  
5251
esac
5252
AC_MSG_RESULT([$enable_shared])
5253
 
5254
AC_MSG_CHECKING([whether to build static libraries])
5255
# Make sure either enable_shared or enable_static is yes.
5256
test "$enable_shared" = yes || enable_static=yes
5257
AC_MSG_RESULT([$enable_static])
5258
 
5259
AC_LIBTOOL_CONFIG($1)
5260
 
5261
AC_LANG_POP
5262
CC="$lt_save_CC"
5263
])# AC_LIBTOOL_LANG_C_CONFIG
5264
 
5265
 
5266
# AC_LIBTOOL_LANG_CXX_CONFIG
5267
# --------------------------
5268
# Ensure that the configuration vars for the C compiler are
5269
# suitably defined.  Those variables are subsequently used by
5270
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5271
AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
5272
AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
5273
[AC_LANG_PUSH(C++)
5274
AC_REQUIRE([AC_PROG_CXX])
5275
AC_REQUIRE([AC_PROG_CXXCPP])
5276
 
5277
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5278
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
5279
_LT_AC_TAGVAR(always_export_symbols, $1)=no
5280
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5281
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5282
_LT_AC_TAGVAR(hardcode_direct, $1)=no
5283
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5284
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5285
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5286
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5287
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
5288
_LT_AC_TAGVAR(module_cmds, $1)=
5289
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
5290
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5291
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5292
_LT_AC_TAGVAR(no_undefined_flag, $1)=
5293
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5294
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5295
 
5296
# Dependencies to place before and after the object being linked:
5297
_LT_AC_TAGVAR(predep_objects, $1)=
5298
_LT_AC_TAGVAR(postdep_objects, $1)=
5299
_LT_AC_TAGVAR(predeps, $1)=
5300
_LT_AC_TAGVAR(postdeps, $1)=
5301
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
5302
 
5303
# Source file extension for C++ test sources.
5304
ac_ext=cc
5305
 
5306
# Object file extension for compiled C++ test sources.
5307
objext=o
5308
_LT_AC_TAGVAR(objext, $1)=$objext
5309
 
5310
# Code to be used in simple compile tests
5311
lt_simple_compile_test_code="int some_variable = 0;\n"
5312
 
5313
# Code to be used in simple link tests
5314
lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
5315
 
5316
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
5317
_LT_AC_SYS_COMPILER
5318
 
5319
# Allow CC to be a program name with arguments.
5320
lt_save_CC=$CC
5321
lt_save_LD=$LD
5322
lt_save_GCC=$GCC
5323
GCC=$GXX
5324
lt_save_with_gnu_ld=$with_gnu_ld
5325
lt_save_path_LD=$lt_cv_path_LD
5326
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5327
  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5328
else
5329
  unset lt_cv_prog_gnu_ld
5330
fi
5331
if test -n "${lt_cv_path_LDCXX+set}"; then
5332
  lt_cv_path_LD=$lt_cv_path_LDCXX
5333
else
5334
  unset lt_cv_path_LD
5335
fi
5336
test -z "${LDCXX+set}" || LD=$LDCXX
5337
CC=${CXX-"c++"}
5338
compiler=$CC
5339
_LT_AC_TAGVAR(compiler, $1)=$CC
5340
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
5341
 
5342
# We don't want -fno-exception wen compiling C++ code, so set the
5343
# no_builtin_flag separately
5344
if test "$GXX" = yes; then
5345
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5346
else
5347
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5348
fi
5349
 
5350
if test "$GXX" = yes; then
5351
  # Set up default GNU C++ configuration
5352
 
5353
  AC_PROG_LD
5354
 
5355
  # Check if GNU C++ uses GNU ld as the underlying linker, since the
5356
  # archiving commands below assume that GNU ld is being used.
5357
  if test "$with_gnu_ld" = yes; then
5358
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5359
    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5360
 
5361
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5362
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5363
 
5364
    # If archive_cmds runs LD, not CC, wlarc should be empty
5365
    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5366
    #     investigate it a little bit more. (MM)
5367
    wlarc='${wl}'
5368
 
5369
    # ancient GNU ld didn't support --whole-archive et. al.
5370
    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
5371
	grep 'no-whole-archive' > /dev/null; then
5372
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5373
    else
5374
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5375
    fi
5376
  else
5377
    with_gnu_ld=no
5378
    wlarc=
5379
 
5380
    # A generic and very simple default shared library creation
5381
    # command for GNU C++ for the case where it uses the native
5382
    # linker, instead of GNU ld.  If possible, this setting should
5383
    # overridden to take advantage of the native linker features on
5384
    # the platform it is being used on.
5385
    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5386
  fi
5387
 
5388
  # Commands to make compiler produce verbose output that lists
5389
  # what "hidden" libraries, object files and flags are used when
5390
  # linking a shared library.
5391
  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
5392
 
5393
else
5394
  GXX=no
5395
  with_gnu_ld=no
5396
  wlarc=
5397
fi
5398
 
5399
# PORTME: fill in a description of your system's C++ link characteristics
5400
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5401
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
5402
case $host_os in
5403
  aix3*)
5404
    # FIXME: insert proper C++ library support
5405
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5406
    ;;
5407
  aix4* | aix5*)
5408
    if test "$host_cpu" = ia64; then
5409
      # On IA64, the linker does run time linking by default, so we don't
5410
      # have to do anything special.
5411
      aix_use_runtimelinking=no
5412
      exp_sym_flag='-Bexport'
5413
      no_entry_flag=""
5414
    else
5415
      aix_use_runtimelinking=no
5416
 
5417
      # Test if we are trying to use run time linking or normal
5418
      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5419
      # need to do runtime linking.
5420
      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
5421
	for ld_flag in $LDFLAGS; do
5422
	  case $ld_flag in
5423
	  *-brtl*)
5424
	    aix_use_runtimelinking=yes
5425
	    break
5426
	    ;;
5427
	  esac
5428
	done
5429
      esac
5430
 
5431
      exp_sym_flag='-bexport'
5432
      no_entry_flag='-bnoentry'
5433
    fi
5434
 
5435
    # When large executables or shared objects are built, AIX ld can
5436
    # have problems creating the table of contents.  If linking a library
5437
    # or program results in "error TOC overflow" add -mminimal-toc to
5438
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5439
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5440
 
5441
    _LT_AC_TAGVAR(archive_cmds, $1)=''
5442
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5443
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5444
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5445
 
5446
    if test "$GXX" = yes; then
5447
      case $host_os in aix4.[012]|aix4.[012].*)
5448
      # We only want to do this on AIX 4.2 and lower, the check
5449
      # below for broken collect2 doesn't work under 4.3+
5450
	collect2name=`${CC} -print-prog-name=collect2`
5451
	if test -f "$collect2name" && \
5452
	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5453
	then
5454
	  # We have reworked collect2
5455
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5456
	else
5457
	  # We have old collect2
5458
	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5459
	  # It fails to find uninstalled libraries when the uninstalled
5460
	  # path is not listed in the libpath.  Setting hardcode_minus_L
5461
	  # to unsupported forces relinking
5462
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5463
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5464
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5465
	fi
5466
      esac
5467
      shared_flag='-shared'
5468
    else
5469
      # not using gcc
5470
      if test "$host_cpu" = ia64; then
5471
	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5472
	# chokes on -Wl,-G. The following line is correct:
5473
	shared_flag='-G'
5474
      else
5475
	if test "$aix_use_runtimelinking" = yes; then
5476
	  shared_flag='${wl}-G'
5477
	else
5478
	  shared_flag='${wl}-bM:SRE'
5479
	fi
5480
      fi
5481
    fi
5482
 
5483
    # It seems that -bexpall does not export symbols beginning with
5484
    # underscore (_), so it is better to generate a list of symbols to export.
5485
    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5486
    if test "$aix_use_runtimelinking" = yes; then
5487
      # Warning - without using the other runtime loading flags (-brtl),
5488
      # -berok will link without error, but may produce a broken library.
5489
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5490
      # Determine the default libpath from the value encoded in an empty executable.
5491
      _LT_AC_SYS_LIBPATH_AIX
5492
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5493
 
5494
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5495
     else
5496
      if test "$host_cpu" = ia64; then
5497
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5498
	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5499
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
5500
      else
5501
	# Determine the default libpath from the value encoded in an empty executable.
5502
	_LT_AC_SYS_LIBPATH_AIX
5503
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5504
	# Warning - without using the other run time loading flags,
5505
	# -berok will link without error, but may produce a broken library.
5506
	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5507
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5508
	# -bexpall does not export symbols beginning with underscore (_)
5509
	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
5510
	# Exported symbols can be pulled into shared objects from archives
5511
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
5512
	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
5513
	# This is similar to how AIX traditionally builds it's shared libraries.
5514
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5515
      fi
5516
    fi
5517
    ;;
5518
  chorus*)
5519
    case $cc_basename in
5520
      *)
5521
	# FIXME: insert proper C++ library support
5522
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5523
	;;
5524
    esac
5525
    ;;
5526
 
5527
  cygwin* | mingw* | pw32*)
5528
    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5529
    # as there is no search path for DLLs.
5530
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5531
    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5532
    _LT_AC_TAGVAR(always_export_symbols, $1)=no
5533
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5534
 
5535
    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5536
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
5537
      # If the export-symbols file already is a .def file (1st line
5538
      # is EXPORTS), use it as is; otherwise, prepend...
5539
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5540
	cp $export_symbols $output_objdir/$soname.def;
5541
      else
5542
	echo EXPORTS > $output_objdir/$soname.def;
5543
	cat $export_symbols >> $output_objdir/$soname.def;
5544
      fi~
5545
      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
5546
    else
5547
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5548
    fi
5549
  ;;
5550
 
5551
  darwin* | rhapsody*)
5552
   if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
5553
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5554
    case "$host_os" in
5555
    rhapsody* | darwin1.[[012]])
5556
      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
5557
      ;;
5558
    *) # Darwin 1.3 on
5559
      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
5560
      ;;
5561
    esac
5562
    	lt_int_apple_cc_single_mod=no
5563
    	output_verbose_link_cmd='echo'
5564
    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
5565
    	  lt_int_apple_cc_single_mod=yes
5566
    	fi
5567
    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
5568
    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
5569
    	else
5570
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
5571
      fi
5572
      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
5573
 
5574
    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
5575
      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
5576
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5577
      else
5578
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5579
      fi
5580
        _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5581
    _LT_AC_TAGVAR(hardcode_direct, $1)=no
5582
    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5583
    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5584
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
5585
    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5586
   fi 
5587
    ;;
5588
 
5589
  dgux*)
5590
    case $cc_basename in
5591
      ec++)
5592
	# FIXME: insert proper C++ library support
5593
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5594
	;;
5595
      ghcx)
5596
	# Green Hills C++ Compiler
5597
	# FIXME: insert proper C++ library support
5598
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5599
	;;
5600
      *)
5601
	# FIXME: insert proper C++ library support
5602
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5603
	;;
5604
    esac
5605
    ;;
5606
  freebsd[12]*)
5607
    # C++ shared libraries reported to be fairly broken before switch to ELF
5608
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5609
    ;;
5610
  freebsd-elf*)
5611
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5612
    ;;
5613
  freebsd*)
5614
    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5615
    # conventions
5616
    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5617
    ;;
5618
  gnu*)
5619
    ;;
5620
  hpux9*)
5621
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5622
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5623
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5624
    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5625
    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5626
				# but as the default
5627
				# location of the library.
5628
 
5629
    case $cc_basename in
5630
    CC)
5631
      # FIXME: insert proper C++ library support
5632
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5633
      ;;
5634
    aCC)
5635
      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5636
      # Commands to make compiler produce verbose output that lists
5637
      # what "hidden" libraries, object files and flags are used when
5638
      # linking a shared library.
5639
      #
5640
      # There doesn't appear to be a way to prevent this compiler from
5641
      # explicitly linking system object files so we need to strip them
5642
      # from the output so that they don't get included in the library
5643
      # dependencies.
5644
      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'
5645
      ;;
5646
    *)
5647
      if test "$GXX" = yes; then
5648
        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5649
      else
5650
        # FIXME: insert proper C++ library support
5651
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
5652
      fi
5653
      ;;
5654
    esac
5655
    ;;
5656
  hpux10*|hpux11*)
5657
    if test $with_gnu_ld = no; then
5658
      case "$host_cpu" in
5659
      hppa*64*)
5660
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5661
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
5662
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5663
        ;;
5664
      ia64*)
5665
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5666
        ;;
5667
      *)
5668
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5669
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5670
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5671
        ;;
5672
      esac
5673
    fi
5674
    case "$host_cpu" in
5675
    hppa*64*)
5676
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5677
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5678
      ;;
5679
    ia64*)
5680
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5681
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5682
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5683
					      # but as the default
5684
					      # location of the library.
5685
      ;;
5686
    *)
5687
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5688
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5689
					      # but as the default
5690
					      # location of the library.
5691
      ;;
5692
    esac
5693
 
5694
    case $cc_basename in
5695
      CC)
5696
	# FIXME: insert proper C++ library support
5697
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5698
	;;
5699
      aCC)
5700
	case "$host_cpu" in
5701
	hppa*64*|ia64*)
5702
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
5703
	  ;;
5704
	*)
5705
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5706
	  ;;
5707
	esac
5708
	# Commands to make compiler produce verbose output that lists
5709
	# what "hidden" libraries, object files and flags are used when
5710
	# linking a shared library.
5711
	#
5712
	# There doesn't appear to be a way to prevent this compiler from
5713
	# explicitly linking system object files so we need to strip them
5714
	# from the output so that they don't get included in the library
5715
	# dependencies.
5716
	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'
5717
	;;
5718
      *)
5719
	if test "$GXX" = yes; then
5720
	  if test $with_gnu_ld = no; then
5721
	    case "$host_cpu" in
5722
	    ia64*|hppa*64*)
5723
	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
5724
	      ;;
5725
	    *)
5726
	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5727
	      ;;
5728
	    esac
5729
	  fi
5730
	else
5731
	  # FIXME: insert proper C++ library support
5732
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5733
	fi
5734
	;;
5735
    esac
5736
    ;;
5737
  irix5* | irix6*)
5738
    case $cc_basename in
5739
      CC)
5740
	# SGI C++
5741
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
5742
 
5743
	# Archives containing C++ object files must be created using
5744
	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5745
	# necessary to make sure instantiated templates are included
5746
	# in the archive.
5747
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5748
	;;
5749
      *)
5750
	if test "$GXX" = yes; then
5751
	  if test "$with_gnu_ld" = no; then
5752
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
5753
	  else
5754
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
5755
	  fi
5756
	fi
5757
	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5758
	;;
5759
    esac
5760
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5761
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5762
    ;;
5763
  linux*)
5764
    case $cc_basename in
5765
      KCC)
5766
	# Kuck and Associates, Inc. (KAI) C++ Compiler
5767
 
5768
	# KCC will only create a shared library if the output file
5769
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5770
	# to its proper name (with version) after linking.
5771
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5772
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
5773
	# Commands to make compiler produce verbose output that lists
5774
	# what "hidden" libraries, object files and flags are used when
5775
	# linking a shared library.
5776
	#
5777
	# There doesn't appear to be a way to prevent this compiler from
5778
	# explicitly linking system object files so we need to strip them
5779
	# from the output so that they don't get included in the library
5780
	# dependencies.
5781
	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'
5782
 
5783
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
5784
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5785
 
5786
	# Archives containing C++ object files must be created using
5787
	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
5788
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5789
	;;
5790
      icpc)
5791
	# Intel C++
5792
	with_gnu_ld=yes
5793
	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5794
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5795
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5796
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5797
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5798
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5799
	;;
5800
      cxx)
5801
	# Compaq C++
5802
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5803
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
5804
 
5805
	runpath_var=LD_RUN_PATH
5806
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5807
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5808
 
5809
	# Commands to make compiler produce verbose output that lists
5810
	# what "hidden" libraries, object files and flags are used when
5811
	# linking a shared library.
5812
	#
5813
	# There doesn't appear to be a way to prevent this compiler from
5814
	# explicitly linking system object files so we need to strip them
5815
	# from the output so that they don't get included in the library
5816
	# dependencies.
5817
	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'
5818
	;;
5819
    esac
5820
    ;;
5821
  lynxos*)
5822
    # FIXME: insert proper C++ library support
5823
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5824
    ;;
5825
  m88k*)
5826
    # FIXME: insert proper C++ library support
5827
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5828
    ;;
5829
  mvs*)
5830
    case $cc_basename in
5831
      cxx)
5832
	# FIXME: insert proper C++ library support
5833
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5834
	;;
5835
      *)
5836
	# FIXME: insert proper C++ library support
5837
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5838
	;;
5839
    esac
5840
    ;;
5841
  netbsd*)
5842
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5843
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
5844
      wlarc=
5845
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5846
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5847
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5848
    fi
5849
    # Workaround some broken pre-1.5 toolchains
5850
    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
5851
    ;;
5852
  osf3*)
5853
    case $cc_basename in
5854
      KCC)
5855
	# Kuck and Associates, Inc. (KAI) C++ Compiler
5856
 
5857
	# KCC will only create a shared library if the output file
5858
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5859
	# to its proper name (with version) after linking.
5860
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5861
 
5862
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5863
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5864
 
5865
	# Archives containing C++ object files must be created using
5866
	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
5867
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5868
 
5869
	;;
5870
      RCC)
5871
	# Rational C++ 2.4.1
5872
	# FIXME: insert proper C++ library support
5873
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5874
	;;
5875
      cxx)
5876
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5877
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
5878
 
5879
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5880
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5881
 
5882
	# Commands to make compiler produce verbose output that lists
5883
	# what "hidden" libraries, object files and flags are used when
5884
	# linking a shared library.
5885
	#
5886
	# There doesn't appear to be a way to prevent this compiler from
5887
	# explicitly linking system object files so we need to strip them
5888
	# from the output so that they don't get included in the library
5889
	# dependencies.
5890
	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'
5891
	;;
5892
      *)
5893
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
5894
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5895
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
5896
 
5897
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5898
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5899
 
5900
	  # Commands to make compiler produce verbose output that lists
5901
	  # what "hidden" libraries, object files and flags are used when
5902
	  # linking a shared library.
5903
	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
5904
 
5905
	else
5906
	  # FIXME: insert proper C++ library support
5907
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5908
	fi
5909
	;;
5910
    esac
5911
    ;;
5912
  osf4* | osf5*)
5913
    case $cc_basename in
5914
      KCC)
5915
	# Kuck and Associates, Inc. (KAI) C++ Compiler
5916
 
5917
	# KCC will only create a shared library if the output file
5918
	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5919
	# to its proper name (with version) after linking.
5920
	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5921
 
5922
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5923
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5924
 
5925
	# Archives containing C++ object files must be created using
5926
	# the KAI C++ compiler.
5927
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
5928
	;;
5929
      RCC)
5930
	# Rational C++ 2.4.1
5931
	# FIXME: insert proper C++ library support
5932
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5933
	;;
5934
      cxx)
5935
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5936
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
5937
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
5938
	  echo "-hidden">> $lib.exp~
5939
	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
5940
	  $rm $lib.exp'
5941
 
5942
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5943
	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5944
 
5945
	# Commands to make compiler produce verbose output that lists
5946
	# what "hidden" libraries, object files and flags are used when
5947
	# linking a shared library.
5948
	#
5949
	# There doesn't appear to be a way to prevent this compiler from
5950
	# explicitly linking system object files so we need to strip them
5951
	# from the output so that they don't get included in the library
5952
	# dependencies.
5953
	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'
5954
	;;
5955
      *)
5956
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
5957
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5958
	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
5959
 
5960
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5961
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5962
 
5963
	  # Commands to make compiler produce verbose output that lists
5964
	  # what "hidden" libraries, object files and flags are used when
5965
	  # linking a shared library.
5966
	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
5967
 
5968
	else
5969
	  # FIXME: insert proper C++ library support
5970
	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5971
	fi
5972
	;;
5973
    esac
5974
    ;;
5975
  psos*)
5976
    # FIXME: insert proper C++ library support
5977
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5978
    ;;
5979
  sco*)
5980
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5981
    case $cc_basename in
5982
      CC)
5983
	# FIXME: insert proper C++ library support
5984
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5985
	;;
5986
      *)
5987
	# FIXME: insert proper C++ library support
5988
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5989
	;;
5990
    esac
5991
    ;;
5992
  sunos4*)
5993
    case $cc_basename in
5994
      CC)
5995
	# Sun C++ 4.x
5996
	# FIXME: insert proper C++ library support
5997
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5998
	;;
5999
      lcc)
6000
	# Lucid
6001
	# FIXME: insert proper C++ library support
6002
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6003
	;;
6004
      *)
6005
	# FIXME: insert proper C++ library support
6006
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6007
	;;
6008
    esac
6009
    ;;
6010
  solaris*)
6011
    case $cc_basename in
6012
      CC)
6013
	# Sun C++ 4.2, 5.x and Centerline C++
6014
	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6015
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6016
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6017
	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
6018
 
6019
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6020
	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6021
	case $host_os in
6022
	  solaris2.[0-5] | solaris2.[0-5].*) ;;
6023
	  *)
6024
	    # The C++ compiler is used as linker so we must use $wl
6025
	    # flag to pass the commands to the underlying system
6026
	    # linker.
6027
	    # Supported since Solaris 2.6 (maybe 2.5.1?)
6028
	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6029
	    ;;
6030
	esac
6031
	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6032
 
6033
	# Commands to make compiler produce verbose output that lists
6034
	# what "hidden" libraries, object files and flags are used when
6035
	# linking a shared library.
6036
	#
6037
	# There doesn't appear to be a way to prevent this compiler from
6038
	# explicitly linking system object files so we need to strip them
6039
	# from the output so that they don't get included in the library
6040
	# dependencies.
6041
	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'
6042
 
6043
	# Archives containing C++ object files must be created using
6044
	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
6045
	# necessary to make sure instantiated templates are included
6046
	# in the archive.
6047
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6048
	;;
6049
      gcx)
6050
	# Green Hills C++ Compiler
6051
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6052
 
6053
	# The C++ compiler must be used to create the archive.
6054
	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6055
	;;
6056
      *)
6057
	# GNU C++ compiler with Solaris linker
6058
	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6059
	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6060
	  if $CC --version | grep -v '^2\.7' > /dev/null; then
6061
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6062
	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6063
		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
6064
 
6065
	    # Commands to make compiler produce verbose output that lists
6066
	    # what "hidden" libraries, object files and flags are used when
6067
	    # linking a shared library.
6068
	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
6069
	  else
6070
	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
6071
	    # platform.
6072
	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6073
	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6074
		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
6075
 
6076
	    # Commands to make compiler produce verbose output that lists
6077
	    # what "hidden" libraries, object files and flags are used when
6078
	    # linking a shared library.
6079
	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
6080
	  fi
6081
 
6082
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6083
	fi
6084
	;;
6085
    esac
6086
    ;;
6087
  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
6088
    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6089
    ;;
6090
  tandem*)
6091
    case $cc_basename in
6092
      NCC)
6093
	# NonStop-UX NCC 3.20
6094
	# FIXME: insert proper C++ library support
6095
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6096
	;;
6097
      *)
6098
	# FIXME: insert proper C++ library support
6099
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6100
	;;
6101
    esac
6102
    ;;
6103
  vxworks*)
6104
    # FIXME: insert proper C++ library support
6105
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6106
    ;;
6107
  *)
6108
    # FIXME: insert proper C++ library support
6109
    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6110
    ;;
6111
esac
6112
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6113
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6114
 
6115
_LT_AC_TAGVAR(GCC, $1)="$GXX"
6116
_LT_AC_TAGVAR(LD, $1)="$LD"
6117
 
6118
## CAVEAT EMPTOR:
6119
## There is no encapsulation within the following macros, do not change
6120
## the running order or otherwise move them around unless you know exactly
6121
## what you are doing...
6122
AC_LIBTOOL_POSTDEP_PREDEP($1)
6123
AC_LIBTOOL_PROG_COMPILER_PIC($1)
6124
AC_LIBTOOL_PROG_CC_C_O($1)
6125
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
6126
AC_LIBTOOL_PROG_LD_SHLIBS($1)
6127
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
6128
AC_LIBTOOL_SYS_LIB_STRIP
6129
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
6130
AC_LIBTOOL_DLOPEN_SELF($1)
6131
 
6132
AC_LIBTOOL_CONFIG($1)
6133
 
6134
AC_LANG_POP
6135
CC=$lt_save_CC
6136
LDCXX=$LD
6137
LD=$lt_save_LD
6138
GCC=$lt_save_GCC
6139
with_gnu_ldcxx=$with_gnu_ld
6140
with_gnu_ld=$lt_save_with_gnu_ld
6141
lt_cv_path_LDCXX=$lt_cv_path_LD
6142
lt_cv_path_LD=$lt_save_path_LD
6143
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6144
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6145
])# AC_LIBTOOL_LANG_CXX_CONFIG
6146
 
6147
# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
6148
# ------------------------
6149
# Figure out "hidden" library dependencies from verbose
6150
# compiler output when linking a shared library.
6151
# Parse the compiler output and extract the necessary
6152
# objects, libraries and library flags.
6153
AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
6154
dnl we can't use the lt_simple_compile_test_code here,
6155
dnl because it contains code intended for an executable,
6156
dnl not a library.  It's possible we should let each
6157
dnl tag define a new lt_????_link_test_code variable,
6158
dnl but it's only used here...
6159
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
6160
int a;
6161
void foo (void) { a = 0; }
6162
EOF
6163
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
6164
class Foo
6165
{
6166
public:
6167
  Foo (void) { a = 0; }
6168
private:
6169
  int a;
6170
};
6171
EOF
6172
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
6173
      subroutine foo
6174
      implicit none
6175
      integer*4 a
6176
      a=0
6177
      return
6178
      end
6179
EOF
6180
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
6181
public class foo {
6182
  private int a;
6183
  public void bar (void) {
6184
    a = 0;
6185
  }
6186
};
6187
EOF
14199 hornik 6188
])
27343 hornik 6189
dnl Parse the compiler output and extract the necessary
6190
dnl objects, libraries and library flags.
6191
if AC_TRY_EVAL(ac_compile); then
6192
  # Parse the compiler output and extract the necessary
6193
  # objects, libraries and library flags.
14199 hornik 6194
 
27343 hornik 6195
  # Sentinel used to keep track of whether or not we are before
6196
  # the conftest object file.
6197
  pre_test_object_deps_done=no
6198
 
6199
  # The `*' in the case matches for architectures that use `case' in
6200
  # $output_verbose_cmd can trigger glob expansion during the loop
6201
  # eval without this substitution.
6202
  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
6203
 
6204
  for p in `eval $output_verbose_link_cmd`; do
6205
    case $p in
6206
 
6207
    -L* | -R* | -l*)
6208
       # Some compilers place space between "-{L,R}" and the path.
6209
       # Remove the space.
6210
       if test $p = "-L" \
6211
	  || test $p = "-R"; then
6212
	 prev=$p
6213
	 continue
6214
       else
6215
	 prev=
6216
       fi
6217
 
6218
       if test "$pre_test_object_deps_done" = no; then
6219
	 case $p in
6220
	 -L* | -R*)
6221
	   # Internal compiler library paths should come after those
6222
	   # provided the user.  The postdeps already come after the
6223
	   # user supplied libs so there is no need to process them.
6224
	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
6225
	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6226
	   else
6227
	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6228
	   fi
6229
	   ;;
6230
	 # The "-l" case would never come before the object being
6231
	 # linked, so don't bother handling this case.
6232
	 esac
6233
       else
6234
	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
6235
	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
6236
	 else
6237
	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
6238
	 fi
6239
       fi
6240
       ;;
6241
 
6242
    *.$objext)
6243
       # This assumes that the test object file only shows up
6244
       # once in the compiler output.
6245
       if test "$p" = "conftest.$objext"; then
6246
	 pre_test_object_deps_done=yes
6247
	 continue
6248
       fi
6249
 
6250
       if test "$pre_test_object_deps_done" = no; then
6251
	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
6252
	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
6253
	 else
6254
	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
6255
	 fi
6256
       else
6257
	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
6258
	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
6259
	 else
6260
	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
6261
	 fi
6262
       fi
6263
       ;;
6264
 
6265
    *) ;; # Ignore the rest.
6266
 
6267
    esac
6268
  done
6269
 
6270
  # Clean up.
6271
  rm -f a.out a.exe
6272
else
6273
  echo "libtool.m4: error: problem compiling $1 test program"
6274
fi
6275
 
6276
$rm -f confest.$objext
6277
 
6278
case " $_LT_AC_TAGVAR(postdeps, $1) " in
6279
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6280
esac
6281
])# AC_LIBTOOL_POSTDEP_PREDEP
6282
 
6283
# AC_LIBTOOL_LANG_F77_CONFIG
6284
# ------------------------
6285
# Ensure that the configuration vars for the C compiler are
6286
# suitably defined.  Those variables are subsequently used by
6287
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6288
AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
6289
AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
6290
[AC_REQUIRE([AC_PROG_F77])
6291
AC_LANG_PUSH(Fortran 77)
6292
 
6293
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6294
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
6295
_LT_AC_TAGVAR(always_export_symbols, $1)=no
6296
_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
6297
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6298
_LT_AC_TAGVAR(hardcode_direct, $1)=no
6299
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6300
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6301
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6302
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
6303
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
6304
_LT_AC_TAGVAR(module_cmds, $1)=
6305
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
6306
_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
6307
_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6308
_LT_AC_TAGVAR(no_undefined_flag, $1)=
6309
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6310
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6311
 
6312
# Source file extension for f77 test sources.
6313
ac_ext=f
6314
 
6315
# Object file extension for compiled f77 test sources.
6316
objext=o
6317
_LT_AC_TAGVAR(objext, $1)=$objext
6318
 
6319
# Code to be used in simple compile tests
6320
lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
6321
 
6322
# Code to be used in simple link tests
6323
lt_simple_link_test_code="      program t\n      end\n"
6324
 
6325
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6326
_LT_AC_SYS_COMPILER
6327
 
6328
# Allow CC to be a program name with arguments.
6329
lt_save_CC="$CC"
6330
CC=${F77-"f77"}
6331
compiler=$CC
6332
_LT_AC_TAGVAR(compiler, $1)=$CC
6333
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
6334
 
6335
AC_MSG_CHECKING([if libtool supports shared libraries])
6336
AC_MSG_RESULT([$can_build_shared])
6337
 
6338
AC_MSG_CHECKING([whether to build shared libraries])
6339
test "$can_build_shared" = "no" && enable_shared=no
6340
 
6341
# On AIX, shared libraries and static libraries use the same namespace, and
6342
# are all built from PIC.
6343
case "$host_os" in
6344
aix3*)
6345
  test "$enable_shared" = yes && enable_static=no
6346
  if test -n "$RANLIB"; then
6347
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
6348
    postinstall_cmds='$RANLIB $lib'
6349
  fi
6350
  ;;
6351
aix4*)
6352
  test "$enable_shared" = yes && enable_static=no
6353
  ;;
6354
esac
6355
AC_MSG_RESULT([$enable_shared])
6356
 
6357
AC_MSG_CHECKING([whether to build static libraries])
6358
# Make sure either enable_shared or enable_static is yes.
6359
test "$enable_shared" = yes || enable_static=yes
6360
AC_MSG_RESULT([$enable_static])
6361
 
6362
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6363
 
6364
_LT_AC_TAGVAR(GCC, $1)="$G77"
6365
_LT_AC_TAGVAR(LD, $1)="$LD"
6366
 
6367
AC_LIBTOOL_PROG_COMPILER_PIC($1)
6368
AC_LIBTOOL_PROG_CC_C_O($1)
6369
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
6370
AC_LIBTOOL_PROG_LD_SHLIBS($1)
6371
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
6372
AC_LIBTOOL_SYS_LIB_STRIP
6373
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
6374
 
6375
AC_LIBTOOL_CONFIG($1)
6376
 
6377
AC_LANG_POP
6378
CC="$lt_save_CC"
6379
])# AC_LIBTOOL_LANG_F77_CONFIG
6380
 
6381
 
6382
# AC_LIBTOOL_LANG_GCJ_CONFIG
6383
# --------------------------
6384
# Ensure that the configuration vars for the C compiler are
6385
# suitably defined.  Those variables are subsequently used by
6386
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6387
AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
6388
AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
6389
[AC_LANG_SAVE
6390
 
6391
# Source file extension for Java test sources.
6392
ac_ext=java
6393
 
6394
# Object file extension for compiled Java test sources.
6395
objext=o
6396
_LT_AC_TAGVAR(objext, $1)=$objext
6397
 
6398
# Code to be used in simple compile tests
6399
lt_simple_compile_test_code="class foo {}\n"
6400
 
6401
# Code to be used in simple link tests
6402
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
6403
 
6404
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6405
_LT_AC_SYS_COMPILER
6406
 
6407
# Allow CC to be a program name with arguments.
6408
lt_save_CC="$CC"
6409
CC=${GCJ-"gcj"}
6410
compiler=$CC
6411
_LT_AC_TAGVAR(compiler, $1)=$CC
6412
 
6413
# GCJ did not exist at the time GCC didn't implicitly link libc in.
6414
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6415
 
6416
## CAVEAT EMPTOR:
6417
## There is no encapsulation within the following macros, do not change
6418
## the running order or otherwise move them around unless you know exactly
6419
## what you are doing...
6420
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
6421
AC_LIBTOOL_PROG_COMPILER_PIC($1)
6422
AC_LIBTOOL_PROG_CC_C_O($1)
6423
AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
6424
AC_LIBTOOL_PROG_LD_SHLIBS($1)
6425
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
6426
AC_LIBTOOL_SYS_LIB_STRIP
6427
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
6428
AC_LIBTOOL_DLOPEN_SELF($1)
6429
 
6430
AC_LIBTOOL_CONFIG($1)
6431
 
6432
AC_LANG_RESTORE
6433
CC="$lt_save_CC"
6434
])# AC_LIBTOOL_LANG_GCJ_CONFIG
6435
 
6436
 
6437
# AC_LIBTOOL_LANG_RC_CONFIG
6438
# --------------------------
6439
# Ensure that the configuration vars for the Windows resource compiler are
6440
# suitably defined.  Those variables are subsequently used by
6441
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6442
AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
6443
AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
6444
[AC_LANG_SAVE
6445
 
6446
# Source file extension for RC test sources.
6447
ac_ext=rc
6448
 
6449
# Object file extension for compiled RC test sources.
6450
objext=o
6451
_LT_AC_TAGVAR(objext, $1)=$objext
6452
 
6453
# Code to be used in simple compile tests
6454
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
6455
 
6456
# Code to be used in simple link tests
6457
lt_simple_link_test_code="$lt_simple_compile_test_code"
6458
 
6459
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6460
_LT_AC_SYS_COMPILER
6461
 
6462
# Allow CC to be a program name with arguments.
6463
lt_save_CC="$CC"
6464
CC=${RC-"windres"}
6465
compiler=$CC
6466
_LT_AC_TAGVAR(compiler, $1)=$CC
6467
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6468
 
6469
AC_LIBTOOL_CONFIG($1)
6470
 
6471
AC_LANG_RESTORE
6472
CC="$lt_save_CC"
6473
])# AC_LIBTOOL_LANG_RC_CONFIG
6474
 
6475
 
6476
# AC_LIBTOOL_CONFIG([TAGNAME])
6477
# ----------------------------
6478
# If TAGNAME is not passed, then create an initial libtool script
6479
# with a default configuration from the untagged config vars.  Otherwise
6480
# add code to config.status for appending the configuration named by
6481
# TAGNAME from the matching tagged config vars.
6482
AC_DEFUN([AC_LIBTOOL_CONFIG],
6483
[# The else clause should only fire when bootstrapping the
6484
# libtool distribution, otherwise you forgot to ship ltmain.sh
6485
# with your package, and you will get complaints that there are
6486
# no rules to generate ltmain.sh.
6487
if test -f "$ltmain"; then
6488
  # See if we are running on zsh, and set the options which allow our commands through
6489
  # without removal of \ escapes.
6490
  if test -n "${ZSH_VERSION+set}" ; then
6491
    setopt NO_GLOB_SUBST
6492
  fi  
6493
  # Now quote all the things that may contain metacharacters while being
6494
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
6495
  # variables and quote the copies for generation of the libtool script.
6496
  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
6497
    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
6498
    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
6499
    deplibs_check_method reload_flag reload_cmds need_locks \
6500
    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
6501
    lt_cv_sys_global_symbol_to_c_name_address \
6502
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
6503
    old_postinstall_cmds old_postuninstall_cmds \
6504
    _LT_AC_TAGVAR(compiler, $1) \
6505
    _LT_AC_TAGVAR(CC, $1) \
6506
    _LT_AC_TAGVAR(LD, $1) \
6507
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
6508
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
6509
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
6510
    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
6511
    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
6512
    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
6513
    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
6514
    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
6515
    _LT_AC_TAGVAR(old_archive_cmds, $1) \
6516
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
6517
    _LT_AC_TAGVAR(predep_objects, $1) \
6518
    _LT_AC_TAGVAR(postdep_objects, $1) \
6519
    _LT_AC_TAGVAR(predeps, $1) \
6520
    _LT_AC_TAGVAR(postdeps, $1) \
6521
    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
6522
    _LT_AC_TAGVAR(archive_cmds, $1) \
6523
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
6524
    _LT_AC_TAGVAR(postinstall_cmds, $1) \
6525
    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
6526
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
6527
    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
6528
    _LT_AC_TAGVAR(no_undefined_flag, $1) \
6529
    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
6530
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
6531
    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
6532
    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
6533
    _LT_AC_TAGVAR(hardcode_automatic, $1) \
6534
    _LT_AC_TAGVAR(module_cmds, $1) \
6535
    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
6536
    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
6537
    _LT_AC_TAGVAR(exclude_expsyms, $1) \
6538
    _LT_AC_TAGVAR(include_expsyms, $1); do
6539
 
6540
    case $var in
6541
    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
6542
    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
6543
    _LT_AC_TAGVAR(archive_cmds, $1) | \
6544
    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
6545
    _LT_AC_TAGVAR(module_cmds, $1) | \
6546
    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
6547
    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
6548
    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
6549
    extract_expsyms_cmds | reload_cmds | finish_cmds | \
6550
    postinstall_cmds | postuninstall_cmds | \
6551
    old_postinstall_cmds | old_postuninstall_cmds | \
6552
    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
6553
      # Double-quote double-evaled strings.
6554
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
6555
      ;;
6556
    *)
6557
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
6558
      ;;
6559
    esac
6560
  done
6561
 
6562
  case $lt_echo in
6563
  *'\[$]0 --fallback-echo"')
6564
    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
6565
    ;;
6566
  esac
6567
 
6568
ifelse([$1], [],
6569
  [cfgfile="${ofile}T"
6570
  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
6571
  $rm -f "$cfgfile"
6572
  AC_MSG_NOTICE([creating $ofile])],
6573
  [cfgfile="$ofile"])
6574
 
6575
  cat <<__EOF__ >> "$cfgfile"
6576
ifelse([$1], [],
6577
[#! $SHELL
6578
 
6579
# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6580
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
6581
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
6582
#
6583
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
6584
# Free Software Foundation, Inc.
6585
#
6586
# This file is part of GNU Libtool:
6587
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6588
#
6589
# This program is free software; you can redistribute it and/or modify
6590
# it under the terms of the GNU General Public License as published by
6591
# the Free Software Foundation; either version 2 of the License, or
6592
# (at your option) any later version.
6593
#
6594
# This program is distributed in the hope that it will be useful, but
6595
# WITHOUT ANY WARRANTY; without even the implied warranty of
6596
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6597
# General Public License for more details.
6598
#
6599
# You should have received a copy of the GNU General Public License
6600
# along with this program; if not, write to the Free Software
6601
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6602
#
6603
# As a special exception to the GNU General Public License, if you
6604
# distribute this file as part of a program that contains a
6605
# configuration script generated by Autoconf, you may include it under
6606
# the same distribution terms that you use for the rest of that program.
6607
 
6608
# A sed program that does not truncate output.
6609
SED=$lt_SED
6610
 
6611
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
6612
Xsed="$SED -e s/^X//"
6613
 
6614
# The HP-UX ksh and POSIX shell print the target directory to stdout
6615
# if CDPATH is set.
6616
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
6617
 
6618
# The names of the tagged configurations supported by this script.
6619
available_tags=
6620
 
6621
# ### BEGIN LIBTOOL CONFIG],
6622
[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
6623
 
6624
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6625
 
6626
# Shell to use when invoking shell scripts.
6627
SHELL=$lt_SHELL
6628
 
6629
# Whether or not to build shared libraries.
6630
build_libtool_libs=$enable_shared
6631
 
6632
# Whether or not to build static libraries.
6633
build_old_libs=$enable_static
6634
 
6635
# Whether or not to add -lc for building shared libraries.
6636
build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
6637
 
6638
# Whether or not to disallow shared libs when runtime libs are static
6639
allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
6640
 
6641
# Whether or not to optimize for fast installation.
6642
fast_install=$enable_fast_install
6643
 
6644
# The host system.
6645
host_alias=$host_alias
6646
host=$host
6647
 
6648
# An echo program that does not interpret backslashes.
6649
echo=$lt_echo
6650
 
6651
# The archiver.
6652
AR=$lt_AR
6653
AR_FLAGS=$lt_AR_FLAGS
6654
 
6655
# A C compiler.
6656
LTCC=$lt_LTCC
6657
 
6658
# A language-specific compiler.
6659
CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
6660
 
6661
# Is the compiler the GNU C compiler?
6662
with_gcc=$_LT_AC_TAGVAR(GCC, $1)
6663
 
6664
# An ERE matcher.
6665
EGREP=$lt_EGREP
6666
 
6667
# The linker used to build libraries.
6668
LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
6669
 
6670
# Whether we need hard or soft links.
6671
LN_S=$lt_LN_S
6672
 
6673
# A BSD-compatible nm program.
6674
NM=$lt_NM
6675
 
6676
# A symbol stripping program
6677
STRIP=$STRIP
6678
 
6679
# Used to examine libraries when file_magic_cmd begins "file"
6680
MAGIC_CMD=$MAGIC_CMD
6681
 
6682
# Used on cygwin: DLL creation program.
6683
DLLTOOL="$DLLTOOL"
6684
 
6685
# Used on cygwin: object dumper.
6686
OBJDUMP="$OBJDUMP"
6687
 
6688
# Used on cygwin: assembler.
6689
AS="$AS"
6690
 
6691
# The name of the directory that contains temporary libtool files.
6692
objdir=$objdir
6693
 
6694
# How to create reloadable object files.
6695
reload_flag=$lt_reload_flag
6696
reload_cmds=$lt_reload_cmds
6697
 
6698
# How to pass a linker flag through the compiler.
6699
wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6700
 
6701
# Object file suffix (normally "o").
6702
objext="$ac_objext"
6703
 
6704
# Old archive suffix (normally "a").
6705
libext="$libext"
6706
 
6707
# Shared library suffix (normally ".so").
6708
shrext='$shrext'
6709
 
6710
# Executable file suffix (normally "").
6711
exeext="$exeext"
6712
 
6713
# Additional compiler flags for building library objects.
6714
pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6715
pic_mode=$pic_mode
6716
 
6717
# What is the maximum length of a command?
6718
max_cmd_len=$lt_cv_sys_max_cmd_len
6719
 
6720
# Does compiler simultaneously support -c and -o options?
6721
compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
6722
 
6723
# Must we lock files when doing compilation ?
6724
need_locks=$lt_need_locks
6725
 
6726
# Do we need the lib prefix for modules?
6727
need_lib_prefix=$need_lib_prefix
6728
 
6729
# Do we need a version for libraries?
6730
need_version=$need_version
6731
 
6732
# Whether dlopen is supported.
6733
dlopen_support=$enable_dlopen
6734
 
6735
# Whether dlopen of programs is supported.
6736
dlopen_self=$enable_dlopen_self
6737
 
6738
# Whether dlopen of statically linked programs is supported.
6739
dlopen_self_static=$enable_dlopen_self_static
6740
 
6741
# Compiler flag to prevent dynamic linking.
6742
link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
6743
 
6744
# Compiler flag to turn off builtin functions.
6745
no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
6746
 
6747
# Compiler flag to allow reflexive dlopens.
6748
export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
6749
 
6750
# Compiler flag to generate shared objects directly from archives.
6751
whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
6752
 
6753
# Compiler flag to generate thread-safe objects.
6754
thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
6755
 
6756
# Library versioning type.
6757
version_type=$version_type
6758
 
6759
# Format of library name prefix.
6760
libname_spec=$lt_libname_spec
6761
 
6762
# List of archive names.  First name is the real one, the rest are links.
6763
# The last name is the one that the linker finds with -lNAME.
6764
library_names_spec=$lt_library_names_spec
6765
 
6766
# The coded name of the library, if different from the real name.
6767
soname_spec=$lt_soname_spec
6768
 
6769
# Commands used to build and install an old-style archive.
6770
RANLIB=$lt_RANLIB
6771
old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
6772
old_postinstall_cmds=$lt_old_postinstall_cmds
6773
old_postuninstall_cmds=$lt_old_postuninstall_cmds
6774
 
6775
# Create an old-style archive from a shared archive.
6776
old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
6777
 
6778
# Create a temporary old-style archive to link instead of a shared archive.
6779
old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
6780
 
6781
# Commands used to build and install a shared archive.
6782
archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
6783
archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
6784
postinstall_cmds=$lt_postinstall_cmds
6785
postuninstall_cmds=$lt_postuninstall_cmds
6786
 
6787
# Commands used to build a loadable module (assumed same as above if empty)
6788
module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
6789
module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
6790
 
6791
# Commands to strip libraries.
6792
old_striplib=$lt_old_striplib
6793
striplib=$lt_striplib
6794
 
6795
# Dependencies to place before the objects being linked to create a
6796
# shared library.
6797
predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
6798
 
6799
# Dependencies to place after the objects being linked to create a
6800
# shared library.
6801
postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
6802
 
6803
# Dependencies to place before the objects being linked to create a
6804
# shared library.
6805
predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
6806
 
6807
# Dependencies to place after the objects being linked to create a
6808
# shared library.
6809
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
6810
 
6811
# The library search path used internally by the compiler when linking
6812
# a shared library.
6813
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
6814
 
6815
# Method to check whether dependent libraries are shared objects.
6816
deplibs_check_method=$lt_deplibs_check_method
6817
 
6818
# Command to use when deplibs_check_method == file_magic.
6819
file_magic_cmd=$lt_file_magic_cmd
6820
 
6821
# Flag that allows shared libraries with undefined symbols to be built.
6822
allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
6823
 
6824
# Flag that forces no undefined symbols.
6825
no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
6826
 
6827
# Commands used to finish a libtool library installation in a directory.
6828
finish_cmds=$lt_finish_cmds
6829
 
6830
# Same as above, but a single script fragment to be evaled but not shown.
6831
finish_eval=$lt_finish_eval
6832
 
6833
# Take the output of nm and produce a listing of raw symbols and C names.
6834
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
6835
 
6836
# Transform the output of nm in a proper C declaration
6837
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
6838
 
6839
# Transform the output of nm in a C name address pair
6840
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
6841
 
6842
# This is the shared library runtime path variable.
6843
runpath_var=$runpath_var
6844
 
6845
# This is the shared library path variable.
6846
shlibpath_var=$shlibpath_var
6847
 
6848
# Is shlibpath searched before the hard-coded library search path?
6849
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
6850
 
6851
# How to hardcode a shared library path into an executable.
6852
hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
6853
 
6854
# Whether we should hardcode library paths into libraries.
6855
hardcode_into_libs=$hardcode_into_libs
6856
 
6857
# Flag to hardcode \$libdir into a binary during linking.
6858
# This must work even if \$libdir does not exist.
6859
hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
6860
 
6861
# If ld is used when linking, flag to hardcode \$libdir into
6862
# a binary during linking. This must work even if \$libdir does
6863
# not exist.
6864
hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
6865
 
6866
# Whether we need a single -rpath flag with a separated argument.
6867
hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
6868
 
6869
# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
6870
# resulting binary.
6871
hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
6872
 
6873
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6874
# resulting binary.
6875
hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
6876
 
6877
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6878
# the resulting binary.
6879
hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
6880
 
6881
# Set to yes if building a shared library automatically hardcodes DIR into the library
6882
# and all subsequent libraries and executables linked against it.
6883
hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
6884
 
6885
# Variables whose values should be saved in libtool wrapper scripts and
6886
# restored at relink time.
6887
variables_saved_for_relink="$variables_saved_for_relink"
6888
 
6889
# Whether libtool must link a program against all its dependency libraries.
6890
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
6891
 
6892
# Compile-time system search path for libraries
6893
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
6894
 
6895
# Run-time system search path for libraries
6896
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
6897
 
6898
# Fix the shell variable \$srcfile for the compiler.
6899
fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
6900
 
6901
# Set to yes if exported symbols are required.
6902
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
6903
 
6904
# The commands to list exported symbols.
6905
export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
6906
 
6907
# The commands to extract the exported symbol list from a shared archive.
6908
extract_expsyms_cmds=$lt_extract_expsyms_cmds
6909
 
6910
# Symbols that should not be listed in the preloaded symbols.
6911
exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
6912
 
6913
# Symbols that must always be exported.
6914
include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
6915
 
6916
ifelse([$1],[],
6917
[# ### END LIBTOOL CONFIG],
6918
[# ### END LIBTOOL TAG CONFIG: $tagname])
6919
 
6920
__EOF__
6921
 
6922
ifelse([$1],[], [
6923
  case $host_os in
6924
  aix3*)
6925
    cat <<\EOF >> "$cfgfile"
6926
 
6927
# AIX sometimes has problems with the GCC collect2 program.  For some
6928
# reason, if we set the COLLECT_NAMES environment variable, the problems
6929
# vanish in a puff of smoke.
6930
if test "X${COLLECT_NAMES+set}" != Xset; then
6931
  COLLECT_NAMES=
6932
  export COLLECT_NAMES
6933
fi
6934
EOF
6935
    ;;
6936
  esac
6937
 
6938
  # We use sed instead of cat because bash on DJGPP gets confused if
6939
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
6940
  # text mode, it properly converts lines to CR/LF.  This bash problem
6941
  # is reportedly fixed, but why not run on old versions too?
6942
  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
6943
 
6944
  mv -f "$cfgfile" "$ofile" || \
6945
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
6946
  chmod +x "$ofile"
6947
])
6948
else
6949
  # If there is no Makefile yet, we rely on a make rule to execute
6950
  # `config.status --recheck' to rerun these tests and create the
6951
  # libtool script then.
6952
  test -f Makefile && make "$ltmain"
6953
fi
6954
])# AC_LIBTOOL_CONFIG
6955
 
6956
 
6957
# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
6958
# -------------------------------------------
6959
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
6960
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6961
 
6962
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6963
 
6964
if test "$GCC" = yes; then
6965
  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6966
 
6967
  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
6968
    lt_cv_prog_compiler_rtti_exceptions,
6969
    [-fno-rtti -fno-exceptions], [],
6970
    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
6971
fi
6972
])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
6973
 
6974
 
6975
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
6976
# ---------------------------------
6977
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
6978
[AC_REQUIRE([AC_CANONICAL_HOST])
6979
AC_REQUIRE([AC_PROG_NM])
6980
AC_REQUIRE([AC_OBJEXT])
6981
# Check for command to grab the raw symbol name followed by C symbol from nm.
6982
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
6983
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
6984
[
6985
# These are sane defaults that work on at least a few old systems.
6986
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
6987
 
6988
# Character class describing NM global symbol codes.
6989
symcode='[[BCDEGRST]]'
6990
 
6991
# Regexp to match symbols that can be accessed directly from C.
6992
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
6993
 
6994
# Transform the above into a raw symbol and a C symbol.
6995
symxfrm='\1 \2\3 \3'
6996
 
6997
# Transform an extracted symbol line into a proper C declaration
6998
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
6999
 
7000
# Transform an extracted symbol line into symbol name and symbol address
7001
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'"
7002
 
7003
# Define system-specific variables.
7004
case $host_os in
7005
aix*)
7006
  symcode='[[BCDT]]'
7007
  ;;
7008
cygwin* | mingw* | pw32*)
7009
  symcode='[[ABCDGISTW]]'
7010
  ;;
7011
hpux*) # Its linker distinguishes data from code symbols
7012
  if test "$host_cpu" = ia64; then
7013
    symcode='[[ABCDEGRST]]'
7014
  fi
7015
  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
7016
  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'"
7017
  ;;
7018
irix* | nonstopux*)
7019
  symcode='[[BCDEGRST]]'
7020
  ;;
7021
osf*)
7022
  symcode='[[BCDEGQRST]]'
7023
  ;;
7024
solaris* | sysv5*)
7025
  symcode='[[BDT]]'
7026
  ;;
7027
sysv4)
7028
  symcode='[[DFNSTU]]'
7029
  ;;
7030
esac
7031
 
7032
# Handle CRLF in mingw tool chain
7033
opt_cr=
7034
case $build_os in
7035
mingw*)
7036
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7037
  ;;
7038
esac
7039
 
7040
# If we're using GNU nm, then use its standard symbol codes.
7041
case `$NM -V 2>&1` in
7042
*GNU* | *'with BFD'*)
7043
  symcode='[[ABCDGISTW]]' ;;
7044
esac
7045
 
7046
# Try without a prefix undercore, then with it.
7047
for ac_symprfx in "" "_"; do
7048
 
7049
  # Write the raw and C identifiers.
7050
  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
7051
 
7052
  # Check to see that the pipe works correctly.
7053
  pipe_works=no
7054
 
7055
  rm -f conftest*
7056
  cat > conftest.$ac_ext <<EOF
7057
#ifdef __cplusplus
7058
extern "C" {
7059
#endif
7060
char nm_test_var;
7061
void nm_test_func(){}
7062
#ifdef __cplusplus
7063
}
7064
#endif
7065
int main(){nm_test_var='a';nm_test_func();return(0);}
7066
EOF
7067
 
7068
  if AC_TRY_EVAL(ac_compile); then
7069
    # Now try to grab the symbols.
7070
    nlist=conftest.nm
7071
    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
7072
      # Try sorting and uniquifying the output.
7073
      if sort "$nlist" | uniq > "$nlist"T; then
7074
	mv -f "$nlist"T "$nlist"
7075
      else
7076
	rm -f "$nlist"T
7077
      fi
7078
 
7079
      # Make sure that we snagged all the symbols we need.
7080
      if grep ' nm_test_var$' "$nlist" >/dev/null; then
7081
	if grep ' nm_test_func$' "$nlist" >/dev/null; then
7082
	  cat <<EOF > conftest.$ac_ext
7083
#ifdef __cplusplus
7084
extern "C" {
7085
#endif
7086
 
7087
EOF
7088
	  # Now generate the symbol file.
7089
	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
7090
 
7091
	  cat <<EOF >> conftest.$ac_ext
7092
#if defined (__STDC__) && __STDC__
7093
# define lt_ptr_t void *
7094
#else
7095
# define lt_ptr_t char *
7096
# define const
7097
#endif
7098
 
7099
/* The mapping between symbol names and symbols. */
7100
const struct {
7101
  const char *name;
7102
  lt_ptr_t address;
7103
}
7104
lt_preloaded_symbols[[]] =
7105
{
7106
EOF
7107
	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
7108
	  cat <<\EOF >> conftest.$ac_ext
7109
  {0, (lt_ptr_t) 0}
7110
};
7111
 
7112
#ifdef __cplusplus
7113
}
7114
#endif
7115
EOF
7116
	  # Now try linking the two files.
7117
	  mv conftest.$ac_objext conftstm.$ac_objext
7118
	  lt_save_LIBS="$LIBS"
7119
	  lt_save_CFLAGS="$CFLAGS"
7120
	  LIBS="conftstm.$ac_objext"
7121
	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
7122
	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
7123
	    pipe_works=yes
7124
	  fi
7125
	  LIBS="$lt_save_LIBS"
7126
	  CFLAGS="$lt_save_CFLAGS"
7127
	else
7128
	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
7129
	fi
7130
      else
7131
	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
7132
      fi
7133
    else
7134
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
7135
    fi
7136
  else
7137
    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
7138
    cat conftest.$ac_ext >&5
7139
  fi
7140
  rm -f conftest* conftst*
7141
 
7142
  # Do not use the global_symbol_pipe unless it works.
7143
  if test "$pipe_works" = yes; then
7144
    break
7145
  else
7146
    lt_cv_sys_global_symbol_pipe=
7147
  fi
7148
done
7149
])
7150
if test -z "$lt_cv_sys_global_symbol_pipe"; then
7151
  lt_cv_sys_global_symbol_to_cdecl=
7152
fi
7153
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
7154
  AC_MSG_RESULT(failed)
7155
else
7156
  AC_MSG_RESULT(ok)
7157
fi
7158
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
7159
 
7160
 
7161
# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
7162
# ---------------------------------------
7163
AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
7164
[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
7165
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7166
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
7167
 
7168
AC_MSG_CHECKING([for $compiler option to produce PIC])
7169
 ifelse([$1],[CXX],[
7170
  # C++ specific cases for pic, static, wl, etc.
7171
  if test "$GXX" = yes; then
7172
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7173
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7174
 
7175
    case $host_os in
7176
    aix*)
7177
      # All AIX code is PIC.
7178
      if test "$host_cpu" = ia64; then
7179
	# AIX 5 now supports IA64 processor
7180
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7181
      fi
7182
      ;;
7183
    amigaos*)
7184
      # FIXME: we need at least 68020 code to build shared libraries, but
7185
      # adding the `-m68020' flag to GCC prevents building anything better,
7186
      # like `-m68040'.
7187
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7188
      ;;
7189
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7190
      # PIC is the default for these OSes.
7191
      ;;
7192
    mingw* | os2* | pw32*)
7193
      # This hack is so that the source file can tell whether it is being
7194
      # built for inclusion in a dll (and should export symbols for example).
7195
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
7196
      ;;
7197
    darwin* | rhapsody*)
7198
      # PIC is the default on this platform
7199
      # Common symbols not allowed in MH_DYLIB files
7200
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7201
      ;;
7202
    *djgpp*)
7203
      # DJGPP does not support shared libraries at all
7204
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7205
      ;;
7206
    sysv4*MP*)
7207
      if test -d /usr/nec; then
7208
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7209
      fi
7210
      ;;
7211
    hpux*)
7212
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7213
      # not for PA HP-UX.
7214
      case "$host_cpu" in
7215
      hppa*64*|ia64*)
7216
	;;
7217
      *)
7218
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7219
	;;
7220
      esac
7221
      ;;
7222
    *)
7223
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7224
      ;;
7225
    esac
7226
  else
7227
    case $host_os in
7228
      aix4* | aix5*)
7229
	# All AIX code is PIC.
7230
	if test "$host_cpu" = ia64; then
7231
	  # AIX 5 now supports IA64 processor
7232
	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7233
	else
7234
	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7235
	fi
7236
	;;
7237
      chorus*)
7238
	case $cc_basename in
7239
	cxch68)
7240
	  # Green Hills C++ Compiler
7241
	  # _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"
7242
	  ;;
7243
	esac
7244
	;;
7245
      dgux*)
7246
	case $cc_basename in
7247
	  ec++)
7248
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7249
	    ;;
7250
	  ghcx)
7251
	    # Green Hills C++ Compiler
7252
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7253
	    ;;
7254
	  *)
7255
	    ;;
7256
	esac
7257
	;;
7258
      freebsd*)
7259
	# FreeBSD uses GNU C++
7260
	;;
7261
      hpux9* | hpux10* | hpux11*)
7262
	case $cc_basename in
7263
	  CC)
7264
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7265
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
7266
	    if test "$host_cpu" != ia64; then
7267
	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7268
	    fi
7269
	    ;;
7270
	  aCC)
7271
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7272
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
7273
	    case "$host_cpu" in
7274
	    hppa*64*|ia64*)
7275
	      # +Z the default
7276
	      ;;
7277
	    *)
7278
	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7279
	      ;;
7280
	    esac
7281
	    ;;
7282
	  *)
7283
	    ;;
7284
	esac
7285
	;;
7286
      irix5* | irix6* | nonstopux*)
7287
	case $cc_basename in
7288
	  CC)
7289
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7290
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7291
	    # CC pic flag -KPIC is the default.
7292
	    ;;
7293
	  *)
7294
	    ;;
7295
	esac
7296
	;;
7297
      linux*)
7298
	case $cc_basename in
7299
	  KCC)
7300
	    # KAI C++ Compiler
7301
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7302
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7303
	    ;;
7304
	  icpc)
7305
	    # Intel C++
7306
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7307
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7308
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7309
	    ;; 
7310
	  cxx)
7311
	    # Compaq C++
7312
	    # Make sure the PIC flag is empty.  It appears that all Alpha
7313
	    # Linux and Compaq Tru64 Unix objects are PIC.
7314
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7315
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7316
	    ;;
7317
	  *)
7318
	    ;;
7319
	esac
7320
	;;
7321
      lynxos*)
7322
	;;
7323
      m88k*)
7324
	;;
7325
      mvs*)
7326
	case $cc_basename in
7327
	  cxx)
7328
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7329
	    ;;
7330
	  *)
7331
	    ;;
7332
	esac
7333
	;;
7334
      netbsd*)
7335
	;;
7336
      osf3* | osf4* | osf5*)
7337
	case $cc_basename in
7338
	  KCC)
7339
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7340
	    ;;
7341
	  RCC)
7342
	    # Rational C++ 2.4.1
7343
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7344
	    ;;
7345
	  cxx)
7346
	    # Digital/Compaq C++
7347
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7348
	    # Make sure the PIC flag is empty.  It appears that all Alpha
7349
	    # Linux and Compaq Tru64 Unix objects are PIC.
7350
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7351
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7352
	    ;;
7353
	  *)
7354
	    ;;
7355
	esac
7356
	;;
7357
      psos*)
7358
	;;
7359
      sco*)
7360
	case $cc_basename in
7361
	  CC)
7362
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7363
	    ;;
7364
	  *)
7365
	    ;;
7366
	esac
7367
	;;
7368
      solaris*)
7369
	case $cc_basename in
7370
	  CC)
7371
	    # Sun C++ 4.2, 5.x and Centerline C++
7372
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7373
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7374
	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7375
	    ;;
7376
	  gcx)
7377
	    # Green Hills C++ Compiler
7378
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7379
	    ;;
7380
	  *)
7381
	    ;;
7382
	esac
7383
	;;
7384
      sunos4*)
7385
	case $cc_basename in
7386
	  CC)
7387
	    # Sun C++ 4.x
7388
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7389
	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7390
	    ;;
7391
	  lcc)
7392
	    # Lucid
7393
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7394
	    ;;
7395
	  *)
7396
	    ;;
7397
	esac
7398
	;;
7399
      tandem*)
7400
	case $cc_basename in
7401
	  NCC)
7402
	    # NonStop-UX NCC 3.20
7403
	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7404
	    ;;
7405
	  *)
7406
	    ;;
7407
	esac
7408
	;;
7409
      unixware*)
7410
	;;
7411
      vxworks*)
7412
	;;
7413
      *)
7414
	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7415
	;;
7416
    esac
7417
  fi
7418
],
7419
[
7420
  if test "$GCC" = yes; then
7421
    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7422
    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7423
 
7424
    case $host_os in
7425
      aix*)
7426
      # All AIX code is PIC.
7427
      if test "$host_cpu" = ia64; then
7428
	# AIX 5 now supports IA64 processor
7429
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7430
      fi
7431
      ;;
7432
 
7433
    amigaos*)
7434
      # FIXME: we need at least 68020 code to build shared libraries, but
7435
      # adding the `-m68020' flag to GCC prevents building anything better,
7436
      # like `-m68040'.
7437
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7438
      ;;
7439
 
7440
    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7441
      # PIC is the default for these OSes.
7442
      ;;
7443
 
7444
    mingw* | pw32* | os2*)
7445
      # This hack is so that the source file can tell whether it is being
7446
      # built for inclusion in a dll (and should export symbols for example).
7447
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
7448
      ;;
7449
 
7450
    darwin* | rhapsody*)
7451
      # PIC is the default on this platform
7452
      # Common symbols not allowed in MH_DYLIB files
7453
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7454
      ;;
7455
 
7456
    msdosdjgpp*)
7457
      # Just because we use GCC doesn't mean we suddenly get shared libraries
7458
      # on systems that don't support them.
7459
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7460
      enable_shared=no
7461
      ;;
7462
 
7463
    sysv4*MP*)
7464
      if test -d /usr/nec; then
7465
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7466
      fi
7467
      ;;
7468
 
7469
    hpux*)
7470
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7471
      # not for PA HP-UX.
7472
      case "$host_cpu" in
7473
      hppa*64*|ia64*)
7474
	# +Z the default
7475
	;;
7476
      *)
7477
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7478
	;;
7479
      esac
7480
      ;;
7481
 
7482
    *)
7483
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7484
      ;;
7485
    esac
7486
  else
7487
    # PORTME Check for flag to pass linker flags through the system compiler.
7488
    case $host_os in
7489
    aix*)
7490
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7491
      if test "$host_cpu" = ia64; then
7492
	# AIX 5 now supports IA64 processor
7493
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7494
      else
7495
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7496
      fi
7497
      ;;
7498
 
7499
    mingw* | pw32* | os2*)
7500
      # This hack is so that the source file can tell whether it is being
7501
      # built for inclusion in a dll (and should export symbols for example).
7502
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
7503
      ;;
7504
 
7505
    hpux9* | hpux10* | hpux11*)
7506
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7507
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7508
      # not for PA HP-UX.
7509
      case "$host_cpu" in
7510
      hppa*64*|ia64*)
7511
	# +Z the default
7512
	;;
7513
      *)
7514
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7515
	;;
7516
      esac
7517
      # Is there a better lt_prog_compiler_static that works with the bundled CC?
7518
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
7519
      ;;
7520
 
7521
    irix5* | irix6* | nonstopux*)
7522
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7523
      # PIC (with -KPIC) is the default.
7524
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7525
      ;;
7526
 
7527
    newsos6)
7528
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7529
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7530
      ;;
7531
 
7532
    linux*)
7533
      case $CC in
7534
      icc|ecc)
7535
	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7536
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7537
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7538
        ;;
7539
      ccc)
7540
        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7541
        # All Alpha code is PIC.
7542
        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7543
        ;;
7544
      esac
7545
      ;;
7546
 
7547
    osf3* | osf4* | osf5*)
7548
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7549
      # All OSF/1 code is PIC.
7550
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7551
      ;;
7552
 
7553
    sco3.2v5*)
7554
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
7555
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
7556
      ;;
7557
 
7558
    solaris*)
7559
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7560
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7561
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7562
      ;;
7563
 
7564
    sunos4*)
7565
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7566
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7567
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7568
      ;;
7569
 
7570
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7571
      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7572
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7573
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7574
      ;;
7575
 
7576
    sysv4*MP*)
7577
      if test -d /usr/nec ;then
7578
	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
7579
	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7580
      fi
7581
      ;;
7582
 
7583
    uts4*)
7584
      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7585
      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7586
      ;;
7587
 
7588
    *)
7589
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7590
      ;;
7591
    esac
7592
  fi
7593
])
7594
AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
7595
 
7596
#
7597
# Check to make sure the PIC flag actually works.
7598
#
7599
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
7600
  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
7601
    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
7602
    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
7603
    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
7604
     "" | " "*) ;;
7605
     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
7606
     esac],
7607
    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7608
     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
7609
fi
7610
case "$host_os" in
7611
  # For platforms which do not support PIC, -DPIC is meaningless:
7612
  *djgpp*)
7613
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7614
    ;;
7615
  *)
7616
    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
7617
    ;;
7618
esac
7619
])
7620
 
7621
 
7622
# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
7623
# ------------------------------------
7624
# See if the linker supports building shared libraries.
7625
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
7626
[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7627
ifelse([$1],[CXX],[
7628
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7629
  case $host_os in
7630
  aix4* | aix5*)
7631
    # If we're using GNU nm, then we don't want the "-C" option.
7632
    # -C means demangle to AIX nm, but means don't demangle with GNU nm
7633
    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
7634
      _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'
7635
    else
7636
      _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'
7637
    fi
7638
    ;;
7639
  pw32*)
7640
    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
7641
  ;;
7642
  cygwin* | mingw*)
7643
    _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'
7644
  ;;
7645
  *)
7646
    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7647
  ;;
7648
  esac
7649
],[
7650
  runpath_var=
7651
  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
7652
  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7653
  _LT_AC_TAGVAR(archive_cmds, $1)=
7654
  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
7655
  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
7656
  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
7657
  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
7658
  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7659
  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
7660
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7661
  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7662
  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7663
  _LT_AC_TAGVAR(hardcode_direct, $1)=no
7664
  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
7665
  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7666
  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
7667
  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
7668
  _LT_AC_TAGVAR(module_cmds, $1)=
7669
  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
7670
  _LT_AC_TAGVAR(always_export_symbols, $1)=no
7671
  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7672
  # include_expsyms should be a list of space-separated symbols to be *always*
7673
  # included in the symbol list
7674
  _LT_AC_TAGVAR(include_expsyms, $1)=
7675
  # exclude_expsyms can be an extended regexp of symbols to exclude
7676
  # it will be wrapped by ` (' and `)$', so one must not match beginning or
7677
  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
7678
  # as well as any symbol that contains `d'.
7679
  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
7680
  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
7681
  # platforms (ab)use it in PIC code, but their linkers get confused if
7682
  # the symbol is explicitly referenced.  Since portable code cannot
7683
  # rely on this symbol name, it's probably fine to never include it in
7684
  # preloaded symbol tables.
7685
  extract_expsyms_cmds=
7686
 
7687
  case $host_os in
7688
  cygwin* | mingw* | pw32*)
7689
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
7690
    # When not using gcc, we currently assume that we are using
7691
    # Microsoft Visual C++.
7692
    if test "$GCC" != yes; then
7693
      with_gnu_ld=no
7694
    fi
7695
    ;;
7696
  openbsd*)
7697
    with_gnu_ld=no
7698
    ;;
7699
  esac
7700
 
7701
  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
7702
  if test "$with_gnu_ld" = yes; then
7703
    # If archive_cmds runs LD, not CC, wlarc should be empty
7704
    wlarc='${wl}'
7705
 
7706
    # See if GNU ld supports shared libraries.
7707
    case $host_os in
7708
    aix3* | aix4* | aix5*)
7709
      # On AIX/PPC, the GNU linker is very broken
7710
      if test "$host_cpu" != ia64; then
7711
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7712
	cat <<EOF 1>&2
7713
 
7714
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
7715
*** to be unable to reliably create shared libraries on AIX.
7716
*** Therefore, libtool is disabling shared libraries support.  If you
7717
*** really care for shared libraries, you may want to modify your PATH
7718
*** so that a non-GNU linker is found, and then restart.
7719
 
7720
EOF
7721
      fi
7722
      ;;
7723
 
7724
    amigaos*)
7725
      _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)'
7726
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7727
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7728
 
7729
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
7730
      # that the semantics of dynamic libraries on AmigaOS, at least up
7731
      # to version 4, is to share data among multiple programs linked
7732
      # with the same dynamic library.  Since this doesn't match the
7733
      # behavior of shared libraries on other platforms, we can't use
7734
      # them.
7735
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7736
      ;;
7737
 
7738
    beos*)
7739
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7740
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7741
	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7742
	# support --undefined.  This deserves some investigation.  FIXME
7743
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7744
      else
7745
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7746
      fi
7747
      ;;
7748
 
7749
    cygwin* | mingw* | pw32*)
7750
      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7751
      # as there is no search path for DLLs.
7752
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7753
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7754
      _LT_AC_TAGVAR(always_export_symbols, $1)=no
7755
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7756
      _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'
7757
 
7758
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
7759
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
7760
	# If the export-symbols file already is a .def file (1st line
7761
	# is EXPORTS), use it as is; otherwise, prepend...
7762
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7763
	  cp $export_symbols $output_objdir/$soname.def;
7764
	else
7765
	  echo EXPORTS > $output_objdir/$soname.def;
7766
	  cat $export_symbols >> $output_objdir/$soname.def;
7767
	fi~
7768
	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
7769
      else
7770
	ld_shlibs=no
7771
      fi
7772
      ;;
7773
 
7774
    netbsd*)
7775
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7776
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
7777
	wlarc=
7778
      else
7779
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7780
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7781
      fi
7782
      ;;
7783
 
7784
    solaris* | sysv5*)
7785
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
7786
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7787
	cat <<EOF 1>&2
7788
 
7789
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
7790
*** create shared libraries on Solaris systems.  Therefore, libtool
7791
*** is disabling shared libraries support.  We urge you to upgrade GNU
7792
*** binutils to release 2.9.1 or newer.  Another option is to modify
7793
*** your PATH or compiler configuration so that the native linker is
7794
*** used, and then restart.
7795
 
7796
EOF
7797
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7798
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7799
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7800
      else
7801
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7802
      fi
7803
      ;;
7804
 
7805
    sunos4*)
7806
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7807
      wlarc=
7808
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7809
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7810
      ;;
7811
 
7812
    *)
7813
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7814
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7815
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7816
      else
7817
	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7818
      fi
7819
      ;;
7820
    esac
7821
 
7822
    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
7823
      runpath_var=LD_RUN_PATH
7824
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7825
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7826
      # ancient GNU ld didn't support --whole-archive et. al.
7827
      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
7828
 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7829
      else
7830
  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7831
      fi
7832
    fi
7833
  else
7834
    # PORTME fill in a description of your system's linker (not GNU ld)
7835
    case $host_os in
7836
    aix3*)
7837
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7838
      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
7839
      _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'
7840
      # Note: this linker hardcodes the directories in LIBPATH if there
7841
      # are no directories specified by -L.
7842
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7843
      if test "$GCC" = yes && test -z "$link_static_flag"; then
7844
	# Neither direct hardcoding nor static linking is supported with a
7845
	# broken collect2.
7846
	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
7847
      fi
7848
      ;;
7849
 
7850
    aix4* | aix5*)
7851
      if test "$host_cpu" = ia64; then
7852
	# On IA64, the linker does run time linking by default, so we don't
7853
	# have to do anything special.
7854
	aix_use_runtimelinking=no
7855
	exp_sym_flag='-Bexport'
7856
	no_entry_flag=""
7857
      else
7858
	# If we're using GNU nm, then we don't want the "-C" option.
7859
	# -C means demangle to AIX nm, but means don't demangle with GNU nm
7860
	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
7861
	  _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'
7862
	else
7863
	  _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'
7864
	fi
7865
	aix_use_runtimelinking=no
7866
 
7867
	# Test if we are trying to use run time linking or normal
7868
	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
7869
	# need to do runtime linking.
7870
	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
7871
	  for ld_flag in $LDFLAGS; do
7872
  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
7873
  	    aix_use_runtimelinking=yes
7874
  	    break
7875
  	  fi
7876
	  done
7877
	esac
7878
 
7879
	exp_sym_flag='-bexport'
7880
	no_entry_flag='-bnoentry'
7881
      fi
7882
 
7883
      # When large executables or shared objects are built, AIX ld can
7884
      # have problems creating the table of contents.  If linking a library
7885
      # or program results in "error TOC overflow" add -mminimal-toc to
7886
      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7887
      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7888
 
7889
      _LT_AC_TAGVAR(archive_cmds, $1)=''
7890
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7891
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
7892
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7893
 
7894
      if test "$GCC" = yes; then
7895
	case $host_os in aix4.[012]|aix4.[012].*)
7896
	# We only want to do this on AIX 4.2 and lower, the check
7897
	# below for broken collect2 doesn't work under 4.3+
7898
	  collect2name=`${CC} -print-prog-name=collect2`
7899
	  if test -f "$collect2name" && \
7900
  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
7901
	  then
7902
  	  # We have reworked collect2
7903
  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7904
	  else
7905
  	  # We have old collect2
7906
  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
7907
  	  # It fails to find uninstalled libraries when the uninstalled
7908
  	  # path is not listed in the libpath.  Setting hardcode_minus_L
7909
  	  # to unsupported forces relinking
7910
  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7911
  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7912
  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7913
	  fi
7914
	esac
7915
	shared_flag='-shared'
7916
      else
7917
	# not using gcc
7918
	if test "$host_cpu" = ia64; then
7919
  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7920
  	# chokes on -Wl,-G. The following line is correct:
7921
	  shared_flag='-G'
7922
	else
7923
  	if test "$aix_use_runtimelinking" = yes; then
7924
	    shared_flag='${wl}-G'
7925
	  else
7926
	    shared_flag='${wl}-bM:SRE'
7927
  	fi
7928
	fi
7929
      fi
7930
 
7931
      # It seems that -bexpall does not export symbols beginning with
7932
      # underscore (_), so it is better to generate a list of symbols to export.
7933
      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
7934
      if test "$aix_use_runtimelinking" = yes; then
7935
	# Warning - without using the other runtime loading flags (-brtl),
7936
	# -berok will link without error, but may produce a broken library.
7937
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
7938
       # Determine the default libpath from the value encoded in an empty executable.
7939
       _LT_AC_SYS_LIBPATH_AIX
7940
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7941
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
7942
       else
7943
	if test "$host_cpu" = ia64; then
7944
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7945
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7946
	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
7947
	else
7948
	 # Determine the default libpath from the value encoded in an empty executable.
7949
	 _LT_AC_SYS_LIBPATH_AIX
7950
	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7951
	  # Warning - without using the other run time loading flags,
7952
	  # -berok will link without error, but may produce a broken library.
7953
	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7954
	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7955
	  # -bexpall does not export symbols beginning with underscore (_)
7956
	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
7957
	  # Exported symbols can be pulled into shared objects from archives
7958
	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
7959
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7960
	  # This is similar to how AIX traditionally builds it's shared libraries.
7961
	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
7962
	fi
7963
      fi
7964
      ;;
7965
 
7966
    amigaos*)
7967
      _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)'
7968
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7969
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7970
      # see comment about different semantics on the GNU ld section
7971
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7972
      ;;
7973
 
7974
    bsdi4*)
7975
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
7976
      ;;
7977
 
7978
    cygwin* | mingw* | pw32*)
7979
      # When not using gcc, we currently assume that we are using
7980
      # Microsoft Visual C++.
7981
      # hardcode_libdir_flag_spec is actually meaningless, as there is
7982
      # no search path for DLLs.
7983
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7984
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7985
      # Tell ltmain to make .lib files, not .a files.
7986
      libext=lib
7987
      # Tell ltmain to make .dll files, not .so files.
7988
      shrext=".dll"
7989
      # FIXME: Setting linknames here is a bad hack.
7990
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
7991
      # The linker will automatically build a .lib file if we build a DLL.
7992
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
7993
      # FIXME: Should let the user specify the lib program.
7994
      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
7995
      fix_srcfile_path='`cygpath -w "$srcfile"`'
7996
      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7997
      ;;
7998
 
7999
    darwin* | rhapsody*)
8000
    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
8001
      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8002
      case "$host_os" in
8003
      rhapsody* | darwin1.[[012]])
8004
	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
8005
	;;
8006
      *) # Darwin 1.3 on
8007
	test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
8008
	;;
8009
      esac
8010
      # FIXME: Relying on posixy $() will cause problems for
8011
      #        cross-compilation, but unfortunately the echo tests do not
8012
      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
8013
      #	       `"' quotes if we put them in here... so don't!
8014
    	lt_int_apple_cc_single_mod=no
8015
    	output_verbose_link_cmd='echo'
8016
    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
8017
    	  lt_int_apple_cc_single_mod=yes
8018
    	fi
8019
    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8020
    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
8021
    	else
8022
        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
8023
      fi
8024
      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
8025
      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8026
        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8027
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8028
        else
8029
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8030
        fi
8031
          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8032
      _LT_AC_TAGVAR(hardcode_direct, $1)=no
8033
      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8034
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8035
      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8036
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8037
    fi  
8038
      ;;
8039
 
8040
    dgux*)
8041
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8042
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8043
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8044
      ;;
8045
 
8046
    freebsd1*)
8047
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
8048
      ;;
8049
 
8050
    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8051
    # support.  Future versions do this automatically, but an explicit c++rt0.o
8052
    # does not break anything, and helps significantly (at the cost of a little
8053
    # extra space).
8054
    freebsd2.2*)
8055
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8056
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8057
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8058
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8059
      ;;
8060
 
8061
    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8062
    freebsd2*)
8063
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8064
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8065
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8066
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8067
      ;;
8068
 
8069
    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8070
    freebsd*)
8071
      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8072
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8073
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8074
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8075
      ;;
8076
 
8077
    hpux9*)
8078
      if test "$GCC" = yes; then
8079
	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8080
      else
8081
	_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'
8082
      fi
8083
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8084
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8085
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8086
 
8087
      # hardcode_minus_L: Not really in the search PATH,
8088
      # but as the default location of the library.
8089
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8090
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8091
      ;;
8092
 
8093
    hpux10* | hpux11*)
8094
      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8095
	case "$host_cpu" in
8096
	hppa*64*|ia64*)
8097
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8098
	  ;;
8099
	*)
8100
	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8101
	  ;;
8102
	esac
8103
      else
8104
	case "$host_cpu" in
8105
	hppa*64*|ia64*)
8106
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
8107
	  ;;
8108
	*)
8109
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8110
	  ;;
8111
	esac
8112
      fi
8113
      if test "$with_gnu_ld" = no; then
8114
	case "$host_cpu" in
8115
	hppa*64*)
8116
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8117
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
8118
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8119
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
8120
	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8121
	  ;;
8122
	ia64*)
8123
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8124
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
8125
	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8126
 
8127
	  # hardcode_minus_L: Not really in the search PATH,
8128
	  # but as the default location of the library.
8129
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8130
	  ;;
8131
	*)
8132
	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8133
	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8134
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8135
	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8136
 
8137
	  # hardcode_minus_L: Not really in the search PATH,
8138
	  # but as the default location of the library.
8139
	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8140
	  ;;
8141
	esac
8142
      fi
8143
      ;;
8144
 
8145
    irix5* | irix6* | nonstopux*)
8146
      if test "$GCC" = yes; then
8147
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8148
      else
8149
	_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'
8150
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
8151
      fi
8152
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8153
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8154
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8155
      ;;
8156
 
8157
    netbsd*)
8158
      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8159
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
8160
      else
8161
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
8162
      fi
8163
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8164
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8165
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8166
      ;;
8167
 
8168
    newsos6)
8169
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8170
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8171
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8172
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8173
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8174
      ;;
8175
 
8176
    openbsd*)
8177
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8178
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8179
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8180
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8181
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8182
	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8183
      else
8184
       case $host_os in
8185
	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
8186
	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8187
	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8188
	   ;;
8189
	 *)
8190
	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8191
	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8192
	   ;;
8193
       esac
8194
      fi
8195
      ;;
8196
 
8197
    os2*)
8198
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8199
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8200
      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
8201
      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8202
      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8203
      ;;
8204
 
8205
    osf3*)
8206
      if test "$GCC" = yes; then
8207
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8208
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8209
      else
8210
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8211
	_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'
8212
      fi
8213
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8214
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8215
      ;;
8216
 
8217
    osf4* | osf5*)	# as osf3* with the addition of -msym flag
8218
      if test "$GCC" = yes; then
8219
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8220
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8221
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8222
      else
8223
	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8224
	_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'
8225
	_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~
8226
	$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'
8227
 
8228
	# Both c and cxx compiler support -rpath directly
8229
	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8230
      fi
8231
      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8232
      ;;
8233
 
8234
    sco3.2v5*)
8235
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8236
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8237
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
8238
      runpath_var=LD_RUN_PATH
8239
      hardcode_runpath_var=yes
8240
      ;;
8241
 
8242
    solaris*)
8243
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
8244
      if test "$GCC" = yes; then
8245
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8246
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8247
	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
8248
      else
8249
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8250
	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8251
  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
8252
      fi
8253
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8254
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8255
      case $host_os in
8256
      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8257
      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
8258
	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
8259
      esac
8260
      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8261
      ;;
8262
 
8263
    sunos4*)
8264
      if test "x$host_vendor" = xsequent; then
8265
	# Use $CC to link under sequent, because it throws in some extra .o
8266
	# files that make .init and .fini sections work.
8267
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8268
      else
8269
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8270
      fi
8271
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8272
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8273
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8274
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8275
      ;;
8276
 
8277
    sysv4)
8278
      case $host_vendor in
8279
	sni)
8280
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8281
	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
8282
	;;
8283
	siemens)
8284
	  ## LD is ld it makes a PLAMLIB
8285
	  ## CC just makes a GrossModule.
8286
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8287
	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
8288
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
8289
        ;;
8290
	motorola)
8291
	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8292
	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
8293
	;;
8294
      esac
8295
      runpath_var='LD_RUN_PATH'
8296
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8297
      ;;
8298
 
8299
    sysv4.3*)
8300
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8301
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8302
      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
8303
      ;;
8304
 
8305
    sysv4*MP*)
8306
      if test -d /usr/nec; then
8307
	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8308
	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8309
	runpath_var=LD_RUN_PATH
8310
	hardcode_runpath_var=yes
8311
	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
8312
      fi
8313
      ;;
8314
 
8315
    sysv4.2uw2*)
8316
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8317
      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8318
      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
8319
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8320
      hardcode_runpath_var=yes
8321
      runpath_var=LD_RUN_PATH
8322
      ;;
8323
 
8324
   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
8325
      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
8326
      if test "$GCC" = yes; then
8327
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8328
      else
8329
	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8330
      fi
8331
      runpath_var='LD_RUN_PATH'
8332
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8333
      ;;
8334
 
8335
    sysv5*)
8336
      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
8337
      # $CC -shared without GNU ld will not create a library from C++
8338
      # object files and a static libstdc++, better avoid it by now
8339
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8340
      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8341
  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
8342
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8343
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8344
      runpath_var='LD_RUN_PATH'
8345
      ;;
8346
 
8347
    uts4*)
8348
      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8349
      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8350
      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8351
      ;;
8352
 
8353
    *)
8354
      _LT_AC_TAGVAR(ld_shlibs, $1)=no
8355
      ;;
8356
    esac
8357
  fi
8358
])
8359
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
8360
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
8361
 
8362
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
8363
if test "$GCC" = yes; then
8364
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
8365
fi
8366
 
8367
#
8368
# Do we need to explicitly link libc?
8369
#
8370
case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
8371
x|xyes)
8372
  # Assume -lc should be added
8373
  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8374
 
8375
  if test "$enable_shared" = yes && test "$GCC" = yes; then
8376
    case $_LT_AC_TAGVAR(archive_cmds, $1) in
8377
    *'~'*)
8378
      # FIXME: we may have to deal with multi-command sequences.
8379
      ;;
8380
    '$CC '*)
8381
      # Test whether the compiler implicitly links with -lc since on some
8382
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
8383
      # to ld, don't add -lc before -lgcc.
8384
      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
8385
      $rm conftest*
8386
      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
8387
 
8388
      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
8389
        soname=conftest
8390
        lib=conftest
8391
        libobjs=conftest.$ac_objext
8392
        deplibs=
8393
        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
8394
        compiler_flags=-v
8395
        linker_flags=-v
8396
        verstring=
8397
        output_objdir=.
8398
        libname=conftest
8399
        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
8400
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
8401
        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
8402
        then
8403
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8404
        else
8405
	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8406
        fi
8407
        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
8408
      else
8409
        cat conftest.err 1>&5
8410
      fi
8411
      $rm conftest*
8412
      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
8413
      ;;
8414
    esac
8415
  fi
8416
  ;;
8417
esac
8418
])# AC_LIBTOOL_PROG_LD_SHLIBS
8419
 
8420
 
8421
# _LT_AC_FILE_LTDLL_C
8422
# -------------------
8423
# Be careful that the start marker always follows a newline.
8424
AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
8425
# /* ltdll.c starts here */
8426
# #define WIN32_LEAN_AND_MEAN
8427
# #include <windows.h>
8428
# #undef WIN32_LEAN_AND_MEAN
8429
# #include <stdio.h>
8430
#
8431
# #ifndef __CYGWIN__
8432
# #  ifdef __CYGWIN32__
8433
# #    define __CYGWIN__ __CYGWIN32__
8434
# #  endif
8435
# #endif
8436
#
8437
# #ifdef __cplusplus
8438
# extern "C" {
8439
# #endif
8440
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
8441
# #ifdef __cplusplus
8442
# }
8443
# #endif
8444
#
8445
# #ifdef __CYGWIN__
8446
# #include <cygwin/cygwin_dll.h>
8447
# DECLARE_CYGWIN_DLL( DllMain );
8448
# #endif
8449
# HINSTANCE __hDllInstance_base;
8450
#
8451
# BOOL APIENTRY
8452
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
8453
# {
8454
#   __hDllInstance_base = hInst;
8455
#   return TRUE;
8456
# }
8457
# /* ltdll.c ends here */
8458
])# _LT_AC_FILE_LTDLL_C
8459
 
8460
 
8461
# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
8462
# ---------------------------------
8463
AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
8464
 
8465
 
14199 hornik 8466
# old names
8467
AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
8468
AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
8469
AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
8470
AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8471
AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8472
AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
8473
AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
8474
 
8475
# This is just to silence aclocal about the macro not being used
8476
ifelse([AC_DISABLE_FAST_INSTALL])
22044 hornik 8477
 
27343 hornik 8478
AC_DEFUN([LT_AC_PROG_GCJ],
8479
[AC_CHECK_TOOL(GCJ, gcj, no)
8480
  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8481
  AC_SUBST(GCJFLAGS)
8482
])
8483
 
8484
AC_DEFUN([LT_AC_PROG_RC],
8485
[AC_CHECK_TOOL(RC, windres, no)
8486
])
8487
 
22044 hornik 8488
############################################################
8489
# NOTE: This macro has been submitted for inclusion into   #
8490
#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8491
#  a released version of Autoconf we should remove this    #
8492
#  macro and use it instead.                               #
8493
############################################################
8494
# LT_AC_PROG_SED
8495
# --------------
8496
# Check for a fully-functional sed program, that truncates
8497
# as few characters as possible.  Prefer GNU sed if found.
8498
AC_DEFUN([LT_AC_PROG_SED],
8499
[AC_MSG_CHECKING([for a sed that does not truncate output])
8500
AC_CACHE_VAL(lt_cv_path_SED,
8501
[# Loop through the user's path and test for sed and gsed.
8502
# Then use that list of sed's as ones to test for truncation.
8503
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8504
for as_dir in $PATH
8505
do
8506
  IFS=$as_save_IFS
8507
  test -z "$as_dir" && as_dir=.
27343 hornik 8508
  for lt_ac_prog in sed gsed; do
22044 hornik 8509
    for ac_exec_ext in '' $ac_executable_extensions; do
27343 hornik 8510
      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8511
        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
22044 hornik 8512
      fi
8513
    done
8514
  done
8515
done
27343 hornik 8516
lt_ac_max=0
8517
lt_ac_count=0
8518
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8519
# along with /bin/sed that truncates output.
8520
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8521
  test ! -f $lt_ac_sed && break
8522
  cat /dev/null > conftest.in
8523
  lt_ac_count=0
8524
  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8525
  # Check for GNU sed and select it if it is found.
8526
  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8527
    lt_cv_path_SED=$lt_ac_sed
8528
    break
8529
  fi
8530
  while true; do
8531
    cat conftest.in conftest.in >conftest.tmp
8532
    mv conftest.tmp conftest.in
8533
    cp conftest.in conftest.nl
8534
    echo >>conftest.nl
8535
    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8536
    cmp -s conftest.out conftest.nl || break
8537
    # 10000 chars as input seems more than enough
8538
    test $lt_ac_count -gt 10 && break
8539
    lt_ac_count=`expr $lt_ac_count + 1`
8540
    if test $lt_ac_count -gt $lt_ac_max; then
8541
      lt_ac_max=$lt_ac_count
8542
      lt_cv_path_SED=$lt_ac_sed
22044 hornik 8543
    fi
8544
  done
27343 hornik 8545
done
8546
SED=$lt_cv_path_SED
22044 hornik 8547
])
8548
AC_MSG_RESULT([$SED])
8549
])