The R Project SVN R

Rev

Rev 23984 | Rev 36821 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23984 Rev 27342
Line 1... Line 1...
1
# ltmain.sh - Provide generalized library-building support services.
1
# ltmain.sh - Provide generalized library-building support services.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
2
# NOTE: Changing this file will not affect anything until you rerun configure.
3
#
3
#
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5
# Free Software Foundation, Inc.
5
# Free Software Foundation, Inc.
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
#
7
#
8
# This program is free software; you can redistribute it and/or modify
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
9
# it under the terms of the GNU General Public License as published by
Line 53... Line 53...
53
modename="$progname"
53
modename="$progname"
54
 
54
 
55
# Constants.
55
# Constants.
56
PROGRAM=ltmain.sh
56
PROGRAM=ltmain.sh
57
PACKAGE=libtool
57
PACKAGE=libtool
58
VERSION=1.4.3
58
VERSION=1.5
59
TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
59
TIMESTAMP=" (1.1220 2003/04/05 19:32:58)"
60
 
60
 
61
default_mode=
61
default_mode=
62
help="Try \`$progname --help' for more information."
62
help="Try \`$progname --help' for more information."
63
magic="%%%MAGIC variable%%%"
63
magic="%%%MAGIC variable%%%"
64
mkdir="mkdir"
64
mkdir="mkdir"
Line 67... Line 67...
67
 
67
 
68
# Sed substitution that helps us do robust quoting.  It backslashifies
68
# Sed substitution that helps us do robust quoting.  It backslashifies
69
# metacharacters that are still active within double-quoted strings.
69
# metacharacters that are still active within double-quoted strings.
70
Xsed="${SED}"' -e 1s/^X//'
70
Xsed="${SED}"' -e 1s/^X//'
71
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
71
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72
# test EBCDIC or ASCII                                                         
72
# test EBCDIC or ASCII
73
case `echo A|od -x` in                                                         
73
case `echo A|od -x` in
74
 *[Cc]1*) # EBCDIC based system                                                
74
 *[Cc]1*) # EBCDIC based system
75
  SP2NL="tr '\100' '\n'"                                                       
75
  SP2NL="tr '\100' '\n'"
76
  NL2SP="tr '\r\n' '\100\100'"                                                 
76
  NL2SP="tr '\r\n' '\100\100'"
77
  ;;                                                                           
-
 
-
 
77
  ;;
78
 *) # Assume ASCII based system                                                
78
 *) # Assume ASCII based system
79
  SP2NL="tr '\040' '\012'"                                                     
79
  SP2NL="tr '\040' '\012'"
80
  NL2SP="tr '\015\012' '\040\040'"                                             
80
  NL2SP="tr '\015\012' '\040\040'"
81
  ;;                                                                           
-
 
82
esac                                                                           
-
 
-
 
81
  ;;
-
 
82
esac
83
 
83
 
84
# NLS nuisances.
84
# NLS nuisances.
85
# Only set LANG and LC_ALL to C if already set.
85
# Only set LANG and LC_ALL to C if already set.
86
# These must not be set unconditionally because not all systems understand
86
# These must not be set unconditionally because not all systems understand
87
# e.g. LANG=C (notably SCO).
87
# e.g. LANG=C (notably SCO).
Line 95... Line 95...
95
 
95
 
96
# Make sure IFS has a sensible default
96
# Make sure IFS has a sensible default
97
: ${IFS=" 	"}
97
: ${IFS=" 	"}
98
 
98
 
99
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
99
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100
  echo "$modename: not configured to build any kind of library" 1>&2
100
  $echo "$modename: not configured to build any kind of library" 1>&2
101
  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
101
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
102
  exit 1
102
  exit 1
103
fi
103
fi
104
 
104
 
105
# Global variables.
105
# Global variables.
106
mode=$default_mode
106
mode=$default_mode
Line 112... Line 112...
112
show_help=
112
show_help=
113
execute_dlfiles=
113
execute_dlfiles=
114
lo2o="s/\\.lo\$/.${objext}/"
114
lo2o="s/\\.lo\$/.${objext}/"
115
o2lo="s/\\.${objext}\$/.lo/"
115
o2lo="s/\\.${objext}\$/.lo/"
116
 
116
 
-
 
117
#####################################
-
 
118
# Shell function definitions:
-
 
119
# This seems to be the best place for them
-
 
120
 
-
 
121
# Need a lot of goo to handle *both* DLLs and import libs
-
 
122
# Has to be a shell function in order to 'eat' the argument
-
 
123
# that is supplied when $file_magic_command is called.
-
 
124
win32_libid () {
-
 
125
  win32_libid_type="unknown"
-
 
126
  win32_fileres=`file -L $1 2>/dev/null`
-
 
127
  case $win32_fileres in
-
 
128
  *ar\ archive\ import\ library*) # definitely import
-
 
129
    win32_libid_type="x86 archive import"
-
 
130
    ;;
-
 
131
  *ar\ archive*) # could be an import, or static
-
 
132
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-
 
133
      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-
 
134
      win32_nmres=`eval $NM -f posix -A $1 | \
-
 
135
	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
-
 
136
      if test "X$win32_nmres" = "Ximport" ; then
-
 
137
        win32_libid_type="x86 archive import"
-
 
138
      else
-
 
139
        win32_libid_type="x86 archive static"
-
 
140
      fi
-
 
141
    fi
-
 
142
    ;;
-
 
143
  *DLL*) 
-
 
144
    win32_libid_type="x86 DLL"
-
 
145
    ;;
-
 
146
  *executable*) # but shell scripts are "executable" too...
-
 
147
    case $win32_fileres in
-
 
148
    *MS\ Windows\ PE\ Intel*)
-
 
149
      win32_libid_type="x86 DLL"
-
 
150
      ;;
-
 
151
    esac
-
 
152
    ;;
-
 
153
  esac
-
 
154
  $echo $win32_libid_type
-
 
155
}
-
 
156
 
-
 
157
# End of Shell function definitions
-
 
158
#####################################
-
 
159
 
117
# Parse our command line options once, thoroughly.
160
# Parse our command line options once, thoroughly.
118
while test $# -gt 0
161
while test "$#" -gt 0
119
do
162
do
120
  arg="$1"
163
  arg="$1"
121
  shift
164
  shift
122
 
165
 
123
  case $arg in
166
  case $arg in
Line 129... Line 172...
129
  if test -n "$prev"; then
172
  if test -n "$prev"; then
130
    case $prev in
173
    case $prev in
131
    execute_dlfiles)
174
    execute_dlfiles)
132
      execute_dlfiles="$execute_dlfiles $arg"
175
      execute_dlfiles="$execute_dlfiles $arg"
133
      ;;
176
      ;;
-
 
177
    tag)
-
 
178
      tagname="$arg"
-
 
179
 
-
 
180
      # Check whether tagname contains only valid characters
-
 
181
      case $tagname in
-
 
182
      *[!-_A-Za-z0-9,/]*)
-
 
183
	$echo "$progname: invalid tag name: $tagname" 1>&2
-
 
184
	exit 1
-
 
185
	;;
-
 
186
      esac
-
 
187
 
-
 
188
      case $tagname in
-
 
189
      CC)
-
 
190
	# Don't test for the "default" C tag, as we know, it's there, but
-
 
191
	# not specially marked.
-
 
192
	;;
-
 
193
      *)
-
 
194
	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
-
 
195
	  taglist="$taglist $tagname"
-
 
196
	  # Evaluate the configuration.
-
 
197
	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
-
 
198
	else
-
 
199
	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
-
 
200
	fi
-
 
201
	;;
-
 
202
      esac
-
 
203
      ;;
134
    *)
204
    *)
135
      eval "$prev=\$arg"
205
      eval "$prev=\$arg"
136
      ;;
206
      ;;
137
    esac
207
    esac
138
 
208
 
Line 146... Line 216...
146
  --help)
216
  --help)
147
    show_help=yes
217
    show_help=yes
148
    ;;
218
    ;;
149
 
219
 
150
  --version)
220
  --version)
151
    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
221
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-
 
222
    $echo
-
 
223
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
-
 
224
    $echo "This is free software; see the source for copying conditions.  There is NO"
-
 
225
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
152
    exit 0
226
    exit 0
153
    ;;
227
    ;;
154
 
228
 
155
  --config)
229
  --config)
156
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
230
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
-
 
231
    # Now print the configurations for the tags.
-
 
232
    for tagname in $taglist; do
-
 
233
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
-
 
234
    done
157
    exit 0
235
    exit 0
158
    ;;
236
    ;;
159
 
237
 
160
  --debug)
238
  --debug)
161
    echo "$progname: enabling shell trace mode"
239
    $echo "$progname: enabling shell trace mode"
162
    set -x
240
    set -x
163
    ;;
241
    ;;
164
 
242
 
165
  --dry-run | -n)
243
  --dry-run | -n)
166
    run=:
244
    run=:
167
    ;;
245
    ;;
168
 
246
 
169
  --features)
247
  --features)
170
    echo "host: $host"
248
    $echo "host: $host"
171
    if test "$build_libtool_libs" = yes; then
249
    if test "$build_libtool_libs" = yes; then
172
      echo "enable shared libraries"
250
      $echo "enable shared libraries"
173
    else
251
    else
174
      echo "disable shared libraries"
252
      $echo "disable shared libraries"
175
    fi
253
    fi
176
    if test "$build_old_libs" = yes; then
254
    if test "$build_old_libs" = yes; then
177
      echo "enable static libraries"
255
      $echo "enable static libraries"
178
    else
256
    else
179
      echo "disable static libraries"
257
      $echo "disable static libraries"
180
    fi
258
    fi
181
    exit 0
259
    exit 0
182
    ;;
260
    ;;
183
 
261
 
184
  --finish) mode="finish" ;;
262
  --finish) mode="finish" ;;
Line 190... Line 268...
190
 
268
 
191
  --quiet | --silent)
269
  --quiet | --silent)
192
    show=:
270
    show=:
193
    ;;
271
    ;;
194
 
272
 
-
 
273
  --tag) prevopt="--tag" prev=tag ;;
-
 
274
  --tag=*)
-
 
275
    set tag "$optarg" ${1+"$@"}
-
 
276
    shift
-
 
277
    prev=tag
-
 
278
    ;;
-
 
279
 
195
  -dlopen)
280
  -dlopen)
196
    prevopt="-dlopen"
281
    prevopt="-dlopen"
197
    prev=execute_dlfiles
282
    prev=execute_dlfiles
198
    ;;
283
    ;;
199
 
284
 
Line 223... Line 308...
223
 
308
 
224
if test -z "$show_help"; then
309
if test -z "$show_help"; then
225
 
310
 
226
  # Infer the operation mode.
311
  # Infer the operation mode.
227
  if test -z "$mode"; then
312
  if test -z "$mode"; then
-
 
313
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-
 
314
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
228
    case $nonopt in
315
    case $nonopt in
229
    *cc | *++ | gcc* | *-gcc* | g++* | xlc*)
316
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
230
      mode=link
317
      mode=link
231
      for arg
318
      for arg
232
      do
319
      do
233
	case $arg in
320
	case $arg in
234
	-c)
321
	-c)
Line 279... Line 366...
279
  # libtool compile mode
366
  # libtool compile mode
280
  compile)
367
  compile)
281
    modename="$modename: compile"
368
    modename="$modename: compile"
282
    # Get the compilation command and the source file.
369
    # Get the compilation command and the source file.
283
    base_compile=
370
    base_compile=
284
    prev=
-
 
285
    lastarg=
-
 
286
    srcfile="$nonopt"
371
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
287
    suppress_output=
372
    suppress_output=
-
 
373
    arg_mode=normal
-
 
374
    libobj=
288
 
375
 
289
    user_target=no
-
 
290
    for arg
376
    for arg
291
    do
377
    do
292
      case $prev in
378
      case "$arg_mode" in
293
      "") ;;
379
      arg  )
294
      xcompiler)
-
 
295
	# Aesthetically quote the previous argument.
-
 
296
	prev=
-
 
297
	lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
380
	# do not "continue".  Instead, add this to base_compile
298
 
-
 
299
	case $arg in
381
	lastarg="$arg"
300
	# Double-quote args containing other shell metacharacters.
-
 
301
	# Many Bourne shells cannot handle close brackets correctly
-
 
302
	# in scan sets, so we specify it separately.
-
 
303
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-
 
304
	  arg="\"$arg\""
382
	arg_mode=normal
305
	  ;;
383
	;;
306
	esac
-
 
307
 
384
 
308
	# Add the previous argument to base_compile.
-
 
309
	if test -z "$base_compile"; then
385
      target )
310
	  base_compile="$lastarg"
386
	libobj="$arg"
311
	else
-
 
312
	  base_compile="$base_compile $lastarg"
387
	arg_mode=normal
313
	fi
-
 
314
	continue
388
	continue
315
	;;
389
	;;
316
      esac
-
 
317
 
390
 
-
 
391
      normal )
318
      # Accept any command-line options.
392
	# Accept any command-line options.
319
      case $arg in
393
	case $arg in
320
      -o)
394
	-o)
321
	if test "$user_target" != "no"; then
395
	  if test -n "$libobj" ; then
322
	  $echo "$modename: you cannot specify \`-o' more than once" 1>&2
396
	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
323
	  exit 1
397
	    exit 1
324
	fi
398
	  fi
325
	user_target=next
399
	  arg_mode=target
-
 
400
	  continue
326
	;;
401
	  ;;
327
 
402
 
328
      -static)
403
	-static)
329
	build_old_libs=yes
404
	  build_old_libs=yes
330
	continue
405
	  continue
331
	;;
406
	  ;;
332
 
407
 
333
      -prefer-pic)
408
	-prefer-pic)
334
	pic_mode=yes
409
	  pic_mode=yes
335
	continue
410
	  continue
336
	;;
411
	  ;;
337
 
412
 
338
      -prefer-non-pic)
413
	-prefer-non-pic)
339
	pic_mode=no
414
	  pic_mode=no
340
	continue
415
	  continue
341
	;;
416
	  ;;
342
 
417
 
343
      -Xcompiler)
418
	-Xcompiler)
-
 
419
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-
 
420
	  continue      #  The current "srcfile" will either be retained or
-
 
421
	  ;;            #  replaced later.  I would guess that would be a bug.
-
 
422
 
344
	prev=xcompiler
423
	-Wc,*)
-
 
424
	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
345
	continue
425
	  lastarg=
-
 
426
	  save_ifs="$IFS"; IFS=','
346
	;;
427
	  for arg in $args; do
-
 
428
	    IFS="$save_ifs"
347
 
429
 
-
 
430
	    # Double-quote args containing other shell metacharacters.
-
 
431
	    # Many Bourne shells cannot handle close brackets correctly
-
 
432
	    # in scan sets, so we specify it separately.
348
      -Wc,*)
433
	    case $arg in
349
	args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
434
	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-
 
435
	      arg="\"$arg\""
350
	lastarg=
436
	      ;;
351
	save_ifs="$IFS"; IFS=','
437
	    esac
352
	for arg in $args; do
438
	    lastarg="$lastarg $arg"
-
 
439
	  done
353
	  IFS="$save_ifs"
440
	  IFS="$save_ifs"
-
 
441
	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
354
 
442
 
355
	  # Double-quote args containing other shell metacharacters.
-
 
356
	  # Many Bourne shells cannot handle close brackets correctly
-
 
357
	  # in scan sets, so we specify it separately.
-
 
358
	  case $arg in
-
 
359
	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-
 
360
	    arg="\"$arg\""
-
 
361
	    ;;
-
 
362
	  esac
-
 
363
	  lastarg="$lastarg $arg"
-
 
364
	done
-
 
365
	IFS="$save_ifs"
-
 
366
	lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
 
367
 
-
 
368
	# Add the arguments to base_compile.
443
	  # Add the arguments to base_compile.
369
	if test -z "$base_compile"; then
-
 
370
	  base_compile="$lastarg"
-
 
371
	else
-
 
372
	  base_compile="$base_compile $lastarg"
444
	  base_compile="$base_compile $lastarg"
373
	fi
-
 
374
	continue
445
	  continue
375
	;;
446
	  ;;
376
      esac
-
 
377
 
447
 
378
      case $user_target in
-
 
379
      next)
448
	* )
380
	# The next one is the -o target name
449
	  # Accept the current argument as the source file.
381
	user_target=yes
450
	  # The previous "srcfile" becomes the current argument.
382
	continue
-
 
383
	;;
451
	  #
384
      yes)
-
 
385
	# We got the output file
452
	  lastarg="$srcfile"
386
	user_target=set
453
	  srcfile="$arg"
387
	libobj="$arg"
454
	  ;;
388
	continue
455
	esac  #  case $arg
389
	;;
456
	;;
390
      esac
-
 
391
 
-
 
392
      # Accept the current argument as the source file.
-
 
393
      lastarg="$srcfile"
-
 
394
      srcfile="$arg"
457
      esac    #  case $arg_mode
395
 
458
 
396
      # Aesthetically quote the previous argument.
459
      # Aesthetically quote the previous argument.
397
 
-
 
398
      # Backslashify any backslashes, double quotes, and dollar signs.
-
 
399
      # These are the only characters that are still specially
-
 
400
      # interpreted inside of double-quoted scrings.
-
 
401
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
460
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
402
 
461
 
-
 
462
      case $lastarg in
403
      # Double-quote args containing other shell metacharacters.
463
      # Double-quote args containing other shell metacharacters.
404
      # Many Bourne shells cannot handle close brackets correctly
464
      # Many Bourne shells cannot handle close brackets correctly
405
      # in scan sets, so we specify it separately.
465
      # in scan sets, so we specify it separately.
406
      case $lastarg in
-
 
407
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
466
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
408
	lastarg="\"$lastarg\""
467
	lastarg="\"$lastarg\""
409
	;;
468
	;;
410
      esac
469
      esac
411
 
470
 
412
      # Add the previous argument to base_compile.
-
 
413
      if test -z "$base_compile"; then
-
 
414
	base_compile="$lastarg"
-
 
415
      else
-
 
416
	base_compile="$base_compile $lastarg"
471
      base_compile="$base_compile $lastarg"
417
      fi
-
 
418
    done
472
    done # for arg
419
 
473
 
420
    case $user_target in
474
    case $arg_mode in
421
    set)
475
    arg)
422
      ;;
-
 
423
    no)
-
 
424
      # Get the name of the library object.
476
      $echo "$modename: you must specify an argument for -Xcompile"
425
      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
477
      exit 1
426
      ;;
478
      ;;
427
    *)
479
    target)
428
      $echo "$modename: you must specify a target with \`-o'" 1>&2
480
      $echo "$modename: you must specify a target with \`-o'" 1>&2
429
      exit 1
481
      exit 1
430
      ;;
482
      ;;
-
 
483
    *)
-
 
484
      # Get the name of the library object.
-
 
485
      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
-
 
486
      ;;
431
    esac
487
    esac
432
 
488
 
433
    # Recognize several different file suffixes.
489
    # Recognize several different file suffixes.
434
    # If the user specifies -o file.o, it is replaced with file.lo
490
    # If the user specifies -o file.o, it is replaced with file.lo
435
    xform='[cCFSfmso]'
491
    xform='[cCFSifmso]'
436
    case $libobj in
492
    case $libobj in
437
    *.ada) xform=ada ;;
493
    *.ada) xform=ada ;;
438
    *.adb) xform=adb ;;
494
    *.adb) xform=adb ;;
439
    *.ads) xform=ads ;;
495
    *.ads) xform=ads ;;
440
    *.asm) xform=asm ;;
496
    *.asm) xform=asm ;;
441
    *.c++) xform=c++ ;;
497
    *.c++) xform=c++ ;;
442
    *.cc) xform=cc ;;
498
    *.cc) xform=cc ;;
-
 
499
    *.ii) xform=ii ;;
-
 
500
    *.class) xform=class ;;
443
    *.cpp) xform=cpp ;;
501
    *.cpp) xform=cpp ;;
444
    *.cxx) xform=cxx ;;
502
    *.cxx) xform=cxx ;;
445
    *.f90) xform=f90 ;;
503
    *.f90) xform=f90 ;;
446
    *.for) xform=for ;;
504
    *.for) xform=for ;;
-
 
505
    *.java) xform=java ;;
447
    esac
506
    esac
448
 
507
 
449
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
508
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
450
 
509
 
451
    case $libobj in
510
    case $libobj in
Line 454... Line 513...
454
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
513
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
455
      exit 1
514
      exit 1
456
      ;;
515
      ;;
457
    esac
516
    esac
458
 
517
 
-
 
518
    # Infer tagged configuration to use if any are available and
-
 
519
    # if one wasn't chosen via the "--tag" command line option.
-
 
520
    # Only attempt this if the compiler in the base compile
-
 
521
    # command doesn't match the default compiler.
-
 
522
    if test -n "$available_tags" && test -z "$tagname"; then
-
 
523
      case $base_compile in
-
 
524
      # Blanks in the command may have been stripped by the calling shell,
-
 
525
      # but not from the CC environment variable when configure was run.
-
 
526
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
-
 
527
      # Blanks at the start of $base_compile will cause this to fail
-
 
528
      # if we don't check for them as well.
-
 
529
      *)
-
 
530
	for z in $available_tags; do
-
 
531
	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
-
 
532
	    # Evaluate the configuration.
-
 
533
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
-
 
534
	    case "$base_compile " in
-
 
535
	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
-
 
536
	      # The compiler in the base compile command matches
-
 
537
	      # the one in the tagged configuration.
-
 
538
	      # Assume this is the tagged configuration we want.
-
 
539
	      tagname=$z
-
 
540
	      break
-
 
541
	      ;;
-
 
542
	    esac
-
 
543
	  fi
-
 
544
	done
-
 
545
	# If $tagname still isn't set, then no tagged configuration
-
 
546
	# was found and let the user know that the "--tag" command
-
 
547
	# line option must be used.
-
 
548
	if test -z "$tagname"; then
-
 
549
	  $echo "$modename: unable to infer tagged configuration"
-
 
550
	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-
 
551
	  exit 1
-
 
552
#        else
-
 
553
#          $echo "$modename: using $tagname tagged configuration"
-
 
554
	fi
-
 
555
	;;
-
 
556
      esac
-
 
557
    fi
-
 
558
 
-
 
559
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-
 
560
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-
 
561
    if test "X$xdir" = "X$obj"; then
-
 
562
      xdir=
-
 
563
    else
-
 
564
      xdir=$xdir/
-
 
565
    fi
-
 
566
    lobj=${xdir}$objdir/$objname
-
 
567
 
459
    if test -z "$base_compile"; then
568
    if test -z "$base_compile"; then
460
      $echo "$modename: you must specify a compilation command" 1>&2
569
      $echo "$modename: you must specify a compilation command" 1>&2
461
      $echo "$help" 1>&2
570
      $echo "$help" 1>&2
462
      exit 1
571
      exit 1
463
    fi
572
    fi
464
 
573
 
465
    # Delete any leftover library objects.
574
    # Delete any leftover library objects.
466
    if test "$build_old_libs" = yes; then
575
    if test "$build_old_libs" = yes; then
467
      removelist="$obj $libobj"
576
      removelist="$obj $lobj $libobj ${libobj}T"
468
    else
577
    else
469
      removelist="$libobj"
578
      removelist="$lobj $libobj ${libobj}T"
470
    fi
579
    fi
471
 
580
 
472
    $run $rm $removelist
581
    $run $rm $removelist
473
    trap "$run $rm $removelist; exit 1" 1 2 15
582
    trap "$run $rm $removelist; exit 1" 1 2 15
474
 
583
 
Line 489... Line 598...
489
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
598
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
490
      lockfile="$output_obj.lock"
599
      lockfile="$output_obj.lock"
491
      removelist="$removelist $output_obj $lockfile"
600
      removelist="$removelist $output_obj $lockfile"
492
      trap "$run $rm $removelist; exit 1" 1 2 15
601
      trap "$run $rm $removelist; exit 1" 1 2 15
493
    else
602
    else
-
 
603
      output_obj=
494
      need_locks=no
604
      need_locks=no
495
      lockfile=
605
      lockfile=
496
    fi
606
    fi
497
 
607
 
498
    # Lock this critical section if it is needed
608
    # Lock this critical section if it is needed
Line 502... Line 612...
502
	$show "Waiting for $lockfile to be removed"
612
	$show "Waiting for $lockfile to be removed"
503
	sleep 2
613
	sleep 2
504
      done
614
      done
505
    elif test "$need_locks" = warn; then
615
    elif test "$need_locks" = warn; then
506
      if test -f "$lockfile"; then
616
      if test -f "$lockfile"; then
507
	echo "\
617
	$echo "\
508
*** ERROR, $lockfile exists and contains:
618
*** ERROR, $lockfile exists and contains:
509
`cat $lockfile 2>/dev/null`
619
`cat $lockfile 2>/dev/null`
510
 
620
 
511
This indicates that another process is trying to use the same
621
This indicates that another process is trying to use the same
512
temporary object file, and libtool could not work around it because
622
temporary object file, and libtool could not work around it because
Line 516... Line 626...
516
compiler."
626
compiler."
517
 
627
 
518
	$run $rm $removelist
628
	$run $rm $removelist
519
	exit 1
629
	exit 1
520
      fi
630
      fi
521
      echo $srcfile > "$lockfile"
631
      $echo $srcfile > "$lockfile"
522
    fi
632
    fi
523
 
633
 
524
    if test -n "$fix_srcfile_path"; then
634
    if test -n "$fix_srcfile_path"; then
525
      eval srcfile=\"$fix_srcfile_path\"
635
      eval srcfile=\"$fix_srcfile_path\"
526
    fi
636
    fi
527
 
637
 
-
 
638
    $run $rm "$libobj" "${libobj}T"
-
 
639
 
-
 
640
    # Create a libtool object file (analogous to a ".la" file),
-
 
641
    # but don't create it if we're doing a dry run.
-
 
642
    test -z "$run" && cat > ${libobj}T <<EOF
-
 
643
# $libobj - a libtool object file
-
 
644
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
 
645
#
-
 
646
# Please DO NOT delete this file!
-
 
647
# It is necessary for linking the library.
-
 
648
 
-
 
649
# Name of the PIC object.
-
 
650
EOF
-
 
651
 
528
    # Only build a PIC object if we are building libtool libraries.
652
    # Only build a PIC object if we are building libtool libraries.
529
    if test "$build_libtool_libs" = yes; then
653
    if test "$build_libtool_libs" = yes; then
530
      # Without this assignment, base_compile gets emptied.
654
      # Without this assignment, base_compile gets emptied.
531
      fbsd_hideous_sh_bug=$base_compile
655
      fbsd_hideous_sh_bug=$base_compile
532
 
656
 
533
      if test "$pic_mode" != no; then
657
      if test "$pic_mode" != no; then
534
	# All platforms use -DPIC, to notify preprocessed assembler code.
-
 
535
	command="$base_compile $srcfile $pic_flag -DPIC"
658
	command="$base_compile $srcfile $pic_flag"
536
      else
659
      else
537
	# Don't build PIC code
660
	# Don't build PIC code
538
	command="$base_compile $srcfile"
661
	command="$base_compile $srcfile"
539
      fi
662
      fi
540
      if test "$build_old_libs" = yes; then
-
 
541
	lo_libobj="$libobj"
-
 
542
	dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
-
 
543
	if test "X$dir" = "X$libobj"; then
-
 
544
	  dir="$objdir"
-
 
545
	else
-
 
546
	  dir="$dir/$objdir"
-
 
547
	fi
-
 
548
	libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
-
 
549
 
663
 
550
	if test -d "$dir"; then
664
      if test ! -d "${xdir}$objdir"; then
551
	  $show "$rm $libobj"
-
 
552
	  $run $rm $libobj
-
 
553
	else
-
 
554
	  $show "$mkdir $dir"
665
	$show "$mkdir ${xdir}$objdir"
555
	  $run $mkdir $dir
666
	$run $mkdir ${xdir}$objdir
556
	  status=$?
667
	status=$?
557
	  if test $status -ne 0 && test ! -d $dir; then
668
	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
558
	    exit $status
669
	  exit $status
559
	  fi
-
 
560
	fi
670
	fi
561
      fi
671
      fi
-
 
672
 
562
      if test "$compiler_o_lo" = yes; then
673
      if test -z "$output_obj"; then
563
	output_obj="$libobj"
674
	# Place PIC objects in $objdir
564
	command="$command -o $output_obj"
-
 
565
      elif test "$compiler_c_o" = yes; then
-
 
566
	output_obj="$obj"
-
 
567
	command="$command -o $output_obj"
675
	command="$command -o $lobj"
568
      fi
676
      fi
569
 
677
 
570
      $run $rm "$output_obj"
678
      $run $rm "$lobj" "$output_obj"
-
 
679
 
571
      $show "$command"
680
      $show "$command"
572
      if $run eval "$command"; then :
681
      if $run eval "$command"; then :
573
      else
682
      else
574
	test -n "$output_obj" && $run $rm $removelist
683
	test -n "$output_obj" && $run $rm $removelist
575
	exit 1
684
	exit 1
576
      fi
685
      fi
577
 
686
 
578
      if test "$need_locks" = warn &&
687
      if test "$need_locks" = warn &&
579
	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
688
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
580
	echo "\
689
	$echo "\
581
*** ERROR, $lockfile contains:
690
*** ERROR, $lockfile contains:
582
`cat $lockfile 2>/dev/null`
691
`cat $lockfile 2>/dev/null`
583
 
692
 
584
but it should contain:
693
but it should contain:
585
$srcfile
694
$srcfile
Line 594... Line 703...
594
	$run $rm $removelist
703
	$run $rm $removelist
595
	exit 1
704
	exit 1
596
      fi
705
      fi
597
 
706
 
598
      # Just move the object if needed, then go on to compile the next one
707
      # Just move the object if needed, then go on to compile the next one
599
      if test x"$output_obj" != x"$libobj"; then
708
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
600
	$show "$mv $output_obj $libobj"
709
	$show "$mv $output_obj $lobj"
601
	if $run $mv $output_obj $libobj; then :
710
	if $run $mv $output_obj $lobj; then :
602
	else
711
	else
603
	  error=$?
712
	  error=$?
604
	  $run $rm $removelist
713
	  $run $rm $removelist
605
	  exit $error
714
	  exit $error
606
	fi
715
	fi
607
      fi
716
      fi
608
 
717
 
609
      # If we have no pic_flag, then copy the object into place and finish.
718
      # Append the name of the PIC object to the libtool object file.
610
      if (test -z "$pic_flag" || test "$pic_mode" != default) &&
719
      test -z "$run" && cat >> ${libobj}T <<EOF
611
	 test "$build_old_libs" = yes; then
-
 
612
	# Rename the .lo from within objdir to obj
-
 
613
	if test -f $obj; then
-
 
614
	  $show $rm $obj
-
 
615
	  $run $rm $obj
-
 
616
	fi
-
 
617
 
-
 
618
	$show "$mv $libobj $obj"
-
 
619
	if $run $mv $libobj $obj; then :
720
pic_object='$objdir/$objname'
620
	else
-
 
621
	  error=$?
-
 
622
	  $run $rm $removelist
-
 
623
	  exit $error
-
 
624
	fi
-
 
625
 
721
 
626
	xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-
 
627
	if test "X$xdir" = "X$obj"; then
-
 
628
	  xdir="."
-
 
629
	else
-
 
630
	  xdir="$xdir"
-
 
631
	fi
722
EOF
632
	baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
-
 
633
	libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
-
 
634
	# Now arrange that obj and lo_libobj become the same file
-
 
635
	$show "(cd $xdir && $LN_S $baseobj $libobj)"
-
 
636
	if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
-
 
637
	  # Unlock the critical section if it was locked
-
 
638
	  if test "$need_locks" != no; then
-
 
639
	    $run $rm "$lockfile"
-
 
640
	  fi
-
 
641
	  exit 0
-
 
642
	else
-
 
643
	  error=$?
-
 
644
	  $run $rm $removelist
-
 
645
	  exit $error
-
 
646
	fi
-
 
647
      fi
-
 
648
 
723
 
649
      # Allow error messages only from the first compilation.
724
      # Allow error messages only from the first compilation.
650
      suppress_output=' >/dev/null 2>&1'
725
      suppress_output=' >/dev/null 2>&1'
-
 
726
    else
-
 
727
      # No PIC object so indicate it doesn't exist in the libtool
-
 
728
      # object file.
-
 
729
      test -z "$run" && cat >> ${libobj}T <<EOF
-
 
730
pic_object=none
-
 
731
 
-
 
732
EOF
651
    fi
733
    fi
652
 
734
 
653
    # Only build a position-dependent object if we build old libraries.
735
    # Only build a position-dependent object if we build old libraries.
654
    if test "$build_old_libs" = yes; then
736
    if test "$build_old_libs" = yes; then
655
      if test "$pic_mode" != yes; then
737
      if test "$pic_mode" != yes; then
656
	# Don't build PIC code
738
	# Don't build PIC code
657
	command="$base_compile $srcfile"
739
	command="$base_compile $srcfile"
658
      else
740
      else
659
	# All platforms use -DPIC, to notify preprocessed assembler code.
-
 
660
	command="$base_compile $srcfile $pic_flag -DPIC"
741
	command="$base_compile $srcfile $pic_flag"
661
      fi
742
      fi
662
      if test "$compiler_c_o" = yes; then
743
      if test "$compiler_c_o" = yes; then
663
	command="$command -o $obj"
744
	command="$command -o $obj"
664
	output_obj="$obj"
-
 
665
      fi
745
      fi
666
 
746
 
667
      # Suppress compiler output if we already did a PIC compilation.
747
      # Suppress compiler output if we already did a PIC compilation.
668
      command="$command$suppress_output"
748
      command="$command$suppress_output"
669
      $run $rm "$output_obj"
749
      $run $rm "$obj" "$output_obj"
670
      $show "$command"
750
      $show "$command"
671
      if $run eval "$command"; then :
751
      if $run eval "$command"; then :
672
      else
752
      else
673
	$run $rm $removelist
753
	$run $rm $removelist
674
	exit 1
754
	exit 1
675
      fi
755
      fi
676
 
756
 
677
      if test "$need_locks" = warn &&
757
      if test "$need_locks" = warn &&
678
	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
758
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
679
	echo "\
759
	$echo "\
680
*** ERROR, $lockfile contains:
760
*** ERROR, $lockfile contains:
681
`cat $lockfile 2>/dev/null`
761
`cat $lockfile 2>/dev/null`
682
 
762
 
683
but it should contain:
763
but it should contain:
684
$srcfile
764
$srcfile
Line 693... Line 773...
693
	$run $rm $removelist
773
	$run $rm $removelist
694
	exit 1
774
	exit 1
695
      fi
775
      fi
696
 
776
 
697
      # Just move the object if needed
777
      # Just move the object if needed
698
      if test x"$output_obj" != x"$obj"; then
778
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
699
	$show "$mv $output_obj $obj"
779
	$show "$mv $output_obj $obj"
700
	if $run $mv $output_obj $obj; then :
780
	if $run $mv $output_obj $obj; then :
701
	else
781
	else
702
	  error=$?
782
	  error=$?
703
	  $run $rm $removelist
783
	  $run $rm $removelist
704
	  exit $error
784
	  exit $error
705
	fi
785
	fi
706
      fi
786
      fi
707
 
787
 
708
      # Create an invalid libtool object if no PIC, so that we do not
788
      # Append the name of the non-PIC object the libtool object file.
709
      # accidentally link it into a program.
789
      # Only append if the libtool object file exists.
710
      if test "$build_libtool_libs" != yes; then
790
      test -z "$run" && cat >> ${libobj}T <<EOF
711
	$show "echo timestamp > $libobj"
791
# Name of the non-PIC object.
712
	$run eval "echo timestamp > \$libobj" || exit $?
792
non_pic_object='$objname'
-
 
793
 
-
 
794
EOF
713
      else
795
    else
714
	# Move the .lo from within objdir
796
      # Append the name of the non-PIC object the libtool object file.
715
	$show "$mv $libobj $lo_libobj"
797
      # Only append if the libtool object file exists.
716
	if $run $mv $libobj $lo_libobj; then :
798
      test -z "$run" && cat >> ${libobj}T <<EOF
717
	else
-
 
718
	  error=$?
-
 
719
	  $run $rm $removelist
799
# Name of the non-PIC object.
720
	  exit $error
800
non_pic_object=none
721
	fi
801
 
722
      fi
802
EOF
723
    fi
803
    fi
724
 
804
 
-
 
805
    $run $mv "${libobj}T" "${libobj}"
-
 
806
 
725
    # Unlock the critical section if it was locked
807
    # Unlock the critical section if it was locked
726
    if test "$need_locks" != no; then
808
    if test "$need_locks" != no; then
727
      $run $rm "$lockfile"
809
      $run $rm "$lockfile"
728
    fi
810
    fi
729
 
811
 
Line 736... Line 818...
736
    case $host in
818
    case $host in
737
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
819
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
738
      # It is impossible to link a dll without this setting, and
820
      # It is impossible to link a dll without this setting, and
739
      # we shouldn't force the makefile maintainer to figure out
821
      # we shouldn't force the makefile maintainer to figure out
740
      # which system we are compiling for in order to pass an extra
822
      # which system we are compiling for in order to pass an extra
741
      # flag for every libtool invokation.
823
      # flag for every libtool invocation.
742
      # allow_undefined=no
824
      # allow_undefined=no
743
 
825
 
744
      # FIXME: Unfortunately, there are problems with the above when trying
826
      # FIXME: Unfortunately, there are problems with the above when trying
745
      # to make a dll which has undefined symbols, in which case not
827
      # to make a dll which has undefined symbols, in which case not
746
      # even a static library is built.  For now, we need to specify
828
      # even a static library is built.  For now, we need to specify
Line 751... Line 833...
751
    *)
833
    *)
752
      allow_undefined=yes
834
      allow_undefined=yes
753
      ;;
835
      ;;
754
    esac
836
    esac
755
    libtool_args="$nonopt"
837
    libtool_args="$nonopt"
-
 
838
    base_compile="$nonopt"
756
    compile_command="$nonopt"
839
    compile_command="$nonopt"
757
    finalize_command="$nonopt"
840
    finalize_command="$nonopt"
758
 
841
 
759
    compile_rpath=
842
    compile_rpath=
760
    finalize_rpath=
843
    finalize_rpath=
Line 781... Line 864...
781
    libobjs=
864
    libobjs=
782
    ltlibs=
865
    ltlibs=
783
    module=no
866
    module=no
784
    no_install=no
867
    no_install=no
785
    objs=
868
    objs=
-
 
869
    non_pic_objects=
786
    prefer_static_libs=no
870
    prefer_static_libs=no
787
    preload=no
871
    preload=no
788
    prev=
872
    prev=
789
    prevarg=
873
    prevarg=
790
    release=
874
    release=
Line 792... Line 876...
792
    xrpath=
876
    xrpath=
793
    perm_rpath=
877
    perm_rpath=
794
    temp_rpath=
878
    temp_rpath=
795
    thread_safe=no
879
    thread_safe=no
796
    vinfo=
880
    vinfo=
-
 
881
    vinfo_number=no
797
 
882
 
798
    # We need to know -static, to get the right output filenames.
883
    # We need to know -static, to get the right output filenames.
799
    for arg
884
    for arg
800
    do
885
    do
801
      case $arg in
886
      case $arg in
Line 822... Line 907...
822
 
907
 
823
    # See if our shared archives depend on static archives.
908
    # See if our shared archives depend on static archives.
824
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
909
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
825
 
910
 
826
    # Go through the arguments, transforming them on the way.
911
    # Go through the arguments, transforming them on the way.
827
    while test $# -gt 0; do
912
    while test "$#" -gt 0; do
828
      arg="$1"
913
      arg="$1"
-
 
914
      base_compile="$base_compile $arg"
829
      shift
915
      shift
830
      case $arg in
916
      case $arg in
831
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
917
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
832
	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
918
	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
833
	;;
919
	;;
Line 907... Line 993...
907
	release)
993
	release)
908
	  release="-$arg"
994
	  release="-$arg"
909
	  prev=
995
	  prev=
910
	  continue
996
	  continue
911
	  ;;
997
	  ;;
-
 
998
	objectlist)
-
 
999
	  if test -f "$arg"; then
-
 
1000
	    save_arg=$arg
-
 
1001
	    moreargs=
-
 
1002
	    for fil in `cat $save_arg`
-
 
1003
	    do
-
 
1004
#	      moreargs="$moreargs $fil"
-
 
1005
	      arg=$fil
-
 
1006
	      # A libtool-controlled object.
-
 
1007
 
-
 
1008
	      # Check to see that this really is a libtool object.
-
 
1009
	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
 
1010
		pic_object=
-
 
1011
		non_pic_object=
-
 
1012
 
-
 
1013
		# Read the .lo file
-
 
1014
		# If there is no directory component, then add one.
-
 
1015
		case $arg in
-
 
1016
		*/* | *\\*) . $arg ;;
-
 
1017
		*) . ./$arg ;;
-
 
1018
		esac
-
 
1019
 
-
 
1020
		if test -z "$pic_object" || \
-
 
1021
		   test -z "$non_pic_object" ||
-
 
1022
		   test "$pic_object" = none && \
-
 
1023
		   test "$non_pic_object" = none; then
-
 
1024
		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-
 
1025
		  exit 1
-
 
1026
		fi
-
 
1027
 
-
 
1028
		# Extract subdirectory from the argument.
-
 
1029
		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-
 
1030
		if test "X$xdir" = "X$arg"; then
-
 
1031
		  xdir=
-
 
1032
		else
-
 
1033
		  xdir="$xdir/"
-
 
1034
		fi
-
 
1035
 
-
 
1036
		if test "$pic_object" != none; then
-
 
1037
		  # Prepend the subdirectory the object is found in.
-
 
1038
		  pic_object="$xdir$pic_object"
-
 
1039
 
-
 
1040
		  if test "$prev" = dlfiles; then
-
 
1041
		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-
 
1042
		      dlfiles="$dlfiles $pic_object"
-
 
1043
		      prev=
-
 
1044
		      continue
-
 
1045
		    else
-
 
1046
		      # If libtool objects are unsupported, then we need to preload.
-
 
1047
		      prev=dlprefiles
-
 
1048
		    fi
-
 
1049
		  fi
-
 
1050
 
-
 
1051
		  # CHECK ME:  I think I busted this.  -Ossama
-
 
1052
		  if test "$prev" = dlprefiles; then
-
 
1053
		    # Preload the old-style object.
-
 
1054
		    dlprefiles="$dlprefiles $pic_object"
-
 
1055
		    prev=
-
 
1056
		  fi
-
 
1057
 
-
 
1058
		  # A PIC object.
-
 
1059
		  libobjs="$libobjs $pic_object"
-
 
1060
		  arg="$pic_object"
-
 
1061
		fi
-
 
1062
 
-
 
1063
		# Non-PIC object.
-
 
1064
		if test "$non_pic_object" != none; then
-
 
1065
		  # Prepend the subdirectory the object is found in.
-
 
1066
		  non_pic_object="$xdir$non_pic_object"
-
 
1067
 
-
 
1068
		  # A standard non-PIC object
-
 
1069
		  non_pic_objects="$non_pic_objects $non_pic_object"
-
 
1070
		  if test -z "$pic_object" || test "$pic_object" = none ; then
-
 
1071
		    arg="$non_pic_object"
-
 
1072
		  fi
-
 
1073
		fi
-
 
1074
	      else
-
 
1075
		# Only an error if not doing a dry-run.
-
 
1076
		if test -z "$run"; then
-
 
1077
		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-
 
1078
		  exit 1
-
 
1079
		else
-
 
1080
		  # Dry-run case.
-
 
1081
 
-
 
1082
		  # Extract subdirectory from the argument.
-
 
1083
		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-
 
1084
		  if test "X$xdir" = "X$arg"; then
-
 
1085
		    xdir=
-
 
1086
		  else
-
 
1087
		    xdir="$xdir/"
-
 
1088
		  fi
-
 
1089
 
-
 
1090
		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-
 
1091
		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-
 
1092
		  libobjs="$libobjs $pic_object"
-
 
1093
		  non_pic_objects="$non_pic_objects $non_pic_object"
-
 
1094
		fi
-
 
1095
	      fi
-
 
1096
	    done
-
 
1097
	  else
-
 
1098
	    $echo "$modename: link input file \`$save_arg' does not exist"
-
 
1099
	    exit 1
-
 
1100
	  fi
-
 
1101
	  arg=$save_arg
-
 
1102
	  prev=
-
 
1103
	  continue
-
 
1104
	  ;;
912
	rpath | xrpath)
1105
	rpath | xrpath)
913
	  # We need an absolute path.
1106
	  # We need an absolute path.
914
	  case $arg in
1107
	  case $arg in
915
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
1108
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
916
	  *)
1109
	  *)
Line 945... Line 1138...
945
	  prev=
1138
	  prev=
946
	  compile_command="$compile_command $wl$qarg"
1139
	  compile_command="$compile_command $wl$qarg"
947
	  finalize_command="$finalize_command $wl$qarg"
1140
	  finalize_command="$finalize_command $wl$qarg"
948
	  continue
1141
	  continue
949
	  ;;
1142
	  ;;
-
 
1143
	xcclinker)
-
 
1144
	  linker_flags="$linker_flags $qarg"
-
 
1145
	  compiler_flags="$compiler_flags $qarg"
-
 
1146
	  prev=
-
 
1147
	  compile_command="$compile_command $qarg"
-
 
1148
	  finalize_command="$finalize_command $qarg"
-
 
1149
	  continue
-
 
1150
	  ;;
950
	*)
1151
	*)
951
	  eval "$prev=\"\$arg\""
1152
	  eval "$prev=\"\$arg\""
952
	  prev=
1153
	  prev=
953
	  continue
1154
	  continue
954
	  ;;
1155
	  ;;
955
	esac
1156
	esac
956
      fi # test -n $prev
1157
      fi # test -n "$prev"
957
 
1158
 
958
      prevarg="$arg"
1159
      prevarg="$arg"
959
 
1160
 
960
      case $arg in
1161
      case $arg in
961
      -all-static)
1162
      -all-static)
Line 1004... Line 1205...
1004
	fi
1205
	fi
1005
	continue
1206
	continue
1006
	;;
1207
	;;
1007
 
1208
 
1008
      -inst-prefix-dir)
1209
      -inst-prefix-dir)
1009
       prev=inst_prefix
1210
	prev=inst_prefix
1010
       continue
1211
	continue
1011
       ;;
1212
	;;
1012
 
1213
 
1013
      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1214
      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1014
      # so, if we see these flags be careful not to treat them like -L
1215
      # so, if we see these flags be careful not to treat them like -L
1015
      -L[A-Z][A-Z]*:*)
1216
      -L[A-Z][A-Z]*:*)
1016
	case $with_gcc/$host in
1217
	case $with_gcc/$host in
1017
	no/*-*-irix* | no/*-*-nonstopux*)
1218
	no/*-*-irix* | /*-*-irix*)
1018
	  compile_command="$compile_command $arg"
1219
	  compile_command="$compile_command $arg"
1019
	  finalize_command="$finalize_command $arg"
1220
	  finalize_command="$finalize_command $arg"
1020
	  ;;
1221
	  ;;
1021
	esac
1222
	esac
1022
	continue
1223
	continue
Line 1067... Line 1268...
1067
	    ;;
1268
	    ;;
1068
	  *-*-openbsd* | *-*-freebsd*)
1269
	  *-*-openbsd* | *-*-freebsd*)
1069
	    # Do not include libc due to us having libc/libc_r.
1270
	    # Do not include libc due to us having libc/libc_r.
1070
	    test "X$arg" = "X-lc" && continue
1271
	    test "X$arg" = "X-lc" && continue
1071
	    ;;
1272
	    ;;
1072
	  esac
-
 
1073
	 elif test "X$arg" = "X-lc_r"; then
1273
	  *-*-rhapsody* | *-*-darwin1.[012])
1074
	  case $host in
-
 
1075
	 *-*-openbsd* | *-*-freebsd*)
1274
	    # Rhapsody C and math libraries are in the System framework
1076
	    # Do not include libc_r directly, use -pthread flag.
1275
	    deplibs="$deplibs -framework System"
1077
	    continue
1276
	    continue
1078
	    ;;
-
 
1079
	  esac
1277
	  esac
-
 
1278
	elif test "X$arg" = "X-lc_r"; then
-
 
1279
	 case $host in
-
 
1280
	 *-*-openbsd* | *-*-freebsd*)
-
 
1281
	   # Do not include libc_r directly, use -pthread flag.
-
 
1282
	   continue
-
 
1283
	   ;;
-
 
1284
	 esac
1080
	fi
1285
	fi
1081
	deplibs="$deplibs $arg"
1286
	deplibs="$deplibs $arg"
1082
	continue
1287
	continue
1083
	;;
1288
	;;
1084
 
1289
 
1085
      -module)
1290
      -module)
1086
	module=yes
1291
	module=yes
1087
	continue
1292
	continue
1088
	;;
1293
	;;
1089
 
1294
 
-
 
1295
      # gcc -m* arguments should be passed to the linker via $compiler_flags
-
 
1296
      # in order to pass architecture information to the linker
-
 
1297
      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
-
 
1298
      # but this is not reliable with gcc because gcc may use -mfoo to
-
 
1299
      # select a different linker, different libraries, etc, while
-
 
1300
      # -Wl,-mfoo simply passes -mfoo to the linker.
-
 
1301
      -m*)
-
 
1302
	# Unknown arguments in both finalize_command and compile_command need
-
 
1303
	# to be aesthetically quoted because they are evaled later.
-
 
1304
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-
 
1305
	case $arg in
-
 
1306
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-
 
1307
	  arg="\"$arg\""
-
 
1308
	  ;;
-
 
1309
	esac
-
 
1310
        compile_command="$compile_command $arg"
-
 
1311
        finalize_command="$finalize_command $arg"
-
 
1312
        if test "$with_gcc" = "yes" ; then
-
 
1313
          compiler_flags="$compiler_flags $arg"
-
 
1314
        fi
-
 
1315
        continue
-
 
1316
        ;;
-
 
1317
 
-
 
1318
      -shrext)
-
 
1319
	prev=shrext
-
 
1320
	continue
-
 
1321
	;;
-
 
1322
 
1090
      -no-fast-install)
1323
      -no-fast-install)
1091
	fast_install=no
1324
	fast_install=no
1092
	continue
1325
	continue
1093
	;;
1326
	;;
1094
 
1327
 
Line 1109... Line 1342...
1109
      -no-undefined)
1342
      -no-undefined)
1110
	allow_undefined=no
1343
	allow_undefined=no
1111
	continue
1344
	continue
1112
	;;
1345
	;;
1113
 
1346
 
-
 
1347
      -objectlist)
-
 
1348
	prev=objectlist
-
 
1349
	continue
-
 
1350
	;;
-
 
1351
 
1114
      -o) prev=output ;;
1352
      -o) prev=output ;;
1115
 
1353
 
1116
      -release)
1354
      -release)
1117
	prev=release
1355
	prev=release
1118
	continue
1356
	continue
Line 1161... Line 1399...
1161
 
1399
 
1162
      -version-info)
1400
      -version-info)
1163
	prev=vinfo
1401
	prev=vinfo
1164
	continue
1402
	continue
1165
	;;
1403
	;;
-
 
1404
      -version-number)
-
 
1405
	prev=vinfo
-
 
1406
	vinfo_number=yes
-
 
1407
	continue
-
 
1408
	;;
1166
 
1409
 
1167
      -Wc,*)
1410
      -Wc,*)
1168
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1411
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1169
	arg=
1412
	arg=
1170
	save_ifs="$IFS"; IFS=','
1413
	save_ifs="$IFS"; IFS=','
Line 1209... Line 1452...
1209
      -Xlinker)
1452
      -Xlinker)
1210
	prev=xlinker
1453
	prev=xlinker
1211
	continue
1454
	continue
1212
	;;
1455
	;;
1213
 
1456
 
-
 
1457
      -XCClinker)
-
 
1458
	prev=xcclinker
-
 
1459
	continue
-
 
1460
	;;
-
 
1461
 
1214
      # Some other compiler flag.
1462
      # Some other compiler flag.
1215
      -* | +*)
1463
      -* | +*)
1216
	# Unknown arguments in both finalize_command and compile_command need
1464
	# Unknown arguments in both finalize_command and compile_command need
1217
	# to be aesthetically quoted because they are evaled later.
1465
	# to be aesthetically quoted because they are evaled later.
1218
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1466
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Line 1221... Line 1469...
1221
	  arg="\"$arg\""
1469
	  arg="\"$arg\""
1222
	  ;;
1470
	  ;;
1223
	esac
1471
	esac
1224
	;;
1472
	;;
1225
 
1473
 
1226
      *.lo | *.$objext)
1474
      *.$objext)
1227
	# A library or standard object.
1475
	# A standard object.
1228
	if test "$prev" = dlfiles; then
-
 
1229
	  # This file was specified with -dlopen.
-
 
1230
	  if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-
 
1231
	    dlfiles="$dlfiles $arg"
1476
	objs="$objs $arg"
1232
	    prev=
-
 
1233
	    continue
-
 
1234
	  else
-
 
1235
	    # If libtool objects are unsupported, then we need to preload.
-
 
1236
	    prev=dlprefiles
-
 
1237
	  fi
-
 
1238
	fi
1477
	;;
1239
 
1478
 
-
 
1479
      *.lo)
1240
	if test "$prev" = dlprefiles; then
1480
	# A libtool-controlled object.
-
 
1481
 
1241
	  # Preload the old-style object.
1482
	# Check to see that this really is a libtool object.
1242
	  dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1483
	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1243
	  prev=
1484
	  pic_object=
-
 
1485
	  non_pic_object=
1244
	else
1486
 
-
 
1487
	  # Read the .lo file
-
 
1488
	  # If there is no directory component, then add one.
1245
	  case $arg in
1489
	  case $arg in
1246
	  *.lo) libobjs="$libobjs $arg" ;;
1490
	  */* | *\\*) . $arg ;;
1247
	  *) objs="$objs $arg" ;;
1491
	  *) . ./$arg ;;
1248
	  esac
1492
	  esac
-
 
1493
 
-
 
1494
	  if test -z "$pic_object" || \
-
 
1495
	     test -z "$non_pic_object" ||
-
 
1496
	     test "$pic_object" = none && \
-
 
1497
	     test "$non_pic_object" = none; then
-
 
1498
	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-
 
1499
	    exit 1
-
 
1500
	  fi
-
 
1501
 
-
 
1502
	  # Extract subdirectory from the argument.
-
 
1503
	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-
 
1504
	  if test "X$xdir" = "X$arg"; then
-
 
1505
	    xdir=
-
 
1506
 	  else
-
 
1507
	    xdir="$xdir/"
-
 
1508
	  fi
-
 
1509
 
-
 
1510
	  if test "$pic_object" != none; then
-
 
1511
	    # Prepend the subdirectory the object is found in.
-
 
1512
	    pic_object="$xdir$pic_object"
-
 
1513
 
-
 
1514
	    if test "$prev" = dlfiles; then
-
 
1515
	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-
 
1516
		dlfiles="$dlfiles $pic_object"
-
 
1517
		prev=
-
 
1518
		continue
-
 
1519
	      else
-
 
1520
		# If libtool objects are unsupported, then we need to preload.
-
 
1521
		prev=dlprefiles
-
 
1522
	      fi
-
 
1523
	    fi
-
 
1524
 
-
 
1525
	    # CHECK ME:  I think I busted this.  -Ossama
-
 
1526
	    if test "$prev" = dlprefiles; then
-
 
1527
	      # Preload the old-style object.
-
 
1528
	      dlprefiles="$dlprefiles $pic_object"
-
 
1529
	      prev=
-
 
1530
	    fi
-
 
1531
 
-
 
1532
	    # A PIC object.
-
 
1533
	    libobjs="$libobjs $pic_object"
-
 
1534
	    arg="$pic_object"
-
 
1535
	  fi
-
 
1536
 
-
 
1537
	  # Non-PIC object.
-
 
1538
	  if test "$non_pic_object" != none; then
-
 
1539
	    # Prepend the subdirectory the object is found in.
-
 
1540
	    non_pic_object="$xdir$non_pic_object"
-
 
1541
 
-
 
1542
	    # A standard non-PIC object
-
 
1543
	    non_pic_objects="$non_pic_objects $non_pic_object"
-
 
1544
	    if test -z "$pic_object" || test "$pic_object" = none ; then
-
 
1545
	      arg="$non_pic_object"
-
 
1546
	    fi
-
 
1547
	  fi
-
 
1548
	else
-
 
1549
	  # Only an error if not doing a dry-run.
-
 
1550
	  if test -z "$run"; then
-
 
1551
	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-
 
1552
	    exit 1
-
 
1553
	  else
-
 
1554
	    # Dry-run case.
-
 
1555
 
-
 
1556
	    # Extract subdirectory from the argument.
-
 
1557
	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-
 
1558
	    if test "X$xdir" = "X$arg"; then
-
 
1559
	      xdir=
-
 
1560
	    else
-
 
1561
	      xdir="$xdir/"
-
 
1562
	    fi
-
 
1563
 
-
 
1564
	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-
 
1565
	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-
 
1566
	    libobjs="$libobjs $pic_object"
-
 
1567
	    non_pic_objects="$non_pic_objects $non_pic_object"
-
 
1568
	  fi
1249
	fi
1569
	fi
1250
	;;
1570
	;;
1251
 
1571
 
1252
      *.$libext)
1572
      *.$libext)
1253
	# An archive.
1573
	# An archive.
Line 1297... Line 1617...
1297
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1617
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1298
      $echo "$help" 1>&2
1618
      $echo "$help" 1>&2
1299
      exit 1
1619
      exit 1
1300
    fi
1620
    fi
1301
 
1621
 
-
 
1622
    # Infer tagged configuration to use if any are available and
-
 
1623
    # if one wasn't chosen via the "--tag" command line option.
-
 
1624
    # Only attempt this if the compiler in the base link
-
 
1625
    # command doesn't match the default compiler.
-
 
1626
    if test -n "$available_tags" && test -z "$tagname"; then
-
 
1627
      case $base_compile in
-
 
1628
      # Blanks in the command may have been stripped by the calling shell,
-
 
1629
      # but not from the CC environment variable when configure was run.
-
 
1630
      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
-
 
1631
      # Blanks at the start of $base_compile will cause this to fail
-
 
1632
      # if we don't check for them as well.
-
 
1633
      *)
-
 
1634
	for z in $available_tags; do
-
 
1635
	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
-
 
1636
	    # Evaluate the configuration.
-
 
1637
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
-
 
1638
	    case $base_compile in
-
 
1639
	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
-
 
1640
	      # The compiler in $compile_command matches
-
 
1641
	      # the one in the tagged configuration.
-
 
1642
	      # Assume this is the tagged configuration we want.
-
 
1643
	      tagname=$z
-
 
1644
	      break
-
 
1645
	      ;;
-
 
1646
	    esac
-
 
1647
	  fi
-
 
1648
	done
-
 
1649
	# If $tagname still isn't set, then no tagged configuration
-
 
1650
	# was found and let the user know that the "--tag" command
-
 
1651
	# line option must be used.
-
 
1652
	if test -z "$tagname"; then
-
 
1653
	  $echo "$modename: unable to infer tagged configuration"
-
 
1654
	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-
 
1655
	  exit 1
-
 
1656
#       else
-
 
1657
#         $echo "$modename: using $tagname tagged configuration"
-
 
1658
	fi
-
 
1659
	;;
-
 
1660
      esac
-
 
1661
    fi
-
 
1662
 
1302
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1663
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1303
      eval arg=\"$export_dynamic_flag_spec\"
1664
      eval arg=\"$export_dynamic_flag_spec\"
1304
      compile_command="$compile_command $arg"
1665
      compile_command="$compile_command $arg"
1305
      finalize_command="$finalize_command $arg"
1666
      finalize_command="$finalize_command $arg"
1306
    fi
1667
    fi
1307
 
1668
 
-
 
1669
    oldlibs=
1308
    # calculate the name of the file, without its directory
1670
    # calculate the name of the file, without its directory
1309
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1671
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1310
    libobjs_save="$libobjs"
1672
    libobjs_save="$libobjs"
1311
 
1673
 
1312
    if test -n "$shlibpath_var"; then
1674
    if test -n "$shlibpath_var"; then
Line 1323... Line 1685...
1323
      output_objdir="$objdir"
1685
      output_objdir="$objdir"
1324
    else
1686
    else
1325
      output_objdir="$output_objdir/$objdir"
1687
      output_objdir="$output_objdir/$objdir"
1326
    fi
1688
    fi
1327
    # Create the object directory.
1689
    # Create the object directory.
1328
    if test ! -d $output_objdir; then
1690
    if test ! -d "$output_objdir"; then
1329
      $show "$mkdir $output_objdir"
1691
      $show "$mkdir $output_objdir"
1330
      $run $mkdir $output_objdir
1692
      $run $mkdir $output_objdir
1331
      status=$?
1693
      status=$?
1332
      if test $status -ne 0 && test ! -d $output_objdir; then
1694
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1333
	exit $status
1695
	exit $status
1334
      fi
1696
      fi
1335
    fi
1697
    fi
1336
 
1698
 
1337
    # Determine the type of output
1699
    # Determine the type of output
Line 1345... Line 1707...
1345
    *.lo | *.$objext) linkmode=obj ;;
1707
    *.lo | *.$objext) linkmode=obj ;;
1346
    *.la) linkmode=lib ;;
1708
    *.la) linkmode=lib ;;
1347
    *) linkmode=prog ;; # Anything else should be a program.
1709
    *) linkmode=prog ;; # Anything else should be a program.
1348
    esac
1710
    esac
1349
 
1711
 
-
 
1712
    case $host in
-
 
1713
    *cygwin* | *mingw* | *pw32*)
-
 
1714
      # don't eliminate duplcations in $postdeps and $predeps
-
 
1715
      duplicate_compiler_generated_deps=yes
-
 
1716
      ;;
-
 
1717
    *)
-
 
1718
      duplicate_compiler_generated_deps=$duplicate_deps
-
 
1719
      ;;
-
 
1720
    esac
1350
    specialdeplibs=
1721
    specialdeplibs=
-
 
1722
 
1351
    libs=
1723
    libs=
1352
    # Find all interdependent deplibs by searching for libraries
1724
    # Find all interdependent deplibs by searching for libraries
1353
    # that are linked more than once (e.g. -la -lb -la)
1725
    # that are linked more than once (e.g. -la -lb -la)
1354
    for deplib in $deplibs; do
1726
    for deplib in $deplibs; do
1355
      if test "X$duplicate_deps" = "Xyes" ; then
1727
      if test "X$duplicate_deps" = "Xyes" ; then
Line 1357... Line 1729...
1357
	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1729
	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1358
	esac
1730
	esac
1359
      fi
1731
      fi
1360
      libs="$libs $deplib"
1732
      libs="$libs $deplib"
1361
    done
1733
    done
-
 
1734
 
-
 
1735
    if test "$linkmode" = lib; then
-
 
1736
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
 
1737
 
-
 
1738
      # Compute libraries that are listed more than once in $predeps
-
 
1739
      # $postdeps and mark them as special (i.e., whose duplicates are
-
 
1740
      # not to be eliminated).
-
 
1741
      pre_post_deps=
-
 
1742
      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
-
 
1743
	for pre_post_dep in $predeps $postdeps; do
-
 
1744
	  case "$pre_post_deps " in
-
 
1745
	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-
 
1746
	  esac
-
 
1747
	  pre_post_deps="$pre_post_deps $pre_post_dep"
-
 
1748
	done
-
 
1749
      fi
-
 
1750
      pre_post_deps=
-
 
1751
    fi
-
 
1752
 
1362
    deplibs=
1753
    deplibs=
1363
    newdependency_libs=
1754
    newdependency_libs=
1364
    newlib_search_path=
1755
    newlib_search_path=
1365
    need_relink=no # whether we're linking any uninstalled libtool libraries
1756
    need_relink=no # whether we're linking any uninstalled libtool libraries
1366
    notinst_deplibs= # not-installed libtool libraries
1757
    notinst_deplibs= # not-installed libtool libraries
Line 1388... Line 1779...
1388
	;;
1779
	;;
1389
    *)  passes="conv"
1780
    *)  passes="conv"
1390
	;;
1781
	;;
1391
    esac
1782
    esac
1392
    for pass in $passes; do
1783
    for pass in $passes; do
1393
      if test $linkmode = prog; then
1784
      if test "$linkmode,$pass" = "lib,link" ||
-
 
1785
	 test "$linkmode,$pass" = "prog,scan"; then
-
 
1786
	libs="$deplibs"
-
 
1787
	deplibs=
-
 
1788
      fi
1394
	# Determine which files to process
1789
      if test "$linkmode" = prog; then
1395
	case $pass in
1790
	case $pass in
1396
	dlopen)
-
 
1397
	  libs="$dlfiles"
1791
	dlopen) libs="$dlfiles" ;;
1398
	  save_deplibs="$deplibs" # Collect dlpreopened libraries
-
 
1399
	  deplibs=
-
 
1400
	  ;;
-
 
1401
	dlpreopen) libs="$dlprefiles" ;;
1792
	dlpreopen) libs="$dlprefiles" ;;
1402
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1793
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1403
	esac
1794
	esac
1404
      fi
1795
      fi
-
 
1796
      if test "$pass" = dlopen; then
-
 
1797
	# Collect dlpreopened libraries
-
 
1798
	save_deplibs="$deplibs"
-
 
1799
	deplibs=
-
 
1800
      fi
1405
      for deplib in $libs; do
1801
      for deplib in $libs; do
1406
	lib=
1802
	lib=
1407
	found=no
1803
	found=no
1408
	case $deplib in
1804
	case $deplib in
1409
	-l*)
1805
	-l*)
1410
	  if test $linkmode = oldlib && test $linkmode = obj; then
1806
	  if test "$linkmode" != lib && test "$linkmode" != prog; then
1411
	    $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1807
	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1412
	    continue
1808
	    continue
1413
	  fi
1809
	  fi
1414
	  if test $pass = conv; then
1810
	  if test "$pass" = conv; then
1415
	    deplibs="$deplib $deplibs"
1811
	    deplibs="$deplib $deplibs"
1416
	    continue
1812
	    continue
1417
	  fi
1813
	  fi
1418
	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1814
	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1419
	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1815
	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
Line 1429... Line 1825...
1429
	    if test "$linkmode,$pass" = "prog,link"; then
1825
	    if test "$linkmode,$pass" = "prog,link"; then
1430
	      compile_deplibs="$deplib $compile_deplibs"
1826
	      compile_deplibs="$deplib $compile_deplibs"
1431
	      finalize_deplibs="$deplib $finalize_deplibs"
1827
	      finalize_deplibs="$deplib $finalize_deplibs"
1432
	    else
1828
	    else
1433
	      deplibs="$deplib $deplibs"
1829
	      deplibs="$deplib $deplibs"
1434
	      test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1830
	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1435
	    fi
1831
	    fi
1436
	    continue
1832
	    continue
-
 
1833
	  else # deplib is a libtool library
-
 
1834
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-
 
1835
	    # We need to do some special things here, and not later.
-
 
1836
	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
1837
	      case " $predeps $postdeps " in
-
 
1838
	      *" $deplib "*)
-
 
1839
		if (${SED} -e '2q' $lib |
-
 
1840
                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
 
1841
		  library_names=
-
 
1842
		  old_library=
-
 
1843
		  case $lib in
-
 
1844
		  */* | *\\*) . $lib ;;
-
 
1845
		  *) . ./$lib ;;
-
 
1846
		  esac
-
 
1847
		  for l in $old_library $library_names; do
-
 
1848
		    ll="$l"
-
 
1849
		  done
-
 
1850
		  if test "X$ll" = "X$old_library" ; then # only static version available
-
 
1851
		    found=no
-
 
1852
		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-
 
1853
		    test "X$ladir" = "X$lib" && ladir="."
-
 
1854
		    lib=$ladir/$old_library
-
 
1855
		    if test "$linkmode,$pass" = "prog,link"; then
-
 
1856
		      compile_deplibs="$deplib $compile_deplibs"
-
 
1857
		      finalize_deplibs="$deplib $finalize_deplibs"
-
 
1858
		    else
-
 
1859
		      deplibs="$deplib $deplibs"
-
 
1860
		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-
 
1861
		    fi
-
 
1862
		    continue
-
 
1863
		  fi
-
 
1864
		fi
-
 
1865
	        ;;
-
 
1866
	      *) ;;
-
 
1867
	      esac
-
 
1868
	    fi
1437
	  fi
1869
	  fi
1438
	  ;; # -l
1870
	  ;; # -l
1439
	-L*)
1871
	-L*)
1440
	  case $linkmode in
1872
	  case $linkmode in
1441
	  lib)
1873
	  lib)
1442
	    deplibs="$deplib $deplibs"
1874
	    deplibs="$deplib $deplibs"
1443
	    test $pass = conv && continue
1875
	    test "$pass" = conv && continue
1444
	    newdependency_libs="$deplib $newdependency_libs"
1876
	    newdependency_libs="$deplib $newdependency_libs"
1445
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1877
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1446
	    ;;
1878
	    ;;
1447
	  prog)
1879
	  prog)
1448
	    if test $pass = conv; then
1880
	    if test "$pass" = conv; then
1449
	      deplibs="$deplib $deplibs"
1881
	      deplibs="$deplib $deplibs"
1450
	      continue
1882
	      continue
1451
	    fi
1883
	    fi
1452
	    if test $pass = scan; then
1884
	    if test "$pass" = scan; then
1453
	      deplibs="$deplib $deplibs"
1885
	      deplibs="$deplib $deplibs"
1454
	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1886
	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1455
	    else
1887
	    else
1456
	      compile_deplibs="$deplib $compile_deplibs"
1888
	      compile_deplibs="$deplib $compile_deplibs"
1457
	      finalize_deplibs="$deplib $finalize_deplibs"
1889
	      finalize_deplibs="$deplib $finalize_deplibs"
1458
	    fi
1890
	    fi
1459
	    ;;
1891
	    ;;
1460
	  *)
1892
	  *)
1461
	    $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1893
	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1462
	    ;;
1894
	    ;;
1463
	  esac # linkmode
1895
	  esac # linkmode
1464
	  continue
1896
	  continue
1465
	  ;; # -L
1897
	  ;; # -L
1466
	-R*)
1898
	-R*)
1467
	  if test $pass = link; then
1899
	  if test "$pass" = link; then
1468
	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1900
	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1469
	    # Make sure the xrpath contains only unique directories.
1901
	    # Make sure the xrpath contains only unique directories.
1470
	    case "$xrpath " in
1902
	    case "$xrpath " in
1471
	    *" $dir "*) ;;
1903
	    *" $dir "*) ;;
1472
	    *) xrpath="$xrpath $dir" ;;
1904
	    *) xrpath="$xrpath $dir" ;;
Line 1475... Line 1907...
1475
	  deplibs="$deplib $deplibs"
1907
	  deplibs="$deplib $deplibs"
1476
	  continue
1908
	  continue
1477
	  ;;
1909
	  ;;
1478
	*.la) lib="$deplib" ;;
1910
	*.la) lib="$deplib" ;;
1479
	*.$libext)
1911
	*.$libext)
1480
	  if test $pass = conv; then
1912
	  if test "$pass" = conv; then
1481
	    deplibs="$deplib $deplibs"
1913
	    deplibs="$deplib $deplibs"
1482
	    continue
1914
	    continue
1483
	  fi
1915
	  fi
1484
	  case $linkmode in
1916
	  case $linkmode in
1485
	  lib)
1917
	  lib)
1486
	    if test "$deplibs_check_method" != pass_all; then
1918
	    if test "$deplibs_check_method" != pass_all; then
1487
	      echo
1919
	      $echo
1488
	      echo "*** Warning: Trying to link with static lib archive $deplib."
1920
	      $echo "*** Warning: Trying to link with static lib archive $deplib."
1489
	      echo "*** I have the capability to make that library automatically link in when"
1921
	      $echo "*** I have the capability to make that library automatically link in when"
1490
	      echo "*** you link to this library.  But I can only do this if you have a"
1922
	      $echo "*** you link to this library.  But I can only do this if you have a"
1491
	      echo "*** shared version of the library, which you do not appear to have"
1923
	      $echo "*** shared version of the library, which you do not appear to have"
1492
	      echo "*** because the file extensions .$libext of this argument makes me believe"
1924
	      $echo "*** because the file extensions .$libext of this argument makes me believe"
1493
	      echo "*** that it is just a static archive that I should not used here."
1925
	      $echo "*** that it is just a static archive that I should not used here."
1494
	    else
1926
	    else
1495
	      echo
1927
	      $echo
1496
	      echo "*** Warning: Linking the shared library $output against the"
1928
	      $echo "*** Warning: Linking the shared library $output against the"
1497
	      echo "*** static library $deplib is not portable!"
1929
	      $echo "*** static library $deplib is not portable!"
1498
	      deplibs="$deplib $deplibs"
1930
	      deplibs="$deplib $deplibs"
1499
	    fi
1931
	    fi
1500
	    continue
1932
	    continue
1501
	    ;;
1933
	    ;;
1502
	  prog)
1934
	  prog)
1503
	    if test $pass != link; then
1935
	    if test "$pass" != link; then
1504
	      deplibs="$deplib $deplibs"
1936
	      deplibs="$deplib $deplibs"
1505
	    else
1937
	    else
1506
	      compile_deplibs="$deplib $compile_deplibs"
1938
	      compile_deplibs="$deplib $compile_deplibs"
1507
	      finalize_deplibs="$deplib $finalize_deplibs"
1939
	      finalize_deplibs="$deplib $finalize_deplibs"
1508
	    fi
1940
	    fi
1509
	    continue
1941
	    continue
1510
	    ;;
1942
	    ;;
1511
	  esac # linkmode
1943
	  esac # linkmode
1512
	  ;; # *.$libext
1944
	  ;; # *.$libext
1513
	*.lo | *.$objext)
1945
	*.lo | *.$objext)
-
 
1946
	  if test "$pass" = conv; then
-
 
1947
	    deplibs="$deplib $deplibs"
-
 
1948
	  elif test "$linkmode" = prog; then
1514
	  if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1949
	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1515
	    # If there is no dlopen support or we're linking statically,
1950
	      # If there is no dlopen support or we're linking statically,
1516
	    # we need to preload.
1951
	      # we need to preload.
1517
	    newdlprefiles="$newdlprefiles $deplib"
1952
	      newdlprefiles="$newdlprefiles $deplib"
1518
	    compile_deplibs="$deplib $compile_deplibs"
1953
	      compile_deplibs="$deplib $compile_deplibs"
1519
	    finalize_deplibs="$deplib $finalize_deplibs"
1954
	      finalize_deplibs="$deplib $finalize_deplibs"
1520
	  else
1955
	    else
1521
	    newdlfiles="$newdlfiles $deplib"
1956
	      newdlfiles="$newdlfiles $deplib"
-
 
1957
	    fi
1522
	  fi
1958
	  fi
1523
	  continue
1959
	  continue
1524
	  ;;
1960
	  ;;
1525
	%DEPLIBS%)
1961
	%DEPLIBS%)
1526
	  alldeplibs=yes
1962
	  alldeplibs=yes
1527
	  continue
1963
	  continue
1528
	  ;;
1964
	  ;;
1529
	esac # case $deplib
1965
	esac # case $deplib
1530
	if test $found = yes || test -f "$lib"; then :
1966
	if test "$found" = yes || test -f "$lib"; then :
1531
	else
1967
	else
1532
	  $echo "$modename: cannot find the library \`$lib'" 1>&2
1968
	  $echo "$modename: cannot find the library \`$lib'" 1>&2
1533
	  exit 1
1969
	  exit 1
1534
	fi
1970
	fi
1535
 
1971
 
1536
	# Check to see that this really is a libtool archive.
1972
	# Check to see that this really is a libtool archive.
1537
	if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1973
	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1538
	else
1974
	else
1539
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1975
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1540
	  exit 1
1976
	  exit 1
1541
	fi
1977
	fi
1542
 
1978
 
Line 1548... Line 1984...
1548
	dlpreopen=
1984
	dlpreopen=
1549
	libdir=
1985
	libdir=
1550
	library_names=
1986
	library_names=
1551
	old_library=
1987
	old_library=
1552
	# If the library was installed with an old release of libtool,
1988
	# If the library was installed with an old release of libtool,
1553
	# it will not redefine variable installed.
1989
	# it will not redefine variables installed, or shouldnotlink
1554
	installed=yes
1990
	installed=yes
-
 
1991
	shouldnotlink=no
1555
 
1992
 
1556
	# Read the .la file
1993
	# Read the .la file
1557
	case $lib in
1994
	case $lib in
1558
	*/* | *\\*) . $lib ;;
1995
	*/* | *\\*) . $lib ;;
1559
	*) . ./$lib ;;
1996
	*) . ./$lib ;;
1560
	esac
1997
	esac
1561
 
1998
 
1562
	if test "$linkmode,$pass" = "lib,link" ||
1999
	if test "$linkmode,$pass" = "lib,link" ||
1563
	   test "$linkmode,$pass" = "prog,scan" ||
2000
	   test "$linkmode,$pass" = "prog,scan" ||
1564
	   { test $linkmode = oldlib && test $linkmode = obj; }; then
2001
	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1565
	   # Add dl[pre]opened files of deplib
-
 
1566
	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2002
	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1567
	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2003
	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1568
	fi
2004
	fi
1569
 
2005
 
1570
	if test $pass = conv; then
2006
	if test "$pass" = conv; then
1571
	  # Only check for convenience libraries
2007
	  # Only check for convenience libraries
1572
	  deplibs="$lib $deplibs"
2008
	  deplibs="$lib $deplibs"
1573
	  if test -z "$libdir"; then
2009
	  if test -z "$libdir"; then
1574
	    if test -z "$old_library"; then
2010
	    if test -z "$old_library"; then
1575
	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2011
	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
Line 1586... Line 2022...
1586
	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2022
	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1587
	        esac
2023
	        esac
1588
              fi
2024
              fi
1589
	      tmp_libs="$tmp_libs $deplib"
2025
	      tmp_libs="$tmp_libs $deplib"
1590
	    done
2026
	    done
1591
	  elif test $linkmode != prog && test $linkmode != lib; then
2027
	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
1592
	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
2028
	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
1593
	    exit 1
2029
	    exit 1
1594
	  fi
2030
	  fi
1595
	  continue
2031
	  continue
1596
	fi # $pass = conv
2032
	fi # $pass = conv
1597
 
2033
 
-
 
2034
    
1598
	# Get the name of the library we link against.
2035
	# Get the name of the library we link against.
1599
	linklib=
2036
	linklib=
1600
	for l in $old_library $library_names; do
2037
	for l in $old_library $library_names; do
1601
	  linklib="$l"
2038
	  linklib="$l"
1602
	done
2039
	done
Line 1604... Line 2041...
1604
	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2041
	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1605
	  exit 1
2042
	  exit 1
1606
	fi
2043
	fi
1607
 
2044
 
1608
	# This library was specified with -dlopen.
2045
	# This library was specified with -dlopen.
1609
	if test $pass = dlopen; then
2046
	if test "$pass" = dlopen; then
1610
	  if test -z "$libdir"; then
2047
	  if test -z "$libdir"; then
1611
	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2048
	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1612
	    exit 1
2049
	    exit 1
1613
	  fi
2050
	  fi
1614
	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2051
	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1615
	    # If there is no dlname, no dlopen support or we're linking
2052
	    # If there is no dlname, no dlopen support or we're linking
1616
	    # statically, we need to preload.
2053
	    # statically, we need to preload.  We also need to preload any
-
 
2054
	    # dependent libraries so libltdl's deplib preloader doesn't
-
 
2055
	    # bomb out in the load deplibs phase.
1617
	    dlprefiles="$dlprefiles $lib"
2056
	    dlprefiles="$dlprefiles $lib $dependency_libs"
1618
	  else
2057
	  else
1619
	    newdlfiles="$newdlfiles $lib"
2058
	    newdlfiles="$newdlfiles $lib"
1620
	  fi
2059
	  fi
1621
	  continue
2060
	  continue
1622
	fi # $pass = dlopen
2061
	fi # $pass = dlopen
Line 1653... Line 2092...
1653
	  notinst_path="$notinst_path $abs_ladir"
2092
	  notinst_path="$notinst_path $abs_ladir"
1654
	fi # $installed = yes
2093
	fi # $installed = yes
1655
	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2094
	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1656
 
2095
 
1657
	# This library was specified with -dlpreopen.
2096
	# This library was specified with -dlpreopen.
1658
	if test $pass = dlpreopen; then
2097
	if test "$pass" = dlpreopen; then
1659
	  if test -z "$libdir"; then
2098
	  if test -z "$libdir"; then
1660
	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2099
	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1661
	    exit 1
2100
	    exit 1
1662
	  fi
2101
	  fi
1663
	  # Prefer using a static library (so that no silly _DYNAMIC symbols
2102
	  # Prefer using a static library (so that no silly _DYNAMIC symbols
Line 1672... Line 2111...
1672
	  fi
2111
	  fi
1673
	fi # $pass = dlpreopen
2112
	fi # $pass = dlpreopen
1674
 
2113
 
1675
	if test -z "$libdir"; then
2114
	if test -z "$libdir"; then
1676
	  # Link the convenience library
2115
	  # Link the convenience library
1677
	  if test $linkmode = lib; then
2116
	  if test "$linkmode" = lib; then
1678
	    deplibs="$dir/$old_library $deplibs"
2117
	    deplibs="$dir/$old_library $deplibs"
1679
	  elif test "$linkmode,$pass" = "prog,link"; then
2118
	  elif test "$linkmode,$pass" = "prog,link"; then
1680
	    compile_deplibs="$dir/$old_library $compile_deplibs"
2119
	    compile_deplibs="$dir/$old_library $compile_deplibs"
1681
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
2120
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
1682
	  else
2121
	  else
1683
	    deplibs="$lib $deplibs"
2122
	    deplibs="$lib $deplibs" # used for prog,scan pass
1684
	  fi
2123
	  fi
1685
	  continue
2124
	  continue
1686
	fi
2125
	fi
1687
 
2126
 
-
 
2127
    
1688
	if test $linkmode = prog && test $pass != link; then
2128
	if test "$linkmode" = prog && test "$pass" != link; then
1689
	  newlib_search_path="$newlib_search_path $ladir"
2129
	  newlib_search_path="$newlib_search_path $ladir"
1690
	  deplibs="$lib $deplibs"
2130
	  deplibs="$lib $deplibs"
1691
 
2131
 
1692
	  linkalldeplibs=no
2132
	  linkalldeplibs=no
1693
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
2133
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
Line 1699... Line 2139...
1699
	  for deplib in $dependency_libs; do
2139
	  for deplib in $dependency_libs; do
1700
	    case $deplib in
2140
	    case $deplib in
1701
	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2141
	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1702
	    esac
2142
	    esac
1703
	    # Need to link against all dependency_libs?
2143
	    # Need to link against all dependency_libs?
1704
	    if test $linkalldeplibs = yes; then
2144
	    if test "$linkalldeplibs" = yes; then
1705
	      deplibs="$deplib $deplibs"
2145
	      deplibs="$deplib $deplibs"
1706
	    else
2146
	    else
1707
	      # Need to hardcode shared library paths
2147
	      # Need to hardcode shared library paths
1708
	      # or/and link against static libraries
2148
	      # or/and link against static libraries
1709
	      newdependency_libs="$deplib $newdependency_libs"
2149
	      newdependency_libs="$deplib $newdependency_libs"
Line 1716... Line 2156...
1716
	    tmp_libs="$tmp_libs $deplib"
2156
	    tmp_libs="$tmp_libs $deplib"
1717
	  done # for deplib
2157
	  done # for deplib
1718
	  continue
2158
	  continue
1719
	fi # $linkmode = prog...
2159
	fi # $linkmode = prog...
1720
 
2160
 
1721
	link_static=no # Whether the deplib will be linked statically
2161
	if test "$linkmode,$pass" = "prog,link"; then
1722
	if test -n "$library_names" &&
2162
	  if test -n "$library_names" &&
1723
	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2163
	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1724
	  # Link against this shared library
2164
	    # We need to hardcode the library path
-
 
2165
	    if test -n "$shlibpath_var"; then
-
 
2166
	      # Make sure the rpath contains only unique directories.
-
 
2167
	      case "$temp_rpath " in
-
 
2168
	      *" $dir "*) ;;
-
 
2169
	      *" $absdir "*) ;;
-
 
2170
	      *) temp_rpath="$temp_rpath $dir" ;;
-
 
2171
	      esac
-
 
2172
	    fi
1725
 
2173
 
1726
	  if test "$linkmode,$pass" = "prog,link" ||
-
 
1727
	   { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
-
 
1728
	    # Hardcode the library path.
2174
	    # Hardcode the library path.
1729
	    # Skip directories that are in the system default run-time
2175
	    # Skip directories that are in the system default run-time
1730
	    # search path.
2176
	    # search path.
1731
	    case " $sys_lib_dlsearch_path " in
2177
	    case " $sys_lib_dlsearch_path " in
1732
	    *" $absdir "*) ;;
2178
	    *" $absdir "*) ;;
Line 1744... Line 2190...
1744
	      *" $libdir "*) ;;
2190
	      *" $libdir "*) ;;
1745
	      *) finalize_rpath="$finalize_rpath $libdir"
2191
	      *) finalize_rpath="$finalize_rpath $libdir"
1746
	      esac
2192
	      esac
1747
	      ;;
2193
	      ;;
1748
	    esac
2194
	    esac
1749
	    if test $linkmode = prog; then
-
 
1750
	      # We need to hardcode the library path
-
 
1751
	      if test -n "$shlibpath_var"; then
-
 
1752
		# Make sure the rpath contains only unique directories.
-
 
1753
		case "$temp_rpath " in
-
 
1754
		*" $dir "*) ;;
-
 
1755
		*" $absdir "*) ;;
-
 
1756
		*) temp_rpath="$temp_rpath $dir" ;;
-
 
1757
		esac
-
 
1758
	      fi
-
 
1759
	    fi
-
 
1760
	  fi # $linkmode,$pass = prog,link...
2195
	  fi # $linkmode,$pass = prog,link...
1761
 
2196
 
1762
	  if test "$alldeplibs" = yes &&
2197
	  if test "$alldeplibs" = yes &&
1763
	     { test "$deplibs_check_method" = pass_all ||
2198
	     { test "$deplibs_check_method" = pass_all ||
1764
	       { test "$build_libtool_libs" = yes &&
2199
	       { test "$build_libtool_libs" = yes &&
1765
		 test -n "$library_names"; }; }; then
2200
		 test -n "$library_names"; }; }; then
1766
	    # We only need to search for static libraries
2201
	    # We only need to search for static libraries
1767
	    continue
2202
	    continue
1768
	  fi
2203
	  fi
-
 
2204
	fi
1769
 
2205
 
-
 
2206
	link_static=no # Whether the deplib will be linked statically
-
 
2207
	if test -n "$library_names" &&
-
 
2208
	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1770
	  if test "$installed" = no; then
2209
	  if test "$installed" = no; then
1771
	    notinst_deplibs="$notinst_deplibs $lib"
2210
	    notinst_deplibs="$notinst_deplibs $lib"
1772
	    need_relink=yes
2211
	    need_relink=yes
1773
	  fi
2212
	  fi
-
 
2213
	  # This is a shared library
-
 
2214
	
-
 
2215
      # Warn about portability, can't link against -module's on some systems (darwin)
-
 
2216
      if test "$shouldnotlink" = yes && test "$pass" = link ; then
-
 
2217
	    $echo
-
 
2218
	    if test "$linkmode" = prog; then
-
 
2219
	      $echo "*** Warning: Linking the executable $output against the loadable module"
-
 
2220
	    else
-
 
2221
	      $echo "*** Warning: Linking the shared library $output against the loadable module"
-
 
2222
	    fi
-
 
2223
	    $echo "*** $linklib is not portable!"    
-
 
2224
      fi	  
-
 
2225
	  if test "$linkmode" = lib &&
-
 
2226
	     test "$hardcode_into_libs" = yes; then
-
 
2227
	    # Hardcode the library path.
-
 
2228
	    # Skip directories that are in the system default run-time
-
 
2229
	    # search path.
-
 
2230
	    case " $sys_lib_dlsearch_path " in
-
 
2231
	    *" $absdir "*) ;;
-
 
2232
	    *)
-
 
2233
	      case "$compile_rpath " in
-
 
2234
	      *" $absdir "*) ;;
-
 
2235
	      *) compile_rpath="$compile_rpath $absdir"
-
 
2236
	      esac
-
 
2237
	      ;;
-
 
2238
	    esac
-
 
2239
	    case " $sys_lib_dlsearch_path " in
-
 
2240
	    *" $libdir "*) ;;
-
 
2241
	    *)
-
 
2242
	      case "$finalize_rpath " in
-
 
2243
	      *" $libdir "*) ;;
-
 
2244
	      *) finalize_rpath="$finalize_rpath $libdir"
-
 
2245
	      esac
-
 
2246
	      ;;
-
 
2247
	    esac
-
 
2248
	  fi
1774
 
2249
 
1775
	  if test -n "$old_archive_from_expsyms_cmds"; then
2250
	  if test -n "$old_archive_from_expsyms_cmds"; then
1776
	    # figure out the soname
2251
	    # figure out the soname
1777
	    set dummy $library_names
2252
	    set dummy $library_names
1778
	    realname="$2"
2253
	    realname="$2"
Line 1782... Line 2257...
1782
	    if test -n "$dlname"; then
2257
	    if test -n "$dlname"; then
1783
	      soname="$dlname"
2258
	      soname="$dlname"
1784
	    elif test -n "$soname_spec"; then
2259
	    elif test -n "$soname_spec"; then
1785
	      # bleh windows
2260
	      # bleh windows
1786
	      case $host in
2261
	      case $host in
1787
	      *cygwin*)
2262
	      *cygwin* | mingw*)
1788
		major=`expr $current - $age`
2263
		major=`expr $current - $age`
1789
		versuffix="-$major"
2264
		versuffix="-$major"
1790
		;;
2265
		;;
1791
	      esac
2266
	      esac
1792
	      eval soname=\"$soname_spec\"
2267
	      eval soname=\"$soname_spec\"
Line 1794... Line 2269...
1794
	      soname="$realname"
2269
	      soname="$realname"
1795
	    fi
2270
	    fi
1796
 
2271
 
1797
	    # Make a new name for the extract_expsyms_cmds to use
2272
	    # Make a new name for the extract_expsyms_cmds to use
1798
	    soroot="$soname"
2273
	    soroot="$soname"
1799
	    soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2274
	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
1800
	    newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2275
	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
1801
 
2276
 
1802
	    # If the library has no export list, then create one now
2277
	    # If the library has no export list, then create one now
1803
	    if test -f "$output_objdir/$soname-def"; then :
2278
	    if test -f "$output_objdir/$soname-def"; then :
1804
	    else
2279
	    else
1805
	      $show "extracting exported symbol list from \`$soname'"
2280
	      $show "extracting exported symbol list from \`$soname'"
Line 1826... Line 2301...
1826
	      IFS="$save_ifs"
2301
	      IFS="$save_ifs"
1827
	    fi
2302
	    fi
1828
	    # make sure the library variables are pointing to the new library
2303
	    # make sure the library variables are pointing to the new library
1829
	    dir=$output_objdir
2304
	    dir=$output_objdir
1830
	    linklib=$newlib
2305
	    linklib=$newlib
1831
	  fi # test -n $old_archive_from_expsyms_cmds
2306
	  fi # test -n "$old_archive_from_expsyms_cmds"
1832
 
2307
 
1833
	  if test $linkmode = prog || test "$mode" != relink; then
2308
	  if test "$linkmode" = prog || test "$mode" != relink; then
1834
	    add_shlibpath=
2309
	    add_shlibpath=
1835
	    add_dir=
2310
	    add_dir=
1836
	    add=
2311
	    add=
1837
	    lib_linked=yes
2312
	    lib_linked=yes
1838
	    case $hardcode_action in
2313
	    case $hardcode_action in
1839
	    immediate | unsupported)
2314
	    immediate | unsupported)
1840
	      if test "$hardcode_direct" = no; then
2315
	      if test "$hardcode_direct" = no; then
1841
		add="$dir/$linklib"
2316
		add="$dir/$linklib"
-
 
2317
		case $host in
-
 
2318
		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
-
 
2319
		  *-*-darwin* )
-
 
2320
		    # if the lib is a module then we can not link against it, someone
-
 
2321
		    # is ignoring the new warnings I added
-
 
2322
		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
-
 
2323
		      $echo "** Warning, lib $linklib is a module, not a shared library"
-
 
2324
		      if test -z "$old_library" ; then
-
 
2325
		        $echo
-
 
2326
		        $echo "** And there doesn't seem to be a static archive available"
-
 
2327
		        $echo "** The link will probably fail, sorry"
-
 
2328
		      else
-
 
2329
		        add="$dir/$old_library"
-
 
2330
		      fi 
-
 
2331
		    fi
-
 
2332
		esac
1842
	      elif test "$hardcode_minus_L" = no; then
2333
	      elif test "$hardcode_minus_L" = no; then
1843
		case $host in
2334
		case $host in
1844
		*-*-sunos*) add_shlibpath="$dir" ;;
2335
		*-*-sunos*) add_shlibpath="$dir" ;;
1845
		esac
2336
		esac
1846
		add_dir="-L$dir"
2337
		add_dir="-L$dir"
Line 1858... Line 2349...
1858
	      elif test "$hardcode_minus_L" = yes; then
2349
	      elif test "$hardcode_minus_L" = yes; then
1859
		add_dir="-L$dir"
2350
		add_dir="-L$dir"
1860
		# Try looking first in the location we're being installed to.
2351
		# Try looking first in the location we're being installed to.
1861
		if test -n "$inst_prefix_dir"; then
2352
		if test -n "$inst_prefix_dir"; then
1862
		  case "$libdir" in
2353
		  case "$libdir" in
1863
		  [\/]*)
2354
		    [\\/]*)
1864
		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
2355
		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
1865
		    ;;
2356
		      ;;
1866
		  esac
2357
		  esac
1867
		fi
2358
		fi
1868
		add="-l$name"
2359
		add="-l$name"
1869
	      elif test "$hardcode_shlibpath_var" = yes; then
2360
	      elif test "$hardcode_shlibpath_var" = yes; then
1870
		add_shlibpath="$dir"
2361
		add_shlibpath="$dir"
Line 1885... Line 2376...
1885
	      case :$compile_shlibpath: in
2376
	      case :$compile_shlibpath: in
1886
	      *":$add_shlibpath:"*) ;;
2377
	      *":$add_shlibpath:"*) ;;
1887
	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2378
	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1888
	      esac
2379
	      esac
1889
	    fi
2380
	    fi
1890
	    if test $linkmode = prog; then
2381
	    if test "$linkmode" = prog; then
1891
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2382
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1892
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
2383
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
1893
	    else
2384
	    else
1894
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
2385
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
1895
	      test -n "$add" && deplibs="$add $deplibs"
2386
	      test -n "$add" && deplibs="$add $deplibs"
Line 1902... Line 2393...
1902
		esac
2393
		esac
1903
	      fi
2394
	      fi
1904
	    fi
2395
	    fi
1905
	  fi
2396
	  fi
1906
 
2397
 
1907
	  if test $linkmode = prog || test "$mode" = relink; then
2398
	  if test "$linkmode" = prog || test "$mode" = relink; then
1908
	    add_shlibpath=
2399
	    add_shlibpath=
1909
	    add_dir=
2400
	    add_dir=
1910
	    add=
2401
	    add=
1911
	    # Finalize command for both is simple: just hardcode it.
2402
	    # Finalize command for both is simple: just hardcode it.
1912
	    if test "$hardcode_direct" = yes; then
2403
	    if test "$hardcode_direct" = yes; then
Line 1918... Line 2409...
1918
	      case :$finalize_shlibpath: in
2409
	      case :$finalize_shlibpath: in
1919
	      *":$libdir:"*) ;;
2410
	      *":$libdir:"*) ;;
1920
	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2411
	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1921
	      esac
2412
	      esac
1922
	      add="-l$name"
2413
	      add="-l$name"
-
 
2414
	    elif test "$hardcode_automatic" = yes; then
-
 
2415
	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
-
 
2416
	        add="$inst_prefix_dir$libdir/$linklib"
-
 
2417
	      else
-
 
2418
	        add="$libdir/$linklib"
-
 
2419
	      fi
1923
	    else
2420
	    else
1924
	      # We cannot seem to hardcode it, guess we'll fake it.
2421
	      # We cannot seem to hardcode it, guess we'll fake it.
1925
	      add_dir="-L$libdir"
2422
	      add_dir="-L$libdir"
1926
	      # Try looking first in the location we're being installed to.
2423
	      # Try looking first in the location we're being installed to.
1927
	      if test -n "$inst_prefix_dir"; then
2424
	      if test -n "$inst_prefix_dir"; then
1928
		case "$libdir" in
2425
		case "$libdir" in
1929
		[\/]*)
2426
		  [\\/]*)
1930
		  add_dir="-L$inst_prefix_dir$libdir $add_dir"
2427
		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
1931
		  ;;
2428
		    ;;
1932
		esac
2429
		esac
1933
	      fi
2430
	      fi
1934
	      add="-l$name"
2431
	      add="-l$name"
1935
	    fi
2432
	    fi
1936
 
2433
 
1937
	    if test $linkmode = prog; then
2434
	    if test "$linkmode" = prog; then
1938
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2435
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1939
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2436
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1940
	    else
2437
	    else
1941
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
2438
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
1942
	      test -n "$add" && deplibs="$add $deplibs"
2439
	      test -n "$add" && deplibs="$add $deplibs"
1943
	    fi
2440
	    fi
1944
	  fi
2441
	  fi
1945
	elif test $linkmode = prog; then
2442
	elif test "$linkmode" = prog; then
1946
	  if test "$alldeplibs" = yes &&
-
 
1947
	     { test "$deplibs_check_method" = pass_all ||
-
 
1948
	       { test "$build_libtool_libs" = yes &&
-
 
1949
		 test -n "$library_names"; }; }; then
-
 
1950
	    # We only need to search for static libraries
-
 
1951
	    continue
-
 
1952
	  fi
-
 
1953
 
-
 
1954
	  # Try to link the static library
-
 
1955
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
2443
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
1956
	  # is not unsupported.  This is valid on all known static and
2444
	  # is not unsupported.  This is valid on all known static and
1957
	  # shared platforms.
2445
	  # shared platforms.
1958
	  if test "$hardcode_direct" != unsupported; then
2446
	  if test "$hardcode_direct" != unsupported; then
1959
	    test -n "$old_library" && linklib="$old_library"
2447
	    test -n "$old_library" && linklib="$old_library"
Line 1969... Line 2457...
1969
	    # We're trying link a shared library against a static one
2457
	    # We're trying link a shared library against a static one
1970
	    # but the system doesn't support it.
2458
	    # but the system doesn't support it.
1971
 
2459
 
1972
	    # Just print a warning and add the library to dependency_libs so
2460
	    # Just print a warning and add the library to dependency_libs so
1973
	    # that the program can be linked against the static library.
2461
	    # that the program can be linked against the static library.
1974
	    echo
2462
	    $echo
1975
	    echo "*** Warning: This system can not link to static lib archive $lib."
2463
	    $echo "*** Warning: This system can not link to static lib archive $lib."
1976
	    echo "*** I have the capability to make that library automatically link in when"
2464
	    $echo "*** I have the capability to make that library automatically link in when"
1977
	    echo "*** you link to this library.  But I can only do this if you have a"
2465
	    $echo "*** you link to this library.  But I can only do this if you have a"
1978
	    echo "*** shared version of the library, which you do not appear to have."
2466
	    $echo "*** shared version of the library, which you do not appear to have."
1979
	    if test "$module" = yes; then
2467
	    if test "$module" = yes; then
1980
	      echo "*** But as you try to build a module library, libtool will still create "
2468
	      $echo "*** But as you try to build a module library, libtool will still create "
1981
	      echo "*** a static module, that should work as long as the dlopening application"
2469
	      $echo "*** a static module, that should work as long as the dlopening application"
1982
	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2470
	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1983
	      if test -z "$global_symbol_pipe"; then
2471
	      if test -z "$global_symbol_pipe"; then
1984
		echo
2472
		$echo
1985
		echo "*** However, this would only work if libtool was able to extract symbol"
2473
		$echo "*** However, this would only work if libtool was able to extract symbol"
1986
		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2474
		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1987
		echo "*** not find such a program.  So, this module is probably useless."
2475
		$echo "*** not find such a program.  So, this module is probably useless."
1988
		echo "*** \`nm' from GNU binutils and a full rebuild may help."
2476
		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
1989
	      fi
2477
	      fi
1990
	      if test "$build_old_libs" = no; then
2478
	      if test "$build_old_libs" = no; then
1991
		build_libtool_libs=module
2479
		build_libtool_libs=module
1992
		build_old_libs=yes
2480
		build_old_libs=yes
1993
	      else
2481
	      else
Line 2000... Line 2488...
2000
	    deplibs="$dir/$old_library $deplibs"
2488
	    deplibs="$dir/$old_library $deplibs"
2001
	    link_static=yes
2489
	    link_static=yes
2002
	  fi
2490
	  fi
2003
	fi # link shared/static library?
2491
	fi # link shared/static library?
2004
 
2492
 
2005
	if test $linkmode = lib; then
2493
	if test "$linkmode" = lib; then
2006
	  if test -n "$dependency_libs" &&
2494
	  if test -n "$dependency_libs" &&
2007
	     { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2495
	     { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2008
	       test $link_static = yes; }; then
2496
	       test "$link_static" = yes; }; then
2009
	    # Extract -R from dependency_libs
2497
	    # Extract -R from dependency_libs
2010
	    temp_deplibs=
2498
	    temp_deplibs=
2011
	    for libdir in $dependency_libs; do
2499
	    for libdir in $dependency_libs; do
2012
	      case $libdir in
2500
	      case $libdir in
2013
	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2501
	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
Line 2034... Line 2522...
2034
	      esac
2522
	      esac
2035
	    fi
2523
	    fi
2036
	    tmp_libs="$tmp_libs $deplib"
2524
	    tmp_libs="$tmp_libs $deplib"
2037
	  done
2525
	  done
2038
 
2526
 
2039
	  if test $link_all_deplibs != no; then
2527
	  if test "$link_all_deplibs" != no; then
2040
	    # Add the search paths of all dependency libraries
2528
	    # Add the search paths of all dependency libraries
2041
	    for deplib in $dependency_libs; do
2529
	    for deplib in $dependency_libs; do
2042
	      case $deplib in
2530
	      case $deplib in
2043
	      -L*) path="$deplib" ;;
2531
	      -L*) path="$deplib" ;;
2044
	      *.la)
2532
	      *.la)
Line 2054... Line 2542...
2054
		    absdir="$dir"
2542
		    absdir="$dir"
2055
		  fi
2543
		  fi
2056
		  ;;
2544
		  ;;
2057
		esac
2545
		esac
2058
		if grep "^installed=no" $deplib > /dev/null; then
2546
		if grep "^installed=no" $deplib > /dev/null; then
2059
		  path="-L$absdir/$objdir"
2547
		  path="$absdir/$objdir"
2060
		else
2548
		else
2061
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2549
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2062
		  if test -z "$libdir"; then
2550
		  if test -z "$libdir"; then
2063
		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2551
		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2064
		    exit 1
2552
		    exit 1
2065
		  fi
2553
		  fi
2066
		  if test "$absdir" != "$libdir"; then
2554
		  if test "$absdir" != "$libdir"; then
2067
		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2555
		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2068
		  fi
2556
		  fi
2069
		  path="-L$absdir"
2557
		  path="$absdir"
2070
		fi
2558
		fi
-
 
2559
		depdepl=
-
 
2560
		case $host in
-
 
2561
		*-*-darwin*)
-
 
2562
		  # we do not want to link against static libs, but need to link against shared
-
 
2563
		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-
 
2564
		  if test -n "$deplibrary_names" ; then
-
 
2565
		    for tmp in $deplibrary_names ; do
-
 
2566
		      depdepl=$tmp
-
 
2567
		    done
-
 
2568
		    if test -f "$path/$depdepl" ; then
-
 
2569
		      depdepl="$path/$depdepl"
-
 
2570
		   fi
-
 
2571
		    newlib_search_path="$newlib_search_path $path"
-
 
2572
		    path=""
-
 
2573
		  fi
-
 
2574
		  ;;
-
 
2575
		*)
-
 
2576
		path="-L$path"
-
 
2577
		;;
-
 
2578
		esac 
-
 
2579
		
-
 
2580
		;;
-
 
2581
		  -l*)
-
 
2582
		case $host in
-
 
2583
		*-*-darwin*)
-
 
2584
		 # Again, we only want to link against shared libraries
-
 
2585
		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-
 
2586
		 for tmp in $newlib_search_path ; do
-
 
2587
		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
-
 
2588
		       eval depdepl="$tmp/lib$tmp_libs.dylib"
-
 
2589
		       break
-
 
2590
		     fi  
-
 
2591
         done
-
 
2592
         path=""
-
 
2593
		  ;;
-
 
2594
		*) continue ;;
-
 
2595
		esac  		  
2071
		;;
2596
		;;
2072
	      *) continue ;;
2597
	      *) continue ;;
2073
	      esac
2598
	      esac
2074
	      case " $deplibs " in
2599
	      case " $deplibs " in
-
 
2600
	      *" $depdepl "*) ;;
-
 
2601
	      *) deplibs="$deplibs $depdepl" ;;
-
 
2602
	      esac	      
-
 
2603
	      case " $deplibs " in
2075
	      *" $path "*) ;;
2604
	      *" $path "*) ;;
2076
	      *) deplibs="$deplibs $path" ;;
2605
	      *) deplibs="$deplibs $path" ;;
2077
	      esac
2606
	      esac
2078
	    done
2607
	    done
2079
	  fi # link_all_deplibs != no
2608
	  fi # link_all_deplibs != no
2080
	fi # linkmode = lib
2609
	fi # linkmode = lib
2081
      done # for deplib in $libs
2610
      done # for deplib in $libs
-
 
2611
      dependency_libs="$newdependency_libs"
2082
      if test $pass = dlpreopen; then
2612
      if test "$pass" = dlpreopen; then
2083
	# Link the dlpreopened libraries before other libraries
2613
	# Link the dlpreopened libraries before other libraries
2084
	for deplib in $save_deplibs; do
2614
	for deplib in $save_deplibs; do
2085
	  deplibs="$deplib $deplibs"
2615
	  deplibs="$deplib $deplibs"
2086
	done
2616
	done
2087
      fi
2617
      fi
2088
      if test $pass != dlopen; then
2618
      if test "$pass" != dlopen; then
2089
	test $pass != scan && dependency_libs="$newdependency_libs"
-
 
2090
	if test $pass != conv; then
2619
	if test "$pass" != conv; then
2091
	  # Make sure lib_search_path contains only unique directories.
2620
	  # Make sure lib_search_path contains only unique directories.
2092
	  lib_search_path=
2621
	  lib_search_path=
2093
	  for dir in $newlib_search_path; do
2622
	  for dir in $newlib_search_path; do
2094
	    case "$lib_search_path " in
2623
	    case "$lib_search_path " in
2095
	    *" $dir "*) ;;
2624
	    *" $dir "*) ;;
Line 2107... Line 2636...
2107
	for var in $vars dependency_libs; do
2636
	for var in $vars dependency_libs; do
2108
	  # Add libraries to $var in reverse order
2637
	  # Add libraries to $var in reverse order
2109
	  eval tmp_libs=\"\$$var\"
2638
	  eval tmp_libs=\"\$$var\"
2110
	  new_libs=
2639
	  new_libs=
2111
	  for deplib in $tmp_libs; do
2640
	  for deplib in $tmp_libs; do
-
 
2641
	    # FIXME: Pedantically, this is the right thing to do, so
-
 
2642
	    #        that some nasty dependency loop isn't accidentally
-
 
2643
	    #        broken:
-
 
2644
	    #new_libs="$deplib $new_libs"
-
 
2645
	    # Pragmatically, this seems to cause very few problems in
-
 
2646
	    # practice:
2112
	    case $deplib in
2647
	    case $deplib in
2113
	    -L*) new_libs="$deplib $new_libs" ;;
2648
	    -L*) new_libs="$deplib $new_libs" ;;
-
 
2649
	    -R*) ;;
2114
	    *)
2650
	    *)
-
 
2651
	      # And here is the reason: when a library appears more
-
 
2652
	      # than once as an explicit dependence of a library, or
-
 
2653
	      # is implicitly linked in more than once by the
-
 
2654
	      # compiler, it is considered special, and multiple
-
 
2655
	      # occurrences thereof are not removed.  Compare this
-
 
2656
	      # with having the same library being listed as a
-
 
2657
	      # dependency of multiple other libraries: in this case,
-
 
2658
	      # we know (pedantically, we assume) the library does not
-
 
2659
	      # need to be listed more than once, so we keep only the
-
 
2660
	      # last copy.  This is not always right, but it is rare
-
 
2661
	      # enough that we require users that really mean to play
-
 
2662
	      # such unportable linking tricks to link the library
-
 
2663
	      # using -Wl,-lname, so that libtool does not consider it
-
 
2664
	      # for duplicate removal.
2115
	      case " $specialdeplibs " in
2665
	      case " $specialdeplibs " in
2116
	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
2666
	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
2117
	      *)
2667
	      *)
2118
		case " $new_libs " in
2668
		case " $new_libs " in
2119
		*" $deplib "*) ;;
2669
		*" $deplib "*) ;;
Line 2137... Line 2687...
2137
	    esac
2687
	    esac
2138
	  done
2688
	  done
2139
	  eval $var=\"$tmp_libs\"
2689
	  eval $var=\"$tmp_libs\"
2140
	done # for var
2690
	done # for var
2141
      fi
2691
      fi
-
 
2692
      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
-
 
2693
      tmp_libs=
2142
      if test "$pass" = "conv" &&
2694
      for i in $dependency_libs ; do
2143
       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2695
	case " $predeps $postdeps $compiler_lib_search_path " in
-
 
2696
	*" $i "*)
-
 
2697
	  i=""
-
 
2698
	  ;;
-
 
2699
	esac
-
 
2700
	if test -n "$i" ; then
2144
	libs="$deplibs" # reset libs
2701
	  tmp_libs="$tmp_libs $i"
2145
	deplibs=
2702
	fi
2146
      fi
2703
      done
-
 
2704
      dependency_libs=$tmp_libs
2147
    done # for pass
2705
    done # for pass
2148
    if test $linkmode = prog; then
2706
    if test "$linkmode" = prog; then
2149
      dlfiles="$newdlfiles"
2707
      dlfiles="$newdlfiles"
2150
      dlprefiles="$newdlprefiles"
2708
      dlprefiles="$newdlprefiles"
2151
    fi
2709
    fi
2152
 
2710
 
2153
    case $linkmode in
2711
    case $linkmode in
2154
    oldlib)
2712
    oldlib)
-
 
2713
      if test -n "$deplibs"; then
-
 
2714
	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
-
 
2715
      fi
-
 
2716
 
2155
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2717
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2156
	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2718
	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2157
      fi
2719
      fi
2158
 
2720
 
2159
      if test -n "$rpath"; then
2721
      if test -n "$rpath"; then
Line 2163... Line 2725...
2163
      if test -n "$xrpath"; then
2725
      if test -n "$xrpath"; then
2164
	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2726
	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2165
      fi
2727
      fi
2166
 
2728
 
2167
      if test -n "$vinfo"; then
2729
      if test -n "$vinfo"; then
2168
	$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2730
	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2169
      fi
2731
      fi
2170
 
2732
 
2171
      if test -n "$release"; then
2733
      if test -n "$release"; then
2172
	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2734
	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2173
      fi
2735
      fi
Line 2185... Line 2747...
2185
    lib)
2747
    lib)
2186
      # Make sure we only generate libraries of the form `libNAME.la'.
2748
      # Make sure we only generate libraries of the form `libNAME.la'.
2187
      case $outputname in
2749
      case $outputname in
2188
      lib*)
2750
      lib*)
2189
	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2751
	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
 
2752
	eval shared_ext=\"$shrext\"
2190
	eval libname=\"$libname_spec\"
2753
	eval libname=\"$libname_spec\"
2191
	;;
2754
	;;
2192
      *)
2755
      *)
2193
	if test "$module" = no; then
2756
	if test "$module" = no; then
2194
	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2757
	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
Line 2196... Line 2759...
2196
	  exit 1
2759
	  exit 1
2197
	fi
2760
	fi
2198
	if test "$need_lib_prefix" != no; then
2761
	if test "$need_lib_prefix" != no; then
2199
	  # Add the "lib" prefix for modules if required
2762
	  # Add the "lib" prefix for modules if required
2200
	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2763
	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-
 
2764
	  eval shared_ext=\"$shrext\"
2201
	  eval libname=\"$libname_spec\"
2765
	  eval libname=\"$libname_spec\"
2202
	else
2766
	else
2203
	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2767
	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2204
	fi
2768
	fi
2205
	;;
2769
	;;
Line 2208... Line 2772...
2208
      if test -n "$objs"; then
2772
      if test -n "$objs"; then
2209
	if test "$deplibs_check_method" != pass_all; then
2773
	if test "$deplibs_check_method" != pass_all; then
2210
	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2774
	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2211
	  exit 1
2775
	  exit 1
2212
	else
2776
	else
2213
	  echo
2777
	  $echo
2214
	  echo "*** Warning: Linking the shared library $output against the non-libtool"
2778
	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
2215
	  echo "*** objects $objs is not portable!"
2779
	  $echo "*** objects $objs is not portable!"
2216
	  libobjs="$libobjs $objs"
2780
	  libobjs="$libobjs $objs"
2217
	fi
2781
	fi
2218
      fi
2782
      fi
2219
 
2783
 
2220
      if test "$dlself" != no; then
2784
      if test "$dlself" != no; then
2221
	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2785
	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2222
      fi
2786
      fi
2223
 
2787
 
2224
      set dummy $rpath
2788
      set dummy $rpath
2225
      if test $# -gt 2; then
2789
      if test "$#" -gt 2; then
2226
	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2790
	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2227
      fi
2791
      fi
2228
      install_libdir="$2"
2792
      install_libdir="$2"
2229
 
2793
 
2230
      oldlibs=
2794
      oldlibs=
2231
      if test -z "$rpath"; then
2795
      if test -z "$rpath"; then
2232
	if test "$build_libtool_libs" = yes; then
2796
	if test "$build_libtool_libs" = yes; then
2233
	  # Building a libtool convenience library.
2797
	  # Building a libtool convenience library.
-
 
2798
	  # Some compilers have problems with a `.al' extension so
-
 
2799
	  # convenience libraries should have the same extension an
2234
	  libext=al
2800
	  # archive normally would.
2235
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
2801
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
2236
	  build_libtool_libs=convenience
2802
	  build_libtool_libs=convenience
2237
	  build_old_libs=yes
2803
	  build_old_libs=yes
2238
	fi
2804
	fi
2239
 
2805
 
2240
	if test -n "$vinfo"; then
2806
	if test -n "$vinfo"; then
2241
	  $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2807
	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2242
	fi
2808
	fi
2243
 
2809
 
2244
	if test -n "$release"; then
2810
	if test -n "$release"; then
2245
	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2811
	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2246
	fi
2812
	fi
Line 2255... Line 2821...
2255
	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
2821
	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
2256
	  $echo "$help" 1>&2
2822
	  $echo "$help" 1>&2
2257
	  exit 1
2823
	  exit 1
2258
	fi
2824
	fi
2259
 
2825
 
-
 
2826
	# convert absolute version numbers to libtool ages
-
 
2827
	# this retains compatibility with .la files and attempts
-
 
2828
	# to make the code below a bit more comprehensible
-
 
2829
	
-
 
2830
	case $vinfo_number in
-
 
2831
	yes)
-
 
2832
	  number_major="$2"
-
 
2833
	  number_minor="$3"
-
 
2834
	  number_revision="$4"
-
 
2835
	  #
-
 
2836
	  # There are really only two kinds -- those that
-
 
2837
	  # use the current revision as the major version
-
 
2838
	  # and those that subtract age and use age as
-
 
2839
	  # a minor version.  But, then there is irix
-
 
2840
	  # which has an extra 1 added just for fun
-
 
2841
	  #
-
 
2842
	  case $version_type in
-
 
2843
	  darwin|linux|osf|windows)
-
 
2844
	    current=`expr $number_major + $number_minor`
-
 
2845
	    age="$number_minor"
-
 
2846
	    revision="$number_revision"
-
 
2847
	    ;;
-
 
2848
	  freebsd-aout|freebsd-elf|sunos)
-
 
2849
	    current="$number_major"
-
 
2850
	    revision="$number_minor"
-
 
2851
	    age="0"
-
 
2852
	    ;;
-
 
2853
	  irix|nonstopux)
-
 
2854
	    current=`expr $number_major + $number_minor - 1`
-
 
2855
	    age="$number_minor"
-
 
2856
	    revision="$number_minor"
-
 
2857
	    ;;
-
 
2858
	  esac
-
 
2859
	  ;;
-
 
2860
	no)
2260
	current="$2"
2861
	  current="$2"
2261
	revision="$3"
2862
	  revision="$3"
2262
	age="$4"
2863
	  age="$4"
-
 
2864
	  ;;
-
 
2865
	esac
2263
 
2866
 
2264
	# Check that each of the things are valid numbers.
2867
	# Check that each of the things are valid numbers.
2265
	case $current in
2868
	case $current in
2266
	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2869
	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2267
	*)
2870
	*)
Line 2287... Line 2890...
2287
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2890
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2288
	  exit 1
2891
	  exit 1
2289
	  ;;
2892
	  ;;
2290
	esac
2893
	esac
2291
 
2894
 
2292
	if test $age -gt $current; then
2895
	if test "$age" -gt "$current"; then
2293
	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2896
	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2294
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2897
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2295
	  exit 1
2898
	  exit 1
2296
	fi
2899
	fi
2297
 
2900
 
Line 2331... Line 2934...
2331
	  esac
2934
	  esac
2332
	  verstring="$verstring_prefix$major.$revision"
2935
	  verstring="$verstring_prefix$major.$revision"
2333
 
2936
 
2334
	  # Add in all the interfaces that we are compatible with.
2937
	  # Add in all the interfaces that we are compatible with.
2335
	  loop=$revision
2938
	  loop=$revision
2336
	  while test $loop != 0; do
2939
	  while test "$loop" -ne 0; do
2337
	    iface=`expr $revision - $loop`
2940
	    iface=`expr $revision - $loop`
2338
	    loop=`expr $loop - 1`
2941
	    loop=`expr $loop - 1`
2339
	    verstring="$verstring_prefix$major.$iface:$verstring"
2942
	    verstring="$verstring_prefix$major.$iface:$verstring"
2340
	  done
2943
	  done
2341
 
2944
 
Line 2354... Line 2957...
2354
	  versuffix=".$current.$age.$revision"
2957
	  versuffix=".$current.$age.$revision"
2355
	  verstring="$current.$age.$revision"
2958
	  verstring="$current.$age.$revision"
2356
 
2959
 
2357
	  # Add in all the interfaces that we are compatible with.
2960
	  # Add in all the interfaces that we are compatible with.
2358
	  loop=$age
2961
	  loop=$age
2359
	  while test $loop != 0; do
2962
	  while test "$loop" -ne 0; do
2360
	    iface=`expr $current - $loop`
2963
	    iface=`expr $current - $loop`
2361
	    loop=`expr $loop - 1`
2964
	    loop=`expr $loop - 1`
2362
	    verstring="$verstring:${iface}.0"
2965
	    verstring="$verstring:${iface}.0"
2363
	  done
2966
	  done
2364
 
2967
 
Line 2378... Line 2981...
2378
	  versuffix="-$major"
2981
	  versuffix="-$major"
2379
	  ;;
2982
	  ;;
2380
 
2983
 
2381
	*)
2984
	*)
2382
	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
2985
	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
2383
	  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2986
	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2384
	  exit 1
2987
	  exit 1
2385
	  ;;
2988
	  ;;
2386
	esac
2989
	esac
2387
 
2990
 
2388
	# Clear the version info if we defaulted, and they specified a release.
2991
	# Clear the version info if we defaulted, and they specified a release.
2389
	if test -z "$vinfo" && test -n "$release"; then
2992
	if test -z "$vinfo" && test -n "$release"; then
2390
	  major=
2993
	  major=
2391
	  verstring="0.0"
-
 
2392
	  case $version_type in
2994
	  case $version_type in
2393
	  darwin)
2995
	  darwin)
2394
	    # we can't check for "0.0" in archive_cmds due to quoting
2996
	    # we can't check for "0.0" in archive_cmds due to quoting
2395
	    # problems, so we reset it completely
2997
	    # problems, so we reset it completely
2396
	    verstring=""
2998
	    verstring=
2397
	    ;;
2999
	    ;;
2398
	  *)
3000
	  *)
2399
	    verstring="0.0"
3001
	    verstring="0.0"
2400
	    ;;
3002
	    ;;
2401
	  esac
3003
	  esac
Line 2425... Line 3027...
2425
	  allow_undefined_flag="$no_undefined_flag"
3027
	  allow_undefined_flag="$no_undefined_flag"
2426
	fi
3028
	fi
2427
      fi
3029
      fi
2428
 
3030
 
2429
      if test "$mode" != relink; then
3031
      if test "$mode" != relink; then
-
 
3032
	# Remove our outputs, but don't remove object files since they
-
 
3033
	# may have been created when compiling PIC objects.
2430
	# Remove our outputs.
3034
	removelist=
2431
	$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
3035
	tempremovelist=`$echo "$output_objdir/*"`
-
 
3036
	for p in $tempremovelist; do
-
 
3037
	  case $p in
-
 
3038
	    *.$objext)
-
 
3039
	       ;;
2432
	$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
3040
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-
 
3041
	       removelist="$removelist $p"
-
 
3042
	       ;;
-
 
3043
	    *) ;;
-
 
3044
	  esac
-
 
3045
	done
-
 
3046
	if test -n "$removelist"; then
-
 
3047
	  $show "${rm}r $removelist"
-
 
3048
	  $run ${rm}r $removelist
-
 
3049
	fi
2433
      fi
3050
      fi
2434
 
3051
 
2435
      # Now set the variables for building old libraries.
3052
      # Now set the variables for building old libraries.
2436
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3053
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2437
	oldlibs="$oldlibs $output_objdir/$libname.$libext"
3054
	oldlibs="$oldlibs $output_objdir/$libname.$libext"
Line 2440... Line 3057...
2440
	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3057
	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2441
      fi
3058
      fi
2442
 
3059
 
2443
      # Eliminate all temporary directories.
3060
      # Eliminate all temporary directories.
2444
      for path in $notinst_path; do
3061
      for path in $notinst_path; do
2445
	lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3062
	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2446
	deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3063
	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2447
	dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3064
	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2448
      done
3065
      done
2449
 
3066
 
2450
      if test -n "$xrpath"; then
3067
      if test -n "$xrpath"; then
2451
	# If the user specified any rpath flags, then add them.
3068
	# If the user specified any rpath flags, then add them.
2452
	temp_xrpath=
3069
	temp_xrpath=
Line 2455... Line 3072...
2455
	  case "$finalize_rpath " in
3072
	  case "$finalize_rpath " in
2456
	  *" $libdir "*) ;;
3073
	  *" $libdir "*) ;;
2457
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
3074
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
2458
	  esac
3075
	  esac
2459
	done
3076
	done
2460
	if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
3077
	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2461
	  dependency_libs="$temp_xrpath $dependency_libs"
3078
	  dependency_libs="$temp_xrpath $dependency_libs"
2462
	fi
3079
	fi
2463
      fi
3080
      fi
2464
 
3081
 
2465
      # Make sure dlfiles contains only unique files that won't be dlpreopened
3082
      # Make sure dlfiles contains only unique files that won't be dlpreopened
Line 2495... Line 3112...
2495
	  *-*-netbsd*)
3112
	  *-*-netbsd*)
2496
	    # Don't link with libc until the a.out ld.so is fixed.
3113
	    # Don't link with libc until the a.out ld.so is fixed.
2497
	    ;;
3114
	    ;;
2498
	  *-*-openbsd* | *-*-freebsd*)
3115
	  *-*-openbsd* | *-*-freebsd*)
2499
	    # Do not include libc due to us having libc/libc_r.
3116
	    # Do not include libc due to us having libc/libc_r.
-
 
3117
	    test "X$arg" = "X-lc" && continue
2500
	    ;;
3118
	    ;;
2501
	  *)
3119
 	  *)
2502
	    # Add libc to deplibs on all other systems if necessary.
3120
	    # Add libc to deplibs on all other systems if necessary.
2503
	    if test $build_libtool_need_lc = "yes"; then
3121
	    if test "$build_libtool_need_lc" = "yes"; then
2504
	      deplibs="$deplibs -lc"
3122
	      deplibs="$deplibs -lc"
2505
	    fi
3123
	    fi
2506
	    ;;
3124
	    ;;
2507
	  esac
3125
	  esac
2508
	fi
3126
	fi
Line 2525... Line 3143...
2525
	pass_all)
3143
	pass_all)
2526
	  # Don't check for shared/static.  Everything works.
3144
	  # Don't check for shared/static.  Everything works.
2527
	  # This might be a little naive.  We might want to check
3145
	  # This might be a little naive.  We might want to check
2528
	  # whether the library exists or not.  But this is on
3146
	  # whether the library exists or not.  But this is on
2529
	  # osf3 & osf4 and I'm not really sure... Just
3147
	  # osf3 & osf4 and I'm not really sure... Just
2530
	  # implementing what was already the behaviour.
3148
	  # implementing what was already the behavior.
2531
	  newdeplibs=$deplibs
3149
	  newdeplibs=$deplibs
2532
	  ;;
3150
	  ;;
2533
	test_compile)
3151
	test_compile)
2534
	  # This code stresses the "libraries are programs" paradigm to its
3152
	  # This code stresses the "libraries are programs" paradigm to its
2535
	  # limits. Maybe even breaks it.  We compile a program, linking it
3153
	  # limits. Maybe even breaks it.  We compile a program, linking it
Line 2538... Line 3156...
2538
	  $rm conftest.c
3156
	  $rm conftest.c
2539
	  cat > conftest.c <<EOF
3157
	  cat > conftest.c <<EOF
2540
	  int main() { return 0; }
3158
	  int main() { return 0; }
2541
EOF
3159
EOF
2542
	  $rm conftest
3160
	  $rm conftest
2543
	  $CC -o conftest conftest.c $deplibs
3161
	  $LTCC -o conftest conftest.c $deplibs
2544
	  if test $? -eq 0 ; then
3162
	  if test "$?" -eq 0 ; then
2545
	    ldd_output=`ldd conftest`
3163
	    ldd_output=`ldd conftest`
2546
	    for i in $deplibs; do
3164
	    for i in $deplibs; do
2547
	      name="`expr $i : '-l\(.*\)'`"
3165
	      name="`expr $i : '-l\(.*\)'`"
2548
	      # If $name is empty we are operating on a -L argument.
3166
	      # If $name is empty we are operating on a -L argument.
2549
	      if test -n "$name" && test "$name" != "0"; then
3167
              if test "$name" != "" && test "$name" -ne "0"; then
-
 
3168
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
3169
		  case " $predeps $postdeps " in
-
 
3170
		  *" $i "*)
-
 
3171
		    newdeplibs="$newdeplibs $i"
-
 
3172
		    i=""
-
 
3173
		    ;;
-
 
3174
		  esac
-
 
3175
	        fi
-
 
3176
		if test -n "$i" ; then
2550
		libname=`eval \\$echo \"$libname_spec\"`
3177
		  libname=`eval \\$echo \"$libname_spec\"`
2551
		deplib_matches=`eval \\$echo \"$library_names_spec\"`
3178
		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
2552
		set dummy $deplib_matches
3179
		  set dummy $deplib_matches
2553
		deplib_match=$2
3180
		  deplib_match=$2
2554
		if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3181
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2555
		  newdeplibs="$newdeplibs $i"
3182
		    newdeplibs="$newdeplibs $i"
2556
		else
3183
		  else
2557
		  droppeddeps=yes
3184
		    droppeddeps=yes
2558
		  echo
3185
		    $echo
2559
		  echo "*** Warning: dynamic linker does not accept needed library $i."
3186
		    $echo "*** Warning: dynamic linker does not accept needed library $i."
2560
		  echo "*** I have the capability to make that library automatically link in when"
3187
		    $echo "*** I have the capability to make that library automatically link in when"
2561
		  echo "*** you link to this library.  But I can only do this if you have a"
3188
		    $echo "*** you link to this library.  But I can only do this if you have a"
2562
		  echo "*** shared version of the library, which I believe you do not have"
3189
		    $echo "*** shared version of the library, which I believe you do not have"
2563
		  echo "*** because a test_compile did reveal that the linker did not use it for"
3190
		    $echo "*** because a test_compile did reveal that the linker did not use it for"
2564
		  echo "*** its dynamic dependency list that programs get resolved with at runtime."
3191
		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
-
 
3192
		  fi
2565
		fi
3193
		fi
2566
	      else
3194
	      else
2567
		newdeplibs="$newdeplibs $i"
3195
		newdeplibs="$newdeplibs $i"
2568
	      fi
3196
	      fi
2569
	    done
3197
	    done
2570
	  else
3198
	  else
2571
	    # Error occured in the first compile.  Let's try to salvage
3199
	    # Error occurred in the first compile.  Let's try to salvage
2572
	    # the situation: Compile a separate program for each library.
3200
	    # the situation: Compile a separate program for each library.
2573
	    for i in $deplibs; do
3201
	    for i in $deplibs; do
2574
	      name="`expr $i : '-l\(.*\)'`"
3202
	      name="`expr $i : '-l\(.*\)'`"
2575
	     # If $name is empty we are operating on a -L argument.
3203
	      # If $name is empty we are operating on a -L argument.
2576
	      if test -n "$name" && test "$name" != "0"; then
3204
              if test "$name" != "" && test "$name" != "0"; then
2577
		$rm conftest
3205
		$rm conftest
2578
		$CC -o conftest conftest.c $i
3206
		$LTCC -o conftest conftest.c $i
2579
		# Did it work?
3207
		# Did it work?
2580
		if test $? -eq 0 ; then
3208
		if test "$?" -eq 0 ; then
2581
		  ldd_output=`ldd conftest`
3209
		  ldd_output=`ldd conftest`
-
 
3210
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
3211
		    case " $predeps $postdeps " in
-
 
3212
		    *" $i "*)
-
 
3213
		      newdeplibs="$newdeplibs $i"
-
 
3214
		      i=""
-
 
3215
		      ;;
-
 
3216
		    esac
-
 
3217
		  fi
-
 
3218
		  if test -n "$i" ; then
2582
		  libname=`eval \\$echo \"$libname_spec\"`
3219
		    libname=`eval \\$echo \"$libname_spec\"`
2583
		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
3220
		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
2584
		  set dummy $deplib_matches
3221
		    set dummy $deplib_matches
2585
		  deplib_match=$2
3222
		    deplib_match=$2
2586
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3223
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2587
		    newdeplibs="$newdeplibs $i"
3224
		      newdeplibs="$newdeplibs $i"
2588
		  else
3225
		    else
2589
		    droppeddeps=yes
3226
		      droppeddeps=yes
2590
		    echo
3227
		      $echo
2591
		    echo "*** Warning: dynamic linker does not accept needed library $i."
3228
		      $echo "*** Warning: dynamic linker does not accept needed library $i."
2592
		    echo "*** I have the capability to make that library automatically link in when"
3229
		      $echo "*** I have the capability to make that library automatically link in when"
2593
		    echo "*** you link to this library.  But I can only do this if you have a"
3230
		      $echo "*** you link to this library.  But I can only do this if you have a"
2594
		    echo "*** shared version of the library, which you do not appear to have"
3231
		      $echo "*** shared version of the library, which you do not appear to have"
2595
		    echo "*** because a test_compile did reveal that the linker did not use this one"
3232
		      $echo "*** because a test_compile did reveal that the linker did not use this one"
2596
		    echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3233
		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-
 
3234
		    fi
2597
		  fi
3235
		  fi
2598
		else
3236
		else
2599
		  droppeddeps=yes
3237
		  droppeddeps=yes
2600
		  echo
3238
		  $echo
2601
		  echo "*** Warning!  Library $i is needed by this library but I was not able to"
3239
		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
2602
		  echo "***  make it link in!  You will probably need to install it or some"
3240
		  $echo "***  make it link in!  You will probably need to install it or some"
2603
		  echo "*** library that it depends on before this library will be fully"
3241
		  $echo "*** library that it depends on before this library will be fully"
2604
		  echo "*** functional.  Installing it before continuing would be even better."
3242
		  $echo "*** functional.  Installing it before continuing would be even better."
2605
		fi
3243
		fi
2606
	      else
3244
	      else
2607
		newdeplibs="$newdeplibs $i"
3245
		newdeplibs="$newdeplibs $i"
2608
	      fi
3246
	      fi
2609
	    done
3247
	    done
Line 2613... Line 3251...
2613
	  set dummy $deplibs_check_method
3251
	  set dummy $deplibs_check_method
2614
	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3252
	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2615
	  for a_deplib in $deplibs; do
3253
	  for a_deplib in $deplibs; do
2616
	    name="`expr $a_deplib : '-l\(.*\)'`"
3254
	    name="`expr $a_deplib : '-l\(.*\)'`"
2617
	    # If $name is empty we are operating on a -L argument.
3255
	    # If $name is empty we are operating on a -L argument.
2618
	    if test -n "$name" && test "$name" != "0"; then
3256
            if test "$name" != "" && test  "$name" != "0"; then
-
 
3257
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
3258
		case " $predeps $postdeps " in
-
 
3259
		*" $a_deplib "*)
-
 
3260
		  newdeplibs="$newdeplibs $a_deplib"
-
 
3261
		  a_deplib=""
-
 
3262
		  ;;
-
 
3263
		esac
-
 
3264
	      fi
-
 
3265
	      if test -n "$a_deplib" ; then
2619
	      libname=`eval \\$echo \"$libname_spec\"`
3266
		libname=`eval \\$echo \"$libname_spec\"`
2620
	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3267
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2621
		    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3268
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2622
		    for potent_lib in $potential_libs; do
3269
		  for potent_lib in $potential_libs; do
2623
		      # Follow soft links.
3270
		      # Follow soft links.
2624
		      if ls -lLd "$potent_lib" 2>/dev/null \
3271
		      if ls -lLd "$potent_lib" 2>/dev/null \
2625
			 | grep " -> " >/dev/null; then
3272
			 | grep " -> " >/dev/null; then
2626
			continue
3273
			continue
2627
		      fi
3274
		      fi
Line 2638... Line 3285...
2638
			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3285
			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2639
			esac
3286
			esac
2640
		      done
3287
		      done
2641
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3288
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2642
			 | ${SED} 10q \
3289
			 | ${SED} 10q \
2643
			 | egrep "$file_magic_regex" > /dev/null; then
3290
			 | $EGREP "$file_magic_regex" > /dev/null; then
2644
			newdeplibs="$newdeplibs $a_deplib"
3291
			newdeplibs="$newdeplibs $a_deplib"
2645
			a_deplib=""
3292
			a_deplib=""
2646
			break 2
3293
			break 2
2647
		      fi
3294
		      fi
2648
		    done
3295
		  done
-
 
3296
		done
2649
	      done
3297
	      fi
2650
	      if test -n "$a_deplib" ; then
3298
	      if test -n "$a_deplib" ; then
2651
		droppeddeps=yes
3299
		droppeddeps=yes
2652
		echo
3300
		$echo
2653
		echo "*** Warning: linker path does not have real file for library $a_deplib."
3301
		$echo "*** Warning: linker path does not have real file for library $a_deplib."
2654
		echo "*** I have the capability to make that library automatically link in when"
3302
		$echo "*** I have the capability to make that library automatically link in when"
2655
		echo "*** you link to this library.  But I can only do this if you have a"
3303
		$echo "*** you link to this library.  But I can only do this if you have a"
2656
		echo "*** shared version of the library, which you do not appear to have"
3304
		$echo "*** shared version of the library, which you do not appear to have"
2657
		echo "*** because I did check the linker path looking for a file starting"
3305
		$echo "*** because I did check the linker path looking for a file starting"
2658
		if test -z "$potlib" ; then
3306
		if test -z "$potlib" ; then
2659
		  echo "*** with $libname but no candidates were found. (...for file magic test)"
3307
		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
2660
		else
3308
		else
2661
		  echo "*** with $libname and none of the candidates passed a file format test"
3309
		  $echo "*** with $libname and none of the candidates passed a file format test"
2662
		  echo "*** using a file magic. Last file checked: $potlib"
3310
		  $echo "*** using a file magic. Last file checked: $potlib"
2663
		fi
3311
		fi
2664
	      fi
3312
	      fi
2665
	    else
3313
	    else
2666
	      # Add a -L argument.
3314
	      # Add a -L argument.
2667
	      newdeplibs="$newdeplibs $a_deplib"
3315
	      newdeplibs="$newdeplibs $a_deplib"
Line 2673... Line 3321...
2673
	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3321
	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2674
	  for a_deplib in $deplibs; do
3322
	  for a_deplib in $deplibs; do
2675
	    name="`expr $a_deplib : '-l\(.*\)'`"
3323
	    name="`expr $a_deplib : '-l\(.*\)'`"
2676
	    # If $name is empty we are operating on a -L argument.
3324
	    # If $name is empty we are operating on a -L argument.
2677
	    if test -n "$name" && test "$name" != "0"; then
3325
	    if test -n "$name" && test "$name" != "0"; then
-
 
3326
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
3327
		case " $predeps $postdeps " in
-
 
3328
		*" $a_deplib "*)
-
 
3329
		  newdeplibs="$newdeplibs $a_deplib"
-
 
3330
		  a_deplib=""
-
 
3331
		  ;;
-
 
3332
		esac
-
 
3333
	      fi
-
 
3334
	      if test -n "$a_deplib" ; then
2678
	      libname=`eval \\$echo \"$libname_spec\"`
3335
		libname=`eval \\$echo \"$libname_spec\"`
2679
	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3336
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2680
		potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3337
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2681
		for potent_lib in $potential_libs; do
3338
		  for potent_lib in $potential_libs; do
2682
		  potlib="$potent_lib" # see symlink-check below in file_magic test
3339
		    potlib="$potent_lib" # see symlink-check above in file_magic test
2683
		  if eval echo \"$potent_lib\" 2>/dev/null \
3340
		    if eval $echo \"$potent_lib\" 2>/dev/null \
2684
		      | ${SED} 10q \
3341
		        | ${SED} 10q \
2685
		      | egrep "$match_pattern_regex" > /dev/null; then
3342
		        | $EGREP "$match_pattern_regex" > /dev/null; then
2686
		    newdeplibs="$newdeplibs $a_deplib"
3343
		      newdeplibs="$newdeplibs $a_deplib"
2687
		    a_deplib=""
3344
		      a_deplib=""
2688
		    break 2
3345
		      break 2
2689
		  fi
3346
		    fi
-
 
3347
		  done
2690
		done
3348
		done
2691
	      done
3349
	      fi
2692
	      if test -n "$a_deplib" ; then
3350
	      if test -n "$a_deplib" ; then
2693
		droppeddeps=yes
3351
		droppeddeps=yes
2694
		echo
3352
		$echo
2695
		echo "*** Warning: linker path does not have real file for library $a_deplib."
3353
		$echo "*** Warning: linker path does not have real file for library $a_deplib."
2696
		echo "*** I have the capability to make that library automatically link in when"
3354
		$echo "*** I have the capability to make that library automatically link in when"
2697
		echo "*** you link to this library.  But I can only do this if you have a"
3355
		$echo "*** you link to this library.  But I can only do this if you have a"
2698
		echo "*** shared version of the library, which you do not appear to have"
3356
		$echo "*** shared version of the library, which you do not appear to have"
2699
		echo "*** because I did check the linker path looking for a file starting"
3357
		$echo "*** because I did check the linker path looking for a file starting"
2700
		if test -z "$potlib" ; then
3358
		if test -z "$potlib" ; then
2701
		  echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3359
		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2702
		else
3360
		else
2703
		  echo "*** with $libname and none of the candidates passed a file format test"
3361
		  $echo "*** with $libname and none of the candidates passed a file format test"
2704
		  echo "*** using a regex pattern. Last file checked: $potlib"
3362
		  $echo "*** using a regex pattern. Last file checked: $potlib"
2705
		fi
3363
		fi
2706
	      fi
3364
	      fi
2707
	    else
3365
	    else
2708
	      # Add a -L argument.
3366
	      # Add a -L argument.
2709
	      newdeplibs="$newdeplibs $a_deplib"
3367
	      newdeplibs="$newdeplibs $a_deplib"
2710
	    fi
3368
	    fi
2711
	  done # Gone through all deplibs.
3369
	  done # Gone through all deplibs.
2712
	  ;;
3370
	  ;;
2713
	none | unknown | *)
3371
	none | unknown | *)
2714
	  newdeplibs=""
3372
	  newdeplibs=""
2715
	  if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3373
	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2716
	       -e 's/ -[LR][^ ]*//g' -e 's/[ 	]//g' |
3374
	    -e 's/ -[LR][^ ]*//g'`
-
 
3375
	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-
 
3376
	    for i in $predeps $postdeps ; do
-
 
3377
	      # can't use Xsed below, because $i might contain '/'
-
 
3378
	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
-
 
3379
	    done
-
 
3380
	  fi
-
 
3381
	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
2717
	     grep . >/dev/null; then
3382
	    | grep . >/dev/null; then
2718
	    echo
3383
	    $echo
2719
	    if test "X$deplibs_check_method" = "Xnone"; then
3384
	    if test "X$deplibs_check_method" = "Xnone"; then
2720
	      echo "*** Warning: inter-library dependencies are not supported in this platform."
3385
	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
2721
	    else
3386
	    else
2722
	      echo "*** Warning: inter-library dependencies are not known to be supported."
3387
	      $echo "*** Warning: inter-library dependencies are not known to be supported."
2723
	    fi
3388
	    fi
2724
	    echo "*** All declared inter-library dependencies are being dropped."
3389
	    $echo "*** All declared inter-library dependencies are being dropped."
2725
	    droppeddeps=yes
3390
	    droppeddeps=yes
2726
	  fi
3391
	  fi
2727
	  ;;
3392
	  ;;
2728
	esac
3393
	esac
2729
	versuffix=$versuffix_save
3394
	versuffix=$versuffix_save
Line 2739... Line 3404...
2739
	  ;;
3404
	  ;;
2740
	esac
3405
	esac
2741
 
3406
 
2742
	if test "$droppeddeps" = yes; then
3407
	if test "$droppeddeps" = yes; then
2743
	  if test "$module" = yes; then
3408
	  if test "$module" = yes; then
2744
	    echo
3409
	    $echo
2745
	    echo "*** Warning: libtool could not satisfy all declared inter-library"
3410
	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
2746
	    echo "*** dependencies of module $libname.  Therefore, libtool will create"
3411
	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
2747
	    echo "*** a static module, that should work as long as the dlopening"
3412
	    $echo "*** a static module, that should work as long as the dlopening"
2748
	    echo "*** application is linked with the -dlopen flag."
3413
	    $echo "*** application is linked with the -dlopen flag."
2749
	    if test -z "$global_symbol_pipe"; then
3414
	    if test -z "$global_symbol_pipe"; then
2750
	      echo
3415
	      $echo
2751
	      echo "*** However, this would only work if libtool was able to extract symbol"
3416
	      $echo "*** However, this would only work if libtool was able to extract symbol"
2752
	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3417
	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2753
	      echo "*** not find such a program.  So, this module is probably useless."
3418
	      $echo "*** not find such a program.  So, this module is probably useless."
2754
	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
3419
	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2755
	    fi
3420
	    fi
2756
	    if test "$build_old_libs" = no; then
3421
	    if test "$build_old_libs" = no; then
2757
	      oldlibs="$output_objdir/$libname.$libext"
3422
	      oldlibs="$output_objdir/$libname.$libext"
2758
	      build_libtool_libs=module
3423
	      build_libtool_libs=module
2759
	      build_old_libs=yes
3424
	      build_old_libs=yes
2760
	    else
3425
	    else
2761
	      build_libtool_libs=no
3426
	      build_libtool_libs=no
2762
	    fi
3427
	    fi
2763
	  else
3428
	  else
2764
	    echo "*** The inter-library dependencies that have been dropped here will be"
3429
	    $echo "*** The inter-library dependencies that have been dropped here will be"
2765
	    echo "*** automatically added whenever a program is linked with this library"
3430
	    $echo "*** automatically added whenever a program is linked with this library"
2766
	    echo "*** or is declared to -dlopen it."
3431
	    $echo "*** or is declared to -dlopen it."
2767
 
3432
 
2768
	    if test $allow_undefined = no; then
3433
	    if test "$allow_undefined" = no; then
2769
	      echo
3434
	      $echo
2770
	      echo "*** Since this library must not contain undefined symbols,"
3435
	      $echo "*** Since this library must not contain undefined symbols,"
2771
	      echo "*** because either the platform does not support them or"
3436
	      $echo "*** because either the platform does not support them or"
2772
	      echo "*** it was explicitly requested with -no-undefined,"
3437
	      $echo "*** it was explicitly requested with -no-undefined,"
2773
	      echo "*** libtool will only create a static version of it."
3438
	      $echo "*** libtool will only create a static version of it."
2774
	      if test "$build_old_libs" = no; then
3439
	      if test "$build_old_libs" = no; then
2775
		oldlibs="$output_objdir/$libname.$libext"
3440
		oldlibs="$output_objdir/$libname.$libext"
2776
		build_libtool_libs=module
3441
		build_libtool_libs=module
2777
		build_old_libs=yes
3442
		build_old_libs=yes
2778
	      else
3443
	      else
Line 2790... Line 3455...
2790
      old_library=
3455
      old_library=
2791
      dlname=
3456
      dlname=
2792
 
3457
 
2793
      # Test again, we may have decided not to build it any more
3458
      # Test again, we may have decided not to build it any more
2794
      if test "$build_libtool_libs" = yes; then
3459
      if test "$build_libtool_libs" = yes; then
2795
	if test $hardcode_into_libs = yes; then
3460
	if test "$hardcode_into_libs" = yes; then
2796
	  # Hardcode the library paths
3461
	  # Hardcode the library paths
2797
	  hardcode_libdirs=
3462
	  hardcode_libdirs=
2798
	  dep_rpath=
3463
	  dep_rpath=
2799
	  rpath="$finalize_rpath"
3464
	  rpath="$finalize_rpath"
2800
	  test "$mode" != relink && rpath="$compile_rpath$rpath"
3465
	  test "$mode" != relink && rpath="$compile_rpath$rpath"
Line 2826... Line 3491...
2826
	  done
3491
	  done
2827
	  # Substitute the hardcoded libdirs into the rpath.
3492
	  # Substitute the hardcoded libdirs into the rpath.
2828
	  if test -n "$hardcode_libdir_separator" &&
3493
	  if test -n "$hardcode_libdir_separator" &&
2829
	     test -n "$hardcode_libdirs"; then
3494
	     test -n "$hardcode_libdirs"; then
2830
	    libdir="$hardcode_libdirs"
3495
	    libdir="$hardcode_libdirs"
-
 
3496
	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-
 
3497
	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-
 
3498
	    else
2831
	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3499
	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-
 
3500
	    fi
2832
	  fi
3501
	  fi
2833
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
3502
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
2834
	    # We should set the runpath_var.
3503
	    # We should set the runpath_var.
2835
	    rpath=
3504
	    rpath=
2836
	    for dir in $perm_rpath; do
3505
	    for dir in $perm_rpath; do
Line 2846... Line 3515...
2846
	if test -n "$shlibpath"; then
3515
	if test -n "$shlibpath"; then
2847
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3516
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2848
	fi
3517
	fi
2849
 
3518
 
2850
	# Get the real and link names of the library.
3519
	# Get the real and link names of the library.
-
 
3520
	eval shared_ext=\"$shrext\"
2851
	eval library_names=\"$library_names_spec\"
3521
	eval library_names=\"$library_names_spec\"
2852
	set dummy $library_names
3522
	set dummy $library_names
2853
	realname="$2"
3523
	realname="$2"
2854
	shift; shift
3524
	shift; shift
2855
 
3525
 
2856
	if test -n "$soname_spec"; then
3526
	if test -n "$soname_spec"; then
2857
	  eval soname=\"$soname_spec\"
3527
	  eval soname=\"$soname_spec\"
2858
	else
3528
	else
2859
	  soname="$realname"
3529
	  soname="$realname"
2860
	fi
3530
	fi
2861
	test -z "$dlname" && dlname=$soname
3531
	if test -z "$dlname"; then
-
 
3532
	  dlname=$soname
-
 
3533
	fi
2862
 
3534
 
2863
	lib="$output_objdir/$realname"
3535
	lib="$output_objdir/$realname"
2864
	for link
3536
	for link
2865
	do
3537
	do
2866
	  linknames="$linknames $link"
3538
	  linknames="$linknames $link"
2867
	done
3539
	done
2868
 
3540
 
2869
	# Ensure that we have .o objects for linkers which dislike .lo
-
 
2870
	# (e.g. aix) in case we are running --disable-static
-
 
2871
	for obj in $libobjs; do
-
 
2872
	  xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-
 
2873
	  if test "X$xdir" = "X$obj"; then
-
 
2874
	    xdir="."
-
 
2875
	  else
-
 
2876
	    xdir="$xdir"
-
 
2877
	  fi
-
 
2878
	  baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-
 
2879
	  oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
-
 
2880
	  if test ! -f $xdir/$oldobj; then
-
 
2881
	    $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
-
 
2882
	    $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
-
 
2883
	  fi
-
 
2884
	done
-
 
2885
 
-
 
2886
	# Use standard objects if they are pic
3541
	# Use standard objects if they are pic
2887
	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3542
	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2888
 
3543
 
2889
	# Prepare the list of exported symbols
3544
	# Prepare the list of exported symbols
2890
	if test -z "$export_symbols"; then
3545
	if test -z "$export_symbols"; then
Line 2894... Line 3549...
2894
	    $run $rm $export_symbols
3549
	    $run $rm $export_symbols
2895
	    eval cmds=\"$export_symbols_cmds\"
3550
	    eval cmds=\"$export_symbols_cmds\"
2896
	    save_ifs="$IFS"; IFS='~'
3551
	    save_ifs="$IFS"; IFS='~'
2897
	    for cmd in $cmds; do
3552
	    for cmd in $cmds; do
2898
	      IFS="$save_ifs"
3553
	      IFS="$save_ifs"
-
 
3554
	      if len=`expr "X$cmd" : ".*"` &&
-
 
3555
	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
2899
	      $show "$cmd"
3556
	        $show "$cmd"
2900
	      $run eval "$cmd" || exit $?
3557
	        $run eval "$cmd" || exit $?
-
 
3558
	        skipped_export=false
-
 
3559
	      else
-
 
3560
	        # The command line is too long to execute in one step.
-
 
3561
	        $show "using reloadable object file for export list..."
-
 
3562
	        skipped_export=:
-
 
3563
	      fi
2901
	    done
3564
	    done
2902
	    IFS="$save_ifs"
3565
	    IFS="$save_ifs"
2903
	    if test -n "$export_symbols_regex"; then
3566
	    if test -n "$export_symbols_regex"; then
2904
	      $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3567
	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2905
	      $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3568
	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2906
	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3569
	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2907
	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
3570
	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
2908
	    fi
3571
	    fi
2909
	  fi
3572
	  fi
2910
	fi
3573
	fi
2911
 
3574
 
2912
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
3575
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
2913
	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3576
	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2914
	fi
3577
	fi
2915
 
3578
 
-
 
3579
	tmp_deplibs=
-
 
3580
	for test_deplib in $deplibs; do
-
 
3581
		case " $convenience " in
-
 
3582
		*" $test_deplib "*) ;;
-
 
3583
		*) 
-
 
3584
			tmp_deplibs="$tmp_deplibs $test_deplib"
-
 
3585
			;;
-
 
3586
		esac
-
 
3587
	done
-
 
3588
	deplibs="$tmp_deplibs" 
-
 
3589
 
2916
	if test -n "$convenience"; then
3590
	if test -n "$convenience"; then
2917
	  if test -n "$whole_archive_flag_spec"; then
3591
	  if test -n "$whole_archive_flag_spec"; then
-
 
3592
	    save_libobjs=$libobjs
2918
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3593
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2919
	  else
3594
	  else
2920
	    gentop="$output_objdir/${outputname}x"
3595
	    gentop="$output_objdir/${outputname}x"
2921
	    $show "${rm}r $gentop"
3596
	    $show "${rm}r $gentop"
2922
	    $run ${rm}r "$gentop"
3597
	    $run ${rm}r "$gentop"
2923
	    $show "mkdir $gentop"
3598
	    $show "$mkdir $gentop"
2924
	    $run mkdir "$gentop"
3599
	    $run $mkdir "$gentop"
2925
	    status=$?
3600
	    status=$?
2926
	    if test $status -ne 0 && test ! -d "$gentop"; then
3601
	    if test "$status" -ne 0 && test ! -d "$gentop"; then
2927
	      exit $status
3602
	      exit $status
2928
	    fi
3603
	    fi
2929
	    generated="$generated $gentop"
3604
	    generated="$generated $gentop"
2930
 
3605
 
2931
	    for xlib in $convenience; do
3606
	    for xlib in $convenience; do
Line 2937... Line 3612...
2937
	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3612
	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2938
	      xdir="$gentop/$xlib"
3613
	      xdir="$gentop/$xlib"
2939
 
3614
 
2940
	      $show "${rm}r $xdir"
3615
	      $show "${rm}r $xdir"
2941
	      $run ${rm}r "$xdir"
3616
	      $run ${rm}r "$xdir"
2942
	      $show "mkdir $xdir"
3617
	      $show "$mkdir $xdir"
2943
	      $run mkdir "$xdir"
3618
	      $run $mkdir "$xdir"
2944
	      status=$?
3619
	      status=$?
2945
	      if test $status -ne 0 && test ! -d "$xdir"; then
3620
	      if test "$status" -ne 0 && test ! -d "$xdir"; then
2946
		exit $status
3621
		exit $status
2947
	      fi
3622
	      fi
-
 
3623
	      # We will extract separately just the conflicting names and we will no
-
 
3624
	      # longer touch any unique names. It is faster to leave these extract
-
 
3625
	      # automatically by $AR in one run.
2948
	      $show "(cd $xdir && $AR x $xabs)"
3626
	      $show "(cd $xdir && $AR x $xabs)"
2949
	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3627
	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
 
3628
	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-
 
3629
		:
-
 
3630
	      else
-
 
3631
		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-
 
3632
		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-
 
3633
		$AR t "$xabs" | sort | uniq -cd | while read -r count name
-
 
3634
		do
-
 
3635
		  i=1
-
 
3636
		  while test "$i" -le "$count"
-
 
3637
		  do
-
 
3638
		   # Put our $i before any first dot (extension)
-
 
3639
		   # Never overwrite any file
-
 
3640
		   name_to="$name"
-
 
3641
		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-
 
3642
		   do
-
 
3643
		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-
 
3644
		   done
-
 
3645
		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-
 
3646
		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-
 
3647
		   i=`expr $i + 1`
-
 
3648
		  done
-
 
3649
		done
-
 
3650
	      fi
2950
 
3651
 
2951
	      libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3652
	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2952
	    done
3653
	    done
2953
	  fi
3654
	  fi
2954
	fi
3655
	fi
2955
 
3656
 
2956
	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3657
	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
Line 2962... Line 3663...
2962
	if test "$mode" = relink; then
3663
	if test "$mode" = relink; then
2963
	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3664
	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2964
	fi
3665
	fi
2965
 
3666
 
2966
	# Do each of the archive commands.
3667
	# Do each of the archive commands.
-
 
3668
	if test "$module" = yes && test -n "$module_cmds" ; then
-
 
3669
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-
 
3670
	    eval cmds=\"$module_expsym_cmds\"
-
 
3671
	  else
-
 
3672
	    eval cmds=\"$module_cmds\"
-
 
3673
	  fi
-
 
3674
	else
2967
	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3675
	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2968
	  eval cmds=\"$archive_expsym_cmds\"
3676
	  eval cmds=\"$archive_expsym_cmds\"
2969
	else
3677
	else
-
 
3678
	  eval cmds=\"$archive_cmds\"
-
 
3679
	  fi
-
 
3680
	fi
-
 
3681
 
-
 
3682
	if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
-
 
3683
	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-
 
3684
	  :
-
 
3685
	else
-
 
3686
	  # The command line is too long to link in one step, link piecewise.
-
 
3687
	  $echo "creating reloadable object files..."
-
 
3688
 
-
 
3689
	  # Save the value of $output and $libobjs because we want to
-
 
3690
	  # use them later.  If we have whole_archive_flag_spec, we
-
 
3691
	  # want to use save_libobjs as it was before
-
 
3692
	  # whole_archive_flag_spec was expanded, because we can't
-
 
3693
	  # assume the linker understands whole_archive_flag_spec.
-
 
3694
	  # This may have to be revisited, in case too many
-
 
3695
	  # convenience libraries get linked in and end up exceeding
-
 
3696
	  # the spec.
-
 
3697
	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
2970
	  save_deplibs="$deplibs"
3698
	    save_libobjs=$libobjs
-
 
3699
	  fi
-
 
3700
	  save_output=$output
-
 
3701
 
-
 
3702
	  # Clear the reloadable object creation command queue and
-
 
3703
	  # initialize k to one.
-
 
3704
	  test_cmds=
-
 
3705
	  concat_cmds=
-
 
3706
	  objlist=
-
 
3707
	  delfiles=
-
 
3708
	  last_robj=
-
 
3709
	  k=1
-
 
3710
	  output=$output_objdir/$save_output-${k}.$objext
-
 
3711
	  # Loop over the list of objects to be linked.
2971
	  for conv in $convenience; do
3712
	  for obj in $save_libobjs
-
 
3713
	  do
-
 
3714
	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
-
 
3715
	    if test "X$objlist" = X ||
-
 
3716
	       { len=`expr "X$test_cmds" : ".*"` &&
-
 
3717
		 test "$len" -le "$max_cmd_len"; }; then
-
 
3718
	      objlist="$objlist $obj"
2972
	    tmp_deplibs=
3719
	    else
-
 
3720
	      # The command $test_cmds is almost too long, add a
2973
	    for test_deplib in $deplibs; do
3721
	      # command to the queue.
2974
	      if test "$test_deplib" != "$conv"; then
3722
	      if test "$k" -eq 1 ; then
-
 
3723
		# The first file doesn't have a previous command to add.
2975
		tmp_deplibs="$tmp_deplibs $test_deplib"
3724
		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-
 
3725
	      else
-
 
3726
		# All subsequent reloadable object files will link in
-
 
3727
		# the last one created.
-
 
3728
		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
2976
	      fi
3729
	      fi
-
 
3730
	      last_robj=$output_objdir/$save_output-${k}.$objext
-
 
3731
	      k=`expr $k + 1`
-
 
3732
	      output=$output_objdir/$save_output-${k}.$objext
-
 
3733
	      objlist=$obj
2977
	    done
3734
	      len=1
2978
	    deplibs="$tmp_deplibs"
3735
	    fi
2979
	  done
3736
	  done
-
 
3737
	  # Handle the remaining objects by creating one last
-
 
3738
	  # reloadable object file.  All subsequent reloadable object
-
 
3739
	  # files will link in the last one created.
-
 
3740
	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-
 
3741
	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
 
3742
 
-
 
3743
	  if ${skipped_export-false}; then
-
 
3744
	    $show "generating symbol list for \`$libname.la'"
-
 
3745
	    export_symbols="$output_objdir/$libname.exp"
-
 
3746
	    $run $rm $export_symbols
-
 
3747
	    libobjs=$output
-
 
3748
	    # Append the command to create the export file.
-
 
3749
	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
-
 
3750
          fi
-
 
3751
 
-
 
3752
	  # Set up a command to remove the reloadale object files
-
 
3753
	  # after they are used.
-
 
3754
	  i=0
-
 
3755
	  while test "$i" -lt "$k"
-
 
3756
	  do
-
 
3757
	    i=`expr $i + 1`
-
 
3758
	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
-
 
3759
	  done
-
 
3760
 
-
 
3761
	  $echo "creating a temporary reloadable object file: $output"
-
 
3762
 
-
 
3763
	  # Loop through the commands generated above and execute them.
-
 
3764
	  save_ifs="$IFS"; IFS='~'
-
 
3765
	  for cmd in $concat_cmds; do
-
 
3766
	    IFS="$save_ifs"
-
 
3767
	    $show "$cmd"
-
 
3768
	    $run eval "$cmd" || exit $?
-
 
3769
	  done
-
 
3770
	  IFS="$save_ifs"
-
 
3771
 
-
 
3772
	  libobjs=$output
-
 
3773
	  # Restore the value of output.
-
 
3774
	  output=$save_output
-
 
3775
 
-
 
3776
	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-
 
3777
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-
 
3778
	  fi
-
 
3779
	  # Expand the library linking commands again to reset the
-
 
3780
	  # value of $libobjs for piecewise linking.
-
 
3781
 
-
 
3782
	  # Do each of the archive commands.
-
 
3783
	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-
 
3784
	    eval cmds=\"$archive_expsym_cmds\"
-
 
3785
	  else
2980
	  eval cmds=\"$archive_cmds\"
3786
	    eval cmds=\"$archive_cmds\"
-
 
3787
	  fi
-
 
3788
 
-
 
3789
	  # Append the command to remove the reloadable object files
-
 
3790
	  # to the just-reset $cmds.
2981
	  deplibs="$save_deplibs"
3791
	  eval cmds=\"\$cmds~$rm $delfiles\"
2982
	fi
3792
	fi
2983
	save_ifs="$IFS"; IFS='~'
3793
	save_ifs="$IFS"; IFS='~'
2984
	for cmd in $cmds; do
3794
	for cmd in $cmds; do
2985
	  IFS="$save_ifs"
3795
	  IFS="$save_ifs"
2986
	  $show "$cmd"
3796
	  $show "$cmd"
Line 3068... Line 3878...
3068
	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3878
	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3069
	else
3879
	else
3070
	  gentop="$output_objdir/${obj}x"
3880
	  gentop="$output_objdir/${obj}x"
3071
	  $show "${rm}r $gentop"
3881
	  $show "${rm}r $gentop"
3072
	  $run ${rm}r "$gentop"
3882
	  $run ${rm}r "$gentop"
3073
	  $show "mkdir $gentop"
3883
	  $show "$mkdir $gentop"
3074
	  $run mkdir "$gentop"
3884
	  $run $mkdir "$gentop"
3075
	  status=$?
3885
	  status=$?
3076
	  if test $status -ne 0 && test ! -d "$gentop"; then
3886
	  if test "$status" -ne 0 && test ! -d "$gentop"; then
3077
	    exit $status
3887
	    exit $status
3078
	  fi
3888
	  fi
3079
	  generated="$generated $gentop"
3889
	  generated="$generated $gentop"
3080
 
3890
 
3081
	  for xlib in $convenience; do
3891
	  for xlib in $convenience; do
Line 3087... Line 3897...
3087
	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3897
	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3088
	    xdir="$gentop/$xlib"
3898
	    xdir="$gentop/$xlib"
3089
 
3899
 
3090
	    $show "${rm}r $xdir"
3900
	    $show "${rm}r $xdir"
3091
	    $run ${rm}r "$xdir"
3901
	    $run ${rm}r "$xdir"
3092
	    $show "mkdir $xdir"
3902
	    $show "$mkdir $xdir"
3093
	    $run mkdir "$xdir"
3903
	    $run $mkdir "$xdir"
3094
	    status=$?
3904
	    status=$?
3095
	    if test $status -ne 0 && test ! -d "$xdir"; then
3905
	    if test "$status" -ne 0 && test ! -d "$xdir"; then
3096
	      exit $status
3906
	      exit $status
3097
	    fi
3907
	    fi
-
 
3908
	    # We will extract separately just the conflicting names and we will no
-
 
3909
	    # longer touch any unique names. It is faster to leave these extract
-
 
3910
	    # automatically by $AR in one run.
3098
	    $show "(cd $xdir && $AR x $xabs)"
3911
	    $show "(cd $xdir && $AR x $xabs)"
3099
	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3912
	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
 
3913
	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-
 
3914
	      :
-
 
3915
	    else
-
 
3916
	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-
 
3917
	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-
 
3918
	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
-
 
3919
	      do
-
 
3920
		i=1
-
 
3921
		while test "$i" -le "$count"
-
 
3922
		do
-
 
3923
		 # Put our $i before any first dot (extension)
-
 
3924
		 # Never overwrite any file
-
 
3925
		 name_to="$name"
-
 
3926
		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-
 
3927
		 do
-
 
3928
		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-
 
3929
		 done
-
 
3930
		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-
 
3931
		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-
 
3932
		 i=`expr $i + 1`
-
 
3933
		done
-
 
3934
	      done
-
 
3935
	    fi
3100
 
3936
 
3101
	    reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3937
	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3102
	  done
3938
	  done
3103
	fi
3939
	fi
3104
      fi
3940
      fi
3105
 
3941
 
3106
      # Create the old-style object.
3942
      # Create the old-style object.
Line 3132... Line 3968...
3132
	  $run ${rm}r $gentop
3968
	  $run ${rm}r $gentop
3133
	fi
3969
	fi
3134
 
3970
 
3135
	# Create an invalid libtool object if no PIC, so that we don't
3971
	# Create an invalid libtool object if no PIC, so that we don't
3136
	# accidentally link it into a program.
3972
	# accidentally link it into a program.
3137
	$show "echo timestamp > $libobj"
3973
	# $show "echo timestamp > $libobj"
3138
	$run eval "echo timestamp > $libobj" || exit $?
3974
	# $run eval "echo timestamp > $libobj" || exit $?
3139
	exit 0
3975
	exit 0
3140
      fi
3976
      fi
3141
 
3977
 
3142
      if test -n "$pic_flag" || test "$pic_mode" != default; then
3978
      if test -n "$pic_flag" || test "$pic_mode" != default; then
3143
	# Only do commands if we really have different PIC objects.
3979
	# Only do commands if we really have different PIC objects.
Line 3149... Line 3985...
3149
	  IFS="$save_ifs"
3985
	  IFS="$save_ifs"
3150
	  $show "$cmd"
3986
	  $show "$cmd"
3151
	  $run eval "$cmd" || exit $?
3987
	  $run eval "$cmd" || exit $?
3152
	done
3988
	done
3153
	IFS="$save_ifs"
3989
	IFS="$save_ifs"
3154
      else
-
 
3155
	# Just create a symlink.
-
 
3156
	$show $rm $libobj
-
 
3157
	$run $rm $libobj
-
 
3158
	xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
-
 
3159
	if test "X$xdir" = "X$libobj"; then
-
 
3160
	  xdir="."
-
 
3161
	else
-
 
3162
	  xdir="$xdir"
-
 
3163
	fi
-
 
3164
	baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
-
 
3165
	oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
-
 
3166
	$show "(cd $xdir && $LN_S $oldobj $baseobj)"
-
 
3167
	$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
-
 
3168
      fi
3990
      fi
3169
 
3991
 
3170
      if test -n "$gentop"; then
3992
      if test -n "$gentop"; then
3171
	$show "${rm}r $gentop"
3993
	$show "${rm}r $gentop"
3172
	$run ${rm}r $gentop
3994
	$run ${rm}r $gentop
Line 3175... Line 3997...
3175
      exit 0
3997
      exit 0
3176
      ;;
3998
      ;;
3177
 
3999
 
3178
    prog)
4000
    prog)
3179
      case $host in
4001
      case $host in
3180
	*cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4002
	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3181
      esac
4003
      esac
3182
      if test -n "$vinfo"; then
4004
      if test -n "$vinfo"; then
3183
	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4005
	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3184
      fi
4006
      fi
3185
 
4007
 
Line 3197... Line 4019...
3197
      case $host in
4019
      case $host in
3198
      *-*-rhapsody* | *-*-darwin1.[012])
4020
      *-*-rhapsody* | *-*-darwin1.[012])
3199
	# On Rhapsody replace the C library is the System framework
4021
	# On Rhapsody replace the C library is the System framework
3200
	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4022
	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3201
	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4023
	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3202
	case $host in
-
 
3203
	*darwin*)
-
 
3204
	  # Don't allow lazy linking, it breaks C++ global constructors
-
 
3205
	  compile_command="$compile_command ${wl}-bind_at_load"
-
 
3206
	  finalize_command="$finalize_command ${wl}-bind_at_load"
-
 
3207
	  ;;
-
 
3208
	esac
-
 
3209
	;;
4024
	;;
3210
      esac
4025
      esac
3211
 
4026
 
-
 
4027
      case $host in
-
 
4028
      *darwin*)
-
 
4029
        # Don't allow lazy linking, it breaks C++ global constructors
-
 
4030
        if test "$tagname" = CXX ; then
-
 
4031
        compile_command="$compile_command ${wl}-bind_at_load"
-
 
4032
        finalize_command="$finalize_command ${wl}-bind_at_load"
-
 
4033
        fi
-
 
4034
        ;;
-
 
4035
      esac
-
 
4036
 
3212
      compile_command="$compile_command $compile_deplibs"
4037
      compile_command="$compile_command $compile_deplibs"
3213
      finalize_command="$finalize_command $finalize_deplibs"
4038
      finalize_command="$finalize_command $finalize_deplibs"
3214
 
4039
 
3215
      if test -n "$rpath$xrpath"; then
4040
      if test -n "$rpath$xrpath"; then
3216
	# If the user specified any rpath flags, then add them.
4041
	# If the user specified any rpath flags, then add them.
Line 3357... Line 4182...
3357
	      $show "extracting global C symbols from \`$arg'"
4182
	      $show "extracting global C symbols from \`$arg'"
3358
	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4183
	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3359
	    done
4184
	    done
3360
 
4185
 
3361
	    if test -n "$exclude_expsyms"; then
4186
	    if test -n "$exclude_expsyms"; then
3362
	      $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4187
	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3363
	      $run eval '$mv "$nlist"T "$nlist"'
4188
	      $run eval '$mv "$nlist"T "$nlist"'
3364
	    fi
4189
	    fi
3365
 
4190
 
3366
	    if test -n "$export_symbols_regex"; then
4191
	    if test -n "$export_symbols_regex"; then
3367
	      $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4192
	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3368
	      $run eval '$mv "$nlist"T "$nlist"'
4193
	      $run eval '$mv "$nlist"T "$nlist"'
3369
	    fi
4194
	    fi
3370
 
4195
 
3371
	    # Prepare the list of exported symbols
4196
	    # Prepare the list of exported symbols
3372
	    if test -z "$export_symbols"; then
4197
	    if test -z "$export_symbols"; then
Line 3380... Line 4205...
3380
	    fi
4205
	    fi
3381
	  fi
4206
	  fi
3382
 
4207
 
3383
	  for arg in $dlprefiles; do
4208
	  for arg in $dlprefiles; do
3384
	    $show "extracting global C symbols from \`$arg'"
4209
	    $show "extracting global C symbols from \`$arg'"
3385
	    name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
4210
	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
3386
	    $run eval 'echo ": $name " >> "$nlist"'
4211
	    $run eval '$echo ": $name " >> "$nlist"'
3387
	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4212
	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3388
	  done
4213
	  done
3389
 
4214
 
3390
	  if test -z "$run"; then
4215
	  if test -z "$run"; then
3391
	    # Make sure we have at least an empty file.
4216
	    # Make sure we have at least an empty file.
3392
	    test -f "$nlist" || : > "$nlist"
4217
	    test -f "$nlist" || : > "$nlist"
3393
 
4218
 
3394
	    if test -n "$exclude_expsyms"; then
4219
	    if test -n "$exclude_expsyms"; then
3395
	      egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4220
	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3396
	      $mv "$nlist"T "$nlist"
4221
	      $mv "$nlist"T "$nlist"
3397
	    fi
4222
	    fi
3398
 
4223
 
3399
	    # Try sorting and uniquifying the output.
4224
	    # Try sorting and uniquifying the output.
3400
	    if grep -v "^: " < "$nlist" |
4225
	    if grep -v "^: " < "$nlist" |
Line 3410... Line 4235...
3410
	    fi
4235
	    fi
3411
 
4236
 
3412
	    if test -f "$nlist"S; then
4237
	    if test -f "$nlist"S; then
3413
	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4238
	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3414
	    else
4239
	    else
3415
	      echo '/* NONE */' >> "$output_objdir/$dlsyms"
4240
	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
3416
	    fi
4241
	    fi
3417
 
4242
 
3418
	    $echo >> "$output_objdir/$dlsyms" "\
4243
	    $echo >> "$output_objdir/$dlsyms" "\
3419
 
4244
 
3420
#undef lt_preloaded_symbols
4245
#undef lt_preloaded_symbols
Line 3462... Line 4287...
3462
	  # pic_flag when linking with -static.  The problem exists in
4287
	  # pic_flag when linking with -static.  The problem exists in
3463
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4288
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3464
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4289
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3465
	    case "$compile_command " in
4290
	    case "$compile_command " in
3466
	    *" -static "*) ;;
4291
	    *" -static "*) ;;
3467
	    *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
4292
	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3468
	    esac;;
4293
	    esac;;
3469
	  *-*-hpux*)
4294
	  *-*-hpux*)
3470
	    case "$compile_command " in
4295
	    case "$compile_command " in
3471
	    *" -static "*) ;;
4296
	    *" -static "*) ;;
3472
	    *) pic_flag_for_symtable=" $pic_flag -DPIC";;
4297
	    *) pic_flag_for_symtable=" $pic_flag";;
3473
	    esac
4298
	    esac
3474
	  esac
4299
	  esac
3475
 
4300
 
3476
	  # Now compile the dynamic symbol file.
4301
	  # Now compile the dynamic symbol file.
3477
	  $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4302
	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3478
	  $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4303
	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3479
 
4304
 
3480
	  # Clean up the generated files.
4305
	  # Clean up the generated files.
3481
	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4306
	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3482
	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4307
	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3483
 
4308
 
Line 3498... Line 4323...
3498
	# Nullify the symbol file.
4323
	# Nullify the symbol file.
3499
	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4324
	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3500
	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4325
	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3501
      fi
4326
      fi
3502
 
4327
 
3503
      if test $need_relink = no || test "$build_libtool_libs" != yes; then
4328
      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3504
	# Replace the output file specification.
4329
	# Replace the output file specification.
3505
	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4330
	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3506
	link_command="$compile_command$compile_rpath"
4331
	link_command="$compile_command$compile_rpath"
3507
 
4332
 
3508
	# We have no uninstalled library dependencies, so finalize right now.
4333
	# We have no uninstalled library dependencies, so finalize right now.
Line 3643... Line 4468...
3643
      # Only actually do things if our run command is non-null.
4468
      # Only actually do things if our run command is non-null.
3644
      if test -z "$run"; then
4469
      if test -z "$run"; then
3645
	# win32 will think the script is a binary if it has
4470
	# win32 will think the script is a binary if it has
3646
	# a .exe suffix, so we strip it off here.
4471
	# a .exe suffix, so we strip it off here.
3647
	case $output in
4472
	case $output in
3648
	  *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4473
	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3649
	esac
4474
	esac
3650
	# test for cygwin because mv fails w/o .exe extensions
4475
	# test for cygwin because mv fails w/o .exe extensions
3651
	case $host in
4476
	case $host in
-
 
4477
	  *cygwin*)
3652
	  *cygwin*) exeext=.exe ;;
4478
	    exeext=.exe
-
 
4479
	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
3653
	  *) exeext= ;;
4480
	  *) exeext= ;;
3654
	esac
4481
	esac
-
 
4482
	case $host in
-
 
4483
	  *cygwin* | *mingw* )
-
 
4484
	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
-
 
4485
	    cwrapper=`$echo ${output}.exe`
-
 
4486
	    $rm $cwrappersource $cwrapper
-
 
4487
	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
-
 
4488
 
-
 
4489
	    cat > $cwrappersource <<EOF
-
 
4490
 
-
 
4491
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-
 
4492
   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
 
4493
 
-
 
4494
   The $output program cannot be directly executed until all the libtool
-
 
4495
   libraries that it depends on are installed.
-
 
4496
   
-
 
4497
   This wrapper executable should never be moved out of the build directory.
-
 
4498
   If it is, it will not operate correctly.
-
 
4499
 
-
 
4500
   Currently, it simply execs the wrapper *script* "/bin/sh $output",
-
 
4501
   but could eventually absorb all of the scripts functionality and
-
 
4502
   exec $objdir/$outputname directly.
-
 
4503
*/
-
 
4504
EOF
-
 
4505
	    cat >> $cwrappersource<<"EOF"
-
 
4506
#include <stdio.h>
-
 
4507
#include <stdlib.h>
-
 
4508
#include <unistd.h>
-
 
4509
#include <malloc.h>
-
 
4510
#include <stdarg.h>
-
 
4511
#include <assert.h>
-
 
4512
 
-
 
4513
#if defined(PATH_MAX)
-
 
4514
# define LT_PATHMAX PATH_MAX
-
 
4515
#elif defined(MAXPATHLEN)
-
 
4516
# define LT_PATHMAX MAXPATHLEN
-
 
4517
#else
-
 
4518
# define LT_PATHMAX 1024
-
 
4519
#endif
-
 
4520
 
-
 
4521
#ifndef DIR_SEPARATOR
-
 
4522
#define DIR_SEPARATOR '/'
-
 
4523
#endif
-
 
4524
 
-
 
4525
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-
 
4526
  defined (__OS2__)
-
 
4527
#define HAVE_DOS_BASED_FILE_SYSTEM
-
 
4528
#ifndef DIR_SEPARATOR_2 
-
 
4529
#define DIR_SEPARATOR_2 '\\'
-
 
4530
#endif
-
 
4531
#endif
-
 
4532
 
-
 
4533
#ifndef DIR_SEPARATOR_2
-
 
4534
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-
 
4535
#else /* DIR_SEPARATOR_2 */
-
 
4536
# define IS_DIR_SEPARATOR(ch) \
-
 
4537
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-
 
4538
#endif /* DIR_SEPARATOR_2 */
-
 
4539
 
-
 
4540
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-
 
4541
#define XFREE(stale) do { \
-
 
4542
  if (stale) { free ((void *) stale); stale = 0; } \
-
 
4543
} while (0)
-
 
4544
 
-
 
4545
const char *program_name = NULL;
-
 
4546
 
-
 
4547
void * xmalloc (size_t num);
-
 
4548
char * xstrdup (const char *string);
-
 
4549
char * basename (const char *name);
-
 
4550
char * fnqualify(const char *path);
-
 
4551
char * strendzap(char *str, const char *pat);
-
 
4552
void lt_fatal (const char *message, ...);
-
 
4553
 
-
 
4554
int
-
 
4555
main (int argc, char *argv[])
-
 
4556
{
-
 
4557
  char **newargz;
-
 
4558
  int i;
-
 
4559
  
-
 
4560
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
-
 
4561
  newargz = XMALLOC(char *, argc+2);
-
 
4562
EOF
-
 
4563
 
-
 
4564
	    cat >> $cwrappersource <<EOF
-
 
4565
  newargz[0] = "$SHELL";
-
 
4566
EOF
-
 
4567
 
-
 
4568
	    cat >> $cwrappersource <<"EOF"
-
 
4569
  newargz[1] = fnqualify(argv[0]);
-
 
4570
  /* we know the script has the same name, without the .exe */
-
 
4571
  /* so make sure newargz[1] doesn't end in .exe */
-
 
4572
  strendzap(newargz[1],".exe"); 
-
 
4573
  for (i = 1; i < argc; i++)
-
 
4574
    newargz[i+1] = xstrdup(argv[i]);
-
 
4575
  newargz[argc+1] = NULL;
-
 
4576
EOF
-
 
4577
 
-
 
4578
	    cat >> $cwrappersource <<EOF
-
 
4579
  execv("$SHELL",newargz);
-
 
4580
EOF
-
 
4581
 
-
 
4582
	    cat >> $cwrappersource <<"EOF"
-
 
4583
}
-
 
4584
 
-
 
4585
void *
-
 
4586
xmalloc (size_t num)
-
 
4587
{
-
 
4588
  void * p = (void *) malloc (num);
-
 
4589
  if (!p)
-
 
4590
    lt_fatal ("Memory exhausted");
-
 
4591
 
-
 
4592
  return p;
-
 
4593
}
-
 
4594
 
-
 
4595
char * 
-
 
4596
xstrdup (const char *string)
-
 
4597
{
-
 
4598
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-
 
4599
;
-
 
4600
}
-
 
4601
 
-
 
4602
char *
-
 
4603
basename (const char *name)
-
 
4604
{
-
 
4605
  const char *base;
-
 
4606
 
-
 
4607
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-
 
4608
  /* Skip over the disk name in MSDOS pathnames. */
-
 
4609
  if (isalpha (name[0]) && name[1] == ':') 
-
 
4610
    name += 2;
-
 
4611
#endif
-
 
4612
 
-
 
4613
  for (base = name; *name; name++)
-
 
4614
    if (IS_DIR_SEPARATOR (*name))
-
 
4615
      base = name + 1;
-
 
4616
  return (char *) base;
-
 
4617
}
-
 
4618
 
-
 
4619
char * 
-
 
4620
fnqualify(const char *path)
-
 
4621
{
-
 
4622
  size_t size;
-
 
4623
  char *p;
-
 
4624
  char tmp[LT_PATHMAX + 1];
-
 
4625
 
-
 
4626
  assert(path != NULL);
-
 
4627
 
-
 
4628
  /* Is it qualified already? */
-
 
4629
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-
 
4630
  if (isalpha (path[0]) && path[1] == ':')
-
 
4631
    return xstrdup (path);
-
 
4632
#endif
-
 
4633
  if (IS_DIR_SEPARATOR (path[0]))
-
 
4634
    return xstrdup (path);
-
 
4635
 
-
 
4636
  /* prepend the current directory */
-
 
4637
  /* doesn't handle '~' */
-
 
4638
  if (getcwd (tmp, LT_PATHMAX) == NULL)
-
 
4639
    lt_fatal ("getcwd failed");
-
 
4640
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
-
 
4641
  p = XMALLOC(char, size);
-
 
4642
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
-
 
4643
  return p;
-
 
4644
}
-
 
4645
 
-
 
4646
char *
-
 
4647
strendzap(char *str, const char *pat) 
-
 
4648
{
-
 
4649
  size_t len, patlen;
-
 
4650
 
-
 
4651
  assert(str != NULL);
-
 
4652
  assert(pat != NULL);
-
 
4653
 
-
 
4654
  len = strlen(str);
-
 
4655
  patlen = strlen(pat);
-
 
4656
 
-
 
4657
  if (patlen <= len)
-
 
4658
  {
-
 
4659
    str += len - patlen;
-
 
4660
    if (strcmp(str, pat) == 0)
-
 
4661
      *str = '\0';
-
 
4662
  }
-
 
4663
  return str;
-
 
4664
}
-
 
4665
 
-
 
4666
static void
-
 
4667
lt_error_core (int exit_status, const char * mode, 
-
 
4668
          const char * message, va_list ap)
-
 
4669
{
-
 
4670
  fprintf (stderr, "%s: %s: ", program_name, mode);
-
 
4671
  vfprintf (stderr, message, ap);
-
 
4672
  fprintf (stderr, ".\n");
-
 
4673
 
-
 
4674
  if (exit_status >= 0)
-
 
4675
    exit (exit_status);
-
 
4676
}
-
 
4677
 
-
 
4678
void
-
 
4679
lt_fatal (const char *message, ...)
-
 
4680
{
-
 
4681
  va_list ap;
-
 
4682
  va_start (ap, message);
-
 
4683
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-
 
4684
  va_end (ap);
-
 
4685
}
-
 
4686
EOF
-
 
4687
	  # we should really use a build-platform specific compiler
-
 
4688
	  # here, but OTOH, the wrappers (shell script and this C one)
-
 
4689
	  # are only useful if you want to execute the "real" binary.
-
 
4690
	  # Since the "real" binary is built for $host, then this
-
 
4691
	  # wrapper might as well be built for $host, too.
-
 
4692
	  $run $LTCC -s -o $cwrapper $cwrappersource
-
 
4693
	  ;;
-
 
4694
	esac
3655
	$rm $output
4695
	$rm $output
3656
	trap "$rm $output; exit 1" 1 2 15
4696
	trap "$rm $output; exit 1" 1 2 15
3657
 
4697
 
3658
	$echo > $output "\
4698
	$echo > $output "\
3659
#! $SHELL
4699
#! $SHELL
Line 3667... Line 4707...
3667
# This wrapper script should never be moved out of the build directory.
4707
# This wrapper script should never be moved out of the build directory.
3668
# If it is, it will not operate correctly.
4708
# If it is, it will not operate correctly.
3669
 
4709
 
3670
# Sed substitution that helps us do robust quoting.  It backslashifies
4710
# Sed substitution that helps us do robust quoting.  It backslashifies
3671
# metacharacters that are still active within double-quoted strings.
4711
# metacharacters that are still active within double-quoted strings.
3672
Xsed="${SED}"' -e 1s/^X//'
4712
Xsed='${SED} -e 1s/^X//'
3673
sed_quote_subst='$sed_quote_subst'
4713
sed_quote_subst='$sed_quote_subst'
3674
 
4714
 
3675
# The HP-UX ksh and POSIX shell print the target directory to stdout
4715
# The HP-UX ksh and POSIX shell print the target directory to stdout
3676
# if CDPATH is set.
4716
# if CDPATH is set.
3677
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4717
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
Line 3727... Line 4767...
3727
  absdir=\`cd \"\$thisdir\" && pwd\`
4767
  absdir=\`cd \"\$thisdir\" && pwd\`
3728
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
4768
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
3729
"
4769
"
3730
 
4770
 
3731
	if test "$fast_install" = yes; then
4771
	if test "$fast_install" = yes; then
3732
	  echo >> $output "\
4772
	  $echo >> $output "\
3733
  program=lt-'$outputname'$exeext
4773
  program=lt-'$outputname'$exeext
3734
  progdir=\"\$thisdir/$objdir\"
4774
  progdir=\"\$thisdir/$objdir\"
3735
 
4775
 
3736
  if test ! -f \"\$progdir/\$program\" || \\
4776
  if test ! -f \"\$progdir/\$program\" || \\
3737
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4777
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
Line 3743... Line 4783...
3743
      $mkdir \"\$progdir\"
4783
      $mkdir \"\$progdir\"
3744
    else
4784
    else
3745
      $rm \"\$progdir/\$file\"
4785
      $rm \"\$progdir/\$file\"
3746
    fi"
4786
    fi"
3747
 
4787
 
3748
	  echo >> $output "\
4788
	  $echo >> $output "\
3749
 
4789
 
3750
    # relink executable if necessary
4790
    # relink executable if necessary
3751
    if test -n \"\$relink_command\"; then
4791
    if test -n \"\$relink_command\"; then
3752
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4792
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3753
      else
4793
      else
Line 3761... Line 4801...
3761
    { $rm \"\$progdir/\$program\";
4801
    { $rm \"\$progdir/\$program\";
3762
      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4802
      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3763
    $rm \"\$progdir/\$file\"
4803
    $rm \"\$progdir/\$file\"
3764
  fi"
4804
  fi"
3765
	else
4805
	else
3766
	  echo >> $output "\
4806
	  $echo >> $output "\
3767
  program='$outputname'
4807
  program='$outputname'
3768
  progdir=\"\$thisdir/$objdir\"
4808
  progdir=\"\$thisdir/$objdir\"
3769
"
4809
"
3770
	fi
4810
	fi
3771
 
4811
 
3772
	echo >> $output "\
4812
	$echo >> $output "\
3773
 
4813
 
3774
  if test -f \"\$progdir/\$program\"; then"
4814
  if test -f \"\$progdir/\$program\"; then"
3775
 
4815
 
3776
	# Export our shlibpath_var if we have one.
4816
	# Export our shlibpath_var if we have one.
3777
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4817
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3778
	  $echo >> $output "\
4818
	  $echo >> $output "\
3779
    # Add our own library path to $shlibpath_var
4819
    # Add our own library path to $shlibpath_var
3780
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4820
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3781
 
4821
 
3782
    # Some systems cannot cope with colon-terminated $shlibpath_var
4822
    # Some systems cannot cope with colon-terminated $shlibpath_var
3783
    # The second colon is a workaround for a bug in BeOS R4 ${SED}
4823
    # The second colon is a workaround for a bug in BeOS R4 sed
3784
    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4824
    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3785
 
4825
 
3786
    export $shlibpath_var
4826
    export $shlibpath_var
3787
"
4827
"
3788
	fi
4828
	fi
Line 3798... Line 4838...
3798
	$echo >> $output "\
4838
	$echo >> $output "\
3799
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
4839
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3800
      # Run the actual program with our arguments.
4840
      # Run the actual program with our arguments.
3801
"
4841
"
3802
	case $host in
4842
	case $host in
3803
	# win32 systems need to use the prog path for dll
-
 
3804
	# lookup to work
-
 
3805
	*-*-cygwin* | *-*-pw32*)
-
 
3806
	  $echo >> $output "\
-
 
3807
      exec \$progdir/\$program \${1+\"\$@\"}
-
 
3808
"
-
 
3809
	  ;;
-
 
3810
 
-
 
3811
	# Backslashes separate directories on plain windows
4843
	# Backslashes separate directories on plain windows
3812
	*-*-mingw | *-*-os2*)
4844
	*-*-mingw | *-*-os2*)
3813
	  $echo >> $output "\
4845
	  $echo >> $output "\
3814
      exec \$progdir\\\\\$program \${1+\"\$@\"}
4846
      exec \$progdir\\\\\$program \${1+\"\$@\"}
3815
"
4847
"
3816
	  ;;
4848
	  ;;
3817
 
4849
 
3818
	*)
4850
	*)
3819
	  $echo >> $output "\
4851
	  $echo >> $output "\
3820
      # Export the path to the program.
-
 
3821
      PATH=\"\$progdir:\$PATH\"
-
 
3822
      export PATH
-
 
3823
 
-
 
3824
      exec \$program \${1+\"\$@\"}
4852
      exec \$progdir/\$program \${1+\"\$@\"}
3825
"
4853
"
3826
	  ;;
4854
	  ;;
3827
	esac
4855
	esac
3828
	$echo >> $output "\
4856
	$echo >> $output "\
3829
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4857
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
Line 3831... Line 4859...
3831
    fi
4859
    fi
3832
  else
4860
  else
3833
    # The program doesn't exist.
4861
    # The program doesn't exist.
3834
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4862
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3835
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4863
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
3836
    echo \"See the $PACKAGE documentation for more information.\" 1>&2
4864
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
3837
    exit 1
4865
    exit 1
3838
  fi
4866
  fi
3839
fi\
4867
fi\
3840
"
4868
"
3841
	chmod +x $output
4869
	chmod +x $output
Line 3854... Line 4882...
3854
      else
4882
      else
3855
	if test "$build_libtool_libs" = module; then
4883
	if test "$build_libtool_libs" = module; then
3856
	  oldobjs="$libobjs_save"
4884
	  oldobjs="$libobjs_save"
3857
	  build_libtool_libs=no
4885
	  build_libtool_libs=no
3858
	else
4886
	else
3859
	  oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4887
	  oldobjs="$old_deplibs $non_pic_objects"
3860
	fi
4888
	fi
3861
	addlibs="$old_convenience"
4889
	addlibs="$old_convenience"
3862
      fi
4890
      fi
3863
 
4891
 
3864
      if test -n "$addlibs"; then
4892
      if test -n "$addlibs"; then
3865
	gentop="$output_objdir/${outputname}x"
4893
	gentop="$output_objdir/${outputname}x"
3866
	$show "${rm}r $gentop"
4894
	$show "${rm}r $gentop"
3867
	$run ${rm}r "$gentop"
4895
	$run ${rm}r "$gentop"
3868
	$show "mkdir $gentop"
4896
	$show "$mkdir $gentop"
3869
	$run mkdir "$gentop"
4897
	$run $mkdir "$gentop"
3870
	status=$?
4898
	status=$?
3871
	if test $status -ne 0 && test ! -d "$gentop"; then
4899
	if test "$status" -ne 0 && test ! -d "$gentop"; then
3872
	  exit $status
4900
	  exit $status
3873
	fi
4901
	fi
3874
	generated="$generated $gentop"
4902
	generated="$generated $gentop"
3875
 
4903
 
3876
	# Add in members from convenience archives.
4904
	# Add in members from convenience archives.
Line 3883... Line 4911...
3883
	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4911
	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3884
	  xdir="$gentop/$xlib"
4912
	  xdir="$gentop/$xlib"
3885
 
4913
 
3886
	  $show "${rm}r $xdir"
4914
	  $show "${rm}r $xdir"
3887
	  $run ${rm}r "$xdir"
4915
	  $run ${rm}r "$xdir"
3888
	  $show "mkdir $xdir"
4916
	  $show "$mkdir $xdir"
3889
	  $run mkdir "$xdir"
4917
	  $run $mkdir "$xdir"
3890
	  status=$?
4918
	  status=$?
3891
	  if test $status -ne 0 && test ! -d "$xdir"; then
4919
	  if test "$status" -ne 0 && test ! -d "$xdir"; then
3892
	    exit $status
4920
	    exit $status
3893
	  fi
4921
	  fi
-
 
4922
	  # We will extract separately just the conflicting names and we will no
-
 
4923
	  # longer touch any unique names. It is faster to leave these extract
-
 
4924
	  # automatically by $AR in one run.
3894
	  $show "(cd $xdir && $AR x $xabs)"
4925
	  $show "(cd $xdir && $AR x $xabs)"
3895
	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4926
	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
 
4927
	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-
 
4928
	    :
-
 
4929
	  else
-
 
4930
	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-
 
4931
	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-
 
4932
	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
-
 
4933
	    do
-
 
4934
	      i=1
-
 
4935
	      while test "$i" -le "$count"
-
 
4936
	      do
-
 
4937
	       # Put our $i before any first dot (extension)
-
 
4938
	       # Never overwrite any file
-
 
4939
	       name_to="$name"
-
 
4940
	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-
 
4941
	       do
-
 
4942
		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-
 
4943
	       done
-
 
4944
	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-
 
4945
	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-
 
4946
	       i=`expr $i + 1`
-
 
4947
	      done
-
 
4948
	    done
-
 
4949
	  fi
3896
 
4950
 
3897
	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4951
	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3898
	done
4952
	done
3899
      fi
4953
      fi
3900
 
4954
 
3901
      # Do each command in the archive commands.
4955
      # Do each command in the archive commands.
3902
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4956
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3903
	eval cmds=\"$old_archive_from_new_cmds\"
4957
	eval cmds=\"$old_archive_from_new_cmds\"
3904
      else
4958
      else
-
 
4959
	eval cmds=\"$old_archive_cmds\"
-
 
4960
 
-
 
4961
	if len=`expr "X$cmds" : ".*"` &&
3905
	# Ensure that we have .o objects in place in case we decided
4962
	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-
 
4963
	  :
-
 
4964
	else
3906
	# not to build a shared library, and have fallen back to building
4965
	  # the command line is too long to link in one step, link in parts
3907
	# static libs even though --disable-static was passed!
4966
	  $echo "using piecewise archive linking..."
-
 
4967
	  save_RANLIB=$RANLIB
-
 
4968
	  RANLIB=:
-
 
4969
	  objlist=
-
 
4970
	  concat_cmds=
3908
	for oldobj in $oldobjs; do
4971
	  save_oldobjs=$oldobjs
-
 
4972
	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
-
 
4973
	  # encoded into archives.  This makes 'ar r' malfunction in
-
 
4974
	  # this piecewise linking case whenever conflicting object
-
 
4975
	  # names appear in distinct ar calls; check, warn and compensate.
3909
	  if test ! -f $oldobj; then
4976
	    if (for obj in $save_oldobjs
-
 
4977
	    do
3910
	    xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4978
	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
-
 
4979
	    done | sort | sort -uc >/dev/null 2>&1); then
-
 
4980
	    :
-
 
4981
	  else
-
 
4982
	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
-
 
4983
	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
-
 
4984
	    AR_FLAGS=cq
-
 
4985
	  fi
-
 
4986
	  # Is there a better way of finding the last object in the list?
-
 
4987
	  for obj in $save_oldobjs
-
 
4988
	  do
-
 
4989
	    last_oldobj=$obj
-
 
4990
	  done  
-
 
4991
	  for obj in $save_oldobjs
-
 
4992
	  do
-
 
4993
	    oldobjs="$objlist $obj"
-
 
4994
	    objlist="$objlist $obj"
-
 
4995
	    eval test_cmds=\"$old_archive_cmds\"
-
 
4996
	    if len=`expr "X$test_cmds" : ".*"` &&
3911
	    if test "X$xdir" = "X$oldobj"; then
4997
	       test "$len" -le "$max_cmd_len"; then
3912
	      xdir="."
4998
	      :
3913
	    else
4999
	    else
-
 
5000
	      # the above command should be used before it gets too long
3914
	      xdir="$xdir"
5001
	      oldobjs=$objlist
-
 
5002
	      if test "$obj" = "$last_oldobj" ; then
-
 
5003
	        RANLIB=$save_RANLIB
-
 
5004
	      fi  
-
 
5005
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-
 
5006
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-
 
5007
	      objlist=
3915
	    fi
5008
	    fi
-
 
5009
	  done
-
 
5010
	  RANLIB=$save_RANLIB
3916
	    baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
5011
	  oldobjs=$objlist
3917
	    obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
5012
	  if test "X$oldobjs" = "X" ; then
3918
	    $show "(cd $xdir && ${LN_S} $obj $baseobj)"
5013
	    eval cmds=\"\$concat_cmds\"
-
 
5014
	  else
3919
	    $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
5015
	    eval cmds=\"\$concat_cmds~$old_archive_cmds\"
3920
	  fi
5016
	  fi
3921
	done
5017
	fi
3922
 
-
 
3923
	eval cmds=\"$old_archive_cmds\"
-
 
3924
      fi
5018
      fi
3925
      save_ifs="$IFS"; IFS='~'
5019
      save_ifs="$IFS"; IFS='~'
3926
      for cmd in $cmds; do
5020
      for cmd in $cmds; do
3927
	IFS="$save_ifs"
5021
	IFS="$save_ifs"
3928
	$show "$cmd"
5022
	$show "$cmd"
Line 4008... Line 5102...
4008
	  fi
5102
	  fi
4009
	  $rm $output
5103
	  $rm $output
4010
	  # place dlname in correct position for cygwin
5104
	  # place dlname in correct position for cygwin
4011
	  tdlname=$dlname
5105
	  tdlname=$dlname
4012
	  case $host,$output,$installed,$module,$dlname in
5106
	  case $host,$output,$installed,$module,$dlname in
4013
	    *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5107
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4014
	  esac
5108
	  esac
4015
	  $echo > $output "\
5109
	  $echo > $output "\
4016
# $outputname - a libtool library file
5110
# $outputname - a libtool library file
4017
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5111
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4018
#
5112
#
Line 4037... Line 5131...
4037
revision=$revision
5131
revision=$revision
4038
 
5132
 
4039
# Is this an already installed library?
5133
# Is this an already installed library?
4040
installed=$installed
5134
installed=$installed
4041
 
5135
 
-
 
5136
# Should we warn about portability when linking against -modules?
-
 
5137
shouldnotlink=$module
-
 
5138
 
4042
# Files to dlopen/dlpreopen
5139
# Files to dlopen/dlpreopen
4043
dlopen='$dlfiles'
5140
dlopen='$dlfiles'
4044
dlpreopen='$dlprefiles'
5141
dlpreopen='$dlprefiles'
4045
 
5142
 
4046
# Directory that this library needs to be installed in:
5143
# Directory that this library needs to be installed in:
4047
libdir='$install_libdir'"
5144
libdir='$install_libdir'"
4048
	  if test "$installed" = no && test $need_relink = yes; then
5145
	  if test "$installed" = no && test "$need_relink" = yes; then
4049
	    $echo >> $output "\
5146
	    $echo >> $output "\
4050
relink_command=\"$relink_command\""
5147
relink_command=\"$relink_command\""
4051
	  fi
5148
	  fi
4052
	done
5149
	done
4053
      fi
5150
      fi
Line 4179... Line 5276...
4179
      test "X$destdir" = "X$dest" && destdir=.
5276
      test "X$destdir" = "X$dest" && destdir=.
4180
      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5277
      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4181
 
5278
 
4182
      # Not a directory, so check to see that there is only one file specified.
5279
      # Not a directory, so check to see that there is only one file specified.
4183
      set dummy $files
5280
      set dummy $files
4184
      if test $# -gt 2; then
5281
      if test "$#" -gt 2; then
4185
	$echo "$modename: \`$dest' is not a directory" 1>&2
5282
	$echo "$modename: \`$dest' is not a directory" 1>&2
4186
	$echo "$help" 1>&2
5283
	$echo "$help" 1>&2
4187
	exit 1
5284
	exit 1
4188
      fi
5285
      fi
4189
    fi
5286
    fi
Line 4219... Line 5316...
4219
	staticlibs="$staticlibs $file"
5316
	staticlibs="$staticlibs $file"
4220
	;;
5317
	;;
4221
 
5318
 
4222
      *.la)
5319
      *.la)
4223
	# Check to see that this really is a libtool archive.
5320
	# Check to see that this really is a libtool archive.
4224
	if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5321
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4225
	else
5322
	else
4226
	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5323
	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4227
	  $echo "$help" 1>&2
5324
	  $echo "$help" 1>&2
4228
	  exit 1
5325
	  exit 1
4229
	fi
5326
	fi
Line 4254... Line 5351...
4254
	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5351
	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4255
	test "X$dir" = "X$file/" && dir=
5352
	test "X$dir" = "X$file/" && dir=
4256
	dir="$dir$objdir"
5353
	dir="$dir$objdir"
4257
 
5354
 
4258
	if test -n "$relink_command"; then
5355
	if test -n "$relink_command"; then
4259
          # Determine the prefix the user has applied to our future dir.
5356
	  # Determine the prefix the user has applied to our future dir.
4260
          inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5357
	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
4261
 
5358
 
4262
          # Don't allow the user to place us outside of our expected
5359
	  # Don't allow the user to place us outside of our expected
4263
          # location b/c this prevents finding dependent libraries that
5360
	  # location b/c this prevents finding dependent libraries that
4264
          # are installed to the same prefix.
5361
	  # are installed to the same prefix.
-
 
5362
	  # At present, this check doesn't affect windows .dll's that
-
 
5363
	  # are installed into $libdir/../bin (currently, that works fine)
-
 
5364
	  # but it's something to keep an eye on.
4265
          if test "$inst_prefix_dir" = "$destdir"; then
5365
	  if test "$inst_prefix_dir" = "$destdir"; then
4266
            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5366
	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4267
            exit 1
5367
	    exit 1
4268
          fi
5368
	  fi
4269
 
5369
 
4270
          if test -n "$inst_prefix_dir"; then
5370
	  if test -n "$inst_prefix_dir"; then
4271
            # Stick the inst_prefix_dir data into the link command.
5371
	    # Stick the inst_prefix_dir data into the link command.
4272
            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5372
	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4273
          else
5373
	  else
4274
            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5374
	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4275
          fi
5375
	  fi
4276
 
5376
 
4277
	  $echo "$modename: warning: relinking \`$file'" 1>&2
5377
	  $echo "$modename: warning: relinking \`$file'" 1>&2
4278
	  $show "$relink_command"
5378
	  $show "$relink_command"
4279
	  if $run eval "$relink_command"; then :
5379
	  if $run eval "$relink_command"; then :
4280
	  else
5380
	  else
Line 4299... Line 5399...
4299
	  if test -n "$stripme" && test -n "$striplib"; then
5399
	  if test -n "$stripme" && test -n "$striplib"; then
4300
	    $show "$striplib $destdir/$realname"
5400
	    $show "$striplib $destdir/$realname"
4301
	    $run eval "$striplib $destdir/$realname" || exit $?
5401
	    $run eval "$striplib $destdir/$realname" || exit $?
4302
	  fi
5402
	  fi
4303
 
5403
 
4304
	  if test $# -gt 0; then
5404
	  if test "$#" -gt 0; then
4305
	    # Delete the old symlinks, and create new ones.
5405
	    # Delete the old symlinks, and create new ones.
4306
	    for linkname
5406
	    for linkname
4307
	    do
5407
	    do
4308
	      if test "$linkname" != "$realname"; then
5408
	      if test "$linkname" != "$realname"; then
4309
		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5409
		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
Line 4385... Line 5485...
4385
	else
5485
	else
4386
	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5486
	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4387
	  destfile="$destdir/$destfile"
5487
	  destfile="$destdir/$destfile"
4388
	fi
5488
	fi
4389
 
5489
 
-
 
5490
	# If the file is missing, and there is a .exe on the end, strip it
-
 
5491
	# because it is most likely a libtool script we actually want to
-
 
5492
	# install
-
 
5493
	stripped_ext=""
-
 
5494
	case $file in
-
 
5495
	  *.exe)
-
 
5496
	    if test ! -f "$file"; then
-
 
5497
	      file=`$echo $file|${SED} 's,.exe$,,'`
-
 
5498
	      stripped_ext=".exe"
-
 
5499
	    fi
-
 
5500
	    ;;
-
 
5501
	esac
-
 
5502
 
4390
	# Do a test to see if this is really a libtool program.
5503
	# Do a test to see if this is really a libtool program.
4391
	case $host in
5504
	case $host in
4392
	*cygwin*|*mingw*)
5505
	*cygwin*|*mingw*)
4393
	    wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
5506
	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
4394
	    ;;
5507
	    ;;
4395
	*)
5508
	*)
4396
	    wrapper=$file
5509
	    wrapper=$file
4397
	    ;;
5510
	    ;;
4398
	esac
5511
	esac
4399
	if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5512
	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4400
	  notinst_deplibs=
5513
	  notinst_deplibs=
4401
	  relink_command=
5514
	  relink_command=
4402
 
5515
 
-
 
5516
	  # To insure that "foo" is sourced, and not "foo.exe",
-
 
5517
	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-
 
5518
	  # which disallows the automatic-append-.exe behavior.
-
 
5519
	  case $build in
-
 
5520
	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-
 
5521
	  *) wrapperdot=${wrapper} ;;
-
 
5522
	  esac
4403
	  # If there is no directory component, then add one.
5523
	  # If there is no directory component, then add one.
4404
	  case $file in
5524
	  case $file in
4405
	  */* | *\\*) . $wrapper ;;
5525
	  */* | *\\*) . ${wrapperdot} ;;
4406
	  *) . ./$wrapper ;;
5526
	  *) . ./${wrapperdot} ;;
4407
	  esac
5527
	  esac
4408
 
5528
 
4409
	  # Check the variables that should have been set.
5529
	  # Check the variables that should have been set.
4410
	  if test -z "$notinst_deplibs"; then
5530
	  if test -z "$notinst_deplibs"; then
4411
	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5531
	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
Line 4429... Line 5549...
4429
	      finalize=no
5549
	      finalize=no
4430
	    fi
5550
	    fi
4431
	  done
5551
	  done
4432
 
5552
 
4433
	  relink_command=
5553
	  relink_command=
-
 
5554
	  # To insure that "foo" is sourced, and not "foo.exe",
-
 
5555
	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-
 
5556
	  # which disallows the automatic-append-.exe behavior.
-
 
5557
	  case $build in
-
 
5558
	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-
 
5559
	  *) wrapperdot=${wrapper} ;;
-
 
5560
	  esac
4434
	  # If there is no directory component, then add one.
5561
	  # If there is no directory component, then add one.
4435
	  case $file in
5562
	  case $file in
4436
	  */* | *\\*) . $wrapper ;;
5563
	  */* | *\\*) . ${wrapperdot} ;;
4437
	  *) . ./$wrapper ;;
5564
	  *) . ./${wrapperdot} ;;
4438
	  esac
5565
	  esac
4439
 
5566
 
4440
	  outputname=
5567
	  outputname=
4441
	  if test "$fast_install" = no && test -n "$relink_command"; then
5568
	  if test "$fast_install" = no && test -n "$relink_command"; then
4442
	    if test "$finalize" = yes && test -z "$run"; then
5569
	    if test "$finalize" = yes && test -z "$run"; then
Line 4446... Line 5573...
4446
	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5573
	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4447
	      else
5574
	      else
4448
		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5575
		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4449
		continue
5576
		continue
4450
	      fi
5577
	      fi
4451
	      file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5578
	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
4452
	      outputname="$tmpdir/$file"
5579
	      outputname="$tmpdir/$file"
4453
	      # Replace the output file specification.
5580
	      # Replace the output file specification.
4454
	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5581
	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4455
 
5582
 
4456
	      $show "$relink_command"
5583
	      $show "$relink_command"
Line 4464... Line 5591...
4464
	    else
5591
	    else
4465
	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
5592
	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
4466
	    fi
5593
	    fi
4467
	  else
5594
	  else
4468
	    # Install the binary that we compiled earlier.
5595
	    # Install the binary that we compiled earlier.
4469
	    file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5596
	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4470
	  fi
5597
	  fi
4471
	fi
5598
	fi
4472
 
5599
 
4473
	# remove .exe since cygwin /usr/bin/install will append another
5600
	# remove .exe since cygwin /usr/bin/install will append another
4474
	# one anyways
5601
	# one anyways
4475
	case $install_prog,$host in
5602
	case $install_prog,$host in
4476
	/usr/bin/install*,*cygwin*)
5603
	*/usr/bin/install*,*cygwin*)
4477
	  case $file:$destfile in
5604
	  case $file:$destfile in
4478
	  *.exe:*.exe)
5605
	  *.exe:*.exe)
4479
	    # this is ok
5606
	    # this is ok
4480
	    ;;
5607
	    ;;
4481
	  *.exe:*)
5608
	  *.exe:*)
4482
	    destfile=$destfile.exe
5609
	    destfile=$destfile.exe
4483
	    ;;
5610
	    ;;
4484
	  *:*.exe)
5611
	  *:*.exe)
4485
	    destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
5612
	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
4486
	    ;;
5613
	    ;;
4487
	  esac
5614
	  esac
4488
	  ;;
5615
	  ;;
4489
	esac
5616
	esac
4490
	$show "$install_prog$stripme $file $destfile"
5617
	$show "$install_prog$stripme $file $destfile"
Line 4565... Line 5692...
4565
	fi
5692
	fi
4566
      done
5693
      done
4567
    fi
5694
    fi
4568
 
5695
 
4569
    # Exit here if they wanted silent mode.
5696
    # Exit here if they wanted silent mode.
4570
    test "$show" = ":" && exit 0
5697
    test "$show" = : && exit 0
4571
 
5698
 
4572
    echo "----------------------------------------------------------------------"
5699
    $echo "----------------------------------------------------------------------"
4573
    echo "Libraries have been installed in:"
5700
    $echo "Libraries have been installed in:"
4574
    for libdir in $libdirs; do
5701
    for libdir in $libdirs; do
4575
      echo "   $libdir"
5702
      $echo "   $libdir"
4576
    done
5703
    done
4577
    echo
5704
    $echo
4578
    echo "If you ever happen to want to link against installed libraries"
5705
    $echo "If you ever happen to want to link against installed libraries"
4579
    echo "in a given directory, LIBDIR, you must either use libtool, and"
5706
    $echo "in a given directory, LIBDIR, you must either use libtool, and"
4580
    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5707
    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4581
    echo "flag during linking and do at least one of the following:"
5708
    $echo "flag during linking and do at least one of the following:"
4582
    if test -n "$shlibpath_var"; then
5709
    if test -n "$shlibpath_var"; then
4583
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
5710
      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4584
      echo "     during execution"
5711
      $echo "     during execution"
4585
    fi
5712
    fi
4586
    if test -n "$runpath_var"; then
5713
    if test -n "$runpath_var"; then
4587
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
5714
      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
4588
      echo "     during linking"
5715
      $echo "     during linking"
4589
    fi
5716
    fi
4590
    if test -n "$hardcode_libdir_flag_spec"; then
5717
    if test -n "$hardcode_libdir_flag_spec"; then
4591
      libdir=LIBDIR
5718
      libdir=LIBDIR
4592
      eval flag=\"$hardcode_libdir_flag_spec\"
5719
      eval flag=\"$hardcode_libdir_flag_spec\"
4593
 
5720
 
4594
      echo "   - use the \`$flag' linker flag"
5721
      $echo "   - use the \`$flag' linker flag"
4595
    fi
5722
    fi
4596
    if test -n "$admincmds"; then
5723
    if test -n "$admincmds"; then
4597
      echo "   - have your system administrator run these commands:$admincmds"
5724
      $echo "   - have your system administrator run these commands:$admincmds"
4598
    fi
5725
    fi
4599
    if test -f /etc/ld.so.conf; then
5726
    if test -f /etc/ld.so.conf; then
4600
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5727
      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4601
    fi
5728
    fi
4602
    echo
5729
    $echo
4603
    echo "See any operating system documentation about shared libraries for"
5730
    $echo "See any operating system documentation about shared libraries for"
4604
    echo "more information, such as the ld(1) and ld.so(8) manual pages."
5731
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
4605
    echo "----------------------------------------------------------------------"
5732
    $echo "----------------------------------------------------------------------"
4606
    exit 0
5733
    exit 0
4607
    ;;
5734
    ;;
4608
 
5735
 
4609
  # libtool execute mode
5736
  # libtool execute mode
4610
  execute)
5737
  execute)
Line 4628... Line 5755...
4628
 
5755
 
4629
      dir=
5756
      dir=
4630
      case $file in
5757
      case $file in
4631
      *.la)
5758
      *.la)
4632
	# Check to see that this really is a libtool archive.
5759
	# Check to see that this really is a libtool archive.
4633
	if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5760
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4634
	else
5761
	else
4635
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5762
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4636
	  $echo "$help" 1>&2
5763
	  $echo "$help" 1>&2
4637
	  exit 1
5764
	  exit 1
4638
	fi
5765
	fi
Line 4699... Line 5826...
4699
    do
5826
    do
4700
      case $file in
5827
      case $file in
4701
      -*) ;;
5828
      -*) ;;
4702
      *)
5829
      *)
4703
	# Do a test to see if this is really a libtool program.
5830
	# Do a test to see if this is really a libtool program.
4704
	if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5831
	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4705
	  # If there is no directory component, then add one.
5832
	  # If there is no directory component, then add one.
4706
	  case $file in
5833
	  case $file in
4707
	  */* | *\\*) . $file ;;
5834
	  */* | *\\*) . $file ;;
4708
	  *) . ./$file ;;
5835
	  *) . ./$file ;;
4709
	  esac
5836
	  esac
Line 4722... Line 5849...
4722
      if test -n "$shlibpath_var"; then
5849
      if test -n "$shlibpath_var"; then
4723
	# Export the shlibpath_var.
5850
	# Export the shlibpath_var.
4724
	eval "export $shlibpath_var"
5851
	eval "export $shlibpath_var"
4725
      fi
5852
      fi
4726
 
5853
 
4727
      # Restore saved enviroment variables
5854
      # Restore saved environment variables
4728
      if test "${save_LC_ALL+set}" = set; then
5855
      if test "${save_LC_ALL+set}" = set; then
4729
	LC_ALL="$save_LC_ALL"; export LC_ALL
5856
	LC_ALL="$save_LC_ALL"; export LC_ALL
4730
      fi
5857
      fi
4731
      if test "${save_LANG+set}" = set; then
5858
      if test "${save_LANG+set}" = set; then
4732
	LANG="$save_LANG"; export LANG
5859
	LANG="$save_LANG"; export LANG
Line 4772... Line 5899...
4772
      exit 1
5899
      exit 1
4773
    fi
5900
    fi
4774
 
5901
 
4775
    rmdirs=
5902
    rmdirs=
4776
 
5903
 
-
 
5904
    origobjdir="$objdir"
4777
    for file in $files; do
5905
    for file in $files; do
4778
      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5906
      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4779
      if test "X$dir" = "X$file"; then
5907
      if test "X$dir" = "X$file"; then
4780
	dir=.
5908
	dir=.
4781
	objdir="$objdir"
5909
	objdir="$origobjdir"
4782
      else
5910
      else
4783
	objdir="$dir/$objdir"
5911
	objdir="$dir/$origobjdir"
4784
      fi
5912
      fi
4785
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5913
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4786
      test $mode = uninstall && objdir="$dir"
5914
      test "$mode" = uninstall && objdir="$dir"
4787
 
5915
 
4788
      # Remember objdir for removal later, being careful to avoid duplicates
5916
      # Remember objdir for removal later, being careful to avoid duplicates
4789
      if test $mode = clean; then
5917
      if test "$mode" = clean; then
4790
	case " $rmdirs " in
5918
	case " $rmdirs " in
4791
	  *" $objdir "*) ;;
5919
	  *" $objdir "*) ;;
4792
	  *) rmdirs="$rmdirs $objdir" ;;
5920
	  *) rmdirs="$rmdirs $objdir" ;;
4793
	esac
5921
	esac
4794
      fi
5922
      fi
Line 4808... Line 5936...
4808
      rmfiles="$file"
5936
      rmfiles="$file"
4809
 
5937
 
4810
      case $name in
5938
      case $name in
4811
      *.la)
5939
      *.la)
4812
	# Possibly a libtool archive, so verify it.
5940
	# Possibly a libtool archive, so verify it.
4813
	if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5941
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4814
	  . $dir/$name
5942
	  . $dir/$name
4815
 
5943
 
4816
	  # Delete the libtool libraries and symlinks.
5944
	  # Delete the libtool libraries and symlinks.
4817
	  for n in $library_names; do
5945
	  for n in $library_names; do
4818
	    rmfiles="$rmfiles $objdir/$n"
5946
	    rmfiles="$rmfiles $objdir/$n"
4819
	  done
5947
	  done
4820
	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5948
	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4821
	  test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5949
	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4822
 
5950
 
4823
	  if test $mode = uninstall; then
5951
	  if test "$mode" = uninstall; then
4824
	    if test -n "$library_names"; then
5952
	    if test -n "$library_names"; then
4825
	      # Do each command in the postuninstall commands.
5953
	      # Do each command in the postuninstall commands.
4826
	      eval cmds=\"$postuninstall_cmds\"
5954
	      eval cmds=\"$postuninstall_cmds\"
4827
	      save_ifs="$IFS"; IFS='~'
5955
	      save_ifs="$IFS"; IFS='~'
4828
	      for cmd in $cmds; do
5956
	      for cmd in $cmds; do
4829
		IFS="$save_ifs"
5957
		IFS="$save_ifs"
4830
		$show "$cmd"
5958
		$show "$cmd"
4831
		$run eval "$cmd"
5959
		$run eval "$cmd"
4832
		if test $? != 0 && test "$rmforce" != yes; then
5960
		if test "$?" -ne 0 && test "$rmforce" != yes; then
4833
		  exit_status=1
5961
		  exit_status=1
4834
		fi
5962
		fi
4835
	      done
5963
	      done
4836
	      IFS="$save_ifs"
5964
	      IFS="$save_ifs"
4837
	    fi
5965
	    fi
Line 4842... Line 5970...
4842
	      save_ifs="$IFS"; IFS='~'
5970
	      save_ifs="$IFS"; IFS='~'
4843
	      for cmd in $cmds; do
5971
	      for cmd in $cmds; do
4844
		IFS="$save_ifs"
5972
		IFS="$save_ifs"
4845
		$show "$cmd"
5973
		$show "$cmd"
4846
		$run eval "$cmd"
5974
		$run eval "$cmd"
4847
		if test $? != 0 && test "$rmforce" != yes; then
5975
		if test "$?" -ne 0 && test "$rmforce" != yes; then
4848
		  exit_status=1
5976
		  exit_status=1
4849
		fi
5977
		fi
4850
	      done
5978
	      done
4851
	      IFS="$save_ifs"
5979
	      IFS="$save_ifs"
4852
	    fi
5980
	    fi
Line 4854... Line 5982...
4854
	  fi
5982
	  fi
4855
	fi
5983
	fi
4856
	;;
5984
	;;
4857
 
5985
 
4858
      *.lo)
5986
      *.lo)
-
 
5987
	# Possibly a libtool object, so verify it.
-
 
5988
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
 
5989
 
-
 
5990
	  # Read the .lo file
-
 
5991
	  . $dir/$name
-
 
5992
 
-
 
5993
	  # Add PIC object to the list of files to remove.
-
 
5994
	  if test -n "$pic_object" \
4859
	if test "$build_old_libs" = yes; then
5995
	     && test "$pic_object" != none; then
-
 
5996
	    rmfiles="$rmfiles $dir/$pic_object"
-
 
5997
	  fi
-
 
5998
 
4860
	  oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5999
	  # Add non-PIC object to the list of files to remove.
-
 
6000
	  if test -n "$non_pic_object" \
-
 
6001
	     && test "$non_pic_object" != none; then
4861
	  rmfiles="$rmfiles $dir/$oldobj"
6002
	    rmfiles="$rmfiles $dir/$non_pic_object"
-
 
6003
	  fi
4862
	fi
6004
	fi
4863
	;;
6005
	;;
4864
 
6006
 
4865
      *)
6007
      *)
-
 
6008
	if test "$mode" = clean ; then
-
 
6009
	  noexename=$name
-
 
6010
	  case $file in
-
 
6011
	  *.exe) 
-
 
6012
	    file=`$echo $file|${SED} 's,.exe$,,'`
-
 
6013
	    noexename=`$echo $name|${SED} 's,.exe$,,'`
4866
	# Do a test to see if this is a libtool program.
6014
	    # $file with .exe has already been added to rmfiles,
4867
	if test $mode = clean &&
6015
	    # add $file without .exe
-
 
6016
	    rmfiles="$rmfiles $file"
-
 
6017
	    ;;
-
 
6018
	  esac
-
 
6019
	  # Do a test to see if this is a libtool program.
4868
	   (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6020
	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4869
	  relink_command=
6021
	    relink_command=
4870
	  . $dir/$file
6022
	    . $dir/$noexename
4871
 
6023
 
-
 
6024
	    # note $name still contains .exe if it was in $file originally
-
 
6025
	    # as does the version of $file that was added into $rmfiles
4872
	  rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6026
	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4873
	  if test "$fast_install" = yes && test -n "$relink_command"; then
6027
	    if test "$fast_install" = yes && test -n "$relink_command"; then
4874
	    rmfiles="$rmfiles $objdir/lt-$name"
6028
	      rmfiles="$rmfiles $objdir/lt-$name"
-
 
6029
	    fi
-
 
6030
	    if test "X$noexename" != "X$name" ; then
-
 
6031
	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
-
 
6032
	    fi
4875
	  fi
6033
	  fi
4876
	fi
6034
	fi
4877
	;;
6035
	;;
4878
      esac
6036
      esac
4879
      $show "$rm $rmfiles"
6037
      $show "$rm $rmfiles"
4880
      $run $rm $rmfiles || exit_status=1
6038
      $run $rm $rmfiles || exit_status=1
4881
    done
6039
    done
-
 
6040
    objdir="$origobjdir"
4882
 
6041
 
4883
    # Try to remove the ${objdir}s in the directories where we deleted files
6042
    # Try to remove the ${objdir}s in the directories where we deleted files
4884
    for dir in $rmdirs; do
6043
    for dir in $rmdirs; do
4885
      if test -d "$dir"; then
6044
      if test -d "$dir"; then
4886
	$show "rmdir $dir"
6045
	$show "rmdir $dir"
Line 4924... Line 6083...
4924
    --finish          same as \`--mode=finish'
6083
    --finish          same as \`--mode=finish'
4925
    --help            display this help message and exit
6084
    --help            display this help message and exit
4926
    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
6085
    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
4927
    --quiet           same as \`--silent'
6086
    --quiet           same as \`--silent'
4928
    --silent          don't print informational messages
6087
    --silent          don't print informational messages
-
 
6088
    --tag=TAG         use configuration variables from tag TAG
4929
    --version         print version information
6089
    --version         print version information
4930
 
6090
 
4931
MODE must be one of the following:
6091
MODE must be one of the following:
4932
 
6092
 
4933
      clean           remove files from the build directory
6093
      clean           remove files from the build directory
Line 4937... Line 6097...
4937
      install         install libraries or executables
6097
      install         install libraries or executables
4938
      link            create a library or an executable
6098
      link            create a library or an executable
4939
      uninstall       remove libraries from an installed directory
6099
      uninstall       remove libraries from an installed directory
4940
 
6100
 
4941
MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
6101
MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
4942
a more detailed description of MODE."
6102
a more detailed description of MODE.
-
 
6103
 
-
 
6104
Report bugs to <bug-libtool@gnu.org>."
4943
  exit 0
6105
  exit 0
4944
  ;;
6106
  ;;
4945
 
6107
 
4946
clean)
6108
clean)
4947
  $echo \
6109
  $echo \
Line 5049... Line 6211...
5049
  -module           build a library that can dlopened
6211
  -module           build a library that can dlopened
5050
  -no-fast-install  disable the fast-install mode
6212
  -no-fast-install  disable the fast-install mode
5051
  -no-install       link a not-installable executable
6213
  -no-install       link a not-installable executable
5052
  -no-undefined     declare that a library does not refer to external symbols
6214
  -no-undefined     declare that a library does not refer to external symbols
5053
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
6215
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-
 
6216
  -objectlist FILE  Use a list of object files found in FILE to specify objects
5054
  -release RELEASE  specify package release information
6217
  -release RELEASE  specify package release information
5055
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
6218
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
5056
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
6219
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
5057
  -static           do not do any dynamic linking of libtool libraries
6220
  -static           do not do any dynamic linking of libtool libraries
5058
  -version-info CURRENT[:REVISION[:AGE]]
6221
  -version-info CURRENT[:REVISION[:AGE]]
Line 5094... Line 6257...
5094
  $echo "$help" 1>&2
6257
  $echo "$help" 1>&2
5095
  exit 1
6258
  exit 1
5096
  ;;
6259
  ;;
5097
esac
6260
esac
5098
 
6261
 
5099
echo
6262
$echo
5100
$echo "Try \`$modename --help' for more information about other modes."
6263
$echo "Try \`$modename --help' for more information about other modes."
5101
 
6264
 
5102
exit 0
6265
exit 0
5103
 
6266
 
-
 
6267
# The TAGs below are defined such that we never get into a situation
-
 
6268
# in which we disable both kinds of libraries.  Given conflicting
-
 
6269
# choices, we go for a static library, that is the most portable,
-
 
6270
# since we can't tell whether shared libraries were disabled because
-
 
6271
# the user asked for that or because the platform doesn't support
-
 
6272
# them.  This is particularly important on AIX, because we don't
-
 
6273
# support having both static and shared libraries enabled at the same
-
 
6274
# time on that platform, so we default to a shared-only configuration.
-
 
6275
# If a disable-shared tag is given, we'll fallback to a static-only
-
 
6276
# configuration.  But we'll never go from static-only to shared-only.
-
 
6277
 
-
 
6278
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-
 
6279
build_libtool_libs=no
-
 
6280
build_old_libs=yes
-
 
6281
# ### END LIBTOOL TAG CONFIG: disable-shared
-
 
6282
 
-
 
6283
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-
 
6284
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
-
 
6285
# ### END LIBTOOL TAG CONFIG: disable-static
-
 
6286
 
5104
# Local Variables:
6287
# Local Variables:
5105
# mode:shell-script
6288
# mode:shell-script
5106
# sh-indentation:2
6289
# sh-indentation:2
5107
# End:
6290
# End: