gst-plugins-mythtv/ltmain.sh
author leo_sobral
Thu Sep 21 00:15:52 2006 +0100 (2006-09-21)
branchtrunk
changeset 4 259b9773e5c3
parent 2 bd3829c2e9c9
permissions -rw-r--r--
[svn r5] Deleted files that are not needed anymore
leo_sobral@2
     1
# ltmain.sh - Provide generalized library-building support services.
leo_sobral@2
     2
# NOTE: Changing this file will not affect anything until you rerun configure.
leo_sobral@2
     3
#
leo_sobral@2
     4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
leo_sobral@2
     5
# Free Software Foundation, Inc.
leo_sobral@2
     6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
leo_sobral@2
     7
#
leo_sobral@2
     8
# This program is free software; you can redistribute it and/or modify
leo_sobral@2
     9
# it under the terms of the GNU General Public License as published by
leo_sobral@2
    10
# the Free Software Foundation; either version 2 of the License, or
leo_sobral@2
    11
# (at your option) any later version.
leo_sobral@2
    12
#
leo_sobral@2
    13
# This program is distributed in the hope that it will be useful, but
leo_sobral@2
    14
# WITHOUT ANY WARRANTY; without even the implied warranty of
leo_sobral@2
    15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
leo_sobral@2
    16
# General Public License for more details.
leo_sobral@2
    17
#
leo_sobral@2
    18
# You should have received a copy of the GNU General Public License
leo_sobral@2
    19
# along with this program; if not, write to the Free Software
leo_sobral@2
    20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
leo_sobral@2
    21
#
leo_sobral@2
    22
# As a special exception to the GNU General Public License, if you
leo_sobral@2
    23
# distribute this file as part of a program that contains a
leo_sobral@2
    24
# configuration script generated by Autoconf, you may include it under
leo_sobral@2
    25
# the same distribution terms that you use for the rest of that program.
leo_sobral@2
    26
leo_sobral@2
    27
basename="s,^.*/,,g"
leo_sobral@2
    28
leo_sobral@2
    29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
leo_sobral@2
    30
# is ksh but when the shell is invoked as "sh" and the current value of
leo_sobral@2
    31
# the _XPG environment variable is not equal to 1 (one), the special
leo_sobral@2
    32
# positional parameter $0, within a function call, is the name of the
leo_sobral@2
    33
# function.
leo_sobral@2
    34
progpath="$0"
leo_sobral@2
    35
leo_sobral@2
    36
# The name of this program:
leo_sobral@2
    37
progname=`echo "$progpath" | $SED $basename`
leo_sobral@2
    38
modename="$progname"
leo_sobral@2
    39
leo_sobral@2
    40
# Global variables:
leo_sobral@2
    41
EXIT_SUCCESS=0
leo_sobral@2
    42
EXIT_FAILURE=1
leo_sobral@2
    43
leo_sobral@2
    44
PROGRAM=ltmain.sh
leo_sobral@2
    45
PACKAGE=libtool
leo_sobral@2
    46
VERSION=1.5.6
leo_sobral@2
    47
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $"
leo_sobral@2
    48
leo_sobral@2
    49
leo_sobral@2
    50
# Check that we have a working $echo.
leo_sobral@2
    51
if test "X$1" = X--no-reexec; then
leo_sobral@2
    52
  # Discard the --no-reexec flag, and continue.
leo_sobral@2
    53
  shift
leo_sobral@2
    54
elif test "X$1" = X--fallback-echo; then
leo_sobral@2
    55
  # Avoid inline document here, it may be left over
leo_sobral@2
    56
  :
leo_sobral@2
    57
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
leo_sobral@2
    58
  # Yippee, $echo works!
leo_sobral@2
    59
  :
leo_sobral@2
    60
else
leo_sobral@2
    61
  # Restart under the correct shell, and then maybe $echo will work.
leo_sobral@2
    62
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
leo_sobral@2
    63
fi
leo_sobral@2
    64
leo_sobral@2
    65
if test "X$1" = X--fallback-echo; then
leo_sobral@2
    66
  # used as fallback echo
leo_sobral@2
    67
  shift
leo_sobral@2
    68
  cat <<EOF
leo_sobral@2
    69
$*
leo_sobral@2
    70
EOF
leo_sobral@2
    71
  exit $EXIT_SUCCESS
leo_sobral@2
    72
fi
leo_sobral@2
    73
leo_sobral@2
    74
default_mode=
leo_sobral@2
    75
help="Try \`$progname --help' for more information."
leo_sobral@2
    76
magic="%%%MAGIC variable%%%"
leo_sobral@2
    77
mkdir="mkdir"
leo_sobral@2
    78
mv="mv -f"
leo_sobral@2
    79
rm="rm -f"
leo_sobral@2
    80
leo_sobral@2
    81
# Sed substitution that helps us do robust quoting.  It backslashifies
leo_sobral@2
    82
# metacharacters that are still active within double-quoted strings.
leo_sobral@2
    83
Xsed="${SED}"' -e 1s/^X//'
leo_sobral@2
    84
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
leo_sobral@2
    85
# test EBCDIC or ASCII
leo_sobral@2
    86
case `echo A|tr A '\301'` in
leo_sobral@2
    87
 A) # EBCDIC based system
leo_sobral@2
    88
  SP2NL="tr '\100' '\n'"
leo_sobral@2
    89
  NL2SP="tr '\r\n' '\100\100'"
leo_sobral@2
    90
  ;;
leo_sobral@2
    91
 *) # Assume ASCII based system
leo_sobral@2
    92
  SP2NL="tr '\040' '\012'"
leo_sobral@2
    93
  NL2SP="tr '\015\012' '\040\040'"
leo_sobral@2
    94
  ;;
leo_sobral@2
    95
esac
leo_sobral@2
    96
leo_sobral@2
    97
# NLS nuisances.
leo_sobral@2
    98
# Only set LANG and LC_ALL to C if already set.
leo_sobral@2
    99
# These must not be set unconditionally because not all systems understand
leo_sobral@2
   100
# e.g. LANG=C (notably SCO).
leo_sobral@2
   101
# We save the old values to restore during execute mode.
leo_sobral@2
   102
if test "${LC_ALL+set}" = set; then
leo_sobral@2
   103
  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
leo_sobral@2
   104
fi
leo_sobral@2
   105
if test "${LANG+set}" = set; then
leo_sobral@2
   106
  save_LANG="$LANG"; LANG=C; export LANG
leo_sobral@2
   107
fi
leo_sobral@2
   108
leo_sobral@2
   109
# Make sure IFS has a sensible default
leo_sobral@2
   110
: ${IFS=" 	
leo_sobral@2
   111
"}
leo_sobral@2
   112
leo_sobral@2
   113
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
leo_sobral@2
   114
  $echo "$modename: not configured to build any kind of library" 1>&2
leo_sobral@2
   115
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
leo_sobral@2
   116
  exit $EXIT_FAILURE
leo_sobral@2
   117
fi
leo_sobral@2
   118
leo_sobral@2
   119
# Global variables.
leo_sobral@2
   120
mode=$default_mode
leo_sobral@2
   121
nonopt=
leo_sobral@2
   122
prev=
leo_sobral@2
   123
prevopt=
leo_sobral@2
   124
run=
leo_sobral@2
   125
show="$echo"
leo_sobral@2
   126
show_help=
leo_sobral@2
   127
execute_dlfiles=
leo_sobral@2
   128
lo2o="s/\\.lo\$/.${objext}/"
leo_sobral@2
   129
o2lo="s/\\.${objext}\$/.lo/"
leo_sobral@2
   130
leo_sobral@2
   131
#####################################
leo_sobral@2
   132
# Shell function definitions:
leo_sobral@2
   133
# This seems to be the best place for them
leo_sobral@2
   134
leo_sobral@2
   135
# func_win32_libid arg
leo_sobral@2
   136
# return the library type of file 'arg'
leo_sobral@2
   137
#
leo_sobral@2
   138
# Need a lot of goo to handle *both* DLLs and import libs
leo_sobral@2
   139
# Has to be a shell function in order to 'eat' the argument
leo_sobral@2
   140
# that is supplied when $file_magic_command is called.
leo_sobral@2
   141
func_win32_libid () {
leo_sobral@2
   142
  win32_libid_type="unknown"
leo_sobral@2
   143
  win32_fileres=`file -L $1 2>/dev/null`
leo_sobral@2
   144
  case $win32_fileres in
leo_sobral@2
   145
  *ar\ archive\ import\ library*) # definitely import
leo_sobral@2
   146
    win32_libid_type="x86 archive import"
leo_sobral@2
   147
    ;;
leo_sobral@2
   148
  *ar\ archive*) # could be an import, or static
leo_sobral@2
   149
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
leo_sobral@2
   150
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
leo_sobral@2
   151
      win32_nmres=`eval $NM -f posix -A $1 | \
leo_sobral@2
   152
	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
leo_sobral@2
   153
      if test "X$win32_nmres" = "Ximport" ; then
leo_sobral@2
   154
        win32_libid_type="x86 archive import"
leo_sobral@2
   155
      else
leo_sobral@2
   156
        win32_libid_type="x86 archive static"
leo_sobral@2
   157
      fi
leo_sobral@2
   158
    fi
leo_sobral@2
   159
    ;;
leo_sobral@2
   160
  *DLL*)
leo_sobral@2
   161
    win32_libid_type="x86 DLL"
leo_sobral@2
   162
    ;;
leo_sobral@2
   163
  *executable*) # but shell scripts are "executable" too...
leo_sobral@2
   164
    case $win32_fileres in
leo_sobral@2
   165
    *MS\ Windows\ PE\ Intel*)
leo_sobral@2
   166
      win32_libid_type="x86 DLL"
leo_sobral@2
   167
      ;;
leo_sobral@2
   168
    esac
leo_sobral@2
   169
    ;;
leo_sobral@2
   170
  esac
leo_sobral@2
   171
  $echo $win32_libid_type
leo_sobral@2
   172
}
leo_sobral@2
   173
leo_sobral@2
   174
leo_sobral@2
   175
# func_infer_tag arg
leo_sobral@2
   176
# Infer tagged configuration to use if any are available and
leo_sobral@2
   177
# if one wasn't chosen via the "--tag" command line option.
leo_sobral@2
   178
# Only attempt this if the compiler in the base compile
leo_sobral@2
   179
# command doesn't match the default compiler.
leo_sobral@2
   180
# arg is usually of the form 'gcc ...'
leo_sobral@2
   181
func_infer_tag () {
leo_sobral@2
   182
    if test -n "$available_tags" && test -z "$tagname"; then
leo_sobral@2
   183
      CC_quoted=
leo_sobral@2
   184
      for arg in $CC; do
leo_sobral@2
   185
	case $arg in
leo_sobral@2
   186
	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
   187
	  arg="\"$arg\""
leo_sobral@2
   188
	  ;;
leo_sobral@2
   189
	esac
leo_sobral@2
   190
	CC_quoted="$CC_quoted $arg"
leo_sobral@2
   191
      done
leo_sobral@2
   192
      case $@ in
leo_sobral@2
   193
      # Blanks in the command may have been stripped by the calling shell,
leo_sobral@2
   194
      # but not from the CC environment variable when configure was run.
leo_sobral@2
   195
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
leo_sobral@2
   196
      # Blanks at the start of $base_compile will cause this to fail
leo_sobral@2
   197
      # if we don't check for them as well.
leo_sobral@2
   198
      *)
leo_sobral@2
   199
	for z in $available_tags; do
leo_sobral@2
   200
	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
leo_sobral@2
   201
	    # Evaluate the configuration.
leo_sobral@2
   202
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
leo_sobral@2
   203
	    CC_quoted=
leo_sobral@2
   204
	    for arg in $CC; do
leo_sobral@2
   205
	    # Double-quote args containing other shell metacharacters.
leo_sobral@2
   206
	    case $arg in
leo_sobral@2
   207
	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
   208
	      arg="\"$arg\""
leo_sobral@2
   209
	      ;;
leo_sobral@2
   210
	    esac
leo_sobral@2
   211
	    CC_quoted="$CC_quoted $arg"
leo_sobral@2
   212
	  done
leo_sobral@2
   213
	    case "$@ " in
leo_sobral@2
   214
	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
leo_sobral@2
   215
	      # The compiler in the base compile command matches
leo_sobral@2
   216
	      # the one in the tagged configuration.
leo_sobral@2
   217
	      # Assume this is the tagged configuration we want.
leo_sobral@2
   218
	      tagname=$z
leo_sobral@2
   219
	      break
leo_sobral@2
   220
	      ;;
leo_sobral@2
   221
	    esac
leo_sobral@2
   222
	  fi
leo_sobral@2
   223
	done
leo_sobral@2
   224
	# If $tagname still isn't set, then no tagged configuration
leo_sobral@2
   225
	# was found and let the user know that the "--tag" command
leo_sobral@2
   226
	# line option must be used.
leo_sobral@2
   227
	if test -z "$tagname"; then
leo_sobral@2
   228
	  $echo "$modename: unable to infer tagged configuration"
leo_sobral@2
   229
	  $echo "$modename: specify a tag with \`--tag'" 1>&2
leo_sobral@2
   230
	  exit $EXIT_FAILURE
leo_sobral@2
   231
#        else
leo_sobral@2
   232
#          $echo "$modename: using $tagname tagged configuration"
leo_sobral@2
   233
	fi
leo_sobral@2
   234
	;;
leo_sobral@2
   235
      esac
leo_sobral@2
   236
    fi
leo_sobral@2
   237
}
leo_sobral@2
   238
# End of Shell function definitions
leo_sobral@2
   239
#####################################
leo_sobral@2
   240
leo_sobral@2
   241
# Darwin sucks
leo_sobral@2
   242
eval std_shrext=\"$shrext_cmds\"
leo_sobral@2
   243
leo_sobral@2
   244
# Parse our command line options once, thoroughly.
leo_sobral@2
   245
while test "$#" -gt 0
leo_sobral@2
   246
do
leo_sobral@2
   247
  arg="$1"
leo_sobral@2
   248
  shift
leo_sobral@2
   249
leo_sobral@2
   250
  case $arg in
leo_sobral@2
   251
  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
leo_sobral@2
   252
  *) optarg= ;;
leo_sobral@2
   253
  esac
leo_sobral@2
   254
leo_sobral@2
   255
  # If the previous option needs an argument, assign it.
leo_sobral@2
   256
  if test -n "$prev"; then
leo_sobral@2
   257
    case $prev in
leo_sobral@2
   258
    execute_dlfiles)
leo_sobral@2
   259
      execute_dlfiles="$execute_dlfiles $arg"
leo_sobral@2
   260
      ;;
leo_sobral@2
   261
    tag)
leo_sobral@2
   262
      tagname="$arg"
leo_sobral@2
   263
      preserve_args="${preserve_args}=$arg"
leo_sobral@2
   264
leo_sobral@2
   265
      # Check whether tagname contains only valid characters
leo_sobral@2
   266
      case $tagname in
leo_sobral@2
   267
      *[!-_A-Za-z0-9,/]*)
leo_sobral@2
   268
	$echo "$progname: invalid tag name: $tagname" 1>&2
leo_sobral@2
   269
	exit $EXIT_FAILURE
leo_sobral@2
   270
	;;
leo_sobral@2
   271
      esac
leo_sobral@2
   272
leo_sobral@2
   273
      case $tagname in
leo_sobral@2
   274
      CC)
leo_sobral@2
   275
	# Don't test for the "default" C tag, as we know, it's there, but
leo_sobral@2
   276
	# not specially marked.
leo_sobral@2
   277
	;;
leo_sobral@2
   278
      *)
leo_sobral@2
   279
	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
leo_sobral@2
   280
	  taglist="$taglist $tagname"
leo_sobral@2
   281
	  # Evaluate the configuration.
leo_sobral@2
   282
	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
leo_sobral@2
   283
	else
leo_sobral@2
   284
	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
leo_sobral@2
   285
	fi
leo_sobral@2
   286
	;;
leo_sobral@2
   287
      esac
leo_sobral@2
   288
      ;;
leo_sobral@2
   289
    *)
leo_sobral@2
   290
      eval "$prev=\$arg"
leo_sobral@2
   291
      ;;
leo_sobral@2
   292
    esac
leo_sobral@2
   293
leo_sobral@2
   294
    prev=
leo_sobral@2
   295
    prevopt=
leo_sobral@2
   296
    continue
leo_sobral@2
   297
  fi
leo_sobral@2
   298
leo_sobral@2
   299
  # Have we seen a non-optional argument yet?
leo_sobral@2
   300
  case $arg in
leo_sobral@2
   301
  --help)
leo_sobral@2
   302
    show_help=yes
leo_sobral@2
   303
    ;;
leo_sobral@2
   304
leo_sobral@2
   305
  --version)
leo_sobral@2
   306
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
leo_sobral@2
   307
    $echo
leo_sobral@2
   308
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
leo_sobral@2
   309
    $echo "This is free software; see the source for copying conditions.  There is NO"
leo_sobral@2
   310
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
leo_sobral@2
   311
    exit $EXIT_SUCCESS
leo_sobral@2
   312
    ;;
leo_sobral@2
   313
leo_sobral@2
   314
  --config)
leo_sobral@2
   315
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
leo_sobral@2
   316
    # Now print the configurations for the tags.
leo_sobral@2
   317
    for tagname in $taglist; do
leo_sobral@2
   318
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
leo_sobral@2
   319
    done
leo_sobral@2
   320
    exit $EXIT_SUCCESS
leo_sobral@2
   321
    ;;
leo_sobral@2
   322
leo_sobral@2
   323
  --debug)
leo_sobral@2
   324
    $echo "$progname: enabling shell trace mode"
leo_sobral@2
   325
    set -x
leo_sobral@2
   326
    preserve_args="$preserve_args $arg"
leo_sobral@2
   327
    ;;
leo_sobral@2
   328
leo_sobral@2
   329
  --dry-run | -n)
leo_sobral@2
   330
    run=:
leo_sobral@2
   331
    ;;
leo_sobral@2
   332
leo_sobral@2
   333
  --features)
leo_sobral@2
   334
    $echo "host: $host"
leo_sobral@2
   335
    if test "$build_libtool_libs" = yes; then
leo_sobral@2
   336
      $echo "enable shared libraries"
leo_sobral@2
   337
    else
leo_sobral@2
   338
      $echo "disable shared libraries"
leo_sobral@2
   339
    fi
leo_sobral@2
   340
    if test "$build_old_libs" = yes; then
leo_sobral@2
   341
      $echo "enable static libraries"
leo_sobral@2
   342
    else
leo_sobral@2
   343
      $echo "disable static libraries"
leo_sobral@2
   344
    fi
leo_sobral@2
   345
    exit $EXIT_SUCCESS
leo_sobral@2
   346
    ;;
leo_sobral@2
   347
leo_sobral@2
   348
  --finish) mode="finish" ;;
leo_sobral@2
   349
leo_sobral@2
   350
  --mode) prevopt="--mode" prev=mode ;;
leo_sobral@2
   351
  --mode=*) mode="$optarg" ;;
leo_sobral@2
   352
leo_sobral@2
   353
  --preserve-dup-deps) duplicate_deps="yes" ;;
leo_sobral@2
   354
leo_sobral@2
   355
  --quiet | --silent)
leo_sobral@2
   356
    show=:
leo_sobral@2
   357
    preserve_args="$preserve_args $arg"
leo_sobral@2
   358
    ;;
leo_sobral@2
   359
leo_sobral@2
   360
  --tag) prevopt="--tag" prev=tag ;;
leo_sobral@2
   361
  --tag=*)
leo_sobral@2
   362
    set tag "$optarg" ${1+"$@"}
leo_sobral@2
   363
    shift
leo_sobral@2
   364
    prev=tag
leo_sobral@2
   365
    preserve_args="$preserve_args --tag"
leo_sobral@2
   366
    ;;
leo_sobral@2
   367
leo_sobral@2
   368
  -dlopen)
leo_sobral@2
   369
    prevopt="-dlopen"
leo_sobral@2
   370
    prev=execute_dlfiles
leo_sobral@2
   371
    ;;
leo_sobral@2
   372
leo_sobral@2
   373
  -*)
leo_sobral@2
   374
    $echo "$modename: unrecognized option \`$arg'" 1>&2
leo_sobral@2
   375
    $echo "$help" 1>&2
leo_sobral@2
   376
    exit $EXIT_FAILURE
leo_sobral@2
   377
    ;;
leo_sobral@2
   378
leo_sobral@2
   379
  *)
leo_sobral@2
   380
    nonopt="$arg"
leo_sobral@2
   381
    break
leo_sobral@2
   382
    ;;
leo_sobral@2
   383
  esac
leo_sobral@2
   384
done
leo_sobral@2
   385
leo_sobral@2
   386
if test -n "$prevopt"; then
leo_sobral@2
   387
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
leo_sobral@2
   388
  $echo "$help" 1>&2
leo_sobral@2
   389
  exit $EXIT_FAILURE
leo_sobral@2
   390
fi
leo_sobral@2
   391
leo_sobral@2
   392
# If this variable is set in any of the actions, the command in it
leo_sobral@2
   393
# will be execed at the end.  This prevents here-documents from being
leo_sobral@2
   394
# left over by shells.
leo_sobral@2
   395
exec_cmd=
leo_sobral@2
   396
leo_sobral@2
   397
if test -z "$show_help"; then
leo_sobral@2
   398
leo_sobral@2
   399
  # Infer the operation mode.
leo_sobral@2
   400
  if test -z "$mode"; then
leo_sobral@2
   401
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
leo_sobral@2
   402
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
leo_sobral@2
   403
    case $nonopt in
leo_sobral@2
   404
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
leo_sobral@2
   405
      mode=link
leo_sobral@2
   406
      for arg
leo_sobral@2
   407
      do
leo_sobral@2
   408
	case $arg in
leo_sobral@2
   409
	-c)
leo_sobral@2
   410
	   mode=compile
leo_sobral@2
   411
	   break
leo_sobral@2
   412
	   ;;
leo_sobral@2
   413
	esac
leo_sobral@2
   414
      done
leo_sobral@2
   415
      ;;
leo_sobral@2
   416
    *db | *dbx | *strace | *truss)
leo_sobral@2
   417
      mode=execute
leo_sobral@2
   418
      ;;
leo_sobral@2
   419
    *install*|cp|mv)
leo_sobral@2
   420
      mode=install
leo_sobral@2
   421
      ;;
leo_sobral@2
   422
    *rm)
leo_sobral@2
   423
      mode=uninstall
leo_sobral@2
   424
      ;;
leo_sobral@2
   425
    *)
leo_sobral@2
   426
      # If we have no mode, but dlfiles were specified, then do execute mode.
leo_sobral@2
   427
      test -n "$execute_dlfiles" && mode=execute
leo_sobral@2
   428
leo_sobral@2
   429
      # Just use the default operation mode.
leo_sobral@2
   430
      if test -z "$mode"; then
leo_sobral@2
   431
	if test -n "$nonopt"; then
leo_sobral@2
   432
	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
leo_sobral@2
   433
	else
leo_sobral@2
   434
	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
leo_sobral@2
   435
	fi
leo_sobral@2
   436
      fi
leo_sobral@2
   437
      ;;
leo_sobral@2
   438
    esac
leo_sobral@2
   439
  fi
leo_sobral@2
   440
leo_sobral@2
   441
  # Only execute mode is allowed to have -dlopen flags.
leo_sobral@2
   442
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
leo_sobral@2
   443
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
leo_sobral@2
   444
    $echo "$help" 1>&2
leo_sobral@2
   445
    exit $EXIT_FAILURE
leo_sobral@2
   446
  fi
leo_sobral@2
   447
leo_sobral@2
   448
  # Change the help message to a mode-specific one.
leo_sobral@2
   449
  generic_help="$help"
leo_sobral@2
   450
  help="Try \`$modename --help --mode=$mode' for more information."
leo_sobral@2
   451
leo_sobral@2
   452
  # These modes are in order of execution frequency so that they run quickly.
leo_sobral@2
   453
  case $mode in
leo_sobral@2
   454
  # libtool compile mode
leo_sobral@2
   455
  compile)
leo_sobral@2
   456
    modename="$modename: compile"
leo_sobral@2
   457
    # Get the compilation command and the source file.
leo_sobral@2
   458
    base_compile=
leo_sobral@2
   459
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
leo_sobral@2
   460
    suppress_opt=yes
leo_sobral@2
   461
    suppress_output=
leo_sobral@2
   462
    arg_mode=normal
leo_sobral@2
   463
    libobj=
leo_sobral@2
   464
    later=
leo_sobral@2
   465
leo_sobral@2
   466
    for arg
leo_sobral@2
   467
    do
leo_sobral@2
   468
      case "$arg_mode" in
leo_sobral@2
   469
      arg  )
leo_sobral@2
   470
	# do not "continue".  Instead, add this to base_compile
leo_sobral@2
   471
	lastarg="$arg"
leo_sobral@2
   472
	arg_mode=normal
leo_sobral@2
   473
	;;
leo_sobral@2
   474
leo_sobral@2
   475
      target )
leo_sobral@2
   476
	libobj="$arg"
leo_sobral@2
   477
	arg_mode=normal
leo_sobral@2
   478
	continue
leo_sobral@2
   479
	;;
leo_sobral@2
   480
leo_sobral@2
   481
      normal )
leo_sobral@2
   482
	# Accept any command-line options.
leo_sobral@2
   483
	case $arg in
leo_sobral@2
   484
	-o)
leo_sobral@2
   485
	  if test -n "$libobj" ; then
leo_sobral@2
   486
	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
leo_sobral@2
   487
	    exit $EXIT_FAILURE
leo_sobral@2
   488
	  fi
leo_sobral@2
   489
	  arg_mode=target
leo_sobral@2
   490
	  continue
leo_sobral@2
   491
	  ;;
leo_sobral@2
   492
leo_sobral@2
   493
	-static | -prefer-pic | -prefer-non-pic)
leo_sobral@2
   494
	  later="$later $arg"
leo_sobral@2
   495
	  continue
leo_sobral@2
   496
	  ;;
leo_sobral@2
   497
leo_sobral@2
   498
	-no-suppress)
leo_sobral@2
   499
	  suppress_opt=no
leo_sobral@2
   500
	  continue
leo_sobral@2
   501
	  ;;
leo_sobral@2
   502
leo_sobral@2
   503
	-Xcompiler)
leo_sobral@2
   504
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
leo_sobral@2
   505
	  continue      #  The current "srcfile" will either be retained or
leo_sobral@2
   506
	  ;;            #  replaced later.  I would guess that would be a bug.
leo_sobral@2
   507
leo_sobral@2
   508
	-Wc,*)
leo_sobral@2
   509
	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
leo_sobral@2
   510
	  lastarg=
leo_sobral@2
   511
	  save_ifs="$IFS"; IFS=','
leo_sobral@2
   512
 	  for arg in $args; do
leo_sobral@2
   513
	    IFS="$save_ifs"
leo_sobral@2
   514
leo_sobral@2
   515
	    # Double-quote args containing other shell metacharacters.
leo_sobral@2
   516
	    # Many Bourne shells cannot handle close brackets correctly
leo_sobral@2
   517
	    # in scan sets, so we specify it separately.
leo_sobral@2
   518
	    case $arg in
leo_sobral@2
   519
	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
   520
	      arg="\"$arg\""
leo_sobral@2
   521
	      ;;
leo_sobral@2
   522
	    esac
leo_sobral@2
   523
	    lastarg="$lastarg $arg"
leo_sobral@2
   524
	  done
leo_sobral@2
   525
	  IFS="$save_ifs"
leo_sobral@2
   526
	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
leo_sobral@2
   527
leo_sobral@2
   528
	  # Add the arguments to base_compile.
leo_sobral@2
   529
	  base_compile="$base_compile $lastarg"
leo_sobral@2
   530
	  continue
leo_sobral@2
   531
	  ;;
leo_sobral@2
   532
leo_sobral@2
   533
	* )
leo_sobral@2
   534
	  # Accept the current argument as the source file.
leo_sobral@2
   535
	  # The previous "srcfile" becomes the current argument.
leo_sobral@2
   536
	  #
leo_sobral@2
   537
	  lastarg="$srcfile"
leo_sobral@2
   538
	  srcfile="$arg"
leo_sobral@2
   539
	  ;;
leo_sobral@2
   540
	esac  #  case $arg
leo_sobral@2
   541
	;;
leo_sobral@2
   542
      esac    #  case $arg_mode
leo_sobral@2
   543
leo_sobral@2
   544
      # Aesthetically quote the previous argument.
leo_sobral@2
   545
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
   546
leo_sobral@2
   547
      case $lastarg in
leo_sobral@2
   548
      # Double-quote args containing other shell metacharacters.
leo_sobral@2
   549
      # Many Bourne shells cannot handle close brackets correctly
leo_sobral@2
   550
      # in scan sets, so we specify it separately.
leo_sobral@2
   551
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
   552
	lastarg="\"$lastarg\""
leo_sobral@2
   553
	;;
leo_sobral@2
   554
      esac
leo_sobral@2
   555
leo_sobral@2
   556
      base_compile="$base_compile $lastarg"
leo_sobral@2
   557
    done # for arg
leo_sobral@2
   558
leo_sobral@2
   559
    case $arg_mode in
leo_sobral@2
   560
    arg)
leo_sobral@2
   561
      $echo "$modename: you must specify an argument for -Xcompile"
leo_sobral@2
   562
      exit $EXIT_FAILURE
leo_sobral@2
   563
      ;;
leo_sobral@2
   564
    target)
leo_sobral@2
   565
      $echo "$modename: you must specify a target with \`-o'" 1>&2
leo_sobral@2
   566
      exit $EXIT_FAILURE
leo_sobral@2
   567
      ;;
leo_sobral@2
   568
    *)
leo_sobral@2
   569
      # Get the name of the library object.
leo_sobral@2
   570
      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
   571
      ;;
leo_sobral@2
   572
    esac
leo_sobral@2
   573
leo_sobral@2
   574
    # Recognize several different file suffixes.
leo_sobral@2
   575
    # If the user specifies -o file.o, it is replaced with file.lo
leo_sobral@2
   576
    xform='[cCFSifmso]'
leo_sobral@2
   577
    case $libobj in
leo_sobral@2
   578
    *.ada) xform=ada ;;
leo_sobral@2
   579
    *.adb) xform=adb ;;
leo_sobral@2
   580
    *.ads) xform=ads ;;
leo_sobral@2
   581
    *.asm) xform=asm ;;
leo_sobral@2
   582
    *.c++) xform=c++ ;;
leo_sobral@2
   583
    *.cc) xform=cc ;;
leo_sobral@2
   584
    *.ii) xform=ii ;;
leo_sobral@2
   585
    *.class) xform=class ;;
leo_sobral@2
   586
    *.cpp) xform=cpp ;;
leo_sobral@2
   587
    *.cxx) xform=cxx ;;
leo_sobral@2
   588
    *.f90) xform=f90 ;;
leo_sobral@2
   589
    *.for) xform=for ;;
leo_sobral@2
   590
    *.java) xform=java ;;
leo_sobral@2
   591
    esac
leo_sobral@2
   592
leo_sobral@2
   593
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
leo_sobral@2
   594
leo_sobral@2
   595
    case $libobj in
leo_sobral@2
   596
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
leo_sobral@2
   597
    *)
leo_sobral@2
   598
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
leo_sobral@2
   599
      exit $EXIT_FAILURE
leo_sobral@2
   600
      ;;
leo_sobral@2
   601
    esac
leo_sobral@2
   602
leo_sobral@2
   603
    func_infer_tag $base_compile
leo_sobral@2
   604
leo_sobral@2
   605
    for arg in $later; do
leo_sobral@2
   606
      case $arg in
leo_sobral@2
   607
      -static)
leo_sobral@2
   608
	build_old_libs=yes
leo_sobral@2
   609
	continue
leo_sobral@2
   610
	;;
leo_sobral@2
   611
leo_sobral@2
   612
      -prefer-pic)
leo_sobral@2
   613
	pic_mode=yes
leo_sobral@2
   614
	continue
leo_sobral@2
   615
	;;
leo_sobral@2
   616
leo_sobral@2
   617
      -prefer-non-pic)
leo_sobral@2
   618
	pic_mode=no
leo_sobral@2
   619
	continue
leo_sobral@2
   620
	;;
leo_sobral@2
   621
      esac
leo_sobral@2
   622
    done
leo_sobral@2
   623
leo_sobral@2
   624
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
   625
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
   626
    if test "X$xdir" = "X$obj"; then
leo_sobral@2
   627
      xdir=
leo_sobral@2
   628
    else
leo_sobral@2
   629
      xdir=$xdir/
leo_sobral@2
   630
    fi
leo_sobral@2
   631
    lobj=${xdir}$objdir/$objname
leo_sobral@2
   632
leo_sobral@2
   633
    if test -z "$base_compile"; then
leo_sobral@2
   634
      $echo "$modename: you must specify a compilation command" 1>&2
leo_sobral@2
   635
      $echo "$help" 1>&2
leo_sobral@2
   636
      exit $EXIT_FAILURE
leo_sobral@2
   637
    fi
leo_sobral@2
   638
leo_sobral@2
   639
    # Delete any leftover library objects.
leo_sobral@2
   640
    if test "$build_old_libs" = yes; then
leo_sobral@2
   641
      removelist="$obj $lobj $libobj ${libobj}T"
leo_sobral@2
   642
    else
leo_sobral@2
   643
      removelist="$lobj $libobj ${libobj}T"
leo_sobral@2
   644
    fi
leo_sobral@2
   645
leo_sobral@2
   646
    $run $rm $removelist
leo_sobral@2
   647
    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
leo_sobral@2
   648
leo_sobral@2
   649
    # On Cygwin there's no "real" PIC flag so we must build both object types
leo_sobral@2
   650
    case $host_os in
leo_sobral@2
   651
    cygwin* | mingw* | pw32* | os2*)
leo_sobral@2
   652
      pic_mode=default
leo_sobral@2
   653
      ;;
leo_sobral@2
   654
    esac
leo_sobral@2
   655
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
leo_sobral@2
   656
      # non-PIC code in shared libraries is not supported
leo_sobral@2
   657
      pic_mode=default
leo_sobral@2
   658
    fi
leo_sobral@2
   659
leo_sobral@2
   660
    # Calculate the filename of the output object if compiler does
leo_sobral@2
   661
    # not support -o with -c
leo_sobral@2
   662
    if test "$compiler_c_o" = no; then
leo_sobral@2
   663
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
leo_sobral@2
   664
      lockfile="$output_obj.lock"
leo_sobral@2
   665
      removelist="$removelist $output_obj $lockfile"
leo_sobral@2
   666
      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
leo_sobral@2
   667
    else
leo_sobral@2
   668
      output_obj=
leo_sobral@2
   669
      need_locks=no
leo_sobral@2
   670
      lockfile=
leo_sobral@2
   671
    fi
leo_sobral@2
   672
leo_sobral@2
   673
    # Lock this critical section if it is needed
leo_sobral@2
   674
    # We use this script file to make the link, it avoids creating a new file
leo_sobral@2
   675
    if test "$need_locks" = yes; then
leo_sobral@2
   676
      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
leo_sobral@2
   677
	$show "Waiting for $lockfile to be removed"
leo_sobral@2
   678
	sleep 2
leo_sobral@2
   679
      done
leo_sobral@2
   680
    elif test "$need_locks" = warn; then
leo_sobral@2
   681
      if test -f "$lockfile"; then
leo_sobral@2
   682
	$echo "\
leo_sobral@2
   683
*** ERROR, $lockfile exists and contains:
leo_sobral@2
   684
`cat $lockfile 2>/dev/null`
leo_sobral@2
   685
leo_sobral@2
   686
This indicates that another process is trying to use the same
leo_sobral@2
   687
temporary object file, and libtool could not work around it because
leo_sobral@2
   688
your compiler does not support \`-c' and \`-o' together.  If you
leo_sobral@2
   689
repeat this compilation, it may succeed, by chance, but you had better
leo_sobral@2
   690
avoid parallel builds (make -j) in this platform, or get a better
leo_sobral@2
   691
compiler."
leo_sobral@2
   692
leo_sobral@2
   693
	$run $rm $removelist
leo_sobral@2
   694
	exit $EXIT_FAILURE
leo_sobral@2
   695
      fi
leo_sobral@2
   696
      $echo $srcfile > "$lockfile"
leo_sobral@2
   697
    fi
leo_sobral@2
   698
leo_sobral@2
   699
    if test -n "$fix_srcfile_path"; then
leo_sobral@2
   700
      eval srcfile=\"$fix_srcfile_path\"
leo_sobral@2
   701
    fi
leo_sobral@2
   702
leo_sobral@2
   703
    $run $rm "$libobj" "${libobj}T"
leo_sobral@2
   704
leo_sobral@2
   705
    # Create a libtool object file (analogous to a ".la" file),
leo_sobral@2
   706
    # but don't create it if we're doing a dry run.
leo_sobral@2
   707
    test -z "$run" && cat > ${libobj}T <<EOF
leo_sobral@2
   708
# $libobj - a libtool object file
leo_sobral@2
   709
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
leo_sobral@2
   710
#
leo_sobral@2
   711
# Please DO NOT delete this file!
leo_sobral@2
   712
# It is necessary for linking the library.
leo_sobral@2
   713
leo_sobral@2
   714
# Name of the PIC object.
leo_sobral@2
   715
EOF
leo_sobral@2
   716
leo_sobral@2
   717
    # Only build a PIC object if we are building libtool libraries.
leo_sobral@2
   718
    if test "$build_libtool_libs" = yes; then
leo_sobral@2
   719
      # Without this assignment, base_compile gets emptied.
leo_sobral@2
   720
      fbsd_hideous_sh_bug=$base_compile
leo_sobral@2
   721
leo_sobral@2
   722
      if test "$pic_mode" != no; then
leo_sobral@2
   723
	command="$base_compile $srcfile $pic_flag"
leo_sobral@2
   724
      else
leo_sobral@2
   725
	# Don't build PIC code
leo_sobral@2
   726
	command="$base_compile $srcfile"
leo_sobral@2
   727
      fi
leo_sobral@2
   728
leo_sobral@2
   729
      if test ! -d "${xdir}$objdir"; then
leo_sobral@2
   730
	$show "$mkdir ${xdir}$objdir"
leo_sobral@2
   731
	$run $mkdir ${xdir}$objdir
leo_sobral@2
   732
	status=$?
leo_sobral@2
   733
	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
leo_sobral@2
   734
	  exit $status
leo_sobral@2
   735
	fi
leo_sobral@2
   736
      fi
leo_sobral@2
   737
leo_sobral@2
   738
      if test -z "$output_obj"; then
leo_sobral@2
   739
	# Place PIC objects in $objdir
leo_sobral@2
   740
	command="$command -o $lobj"
leo_sobral@2
   741
      fi
leo_sobral@2
   742
leo_sobral@2
   743
      $run $rm "$lobj" "$output_obj"
leo_sobral@2
   744
leo_sobral@2
   745
      $show "$command"
leo_sobral@2
   746
      if $run eval "$command"; then :
leo_sobral@2
   747
      else
leo_sobral@2
   748
	test -n "$output_obj" && $run $rm $removelist
leo_sobral@2
   749
	exit $EXIT_FAILURE
leo_sobral@2
   750
      fi
leo_sobral@2
   751
leo_sobral@2
   752
      if test "$need_locks" = warn &&
leo_sobral@2
   753
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
leo_sobral@2
   754
	$echo "\
leo_sobral@2
   755
*** ERROR, $lockfile contains:
leo_sobral@2
   756
`cat $lockfile 2>/dev/null`
leo_sobral@2
   757
leo_sobral@2
   758
but it should contain:
leo_sobral@2
   759
$srcfile
leo_sobral@2
   760
leo_sobral@2
   761
This indicates that another process is trying to use the same
leo_sobral@2
   762
temporary object file, and libtool could not work around it because
leo_sobral@2
   763
your compiler does not support \`-c' and \`-o' together.  If you
leo_sobral@2
   764
repeat this compilation, it may succeed, by chance, but you had better
leo_sobral@2
   765
avoid parallel builds (make -j) in this platform, or get a better
leo_sobral@2
   766
compiler."
leo_sobral@2
   767
leo_sobral@2
   768
	$run $rm $removelist
leo_sobral@2
   769
	exit $EXIT_FAILURE
leo_sobral@2
   770
      fi
leo_sobral@2
   771
leo_sobral@2
   772
      # Just move the object if needed, then go on to compile the next one
leo_sobral@2
   773
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
leo_sobral@2
   774
	$show "$mv $output_obj $lobj"
leo_sobral@2
   775
	if $run $mv $output_obj $lobj; then :
leo_sobral@2
   776
	else
leo_sobral@2
   777
	  error=$?
leo_sobral@2
   778
	  $run $rm $removelist
leo_sobral@2
   779
	  exit $error
leo_sobral@2
   780
	fi
leo_sobral@2
   781
      fi
leo_sobral@2
   782
leo_sobral@2
   783
      # Append the name of the PIC object to the libtool object file.
leo_sobral@2
   784
      test -z "$run" && cat >> ${libobj}T <<EOF
leo_sobral@2
   785
pic_object='$objdir/$objname'
leo_sobral@2
   786
leo_sobral@2
   787
EOF
leo_sobral@2
   788
leo_sobral@2
   789
      # Allow error messages only from the first compilation.
leo_sobral@2
   790
      if test "$suppress_opt" = yes; then
leo_sobral@2
   791
        suppress_output=' >/dev/null 2>&1'
leo_sobral@2
   792
      fi
leo_sobral@2
   793
    else
leo_sobral@2
   794
      # No PIC object so indicate it doesn't exist in the libtool
leo_sobral@2
   795
      # object file.
leo_sobral@2
   796
      test -z "$run" && cat >> ${libobj}T <<EOF
leo_sobral@2
   797
pic_object=none
leo_sobral@2
   798
leo_sobral@2
   799
EOF
leo_sobral@2
   800
    fi
leo_sobral@2
   801
leo_sobral@2
   802
    # Only build a position-dependent object if we build old libraries.
leo_sobral@2
   803
    if test "$build_old_libs" = yes; then
leo_sobral@2
   804
      if test "$pic_mode" != yes; then
leo_sobral@2
   805
	# Don't build PIC code
leo_sobral@2
   806
	command="$base_compile $srcfile"
leo_sobral@2
   807
      else
leo_sobral@2
   808
	command="$base_compile $srcfile $pic_flag"
leo_sobral@2
   809
      fi
leo_sobral@2
   810
      if test "$compiler_c_o" = yes; then
leo_sobral@2
   811
	command="$command -o $obj"
leo_sobral@2
   812
      fi
leo_sobral@2
   813
leo_sobral@2
   814
      # Suppress compiler output if we already did a PIC compilation.
leo_sobral@2
   815
      command="$command$suppress_output"
leo_sobral@2
   816
      $run $rm "$obj" "$output_obj"
leo_sobral@2
   817
      $show "$command"
leo_sobral@2
   818
      if $run eval "$command"; then :
leo_sobral@2
   819
      else
leo_sobral@2
   820
	$run $rm $removelist
leo_sobral@2
   821
	exit $EXIT_FAILURE
leo_sobral@2
   822
      fi
leo_sobral@2
   823
leo_sobral@2
   824
      if test "$need_locks" = warn &&
leo_sobral@2
   825
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
leo_sobral@2
   826
	$echo "\
leo_sobral@2
   827
*** ERROR, $lockfile contains:
leo_sobral@2
   828
`cat $lockfile 2>/dev/null`
leo_sobral@2
   829
leo_sobral@2
   830
but it should contain:
leo_sobral@2
   831
$srcfile
leo_sobral@2
   832
leo_sobral@2
   833
This indicates that another process is trying to use the same
leo_sobral@2
   834
temporary object file, and libtool could not work around it because
leo_sobral@2
   835
your compiler does not support \`-c' and \`-o' together.  If you
leo_sobral@2
   836
repeat this compilation, it may succeed, by chance, but you had better
leo_sobral@2
   837
avoid parallel builds (make -j) in this platform, or get a better
leo_sobral@2
   838
compiler."
leo_sobral@2
   839
leo_sobral@2
   840
	$run $rm $removelist
leo_sobral@2
   841
	exit $EXIT_FAILURE
leo_sobral@2
   842
      fi
leo_sobral@2
   843
leo_sobral@2
   844
      # Just move the object if needed
leo_sobral@2
   845
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
leo_sobral@2
   846
	$show "$mv $output_obj $obj"
leo_sobral@2
   847
	if $run $mv $output_obj $obj; then :
leo_sobral@2
   848
	else
leo_sobral@2
   849
	  error=$?
leo_sobral@2
   850
	  $run $rm $removelist
leo_sobral@2
   851
	  exit $error
leo_sobral@2
   852
	fi
leo_sobral@2
   853
      fi
leo_sobral@2
   854
leo_sobral@2
   855
      # Append the name of the non-PIC object the libtool object file.
leo_sobral@2
   856
      # Only append if the libtool object file exists.
leo_sobral@2
   857
      test -z "$run" && cat >> ${libobj}T <<EOF
leo_sobral@2
   858
# Name of the non-PIC object.
leo_sobral@2
   859
non_pic_object='$objname'
leo_sobral@2
   860
leo_sobral@2
   861
EOF
leo_sobral@2
   862
    else
leo_sobral@2
   863
      # Append the name of the non-PIC object the libtool object file.
leo_sobral@2
   864
      # Only append if the libtool object file exists.
leo_sobral@2
   865
      test -z "$run" && cat >> ${libobj}T <<EOF
leo_sobral@2
   866
# Name of the non-PIC object.
leo_sobral@2
   867
non_pic_object=none
leo_sobral@2
   868
leo_sobral@2
   869
EOF
leo_sobral@2
   870
    fi
leo_sobral@2
   871
leo_sobral@2
   872
    $run $mv "${libobj}T" "${libobj}"
leo_sobral@2
   873
leo_sobral@2
   874
    # Unlock the critical section if it was locked
leo_sobral@2
   875
    if test "$need_locks" != no; then
leo_sobral@2
   876
      $run $rm "$lockfile"
leo_sobral@2
   877
    fi
leo_sobral@2
   878
leo_sobral@2
   879
    exit $EXIT_SUCCESS
leo_sobral@2
   880
    ;;
leo_sobral@2
   881
leo_sobral@2
   882
  # libtool link mode
leo_sobral@2
   883
  link | relink)
leo_sobral@2
   884
    modename="$modename: link"
leo_sobral@2
   885
    case $host in
leo_sobral@2
   886
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
leo_sobral@2
   887
      # It is impossible to link a dll without this setting, and
leo_sobral@2
   888
      # we shouldn't force the makefile maintainer to figure out
leo_sobral@2
   889
      # which system we are compiling for in order to pass an extra
leo_sobral@2
   890
      # flag for every libtool invocation.
leo_sobral@2
   891
      # allow_undefined=no
leo_sobral@2
   892
leo_sobral@2
   893
      # FIXME: Unfortunately, there are problems with the above when trying
leo_sobral@2
   894
      # to make a dll which has undefined symbols, in which case not
leo_sobral@2
   895
      # even a static library is built.  For now, we need to specify
leo_sobral@2
   896
      # -no-undefined on the libtool link line when we can be certain
leo_sobral@2
   897
      # that all symbols are satisfied, otherwise we get a static library.
leo_sobral@2
   898
      allow_undefined=yes
leo_sobral@2
   899
      ;;
leo_sobral@2
   900
    *)
leo_sobral@2
   901
      allow_undefined=yes
leo_sobral@2
   902
      ;;
leo_sobral@2
   903
    esac
leo_sobral@2
   904
    libtool_args="$nonopt"
leo_sobral@2
   905
    base_compile="$nonopt $@"
leo_sobral@2
   906
    compile_command="$nonopt"
leo_sobral@2
   907
    finalize_command="$nonopt"
leo_sobral@2
   908
leo_sobral@2
   909
    compile_rpath=
leo_sobral@2
   910
    finalize_rpath=
leo_sobral@2
   911
    compile_shlibpath=
leo_sobral@2
   912
    finalize_shlibpath=
leo_sobral@2
   913
    convenience=
leo_sobral@2
   914
    old_convenience=
leo_sobral@2
   915
    deplibs=
leo_sobral@2
   916
    old_deplibs=
leo_sobral@2
   917
    compiler_flags=
leo_sobral@2
   918
    linker_flags=
leo_sobral@2
   919
    dllsearchpath=
leo_sobral@2
   920
    lib_search_path=`pwd`
leo_sobral@2
   921
    inst_prefix_dir=
leo_sobral@2
   922
leo_sobral@2
   923
    avoid_version=no
leo_sobral@2
   924
    dlfiles=
leo_sobral@2
   925
    dlprefiles=
leo_sobral@2
   926
    dlself=no
leo_sobral@2
   927
    export_dynamic=no
leo_sobral@2
   928
    export_symbols=
leo_sobral@2
   929
    export_symbols_regex=
leo_sobral@2
   930
    generated=
leo_sobral@2
   931
    libobjs=
leo_sobral@2
   932
    ltlibs=
leo_sobral@2
   933
    module=no
leo_sobral@2
   934
    no_install=no
leo_sobral@2
   935
    objs=
leo_sobral@2
   936
    non_pic_objects=
leo_sobral@2
   937
    precious_files_regex=
leo_sobral@2
   938
    prefer_static_libs=no
leo_sobral@2
   939
    preload=no
leo_sobral@2
   940
    prev=
leo_sobral@2
   941
    prevarg=
leo_sobral@2
   942
    release=
leo_sobral@2
   943
    rpath=
leo_sobral@2
   944
    xrpath=
leo_sobral@2
   945
    perm_rpath=
leo_sobral@2
   946
    temp_rpath=
leo_sobral@2
   947
    thread_safe=no
leo_sobral@2
   948
    vinfo=
leo_sobral@2
   949
    vinfo_number=no
leo_sobral@2
   950
leo_sobral@2
   951
    func_infer_tag $base_compile
leo_sobral@2
   952
leo_sobral@2
   953
    # We need to know -static, to get the right output filenames.
leo_sobral@2
   954
    for arg
leo_sobral@2
   955
    do
leo_sobral@2
   956
      case $arg in
leo_sobral@2
   957
      -all-static | -static)
leo_sobral@2
   958
	if test "X$arg" = "X-all-static"; then
leo_sobral@2
   959
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
leo_sobral@2
   960
	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
leo_sobral@2
   961
	  fi
leo_sobral@2
   962
	  if test -n "$link_static_flag"; then
leo_sobral@2
   963
	    dlopen_self=$dlopen_self_static
leo_sobral@2
   964
	  fi
leo_sobral@2
   965
	else
leo_sobral@2
   966
	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
leo_sobral@2
   967
	    dlopen_self=$dlopen_self_static
leo_sobral@2
   968
	  fi
leo_sobral@2
   969
	fi
leo_sobral@2
   970
	build_libtool_libs=no
leo_sobral@2
   971
	build_old_libs=yes
leo_sobral@2
   972
	prefer_static_libs=yes
leo_sobral@2
   973
	break
leo_sobral@2
   974
	;;
leo_sobral@2
   975
      esac
leo_sobral@2
   976
    done
leo_sobral@2
   977
leo_sobral@2
   978
    # See if our shared archives depend on static archives.
leo_sobral@2
   979
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
leo_sobral@2
   980
leo_sobral@2
   981
    # Go through the arguments, transforming them on the way.
leo_sobral@2
   982
    while test "$#" -gt 0; do
leo_sobral@2
   983
      arg="$1"
leo_sobral@2
   984
      shift
leo_sobral@2
   985
      case $arg in
leo_sobral@2
   986
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
   987
	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
leo_sobral@2
   988
	;;
leo_sobral@2
   989
      *) qarg=$arg ;;
leo_sobral@2
   990
      esac
leo_sobral@2
   991
      libtool_args="$libtool_args $qarg"
leo_sobral@2
   992
leo_sobral@2
   993
      # If the previous option needs an argument, assign it.
leo_sobral@2
   994
      if test -n "$prev"; then
leo_sobral@2
   995
	case $prev in
leo_sobral@2
   996
	output)
leo_sobral@2
   997
	  compile_command="$compile_command @OUTPUT@"
leo_sobral@2
   998
	  finalize_command="$finalize_command @OUTPUT@"
leo_sobral@2
   999
	  ;;
leo_sobral@2
  1000
	esac
leo_sobral@2
  1001
leo_sobral@2
  1002
	case $prev in
leo_sobral@2
  1003
	dlfiles|dlprefiles)
leo_sobral@2
  1004
	  if test "$preload" = no; then
leo_sobral@2
  1005
	    # Add the symbol object into the linking commands.
leo_sobral@2
  1006
	    compile_command="$compile_command @SYMFILE@"
leo_sobral@2
  1007
	    finalize_command="$finalize_command @SYMFILE@"
leo_sobral@2
  1008
	    preload=yes
leo_sobral@2
  1009
	  fi
leo_sobral@2
  1010
	  case $arg in
leo_sobral@2
  1011
	  *.la | *.lo) ;;  # We handle these cases below.
leo_sobral@2
  1012
	  force)
leo_sobral@2
  1013
	    if test "$dlself" = no; then
leo_sobral@2
  1014
	      dlself=needless
leo_sobral@2
  1015
	      export_dynamic=yes
leo_sobral@2
  1016
	    fi
leo_sobral@2
  1017
	    prev=
leo_sobral@2
  1018
	    continue
leo_sobral@2
  1019
	    ;;
leo_sobral@2
  1020
	  self)
leo_sobral@2
  1021
	    if test "$prev" = dlprefiles; then
leo_sobral@2
  1022
	      dlself=yes
leo_sobral@2
  1023
	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
leo_sobral@2
  1024
	      dlself=yes
leo_sobral@2
  1025
	    else
leo_sobral@2
  1026
	      dlself=needless
leo_sobral@2
  1027
	      export_dynamic=yes
leo_sobral@2
  1028
	    fi
leo_sobral@2
  1029
	    prev=
leo_sobral@2
  1030
	    continue
leo_sobral@2
  1031
	    ;;
leo_sobral@2
  1032
	  *)
leo_sobral@2
  1033
	    if test "$prev" = dlfiles; then
leo_sobral@2
  1034
	      dlfiles="$dlfiles $arg"
leo_sobral@2
  1035
	    else
leo_sobral@2
  1036
	      dlprefiles="$dlprefiles $arg"
leo_sobral@2
  1037
	    fi
leo_sobral@2
  1038
	    prev=
leo_sobral@2
  1039
	    continue
leo_sobral@2
  1040
	    ;;
leo_sobral@2
  1041
	  esac
leo_sobral@2
  1042
	  ;;
leo_sobral@2
  1043
	expsyms)
leo_sobral@2
  1044
	  export_symbols="$arg"
leo_sobral@2
  1045
	  if test ! -f "$arg"; then
leo_sobral@2
  1046
	    $echo "$modename: symbol file \`$arg' does not exist"
leo_sobral@2
  1047
	    exit $EXIT_FAILURE
leo_sobral@2
  1048
	  fi
leo_sobral@2
  1049
	  prev=
leo_sobral@2
  1050
	  continue
leo_sobral@2
  1051
	  ;;
leo_sobral@2
  1052
	expsyms_regex)
leo_sobral@2
  1053
	  export_symbols_regex="$arg"
leo_sobral@2
  1054
	  prev=
leo_sobral@2
  1055
	  continue
leo_sobral@2
  1056
	  ;;
leo_sobral@2
  1057
	inst_prefix)
leo_sobral@2
  1058
	  inst_prefix_dir="$arg"
leo_sobral@2
  1059
	  prev=
leo_sobral@2
  1060
	  continue
leo_sobral@2
  1061
	  ;;
leo_sobral@2
  1062
	precious_regex)
leo_sobral@2
  1063
	  precious_files_regex="$arg"
leo_sobral@2
  1064
	  prev=
leo_sobral@2
  1065
	  continue
leo_sobral@2
  1066
	  ;;
leo_sobral@2
  1067
	release)
leo_sobral@2
  1068
	  release="-$arg"
leo_sobral@2
  1069
	  prev=
leo_sobral@2
  1070
	  continue
leo_sobral@2
  1071
	  ;;
leo_sobral@2
  1072
	objectlist)
leo_sobral@2
  1073
	  if test -f "$arg"; then
leo_sobral@2
  1074
	    save_arg=$arg
leo_sobral@2
  1075
	    moreargs=
leo_sobral@2
  1076
	    for fil in `cat $save_arg`
leo_sobral@2
  1077
	    do
leo_sobral@2
  1078
#	      moreargs="$moreargs $fil"
leo_sobral@2
  1079
	      arg=$fil
leo_sobral@2
  1080
	      # A libtool-controlled object.
leo_sobral@2
  1081
leo_sobral@2
  1082
	      # Check to see that this really is a libtool object.
leo_sobral@2
  1083
	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  1084
		pic_object=
leo_sobral@2
  1085
		non_pic_object=
leo_sobral@2
  1086
leo_sobral@2
  1087
		# Read the .lo file
leo_sobral@2
  1088
		# If there is no directory component, then add one.
leo_sobral@2
  1089
		case $arg in
leo_sobral@2
  1090
		*/* | *\\*) . $arg ;;
leo_sobral@2
  1091
		*) . ./$arg ;;
leo_sobral@2
  1092
		esac
leo_sobral@2
  1093
leo_sobral@2
  1094
		if test -z "$pic_object" || \
leo_sobral@2
  1095
		   test -z "$non_pic_object" ||
leo_sobral@2
  1096
		   test "$pic_object" = none && \
leo_sobral@2
  1097
		   test "$non_pic_object" = none; then
leo_sobral@2
  1098
		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
leo_sobral@2
  1099
		  exit $EXIT_FAILURE
leo_sobral@2
  1100
		fi
leo_sobral@2
  1101
leo_sobral@2
  1102
		# Extract subdirectory from the argument.
leo_sobral@2
  1103
		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1104
		if test "X$xdir" = "X$arg"; then
leo_sobral@2
  1105
		  xdir=
leo_sobral@2
  1106
		else
leo_sobral@2
  1107
		  xdir="$xdir/"
leo_sobral@2
  1108
		fi
leo_sobral@2
  1109
leo_sobral@2
  1110
		if test "$pic_object" != none; then
leo_sobral@2
  1111
		  # Prepend the subdirectory the object is found in.
leo_sobral@2
  1112
		  pic_object="$xdir$pic_object"
leo_sobral@2
  1113
leo_sobral@2
  1114
		  if test "$prev" = dlfiles; then
leo_sobral@2
  1115
		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
leo_sobral@2
  1116
		      dlfiles="$dlfiles $pic_object"
leo_sobral@2
  1117
		      prev=
leo_sobral@2
  1118
		      continue
leo_sobral@2
  1119
		    else
leo_sobral@2
  1120
		      # If libtool objects are unsupported, then we need to preload.
leo_sobral@2
  1121
		      prev=dlprefiles
leo_sobral@2
  1122
		    fi
leo_sobral@2
  1123
		  fi
leo_sobral@2
  1124
leo_sobral@2
  1125
		  # CHECK ME:  I think I busted this.  -Ossama
leo_sobral@2
  1126
		  if test "$prev" = dlprefiles; then
leo_sobral@2
  1127
		    # Preload the old-style object.
leo_sobral@2
  1128
		    dlprefiles="$dlprefiles $pic_object"
leo_sobral@2
  1129
		    prev=
leo_sobral@2
  1130
		  fi
leo_sobral@2
  1131
leo_sobral@2
  1132
		  # A PIC object.
leo_sobral@2
  1133
		  libobjs="$libobjs $pic_object"
leo_sobral@2
  1134
		  arg="$pic_object"
leo_sobral@2
  1135
		fi
leo_sobral@2
  1136
leo_sobral@2
  1137
		# Non-PIC object.
leo_sobral@2
  1138
		if test "$non_pic_object" != none; then
leo_sobral@2
  1139
		  # Prepend the subdirectory the object is found in.
leo_sobral@2
  1140
		  non_pic_object="$xdir$non_pic_object"
leo_sobral@2
  1141
leo_sobral@2
  1142
		  # A standard non-PIC object
leo_sobral@2
  1143
		  non_pic_objects="$non_pic_objects $non_pic_object"
leo_sobral@2
  1144
		  if test -z "$pic_object" || test "$pic_object" = none ; then
leo_sobral@2
  1145
		    arg="$non_pic_object"
leo_sobral@2
  1146
		  fi
leo_sobral@2
  1147
		fi
leo_sobral@2
  1148
	      else
leo_sobral@2
  1149
		# Only an error if not doing a dry-run.
leo_sobral@2
  1150
		if test -z "$run"; then
leo_sobral@2
  1151
		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
leo_sobral@2
  1152
		  exit $EXIT_FAILURE
leo_sobral@2
  1153
		else
leo_sobral@2
  1154
		  # Dry-run case.
leo_sobral@2
  1155
leo_sobral@2
  1156
		  # Extract subdirectory from the argument.
leo_sobral@2
  1157
		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1158
		  if test "X$xdir" = "X$arg"; then
leo_sobral@2
  1159
		    xdir=
leo_sobral@2
  1160
		  else
leo_sobral@2
  1161
		    xdir="$xdir/"
leo_sobral@2
  1162
		  fi
leo_sobral@2
  1163
leo_sobral@2
  1164
		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
leo_sobral@2
  1165
		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
leo_sobral@2
  1166
		  libobjs="$libobjs $pic_object"
leo_sobral@2
  1167
		  non_pic_objects="$non_pic_objects $non_pic_object"
leo_sobral@2
  1168
		fi
leo_sobral@2
  1169
	      fi
leo_sobral@2
  1170
	    done
leo_sobral@2
  1171
	  else
leo_sobral@2
  1172
	    $echo "$modename: link input file \`$save_arg' does not exist"
leo_sobral@2
  1173
	    exit $EXIT_FAILURE
leo_sobral@2
  1174
	  fi
leo_sobral@2
  1175
	  arg=$save_arg
leo_sobral@2
  1176
	  prev=
leo_sobral@2
  1177
	  continue
leo_sobral@2
  1178
	  ;;
leo_sobral@2
  1179
	rpath | xrpath)
leo_sobral@2
  1180
	  # We need an absolute path.
leo_sobral@2
  1181
	  case $arg in
leo_sobral@2
  1182
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
leo_sobral@2
  1183
	  *)
leo_sobral@2
  1184
	    $echo "$modename: only absolute run-paths are allowed" 1>&2
leo_sobral@2
  1185
	    exit $EXIT_FAILURE
leo_sobral@2
  1186
	    ;;
leo_sobral@2
  1187
	  esac
leo_sobral@2
  1188
	  if test "$prev" = rpath; then
leo_sobral@2
  1189
	    case "$rpath " in
leo_sobral@2
  1190
	    *" $arg "*) ;;
leo_sobral@2
  1191
	    *) rpath="$rpath $arg" ;;
leo_sobral@2
  1192
	    esac
leo_sobral@2
  1193
	  else
leo_sobral@2
  1194
	    case "$xrpath " in
leo_sobral@2
  1195
	    *" $arg "*) ;;
leo_sobral@2
  1196
	    *) xrpath="$xrpath $arg" ;;
leo_sobral@2
  1197
	    esac
leo_sobral@2
  1198
	  fi
leo_sobral@2
  1199
	  prev=
leo_sobral@2
  1200
	  continue
leo_sobral@2
  1201
	  ;;
leo_sobral@2
  1202
	xcompiler)
leo_sobral@2
  1203
	  compiler_flags="$compiler_flags $qarg"
leo_sobral@2
  1204
	  prev=
leo_sobral@2
  1205
	  compile_command="$compile_command $qarg"
leo_sobral@2
  1206
	  finalize_command="$finalize_command $qarg"
leo_sobral@2
  1207
	  continue
leo_sobral@2
  1208
	  ;;
leo_sobral@2
  1209
	xlinker)
leo_sobral@2
  1210
	  linker_flags="$linker_flags $qarg"
leo_sobral@2
  1211
	  compiler_flags="$compiler_flags $wl$qarg"
leo_sobral@2
  1212
	  prev=
leo_sobral@2
  1213
	  compile_command="$compile_command $wl$qarg"
leo_sobral@2
  1214
	  finalize_command="$finalize_command $wl$qarg"
leo_sobral@2
  1215
	  continue
leo_sobral@2
  1216
	  ;;
leo_sobral@2
  1217
	xcclinker)
leo_sobral@2
  1218
	  linker_flags="$linker_flags $qarg"
leo_sobral@2
  1219
	  compiler_flags="$compiler_flags $qarg"
leo_sobral@2
  1220
	  prev=
leo_sobral@2
  1221
	  compile_command="$compile_command $qarg"
leo_sobral@2
  1222
	  finalize_command="$finalize_command $qarg"
leo_sobral@2
  1223
	  continue
leo_sobral@2
  1224
	  ;;
leo_sobral@2
  1225
	shrext)
leo_sobral@2
  1226
  	  shrext_cmds="$arg"
leo_sobral@2
  1227
	  prev=
leo_sobral@2
  1228
	  continue
leo_sobral@2
  1229
	  ;;
leo_sobral@2
  1230
	*)
leo_sobral@2
  1231
	  eval "$prev=\"\$arg\""
leo_sobral@2
  1232
	  prev=
leo_sobral@2
  1233
	  continue
leo_sobral@2
  1234
	  ;;
leo_sobral@2
  1235
	esac
leo_sobral@2
  1236
      fi # test -n "$prev"
leo_sobral@2
  1237
leo_sobral@2
  1238
      prevarg="$arg"
leo_sobral@2
  1239
leo_sobral@2
  1240
      case $arg in
leo_sobral@2
  1241
      -all-static)
leo_sobral@2
  1242
	if test -n "$link_static_flag"; then
leo_sobral@2
  1243
	  compile_command="$compile_command $link_static_flag"
leo_sobral@2
  1244
	  finalize_command="$finalize_command $link_static_flag"
leo_sobral@2
  1245
	fi
leo_sobral@2
  1246
	continue
leo_sobral@2
  1247
	;;
leo_sobral@2
  1248
leo_sobral@2
  1249
      -allow-undefined)
leo_sobral@2
  1250
	# FIXME: remove this flag sometime in the future.
leo_sobral@2
  1251
	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
leo_sobral@2
  1252
	continue
leo_sobral@2
  1253
	;;
leo_sobral@2
  1254
leo_sobral@2
  1255
      -avoid-version)
leo_sobral@2
  1256
	avoid_version=yes
leo_sobral@2
  1257
	continue
leo_sobral@2
  1258
	;;
leo_sobral@2
  1259
leo_sobral@2
  1260
      -dlopen)
leo_sobral@2
  1261
	prev=dlfiles
leo_sobral@2
  1262
	continue
leo_sobral@2
  1263
	;;
leo_sobral@2
  1264
leo_sobral@2
  1265
      -dlpreopen)
leo_sobral@2
  1266
	prev=dlprefiles
leo_sobral@2
  1267
	continue
leo_sobral@2
  1268
	;;
leo_sobral@2
  1269
leo_sobral@2
  1270
      -export-dynamic)
leo_sobral@2
  1271
	export_dynamic=yes
leo_sobral@2
  1272
	continue
leo_sobral@2
  1273
	;;
leo_sobral@2
  1274
leo_sobral@2
  1275
      -export-symbols | -export-symbols-regex)
leo_sobral@2
  1276
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
leo_sobral@2
  1277
	  $echo "$modename: more than one -exported-symbols argument is not allowed"
leo_sobral@2
  1278
	  exit $EXIT_FAILURE
leo_sobral@2
  1279
	fi
leo_sobral@2
  1280
	if test "X$arg" = "X-export-symbols"; then
leo_sobral@2
  1281
	  prev=expsyms
leo_sobral@2
  1282
	else
leo_sobral@2
  1283
	  prev=expsyms_regex
leo_sobral@2
  1284
	fi
leo_sobral@2
  1285
	continue
leo_sobral@2
  1286
	;;
leo_sobral@2
  1287
leo_sobral@2
  1288
      -inst-prefix-dir)
leo_sobral@2
  1289
	prev=inst_prefix
leo_sobral@2
  1290
	continue
leo_sobral@2
  1291
	;;
leo_sobral@2
  1292
leo_sobral@2
  1293
      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
leo_sobral@2
  1294
      # so, if we see these flags be careful not to treat them like -L
leo_sobral@2
  1295
      -L[A-Z][A-Z]*:*)
leo_sobral@2
  1296
	case $with_gcc/$host in
leo_sobral@2
  1297
	no/*-*-irix* | /*-*-irix*)
leo_sobral@2
  1298
	  compile_command="$compile_command $arg"
leo_sobral@2
  1299
	  finalize_command="$finalize_command $arg"
leo_sobral@2
  1300
	  ;;
leo_sobral@2
  1301
	esac
leo_sobral@2
  1302
	continue
leo_sobral@2
  1303
	;;
leo_sobral@2
  1304
leo_sobral@2
  1305
      -L*)
leo_sobral@2
  1306
	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
leo_sobral@2
  1307
	# We need an absolute path.
leo_sobral@2
  1308
	case $dir in
leo_sobral@2
  1309
	[\\/]* | [A-Za-z]:[\\/]*) ;;
leo_sobral@2
  1310
	*)
leo_sobral@2
  1311
	  absdir=`cd "$dir" && pwd`
leo_sobral@2
  1312
	  if test -z "$absdir"; then
leo_sobral@2
  1313
	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
leo_sobral@2
  1314
	    exit $EXIT_FAILURE
leo_sobral@2
  1315
	  fi
leo_sobral@2
  1316
	  dir="$absdir"
leo_sobral@2
  1317
	  ;;
leo_sobral@2
  1318
	esac
leo_sobral@2
  1319
	case "$deplibs " in
leo_sobral@2
  1320
	*" -L$dir "*) ;;
leo_sobral@2
  1321
	*)
leo_sobral@2
  1322
	  deplibs="$deplibs -L$dir"
leo_sobral@2
  1323
	  lib_search_path="$lib_search_path $dir"
leo_sobral@2
  1324
	  ;;
leo_sobral@2
  1325
	esac
leo_sobral@2
  1326
	case $host in
leo_sobral@2
  1327
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
leo_sobral@2
  1328
	  case :$dllsearchpath: in
leo_sobral@2
  1329
	  *":$dir:"*) ;;
leo_sobral@2
  1330
	  *) dllsearchpath="$dllsearchpath:$dir";;
leo_sobral@2
  1331
	  esac
leo_sobral@2
  1332
	  ;;
leo_sobral@2
  1333
	esac
leo_sobral@2
  1334
	continue
leo_sobral@2
  1335
	;;
leo_sobral@2
  1336
leo_sobral@2
  1337
      -l*)
leo_sobral@2
  1338
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
leo_sobral@2
  1339
	  case $host in
leo_sobral@2
  1340
	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
leo_sobral@2
  1341
	    # These systems don't actually have a C or math library (as such)
leo_sobral@2
  1342
	    continue
leo_sobral@2
  1343
	    ;;
leo_sobral@2
  1344
	  *-*-mingw* | *-*-os2*)
leo_sobral@2
  1345
	    # These systems don't actually have a C library (as such)
leo_sobral@2
  1346
	    test "X$arg" = "X-lc" && continue
leo_sobral@2
  1347
	    ;;
leo_sobral@2
  1348
	  *-*-openbsd* | *-*-freebsd*)
leo_sobral@2
  1349
	    # Do not include libc due to us having libc/libc_r.
leo_sobral@2
  1350
	    test "X$arg" = "X-lc" && continue
leo_sobral@2
  1351
	    ;;
leo_sobral@2
  1352
	  *-*-rhapsody* | *-*-darwin1.[012])
leo_sobral@2
  1353
	    # Rhapsody C and math libraries are in the System framework
leo_sobral@2
  1354
	    deplibs="$deplibs -framework System"
leo_sobral@2
  1355
	    continue
leo_sobral@2
  1356
	  esac
leo_sobral@2
  1357
	elif test "X$arg" = "X-lc_r"; then
leo_sobral@2
  1358
	 case $host in
leo_sobral@2
  1359
	 *-*-openbsd* | *-*-freebsd*)
leo_sobral@2
  1360
	   # Do not include libc_r directly, use -pthread flag.
leo_sobral@2
  1361
	   continue
leo_sobral@2
  1362
	   ;;
leo_sobral@2
  1363
	 esac
leo_sobral@2
  1364
	fi
leo_sobral@2
  1365
	deplibs="$deplibs $arg"
leo_sobral@2
  1366
	continue
leo_sobral@2
  1367
	;;
leo_sobral@2
  1368
leo_sobral@2
  1369
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
leo_sobral@2
  1370
	deplibs="$deplibs $arg"
leo_sobral@2
  1371
	continue
leo_sobral@2
  1372
	;;
leo_sobral@2
  1373
leo_sobral@2
  1374
      -module)
leo_sobral@2
  1375
	module=yes
leo_sobral@2
  1376
	continue
leo_sobral@2
  1377
	;;
leo_sobral@2
  1378
leo_sobral@2
  1379
      # gcc -m* arguments should be passed to the linker via $compiler_flags
leo_sobral@2
  1380
      # in order to pass architecture information to the linker
leo_sobral@2
  1381
      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
leo_sobral@2
  1382
      # but this is not reliable with gcc because gcc may use -mfoo to
leo_sobral@2
  1383
      # select a different linker, different libraries, etc, while
leo_sobral@2
  1384
      # -Wl,-mfoo simply passes -mfoo to the linker.
leo_sobral@2
  1385
      -m*)
leo_sobral@2
  1386
	# Unknown arguments in both finalize_command and compile_command need
leo_sobral@2
  1387
	# to be aesthetically quoted because they are evaled later.
leo_sobral@2
  1388
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  1389
	case $arg in
leo_sobral@2
  1390
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
  1391
	  arg="\"$arg\""
leo_sobral@2
  1392
	  ;;
leo_sobral@2
  1393
	esac
leo_sobral@2
  1394
        compile_command="$compile_command $arg"
leo_sobral@2
  1395
        finalize_command="$finalize_command $arg"
leo_sobral@2
  1396
        if test "$with_gcc" = "yes" ; then
leo_sobral@2
  1397
          compiler_flags="$compiler_flags $arg"
leo_sobral@2
  1398
        fi
leo_sobral@2
  1399
        continue
leo_sobral@2
  1400
        ;;
leo_sobral@2
  1401
leo_sobral@2
  1402
      -shrext)
leo_sobral@2
  1403
	prev=shrext
leo_sobral@2
  1404
	continue
leo_sobral@2
  1405
	;;
leo_sobral@2
  1406
leo_sobral@2
  1407
      -no-fast-install)
leo_sobral@2
  1408
	fast_install=no
leo_sobral@2
  1409
	continue
leo_sobral@2
  1410
	;;
leo_sobral@2
  1411
leo_sobral@2
  1412
      -no-install)
leo_sobral@2
  1413
	case $host in
leo_sobral@2
  1414
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
leo_sobral@2
  1415
	  # The PATH hackery in wrapper scripts is required on Windows
leo_sobral@2
  1416
	  # in order for the loader to find any dlls it needs.
leo_sobral@2
  1417
	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
leo_sobral@2
  1418
	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
leo_sobral@2
  1419
	  fast_install=no
leo_sobral@2
  1420
	  ;;
leo_sobral@2
  1421
	*) no_install=yes ;;
leo_sobral@2
  1422
	esac
leo_sobral@2
  1423
	continue
leo_sobral@2
  1424
	;;
leo_sobral@2
  1425
leo_sobral@2
  1426
      -no-undefined)
leo_sobral@2
  1427
	allow_undefined=no
leo_sobral@2
  1428
	continue
leo_sobral@2
  1429
	;;
leo_sobral@2
  1430
leo_sobral@2
  1431
      -objectlist)
leo_sobral@2
  1432
	prev=objectlist
leo_sobral@2
  1433
	continue
leo_sobral@2
  1434
	;;
leo_sobral@2
  1435
leo_sobral@2
  1436
      -o) prev=output ;;
leo_sobral@2
  1437
leo_sobral@2
  1438
      -precious-files-regex)
leo_sobral@2
  1439
	prev=precious_regex
leo_sobral@2
  1440
	continue
leo_sobral@2
  1441
	;;
leo_sobral@2
  1442
leo_sobral@2
  1443
      -release)
leo_sobral@2
  1444
	prev=release
leo_sobral@2
  1445
	continue
leo_sobral@2
  1446
	;;
leo_sobral@2
  1447
leo_sobral@2
  1448
      -rpath)
leo_sobral@2
  1449
	prev=rpath
leo_sobral@2
  1450
	continue
leo_sobral@2
  1451
	;;
leo_sobral@2
  1452
leo_sobral@2
  1453
      -R)
leo_sobral@2
  1454
	prev=xrpath
leo_sobral@2
  1455
	continue
leo_sobral@2
  1456
	;;
leo_sobral@2
  1457
leo_sobral@2
  1458
      -R*)
leo_sobral@2
  1459
	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
leo_sobral@2
  1460
	# We need an absolute path.
leo_sobral@2
  1461
	case $dir in
leo_sobral@2
  1462
	[\\/]* | [A-Za-z]:[\\/]*) ;;
leo_sobral@2
  1463
	*)
leo_sobral@2
  1464
	  $echo "$modename: only absolute run-paths are allowed" 1>&2
leo_sobral@2
  1465
	  exit $EXIT_FAILURE
leo_sobral@2
  1466
	  ;;
leo_sobral@2
  1467
	esac
leo_sobral@2
  1468
	case "$xrpath " in
leo_sobral@2
  1469
	*" $dir "*) ;;
leo_sobral@2
  1470
	*) xrpath="$xrpath $dir" ;;
leo_sobral@2
  1471
	esac
leo_sobral@2
  1472
	continue
leo_sobral@2
  1473
	;;
leo_sobral@2
  1474
leo_sobral@2
  1475
      -static)
leo_sobral@2
  1476
	# The effects of -static are defined in a previous loop.
leo_sobral@2
  1477
	# We used to do the same as -all-static on platforms that
leo_sobral@2
  1478
	# didn't have a PIC flag, but the assumption that the effects
leo_sobral@2
  1479
	# would be equivalent was wrong.  It would break on at least
leo_sobral@2
  1480
	# Digital Unix and AIX.
leo_sobral@2
  1481
	continue
leo_sobral@2
  1482
	;;
leo_sobral@2
  1483
leo_sobral@2
  1484
      -thread-safe)
leo_sobral@2
  1485
	thread_safe=yes
leo_sobral@2
  1486
	continue
leo_sobral@2
  1487
	;;
leo_sobral@2
  1488
leo_sobral@2
  1489
      -version-info)
leo_sobral@2
  1490
	prev=vinfo
leo_sobral@2
  1491
	continue
leo_sobral@2
  1492
	;;
leo_sobral@2
  1493
      -version-number)
leo_sobral@2
  1494
	prev=vinfo
leo_sobral@2
  1495
	vinfo_number=yes
leo_sobral@2
  1496
	continue
leo_sobral@2
  1497
	;;
leo_sobral@2
  1498
leo_sobral@2
  1499
      -Wc,*)
leo_sobral@2
  1500
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
leo_sobral@2
  1501
	arg=
leo_sobral@2
  1502
	save_ifs="$IFS"; IFS=','
leo_sobral@2
  1503
	for flag in $args; do
leo_sobral@2
  1504
	  IFS="$save_ifs"
leo_sobral@2
  1505
	  case $flag in
leo_sobral@2
  1506
	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
  1507
	    flag="\"$flag\""
leo_sobral@2
  1508
	    ;;
leo_sobral@2
  1509
	  esac
leo_sobral@2
  1510
	  arg="$arg $wl$flag"
leo_sobral@2
  1511
	  compiler_flags="$compiler_flags $flag"
leo_sobral@2
  1512
	done
leo_sobral@2
  1513
	IFS="$save_ifs"
leo_sobral@2
  1514
	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
leo_sobral@2
  1515
	;;
leo_sobral@2
  1516
leo_sobral@2
  1517
      -Wl,*)
leo_sobral@2
  1518
	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
leo_sobral@2
  1519
	arg=
leo_sobral@2
  1520
	save_ifs="$IFS"; IFS=','
leo_sobral@2
  1521
	for flag in $args; do
leo_sobral@2
  1522
	  IFS="$save_ifs"
leo_sobral@2
  1523
	  case $flag in
leo_sobral@2
  1524
	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
  1525
	    flag="\"$flag\""
leo_sobral@2
  1526
	    ;;
leo_sobral@2
  1527
	  esac
leo_sobral@2
  1528
	  arg="$arg $wl$flag"
leo_sobral@2
  1529
	  compiler_flags="$compiler_flags $wl$flag"
leo_sobral@2
  1530
	  linker_flags="$linker_flags $flag"
leo_sobral@2
  1531
	done
leo_sobral@2
  1532
	IFS="$save_ifs"
leo_sobral@2
  1533
	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
leo_sobral@2
  1534
	;;
leo_sobral@2
  1535
leo_sobral@2
  1536
      -Xcompiler)
leo_sobral@2
  1537
	prev=xcompiler
leo_sobral@2
  1538
	continue
leo_sobral@2
  1539
	;;
leo_sobral@2
  1540
leo_sobral@2
  1541
      -Xlinker)
leo_sobral@2
  1542
	prev=xlinker
leo_sobral@2
  1543
	continue
leo_sobral@2
  1544
	;;
leo_sobral@2
  1545
leo_sobral@2
  1546
      -XCClinker)
leo_sobral@2
  1547
	prev=xcclinker
leo_sobral@2
  1548
	continue
leo_sobral@2
  1549
	;;
leo_sobral@2
  1550
leo_sobral@2
  1551
      # Some other compiler flag.
leo_sobral@2
  1552
      -* | +*)
leo_sobral@2
  1553
	# Unknown arguments in both finalize_command and compile_command need
leo_sobral@2
  1554
	# to be aesthetically quoted because they are evaled later.
leo_sobral@2
  1555
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  1556
	case $arg in
leo_sobral@2
  1557
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
  1558
	  arg="\"$arg\""
leo_sobral@2
  1559
	  ;;
leo_sobral@2
  1560
	esac
leo_sobral@2
  1561
	;;
leo_sobral@2
  1562
leo_sobral@2
  1563
      *.$objext)
leo_sobral@2
  1564
	# A standard object.
leo_sobral@2
  1565
	objs="$objs $arg"
leo_sobral@2
  1566
	;;
leo_sobral@2
  1567
leo_sobral@2
  1568
      *.lo)
leo_sobral@2
  1569
	# A libtool-controlled object.
leo_sobral@2
  1570
leo_sobral@2
  1571
	# Check to see that this really is a libtool object.
leo_sobral@2
  1572
	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  1573
	  pic_object=
leo_sobral@2
  1574
	  non_pic_object=
leo_sobral@2
  1575
leo_sobral@2
  1576
	  # Read the .lo file
leo_sobral@2
  1577
	  # If there is no directory component, then add one.
leo_sobral@2
  1578
	  case $arg in
leo_sobral@2
  1579
	  */* | *\\*) . $arg ;;
leo_sobral@2
  1580
	  *) . ./$arg ;;
leo_sobral@2
  1581
	  esac
leo_sobral@2
  1582
leo_sobral@2
  1583
	  if test -z "$pic_object" || \
leo_sobral@2
  1584
	     test -z "$non_pic_object" ||
leo_sobral@2
  1585
	     test "$pic_object" = none && \
leo_sobral@2
  1586
	     test "$non_pic_object" = none; then
leo_sobral@2
  1587
	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
leo_sobral@2
  1588
	    exit $EXIT_FAILURE
leo_sobral@2
  1589
	  fi
leo_sobral@2
  1590
leo_sobral@2
  1591
	  # Extract subdirectory from the argument.
leo_sobral@2
  1592
	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1593
	  if test "X$xdir" = "X$arg"; then
leo_sobral@2
  1594
	    xdir=
leo_sobral@2
  1595
 	  else
leo_sobral@2
  1596
	    xdir="$xdir/"
leo_sobral@2
  1597
	  fi
leo_sobral@2
  1598
leo_sobral@2
  1599
	  if test "$pic_object" != none; then
leo_sobral@2
  1600
	    # Prepend the subdirectory the object is found in.
leo_sobral@2
  1601
	    pic_object="$xdir$pic_object"
leo_sobral@2
  1602
leo_sobral@2
  1603
	    if test "$prev" = dlfiles; then
leo_sobral@2
  1604
	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
leo_sobral@2
  1605
		dlfiles="$dlfiles $pic_object"
leo_sobral@2
  1606
		prev=
leo_sobral@2
  1607
		continue
leo_sobral@2
  1608
	      else
leo_sobral@2
  1609
		# If libtool objects are unsupported, then we need to preload.
leo_sobral@2
  1610
		prev=dlprefiles
leo_sobral@2
  1611
	      fi
leo_sobral@2
  1612
	    fi
leo_sobral@2
  1613
leo_sobral@2
  1614
	    # CHECK ME:  I think I busted this.  -Ossama
leo_sobral@2
  1615
	    if test "$prev" = dlprefiles; then
leo_sobral@2
  1616
	      # Preload the old-style object.
leo_sobral@2
  1617
	      dlprefiles="$dlprefiles $pic_object"
leo_sobral@2
  1618
	      prev=
leo_sobral@2
  1619
	    fi
leo_sobral@2
  1620
leo_sobral@2
  1621
	    # A PIC object.
leo_sobral@2
  1622
	    libobjs="$libobjs $pic_object"
leo_sobral@2
  1623
	    arg="$pic_object"
leo_sobral@2
  1624
	  fi
leo_sobral@2
  1625
leo_sobral@2
  1626
	  # Non-PIC object.
leo_sobral@2
  1627
	  if test "$non_pic_object" != none; then
leo_sobral@2
  1628
	    # Prepend the subdirectory the object is found in.
leo_sobral@2
  1629
	    non_pic_object="$xdir$non_pic_object"
leo_sobral@2
  1630
leo_sobral@2
  1631
	    # A standard non-PIC object
leo_sobral@2
  1632
	    non_pic_objects="$non_pic_objects $non_pic_object"
leo_sobral@2
  1633
	    if test -z "$pic_object" || test "$pic_object" = none ; then
leo_sobral@2
  1634
	      arg="$non_pic_object"
leo_sobral@2
  1635
	    fi
leo_sobral@2
  1636
	  fi
leo_sobral@2
  1637
	else
leo_sobral@2
  1638
	  # Only an error if not doing a dry-run.
leo_sobral@2
  1639
	  if test -z "$run"; then
leo_sobral@2
  1640
	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
leo_sobral@2
  1641
	    exit $EXIT_FAILURE
leo_sobral@2
  1642
	  else
leo_sobral@2
  1643
	    # Dry-run case.
leo_sobral@2
  1644
leo_sobral@2
  1645
	    # Extract subdirectory from the argument.
leo_sobral@2
  1646
	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1647
	    if test "X$xdir" = "X$arg"; then
leo_sobral@2
  1648
	      xdir=
leo_sobral@2
  1649
	    else
leo_sobral@2
  1650
	      xdir="$xdir/"
leo_sobral@2
  1651
	    fi
leo_sobral@2
  1652
leo_sobral@2
  1653
	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
leo_sobral@2
  1654
	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
leo_sobral@2
  1655
	    libobjs="$libobjs $pic_object"
leo_sobral@2
  1656
	    non_pic_objects="$non_pic_objects $non_pic_object"
leo_sobral@2
  1657
	  fi
leo_sobral@2
  1658
	fi
leo_sobral@2
  1659
	;;
leo_sobral@2
  1660
leo_sobral@2
  1661
      *.$libext)
leo_sobral@2
  1662
	# An archive.
leo_sobral@2
  1663
	deplibs="$deplibs $arg"
leo_sobral@2
  1664
	old_deplibs="$old_deplibs $arg"
leo_sobral@2
  1665
	continue
leo_sobral@2
  1666
	;;
leo_sobral@2
  1667
leo_sobral@2
  1668
      *.la)
leo_sobral@2
  1669
	# A libtool-controlled library.
leo_sobral@2
  1670
leo_sobral@2
  1671
	if test "$prev" = dlfiles; then
leo_sobral@2
  1672
	  # This library was specified with -dlopen.
leo_sobral@2
  1673
	  dlfiles="$dlfiles $arg"
leo_sobral@2
  1674
	  prev=
leo_sobral@2
  1675
	elif test "$prev" = dlprefiles; then
leo_sobral@2
  1676
	  # The library was specified with -dlpreopen.
leo_sobral@2
  1677
	  dlprefiles="$dlprefiles $arg"
leo_sobral@2
  1678
	  prev=
leo_sobral@2
  1679
	else
leo_sobral@2
  1680
	  deplibs="$deplibs $arg"
leo_sobral@2
  1681
	fi
leo_sobral@2
  1682
	continue
leo_sobral@2
  1683
	;;
leo_sobral@2
  1684
leo_sobral@2
  1685
      # Some other compiler argument.
leo_sobral@2
  1686
      *)
leo_sobral@2
  1687
	# Unknown arguments in both finalize_command and compile_command need
leo_sobral@2
  1688
	# to be aesthetically quoted because they are evaled later.
leo_sobral@2
  1689
	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  1690
	case $arg in
leo_sobral@2
  1691
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
leo_sobral@2
  1692
	  arg="\"$arg\""
leo_sobral@2
  1693
	  ;;
leo_sobral@2
  1694
	esac
leo_sobral@2
  1695
	;;
leo_sobral@2
  1696
      esac # arg
leo_sobral@2
  1697
leo_sobral@2
  1698
      # Now actually substitute the argument into the commands.
leo_sobral@2
  1699
      if test -n "$arg"; then
leo_sobral@2
  1700
	compile_command="$compile_command $arg"
leo_sobral@2
  1701
	finalize_command="$finalize_command $arg"
leo_sobral@2
  1702
      fi
leo_sobral@2
  1703
    done # argument parsing loop
leo_sobral@2
  1704
leo_sobral@2
  1705
    if test -n "$prev"; then
leo_sobral@2
  1706
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
leo_sobral@2
  1707
      $echo "$help" 1>&2
leo_sobral@2
  1708
      exit $EXIT_FAILURE
leo_sobral@2
  1709
    fi
leo_sobral@2
  1710
leo_sobral@2
  1711
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
leo_sobral@2
  1712
      eval arg=\"$export_dynamic_flag_spec\"
leo_sobral@2
  1713
      compile_command="$compile_command $arg"
leo_sobral@2
  1714
      finalize_command="$finalize_command $arg"
leo_sobral@2
  1715
    fi
leo_sobral@2
  1716
leo_sobral@2
  1717
    oldlibs=
leo_sobral@2
  1718
    # calculate the name of the file, without its directory
leo_sobral@2
  1719
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  1720
    libobjs_save="$libobjs"
leo_sobral@2
  1721
leo_sobral@2
  1722
    if test -n "$shlibpath_var"; then
leo_sobral@2
  1723
      # get the directories listed in $shlibpath_var
leo_sobral@2
  1724
      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
leo_sobral@2
  1725
    else
leo_sobral@2
  1726
      shlib_search_path=
leo_sobral@2
  1727
    fi
leo_sobral@2
  1728
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
leo_sobral@2
  1729
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
leo_sobral@2
  1730
leo_sobral@2
  1731
    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1732
    if test "X$output_objdir" = "X$output"; then
leo_sobral@2
  1733
      output_objdir="$objdir"
leo_sobral@2
  1734
    else
leo_sobral@2
  1735
      output_objdir="$output_objdir/$objdir"
leo_sobral@2
  1736
    fi
leo_sobral@2
  1737
    # Create the object directory.
leo_sobral@2
  1738
    if test ! -d "$output_objdir"; then
leo_sobral@2
  1739
      $show "$mkdir $output_objdir"
leo_sobral@2
  1740
      $run $mkdir $output_objdir
leo_sobral@2
  1741
      status=$?
leo_sobral@2
  1742
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
leo_sobral@2
  1743
	exit $status
leo_sobral@2
  1744
      fi
leo_sobral@2
  1745
    fi
leo_sobral@2
  1746
leo_sobral@2
  1747
    # Determine the type of output
leo_sobral@2
  1748
    case $output in
leo_sobral@2
  1749
    "")
leo_sobral@2
  1750
      $echo "$modename: you must specify an output file" 1>&2
leo_sobral@2
  1751
      $echo "$help" 1>&2
leo_sobral@2
  1752
      exit $EXIT_FAILURE
leo_sobral@2
  1753
      ;;
leo_sobral@2
  1754
    *.$libext) linkmode=oldlib ;;
leo_sobral@2
  1755
    *.lo | *.$objext) linkmode=obj ;;
leo_sobral@2
  1756
    *.la) linkmode=lib ;;
leo_sobral@2
  1757
    *) linkmode=prog ;; # Anything else should be a program.
leo_sobral@2
  1758
    esac
leo_sobral@2
  1759
leo_sobral@2
  1760
    case $host in
leo_sobral@2
  1761
    *cygwin* | *mingw* | *pw32*)
leo_sobral@2
  1762
      # don't eliminate duplications in $postdeps and $predeps
leo_sobral@2
  1763
      duplicate_compiler_generated_deps=yes
leo_sobral@2
  1764
      ;;
leo_sobral@2
  1765
    *)
leo_sobral@2
  1766
      duplicate_compiler_generated_deps=$duplicate_deps
leo_sobral@2
  1767
      ;;
leo_sobral@2
  1768
    esac
leo_sobral@2
  1769
    specialdeplibs=
leo_sobral@2
  1770
leo_sobral@2
  1771
    libs=
leo_sobral@2
  1772
    # Find all interdependent deplibs by searching for libraries
leo_sobral@2
  1773
    # that are linked more than once (e.g. -la -lb -la)
leo_sobral@2
  1774
    for deplib in $deplibs; do
leo_sobral@2
  1775
      if test "X$duplicate_deps" = "Xyes" ; then
leo_sobral@2
  1776
	case "$libs " in
leo_sobral@2
  1777
	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
leo_sobral@2
  1778
	esac
leo_sobral@2
  1779
      fi
leo_sobral@2
  1780
      libs="$libs $deplib"
leo_sobral@2
  1781
    done
leo_sobral@2
  1782
leo_sobral@2
  1783
    if test "$linkmode" = lib; then
leo_sobral@2
  1784
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
leo_sobral@2
  1785
leo_sobral@2
  1786
      # Compute libraries that are listed more than once in $predeps
leo_sobral@2
  1787
      # $postdeps and mark them as special (i.e., whose duplicates are
leo_sobral@2
  1788
      # not to be eliminated).
leo_sobral@2
  1789
      pre_post_deps=
leo_sobral@2
  1790
      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
leo_sobral@2
  1791
	for pre_post_dep in $predeps $postdeps; do
leo_sobral@2
  1792
	  case "$pre_post_deps " in
leo_sobral@2
  1793
	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
leo_sobral@2
  1794
	  esac
leo_sobral@2
  1795
	  pre_post_deps="$pre_post_deps $pre_post_dep"
leo_sobral@2
  1796
	done
leo_sobral@2
  1797
      fi
leo_sobral@2
  1798
      pre_post_deps=
leo_sobral@2
  1799
    fi
leo_sobral@2
  1800
leo_sobral@2
  1801
    deplibs=
leo_sobral@2
  1802
    newdependency_libs=
leo_sobral@2
  1803
    newlib_search_path=
leo_sobral@2
  1804
    need_relink=no # whether we're linking any uninstalled libtool libraries
leo_sobral@2
  1805
    notinst_deplibs= # not-installed libtool libraries
leo_sobral@2
  1806
    notinst_path= # paths that contain not-installed libtool libraries
leo_sobral@2
  1807
    case $linkmode in
leo_sobral@2
  1808
    lib)
leo_sobral@2
  1809
	passes="conv link"
leo_sobral@2
  1810
	for file in $dlfiles $dlprefiles; do
leo_sobral@2
  1811
	  case $file in
leo_sobral@2
  1812
	  *.la) ;;
leo_sobral@2
  1813
	  *)
leo_sobral@2
  1814
	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
leo_sobral@2
  1815
	    exit $EXIT_FAILURE
leo_sobral@2
  1816
	    ;;
leo_sobral@2
  1817
	  esac
leo_sobral@2
  1818
	done
leo_sobral@2
  1819
	;;
leo_sobral@2
  1820
    prog)
leo_sobral@2
  1821
	compile_deplibs=
leo_sobral@2
  1822
	finalize_deplibs=
leo_sobral@2
  1823
	alldeplibs=no
leo_sobral@2
  1824
	newdlfiles=
leo_sobral@2
  1825
	newdlprefiles=
leo_sobral@2
  1826
	passes="conv scan dlopen dlpreopen link"
leo_sobral@2
  1827
	;;
leo_sobral@2
  1828
    *)  passes="conv"
leo_sobral@2
  1829
	;;
leo_sobral@2
  1830
    esac
leo_sobral@2
  1831
    for pass in $passes; do
leo_sobral@2
  1832
      if test "$linkmode,$pass" = "lib,link" ||
leo_sobral@2
  1833
	 test "$linkmode,$pass" = "prog,scan"; then
leo_sobral@2
  1834
	libs="$deplibs"
leo_sobral@2
  1835
	deplibs=
leo_sobral@2
  1836
      fi
leo_sobral@2
  1837
      if test "$linkmode" = prog; then
leo_sobral@2
  1838
	case $pass in
leo_sobral@2
  1839
	dlopen) libs="$dlfiles" ;;
leo_sobral@2
  1840
	dlpreopen) libs="$dlprefiles" ;;
leo_sobral@2
  1841
	link)
leo_sobral@2
  1842
	  libs="$deplibs %DEPLIBS%"
leo_sobral@2
  1843
	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
leo_sobral@2
  1844
	  ;;
leo_sobral@2
  1845
	esac
leo_sobral@2
  1846
      fi
leo_sobral@2
  1847
      if test "$pass" = dlopen; then
leo_sobral@2
  1848
	# Collect dlpreopened libraries
leo_sobral@2
  1849
	save_deplibs="$deplibs"
leo_sobral@2
  1850
	deplibs=
leo_sobral@2
  1851
      fi
leo_sobral@2
  1852
      for deplib in $libs; do
leo_sobral@2
  1853
	lib=
leo_sobral@2
  1854
	found=no
leo_sobral@2
  1855
	case $deplib in
leo_sobral@2
  1856
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
leo_sobral@2
  1857
	  if test "$linkmode,$pass" = "prog,link"; then
leo_sobral@2
  1858
	    compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  1859
	    finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  1860
	  else
leo_sobral@2
  1861
	    deplibs="$deplib $deplibs"
leo_sobral@2
  1862
	  fi
leo_sobral@2
  1863
	  continue
leo_sobral@2
  1864
	  ;;
leo_sobral@2
  1865
	-l*)
leo_sobral@2
  1866
	  if test "$linkmode" != lib && test "$linkmode" != prog; then
leo_sobral@2
  1867
	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
leo_sobral@2
  1868
	    continue
leo_sobral@2
  1869
	  fi
leo_sobral@2
  1870
	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
leo_sobral@2
  1871
	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
leo_sobral@2
  1872
	    for search_ext in .la $std_shrext .so .a; do
leo_sobral@2
  1873
	      # Search the libtool library
leo_sobral@2
  1874
	      lib="$searchdir/lib${name}${search_ext}"
leo_sobral@2
  1875
	      if test -f "$lib"; then
leo_sobral@2
  1876
		if test "$search_ext" = ".la"; then
leo_sobral@2
  1877
		  found=yes
leo_sobral@2
  1878
		else
leo_sobral@2
  1879
		  found=no
leo_sobral@2
  1880
		fi
leo_sobral@2
  1881
		break 2
leo_sobral@2
  1882
	      fi
leo_sobral@2
  1883
	    done
leo_sobral@2
  1884
	  done
leo_sobral@2
  1885
	  if test "$found" != yes; then
leo_sobral@2
  1886
	    # deplib doesn't seem to be a libtool library
leo_sobral@2
  1887
	    if test "$linkmode,$pass" = "prog,link"; then
leo_sobral@2
  1888
	      compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  1889
	      finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  1890
	    else
leo_sobral@2
  1891
	      deplibs="$deplib $deplibs"
leo_sobral@2
  1892
	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
leo_sobral@2
  1893
	    fi
leo_sobral@2
  1894
	    continue
leo_sobral@2
  1895
	  else # deplib is a libtool library
leo_sobral@2
  1896
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
leo_sobral@2
  1897
	    # We need to do some special things here, and not later.
leo_sobral@2
  1898
	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  1899
	      case " $predeps $postdeps " in
leo_sobral@2
  1900
	      *" $deplib "*)
leo_sobral@2
  1901
		if (${SED} -e '2q' $lib |
leo_sobral@2
  1902
                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  1903
		  library_names=
leo_sobral@2
  1904
		  old_library=
leo_sobral@2
  1905
		  case $lib in
leo_sobral@2
  1906
		  */* | *\\*) . $lib ;;
leo_sobral@2
  1907
		  *) . ./$lib ;;
leo_sobral@2
  1908
		  esac
leo_sobral@2
  1909
		  for l in $old_library $library_names; do
leo_sobral@2
  1910
		    ll="$l"
leo_sobral@2
  1911
		  done
leo_sobral@2
  1912
		  if test "X$ll" = "X$old_library" ; then # only static version available
leo_sobral@2
  1913
		    found=no
leo_sobral@2
  1914
		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  1915
		    test "X$ladir" = "X$lib" && ladir="."
leo_sobral@2
  1916
		    lib=$ladir/$old_library
leo_sobral@2
  1917
		    if test "$linkmode,$pass" = "prog,link"; then
leo_sobral@2
  1918
		      compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  1919
		      finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  1920
		    else
leo_sobral@2
  1921
		      deplibs="$deplib $deplibs"
leo_sobral@2
  1922
		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
leo_sobral@2
  1923
		    fi
leo_sobral@2
  1924
		    continue
leo_sobral@2
  1925
		  fi
leo_sobral@2
  1926
		fi
leo_sobral@2
  1927
	        ;;
leo_sobral@2
  1928
	      *) ;;
leo_sobral@2
  1929
	      esac
leo_sobral@2
  1930
	    fi
leo_sobral@2
  1931
	  fi
leo_sobral@2
  1932
	  ;; # -l
leo_sobral@2
  1933
	-L*)
leo_sobral@2
  1934
	  case $linkmode in
leo_sobral@2
  1935
	  lib)
leo_sobral@2
  1936
	    deplibs="$deplib $deplibs"
leo_sobral@2
  1937
	    test "$pass" = conv && continue
leo_sobral@2
  1938
	    newdependency_libs="$deplib $newdependency_libs"
leo_sobral@2
  1939
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
leo_sobral@2
  1940
	    ;;
leo_sobral@2
  1941
	  prog)
leo_sobral@2
  1942
	    if test "$pass" = conv; then
leo_sobral@2
  1943
	      deplibs="$deplib $deplibs"
leo_sobral@2
  1944
	      continue
leo_sobral@2
  1945
	    fi
leo_sobral@2
  1946
	    if test "$pass" = scan; then
leo_sobral@2
  1947
	      deplibs="$deplib $deplibs"
leo_sobral@2
  1948
	    else
leo_sobral@2
  1949
	      compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  1950
	      finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  1951
	    fi
leo_sobral@2
  1952
	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
leo_sobral@2
  1953
	    ;;
leo_sobral@2
  1954
	  *)
leo_sobral@2
  1955
	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
leo_sobral@2
  1956
	    ;;
leo_sobral@2
  1957
	  esac # linkmode
leo_sobral@2
  1958
	  continue
leo_sobral@2
  1959
	  ;; # -L
leo_sobral@2
  1960
	-R*)
leo_sobral@2
  1961
	  if test "$pass" = link; then
leo_sobral@2
  1962
	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
leo_sobral@2
  1963
	    # Make sure the xrpath contains only unique directories.
leo_sobral@2
  1964
	    case "$xrpath " in
leo_sobral@2
  1965
	    *" $dir "*) ;;
leo_sobral@2
  1966
	    *) xrpath="$xrpath $dir" ;;
leo_sobral@2
  1967
	    esac
leo_sobral@2
  1968
	  fi
leo_sobral@2
  1969
	  deplibs="$deplib $deplibs"
leo_sobral@2
  1970
	  continue
leo_sobral@2
  1971
	  ;;
leo_sobral@2
  1972
	*.la) lib="$deplib" ;;
leo_sobral@2
  1973
	*.$libext)
leo_sobral@2
  1974
	  if test "$pass" = conv; then
leo_sobral@2
  1975
	    deplibs="$deplib $deplibs"
leo_sobral@2
  1976
	    continue
leo_sobral@2
  1977
	  fi
leo_sobral@2
  1978
	  case $linkmode in
leo_sobral@2
  1979
	  lib)
leo_sobral@2
  1980
	    if test "$deplibs_check_method" != pass_all; then
leo_sobral@2
  1981
	      $echo
leo_sobral@2
  1982
	      $echo "*** Warning: Trying to link with static lib archive $deplib."
leo_sobral@2
  1983
	      $echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  1984
	      $echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  1985
	      $echo "*** shared version of the library, which you do not appear to have"
leo_sobral@2
  1986
	      $echo "*** because the file extensions .$libext of this argument makes me believe"
leo_sobral@2
  1987
	      $echo "*** that it is just a static archive that I should not used here."
leo_sobral@2
  1988
	    else
leo_sobral@2
  1989
	      $echo
leo_sobral@2
  1990
	      $echo "*** Warning: Linking the shared library $output against the"
leo_sobral@2
  1991
	      $echo "*** static library $deplib is not portable!"
leo_sobral@2
  1992
	      deplibs="$deplib $deplibs"
leo_sobral@2
  1993
	    fi
leo_sobral@2
  1994
	    continue
leo_sobral@2
  1995
	    ;;
leo_sobral@2
  1996
	  prog)
leo_sobral@2
  1997
	    if test "$pass" != link; then
leo_sobral@2
  1998
	      deplibs="$deplib $deplibs"
leo_sobral@2
  1999
	    else
leo_sobral@2
  2000
	      compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  2001
	      finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  2002
	    fi
leo_sobral@2
  2003
	    continue
leo_sobral@2
  2004
	    ;;
leo_sobral@2
  2005
	  esac # linkmode
leo_sobral@2
  2006
	  ;; # *.$libext
leo_sobral@2
  2007
	*.lo | *.$objext)
leo_sobral@2
  2008
	  if test "$pass" = conv; then
leo_sobral@2
  2009
	    deplibs="$deplib $deplibs"
leo_sobral@2
  2010
	  elif test "$linkmode" = prog; then
leo_sobral@2
  2011
	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
leo_sobral@2
  2012
	      # If there is no dlopen support or we're linking statically,
leo_sobral@2
  2013
	      # we need to preload.
leo_sobral@2
  2014
	      newdlprefiles="$newdlprefiles $deplib"
leo_sobral@2
  2015
	      compile_deplibs="$deplib $compile_deplibs"
leo_sobral@2
  2016
	      finalize_deplibs="$deplib $finalize_deplibs"
leo_sobral@2
  2017
	    else
leo_sobral@2
  2018
	      newdlfiles="$newdlfiles $deplib"
leo_sobral@2
  2019
	    fi
leo_sobral@2
  2020
	  fi
leo_sobral@2
  2021
	  continue
leo_sobral@2
  2022
	  ;;
leo_sobral@2
  2023
	%DEPLIBS%)
leo_sobral@2
  2024
	  alldeplibs=yes
leo_sobral@2
  2025
	  continue
leo_sobral@2
  2026
	  ;;
leo_sobral@2
  2027
	esac # case $deplib
leo_sobral@2
  2028
	if test "$found" = yes || test -f "$lib"; then :
leo_sobral@2
  2029
	else
leo_sobral@2
  2030
	  $echo "$modename: cannot find the library \`$lib'" 1>&2
leo_sobral@2
  2031
	  exit $EXIT_FAILURE
leo_sobral@2
  2032
	fi
leo_sobral@2
  2033
leo_sobral@2
  2034
	# Check to see that this really is a libtool archive.
leo_sobral@2
  2035
	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
leo_sobral@2
  2036
	else
leo_sobral@2
  2037
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
leo_sobral@2
  2038
	  exit $EXIT_FAILURE
leo_sobral@2
  2039
	fi
leo_sobral@2
  2040
leo_sobral@2
  2041
	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  2042
	test "X$ladir" = "X$lib" && ladir="."
leo_sobral@2
  2043
leo_sobral@2
  2044
	dlname=
leo_sobral@2
  2045
	dlopen=
leo_sobral@2
  2046
	dlpreopen=
leo_sobral@2
  2047
	libdir=
leo_sobral@2
  2048
	library_names=
leo_sobral@2
  2049
	old_library=
leo_sobral@2
  2050
	# If the library was installed with an old release of libtool,
leo_sobral@2
  2051
	# it will not redefine variables installed, or shouldnotlink
leo_sobral@2
  2052
	installed=yes
leo_sobral@2
  2053
	shouldnotlink=no
leo_sobral@2
  2054
leo_sobral@2
  2055
	# Read the .la file
leo_sobral@2
  2056
	case $lib in
leo_sobral@2
  2057
	*/* | *\\*) . $lib ;;
leo_sobral@2
  2058
	*) . ./$lib ;;
leo_sobral@2
  2059
	esac
leo_sobral@2
  2060
leo_sobral@2
  2061
	if test "$linkmode,$pass" = "lib,link" ||
leo_sobral@2
  2062
	   test "$linkmode,$pass" = "prog,scan" ||
leo_sobral@2
  2063
	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
leo_sobral@2
  2064
	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
leo_sobral@2
  2065
	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
leo_sobral@2
  2066
	fi
leo_sobral@2
  2067
leo_sobral@2
  2068
	if test "$pass" = conv; then
leo_sobral@2
  2069
	  # Only check for convenience libraries
leo_sobral@2
  2070
	  deplibs="$lib $deplibs"
leo_sobral@2
  2071
	  if test -z "$libdir"; then
leo_sobral@2
  2072
	    if test -z "$old_library"; then
leo_sobral@2
  2073
	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
leo_sobral@2
  2074
	      exit $EXIT_FAILURE
leo_sobral@2
  2075
	    fi
leo_sobral@2
  2076
	    # It is a libtool convenience library, so add in its objects.
leo_sobral@2
  2077
	    convenience="$convenience $ladir/$objdir/$old_library"
leo_sobral@2
  2078
	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
leo_sobral@2
  2079
	    tmp_libs=
leo_sobral@2
  2080
	    for deplib in $dependency_libs; do
leo_sobral@2
  2081
	      deplibs="$deplib $deplibs"
leo_sobral@2
  2082
              if test "X$duplicate_deps" = "Xyes" ; then
leo_sobral@2
  2083
	        case "$tmp_libs " in
leo_sobral@2
  2084
	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
leo_sobral@2
  2085
	        esac
leo_sobral@2
  2086
              fi
leo_sobral@2
  2087
	      tmp_libs="$tmp_libs $deplib"
leo_sobral@2
  2088
	    done
leo_sobral@2
  2089
	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
leo_sobral@2
  2090
	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
leo_sobral@2
  2091
	    exit $EXIT_FAILURE
leo_sobral@2
  2092
	  fi
leo_sobral@2
  2093
	  continue
leo_sobral@2
  2094
	fi # $pass = conv
leo_sobral@2
  2095
leo_sobral@2
  2096
leo_sobral@2
  2097
	# Get the name of the library we link against.
leo_sobral@2
  2098
	linklib=
leo_sobral@2
  2099
	for l in $old_library $library_names; do
leo_sobral@2
  2100
	  linklib="$l"
leo_sobral@2
  2101
	done
leo_sobral@2
  2102
	if test -z "$linklib"; then
leo_sobral@2
  2103
	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
leo_sobral@2
  2104
	  exit $EXIT_FAILURE
leo_sobral@2
  2105
	fi
leo_sobral@2
  2106
leo_sobral@2
  2107
	# This library was specified with -dlopen.
leo_sobral@2
  2108
	if test "$pass" = dlopen; then
leo_sobral@2
  2109
	  if test -z "$libdir"; then
leo_sobral@2
  2110
	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
leo_sobral@2
  2111
	    exit $EXIT_FAILURE
leo_sobral@2
  2112
	  fi
leo_sobral@2
  2113
	  if test -z "$dlname" ||
leo_sobral@2
  2114
	     test "$dlopen_support" != yes ||
leo_sobral@2
  2115
	     test "$build_libtool_libs" = no; then
leo_sobral@2
  2116
	    # If there is no dlname, no dlopen support or we're linking
leo_sobral@2
  2117
	    # statically, we need to preload.  We also need to preload any
leo_sobral@2
  2118
	    # dependent libraries so libltdl's deplib preloader doesn't
leo_sobral@2
  2119
	    # bomb out in the load deplibs phase.
leo_sobral@2
  2120
	    dlprefiles="$dlprefiles $lib $dependency_libs"
leo_sobral@2
  2121
	  else
leo_sobral@2
  2122
	    newdlfiles="$newdlfiles $lib"
leo_sobral@2
  2123
	  fi
leo_sobral@2
  2124
	  continue
leo_sobral@2
  2125
	fi # $pass = dlopen
leo_sobral@2
  2126
leo_sobral@2
  2127
	# We need an absolute path.
leo_sobral@2
  2128
	case $ladir in
leo_sobral@2
  2129
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
leo_sobral@2
  2130
	*)
leo_sobral@2
  2131
	  abs_ladir=`cd "$ladir" && pwd`
leo_sobral@2
  2132
	  if test -z "$abs_ladir"; then
leo_sobral@2
  2133
	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
leo_sobral@2
  2134
	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
leo_sobral@2
  2135
	    abs_ladir="$ladir"
leo_sobral@2
  2136
	  fi
leo_sobral@2
  2137
	  ;;
leo_sobral@2
  2138
	esac
leo_sobral@2
  2139
	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  2140
leo_sobral@2
  2141
	# Find the relevant object directory and library name.
leo_sobral@2
  2142
	if test "X$installed" = Xyes; then
leo_sobral@2
  2143
	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
leo_sobral@2
  2144
	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
leo_sobral@2
  2145
	    dir="$ladir"
leo_sobral@2
  2146
	    absdir="$abs_ladir"
leo_sobral@2
  2147
	    libdir="$abs_ladir"
leo_sobral@2
  2148
	  else
leo_sobral@2
  2149
	    dir="$libdir"
leo_sobral@2
  2150
	    absdir="$libdir"
leo_sobral@2
  2151
	  fi
leo_sobral@2
  2152
	else
leo_sobral@2
  2153
	  dir="$ladir/$objdir"
leo_sobral@2
  2154
	  absdir="$abs_ladir/$objdir"
leo_sobral@2
  2155
	  # Remove this search path later
leo_sobral@2
  2156
	  notinst_path="$notinst_path $abs_ladir"
leo_sobral@2
  2157
	fi # $installed = yes
leo_sobral@2
  2158
	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
leo_sobral@2
  2159
leo_sobral@2
  2160
	# This library was specified with -dlpreopen.
leo_sobral@2
  2161
	if test "$pass" = dlpreopen; then
leo_sobral@2
  2162
	  if test -z "$libdir"; then
leo_sobral@2
  2163
	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
leo_sobral@2
  2164
	    exit $EXIT_FAILURE
leo_sobral@2
  2165
	  fi
leo_sobral@2
  2166
	  # Prefer using a static library (so that no silly _DYNAMIC symbols
leo_sobral@2
  2167
	  # are required to link).
leo_sobral@2
  2168
	  if test -n "$old_library"; then
leo_sobral@2
  2169
	    newdlprefiles="$newdlprefiles $dir/$old_library"
leo_sobral@2
  2170
	  # Otherwise, use the dlname, so that lt_dlopen finds it.
leo_sobral@2
  2171
	  elif test -n "$dlname"; then
leo_sobral@2
  2172
	    newdlprefiles="$newdlprefiles $dir/$dlname"
leo_sobral@2
  2173
	  else
leo_sobral@2
  2174
	    newdlprefiles="$newdlprefiles $dir/$linklib"
leo_sobral@2
  2175
	  fi
leo_sobral@2
  2176
	fi # $pass = dlpreopen
leo_sobral@2
  2177
leo_sobral@2
  2178
	if test -z "$libdir"; then
leo_sobral@2
  2179
	  # Link the convenience library
leo_sobral@2
  2180
	  if test "$linkmode" = lib; then
leo_sobral@2
  2181
	    deplibs="$dir/$old_library $deplibs"
leo_sobral@2
  2182
	  elif test "$linkmode,$pass" = "prog,link"; then
leo_sobral@2
  2183
	    compile_deplibs="$dir/$old_library $compile_deplibs"
leo_sobral@2
  2184
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
leo_sobral@2
  2185
	  else
leo_sobral@2
  2186
	    deplibs="$lib $deplibs" # used for prog,scan pass
leo_sobral@2
  2187
	  fi
leo_sobral@2
  2188
	  continue
leo_sobral@2
  2189
	fi
leo_sobral@2
  2190
leo_sobral@2
  2191
leo_sobral@2
  2192
	if test "$linkmode" = prog && test "$pass" != link; then
leo_sobral@2
  2193
	  newlib_search_path="$newlib_search_path $ladir"
leo_sobral@2
  2194
	  deplibs="$lib $deplibs"
leo_sobral@2
  2195
leo_sobral@2
  2196
	  linkalldeplibs=no
leo_sobral@2
  2197
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
leo_sobral@2
  2198
	     test "$build_libtool_libs" = no; then
leo_sobral@2
  2199
	    linkalldeplibs=yes
leo_sobral@2
  2200
	  fi
leo_sobral@2
  2201
leo_sobral@2
  2202
	  tmp_libs=
leo_sobral@2
  2203
	  for deplib in $dependency_libs; do
leo_sobral@2
  2204
	    case $deplib in
leo_sobral@2
  2205
	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
leo_sobral@2
  2206
	    esac
leo_sobral@2
  2207
	    # Need to link against all dependency_libs?
leo_sobral@2
  2208
	    if test "$linkalldeplibs" = yes; then
leo_sobral@2
  2209
	      deplibs="$deplib $deplibs"
leo_sobral@2
  2210
	    else
leo_sobral@2
  2211
	      # Need to hardcode shared library paths
leo_sobral@2
  2212
	      # or/and link against static libraries
leo_sobral@2
  2213
	      newdependency_libs="$deplib $newdependency_libs"
leo_sobral@2
  2214
	    fi
leo_sobral@2
  2215
	    if test "X$duplicate_deps" = "Xyes" ; then
leo_sobral@2
  2216
	      case "$tmp_libs " in
leo_sobral@2
  2217
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
leo_sobral@2
  2218
	      esac
leo_sobral@2
  2219
	    fi
leo_sobral@2
  2220
	    tmp_libs="$tmp_libs $deplib"
leo_sobral@2
  2221
	  done # for deplib
leo_sobral@2
  2222
	  continue
leo_sobral@2
  2223
	fi # $linkmode = prog...
leo_sobral@2
  2224
leo_sobral@2
  2225
	if test "$linkmode,$pass" = "prog,link"; then
leo_sobral@2
  2226
	  if test -n "$library_names" &&
leo_sobral@2
  2227
	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
leo_sobral@2
  2228
	    # We need to hardcode the library path
leo_sobral@2
  2229
	    if test -n "$shlibpath_var"; then
leo_sobral@2
  2230
	      # Make sure the rpath contains only unique directories.
leo_sobral@2
  2231
	      case "$temp_rpath " in
leo_sobral@2
  2232
	      *" $dir "*) ;;
leo_sobral@2
  2233
	      *" $absdir "*) ;;
leo_sobral@2
  2234
	      *) temp_rpath="$temp_rpath $dir" ;;
leo_sobral@2
  2235
	      esac
leo_sobral@2
  2236
	    fi
leo_sobral@2
  2237
leo_sobral@2
  2238
	    # Hardcode the library path.
leo_sobral@2
  2239
	    # Skip directories that are in the system default run-time
leo_sobral@2
  2240
	    # search path.
leo_sobral@2
  2241
	    case " $sys_lib_dlsearch_path " in
leo_sobral@2
  2242
	    *" $absdir "*) ;;
leo_sobral@2
  2243
	    *)
leo_sobral@2
  2244
	      case "$compile_rpath " in
leo_sobral@2
  2245
	      *" $absdir "*) ;;
leo_sobral@2
  2246
	      *) compile_rpath="$compile_rpath $absdir"
leo_sobral@2
  2247
	      esac
leo_sobral@2
  2248
	      ;;
leo_sobral@2
  2249
	    esac
leo_sobral@2
  2250
	    case " $sys_lib_dlsearch_path " in
leo_sobral@2
  2251
	    *" $libdir "*) ;;
leo_sobral@2
  2252
	    *)
leo_sobral@2
  2253
	      case "$finalize_rpath " in
leo_sobral@2
  2254
	      *" $libdir "*) ;;
leo_sobral@2
  2255
	      *) finalize_rpath="$finalize_rpath $libdir"
leo_sobral@2
  2256
	      esac
leo_sobral@2
  2257
	      ;;
leo_sobral@2
  2258
	    esac
leo_sobral@2
  2259
	  fi # $linkmode,$pass = prog,link...
leo_sobral@2
  2260
leo_sobral@2
  2261
	  if test "$alldeplibs" = yes &&
leo_sobral@2
  2262
	     { test "$deplibs_check_method" = pass_all ||
leo_sobral@2
  2263
	       { test "$build_libtool_libs" = yes &&
leo_sobral@2
  2264
		 test -n "$library_names"; }; }; then
leo_sobral@2
  2265
	    # We only need to search for static libraries
leo_sobral@2
  2266
	    continue
leo_sobral@2
  2267
	  fi
leo_sobral@2
  2268
	fi
leo_sobral@2
  2269
leo_sobral@2
  2270
	link_static=no # Whether the deplib will be linked statically
leo_sobral@2
  2271
	if test -n "$library_names" &&
leo_sobral@2
  2272
	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
leo_sobral@2
  2273
	  if test "$installed" = no; then
leo_sobral@2
  2274
	    notinst_deplibs="$notinst_deplibs $lib"
leo_sobral@2
  2275
	    need_relink=yes
leo_sobral@2
  2276
	  fi
leo_sobral@2
  2277
	  # This is a shared library
leo_sobral@2
  2278
leo_sobral@2
  2279
	  # Warn about portability, can't link against -module's on
leo_sobral@2
  2280
	  # some systems (darwin)
leo_sobral@2
  2281
	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
leo_sobral@2
  2282
	    $echo
leo_sobral@2
  2283
	    if test "$linkmode" = prog; then
leo_sobral@2
  2284
	      $echo "*** Warning: Linking the executable $output against the loadable module"
leo_sobral@2
  2285
	    else
leo_sobral@2
  2286
	      $echo "*** Warning: Linking the shared library $output against the loadable module"
leo_sobral@2
  2287
	    fi
leo_sobral@2
  2288
	    $echo "*** $linklib is not portable!"
leo_sobral@2
  2289
	  fi
leo_sobral@2
  2290
	  if test "$linkmode" = lib &&
leo_sobral@2
  2291
	     test "$hardcode_into_libs" = yes; then
leo_sobral@2
  2292
	    # Hardcode the library path.
leo_sobral@2
  2293
	    # Skip directories that are in the system default run-time
leo_sobral@2
  2294
	    # search path.
leo_sobral@2
  2295
	    case " $sys_lib_dlsearch_path " in
leo_sobral@2
  2296
	    *" $absdir "*) ;;
leo_sobral@2
  2297
	    *)
leo_sobral@2
  2298
	      case "$compile_rpath " in
leo_sobral@2
  2299
	      *" $absdir "*) ;;
leo_sobral@2
  2300
	      *) compile_rpath="$compile_rpath $absdir"
leo_sobral@2
  2301
	      esac
leo_sobral@2
  2302
	      ;;
leo_sobral@2
  2303
	    esac
leo_sobral@2
  2304
	    case " $sys_lib_dlsearch_path " in
leo_sobral@2
  2305
	    *" $libdir "*) ;;
leo_sobral@2
  2306
	    *)
leo_sobral@2
  2307
	      case "$finalize_rpath " in
leo_sobral@2
  2308
	      *" $libdir "*) ;;
leo_sobral@2
  2309
	      *) finalize_rpath="$finalize_rpath $libdir"
leo_sobral@2
  2310
	      esac
leo_sobral@2
  2311
	      ;;
leo_sobral@2
  2312
	    esac
leo_sobral@2
  2313
	  fi
leo_sobral@2
  2314
leo_sobral@2
  2315
	  if test -n "$old_archive_from_expsyms_cmds"; then
leo_sobral@2
  2316
	    # figure out the soname
leo_sobral@2
  2317
	    set dummy $library_names
leo_sobral@2
  2318
	    realname="$2"
leo_sobral@2
  2319
	    shift; shift
leo_sobral@2
  2320
	    libname=`eval \\$echo \"$libname_spec\"`
leo_sobral@2
  2321
	    # use dlname if we got it. it's perfectly good, no?
leo_sobral@2
  2322
	    if test -n "$dlname"; then
leo_sobral@2
  2323
	      soname="$dlname"
leo_sobral@2
  2324
	    elif test -n "$soname_spec"; then
leo_sobral@2
  2325
	      # bleh windows
leo_sobral@2
  2326
	      case $host in
leo_sobral@2
  2327
	      *cygwin* | mingw*)
leo_sobral@2
  2328
		major=`expr $current - $age`
leo_sobral@2
  2329
		versuffix="-$major"
leo_sobral@2
  2330
		;;
leo_sobral@2
  2331
	      esac
leo_sobral@2
  2332
	      eval soname=\"$soname_spec\"
leo_sobral@2
  2333
	    else
leo_sobral@2
  2334
	      soname="$realname"
leo_sobral@2
  2335
	    fi
leo_sobral@2
  2336
leo_sobral@2
  2337
	    # Make a new name for the extract_expsyms_cmds to use
leo_sobral@2
  2338
	    soroot="$soname"
leo_sobral@2
  2339
	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
leo_sobral@2
  2340
	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
leo_sobral@2
  2341
leo_sobral@2
  2342
	    # If the library has no export list, then create one now
leo_sobral@2
  2343
	    if test -f "$output_objdir/$soname-def"; then :
leo_sobral@2
  2344
	    else
leo_sobral@2
  2345
	      $show "extracting exported symbol list from \`$soname'"
leo_sobral@2
  2346
	      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  2347
	      cmds=$extract_expsyms_cmds
leo_sobral@2
  2348
	      for cmd in $cmds; do
leo_sobral@2
  2349
		IFS="$save_ifs"
leo_sobral@2
  2350
		eval cmd=\"$cmd\"
leo_sobral@2
  2351
		$show "$cmd"
leo_sobral@2
  2352
		$run eval "$cmd" || exit $?
leo_sobral@2
  2353
	      done
leo_sobral@2
  2354
	      IFS="$save_ifs"
leo_sobral@2
  2355
	    fi
leo_sobral@2
  2356
leo_sobral@2
  2357
	    # Create $newlib
leo_sobral@2
  2358
	    if test -f "$output_objdir/$newlib"; then :; else
leo_sobral@2
  2359
	      $show "generating import library for \`$soname'"
leo_sobral@2
  2360
	      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  2361
	      cmds=$old_archive_from_expsyms_cmds
leo_sobral@2
  2362
	      for cmd in $cmds; do
leo_sobral@2
  2363
		IFS="$save_ifs"
leo_sobral@2
  2364
		eval cmd=\"$cmd\"
leo_sobral@2
  2365
		$show "$cmd"
leo_sobral@2
  2366
		$run eval "$cmd" || exit $?
leo_sobral@2
  2367
	      done
leo_sobral@2
  2368
	      IFS="$save_ifs"
leo_sobral@2
  2369
	    fi
leo_sobral@2
  2370
	    # make sure the library variables are pointing to the new library
leo_sobral@2
  2371
	    dir=$output_objdir
leo_sobral@2
  2372
	    linklib=$newlib
leo_sobral@2
  2373
	  fi # test -n "$old_archive_from_expsyms_cmds"
leo_sobral@2
  2374
leo_sobral@2
  2375
	  if test "$linkmode" = prog || test "$mode" != relink; then
leo_sobral@2
  2376
	    add_shlibpath=
leo_sobral@2
  2377
	    add_dir=
leo_sobral@2
  2378
	    add=
leo_sobral@2
  2379
	    lib_linked=yes
leo_sobral@2
  2380
	    case $hardcode_action in
leo_sobral@2
  2381
	    immediate | unsupported)
leo_sobral@2
  2382
	      if test "$hardcode_direct" = no; then
leo_sobral@2
  2383
		add="$dir/$linklib"
leo_sobral@2
  2384
		case $host in
leo_sobral@2
  2385
		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
leo_sobral@2
  2386
		  *-*-darwin* )
leo_sobral@2
  2387
		    # if the lib is a module then we can not link against
leo_sobral@2
  2388
		    # it, someone is ignoring the new warnings I added
leo_sobral@2
  2389
		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
leo_sobral@2
  2390
		      $echo "** Warning, lib $linklib is a module, not a shared library"
leo_sobral@2
  2391
		      if test -z "$old_library" ; then
leo_sobral@2
  2392
		        $echo
leo_sobral@2
  2393
		        $echo "** And there doesn't seem to be a static archive available"
leo_sobral@2
  2394
		        $echo "** The link will probably fail, sorry"
leo_sobral@2
  2395
		      else
leo_sobral@2
  2396
		        add="$dir/$old_library"
leo_sobral@2
  2397
		      fi
leo_sobral@2
  2398
		    fi
leo_sobral@2
  2399
		esac
leo_sobral@2
  2400
	      elif test "$hardcode_minus_L" = no; then
leo_sobral@2
  2401
		case $host in
leo_sobral@2
  2402
		*-*-sunos*) add_shlibpath="$dir" ;;
leo_sobral@2
  2403
		esac
leo_sobral@2
  2404
		add_dir="-L$dir"
leo_sobral@2
  2405
		add="-l$name"
leo_sobral@2
  2406
	      elif test "$hardcode_shlibpath_var" = no; then
leo_sobral@2
  2407
		add_shlibpath="$dir"
leo_sobral@2
  2408
		add="-l$name"
leo_sobral@2
  2409
	      else
leo_sobral@2
  2410
		lib_linked=no
leo_sobral@2
  2411
	      fi
leo_sobral@2
  2412
	      ;;
leo_sobral@2
  2413
	    relink)
leo_sobral@2
  2414
	      if test "$hardcode_direct" = yes; then
leo_sobral@2
  2415
		add="$dir/$linklib"
leo_sobral@2
  2416
	      elif test "$hardcode_minus_L" = yes; then
leo_sobral@2
  2417
		add_dir="-L$dir"
leo_sobral@2
  2418
		# Try looking first in the location we're being installed to.
leo_sobral@2
  2419
		if test -n "$inst_prefix_dir"; then
leo_sobral@2
  2420
		  case "$libdir" in
leo_sobral@2
  2421
		    [\\/]*)
leo_sobral@2
  2422
		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
leo_sobral@2
  2423
		      ;;
leo_sobral@2
  2424
		  esac
leo_sobral@2
  2425
		fi
leo_sobral@2
  2426
		add="-l$name"
leo_sobral@2
  2427
	      elif test "$hardcode_shlibpath_var" = yes; then
leo_sobral@2
  2428
		add_shlibpath="$dir"
leo_sobral@2
  2429
		add="-l$name"
leo_sobral@2
  2430
	      else
leo_sobral@2
  2431
		lib_linked=no
leo_sobral@2
  2432
	      fi
leo_sobral@2
  2433
	      ;;
leo_sobral@2
  2434
	    *) lib_linked=no ;;
leo_sobral@2
  2435
	    esac
leo_sobral@2
  2436
leo_sobral@2
  2437
	    if test "$lib_linked" != yes; then
leo_sobral@2
  2438
	      $echo "$modename: configuration error: unsupported hardcode properties"
leo_sobral@2
  2439
	      exit $EXIT_FAILURE
leo_sobral@2
  2440
	    fi
leo_sobral@2
  2441
leo_sobral@2
  2442
	    if test -n "$add_shlibpath"; then
leo_sobral@2
  2443
	      case :$compile_shlibpath: in
leo_sobral@2
  2444
	      *":$add_shlibpath:"*) ;;
leo_sobral@2
  2445
	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
leo_sobral@2
  2446
	      esac
leo_sobral@2
  2447
	    fi
leo_sobral@2
  2448
	    if test "$linkmode" = prog; then
leo_sobral@2
  2449
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
leo_sobral@2
  2450
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
leo_sobral@2
  2451
	    else
leo_sobral@2
  2452
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
leo_sobral@2
  2453
	      test -n "$add" && deplibs="$add $deplibs"
leo_sobral@2
  2454
	      if test "$hardcode_direct" != yes && \
leo_sobral@2
  2455
		 test "$hardcode_minus_L" != yes && \
leo_sobral@2
  2456
		 test "$hardcode_shlibpath_var" = yes; then
leo_sobral@2
  2457
		case :$finalize_shlibpath: in
leo_sobral@2
  2458
		*":$libdir:"*) ;;
leo_sobral@2
  2459
		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
leo_sobral@2
  2460
		esac
leo_sobral@2
  2461
	      fi
leo_sobral@2
  2462
	    fi
leo_sobral@2
  2463
	  fi
leo_sobral@2
  2464
leo_sobral@2
  2465
	  if test "$linkmode" = prog || test "$mode" = relink; then
leo_sobral@2
  2466
	    add_shlibpath=
leo_sobral@2
  2467
	    add_dir=
leo_sobral@2
  2468
	    add=
leo_sobral@2
  2469
	    # Finalize command for both is simple: just hardcode it.
leo_sobral@2
  2470
	    if test "$hardcode_direct" = yes; then
leo_sobral@2
  2471
	      add="$libdir/$linklib"
leo_sobral@2
  2472
	    elif test "$hardcode_minus_L" = yes; then
leo_sobral@2
  2473
	      add_dir="-L$libdir"
leo_sobral@2
  2474
	      add="-l$name"
leo_sobral@2
  2475
	    elif test "$hardcode_shlibpath_var" = yes; then
leo_sobral@2
  2476
	      case :$finalize_shlibpath: in
leo_sobral@2
  2477
	      *":$libdir:"*) ;;
leo_sobral@2
  2478
	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
leo_sobral@2
  2479
	      esac
leo_sobral@2
  2480
	      add="-l$name"
leo_sobral@2
  2481
	    elif test "$hardcode_automatic" = yes; then
leo_sobral@2
  2482
	      if test -n "$inst_prefix_dir" &&
leo_sobral@2
  2483
		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
leo_sobral@2
  2484
	        add="$inst_prefix_dir$libdir/$linklib"
leo_sobral@2
  2485
	      else
leo_sobral@2
  2486
	        add="$libdir/$linklib"
leo_sobral@2
  2487
	      fi
leo_sobral@2
  2488
	    else
leo_sobral@2
  2489
	      # We cannot seem to hardcode it, guess we'll fake it.
leo_sobral@2
  2490
	      add_dir="-L$libdir"
leo_sobral@2
  2491
	      # Try looking first in the location we're being installed to.
leo_sobral@2
  2492
	      if test -n "$inst_prefix_dir"; then
leo_sobral@2
  2493
		case "$libdir" in
leo_sobral@2
  2494
		  [\\/]*)
leo_sobral@2
  2495
		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
leo_sobral@2
  2496
		    ;;
leo_sobral@2
  2497
		esac
leo_sobral@2
  2498
	      fi
leo_sobral@2
  2499
	      add="-l$name"
leo_sobral@2
  2500
	    fi
leo_sobral@2
  2501
leo_sobral@2
  2502
	    if test "$linkmode" = prog; then
leo_sobral@2
  2503
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
leo_sobral@2
  2504
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
leo_sobral@2
  2505
	    else
leo_sobral@2
  2506
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
leo_sobral@2
  2507
	      test -n "$add" && deplibs="$add $deplibs"
leo_sobral@2
  2508
	    fi
leo_sobral@2
  2509
	  fi
leo_sobral@2
  2510
	elif test "$linkmode" = prog; then
leo_sobral@2
  2511
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
leo_sobral@2
  2512
	  # is not unsupported.  This is valid on all known static and
leo_sobral@2
  2513
	  # shared platforms.
leo_sobral@2
  2514
	  if test "$hardcode_direct" != unsupported; then
leo_sobral@2
  2515
	    test -n "$old_library" && linklib="$old_library"
leo_sobral@2
  2516
	    compile_deplibs="$dir/$linklib $compile_deplibs"
leo_sobral@2
  2517
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
leo_sobral@2
  2518
	  else
leo_sobral@2
  2519
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
leo_sobral@2
  2520
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
leo_sobral@2
  2521
	  fi
leo_sobral@2
  2522
	elif test "$build_libtool_libs" = yes; then
leo_sobral@2
  2523
	  # Not a shared library
leo_sobral@2
  2524
	  if test "$deplibs_check_method" != pass_all; then
leo_sobral@2
  2525
	    # We're trying link a shared library against a static one
leo_sobral@2
  2526
	    # but the system doesn't support it.
leo_sobral@2
  2527
leo_sobral@2
  2528
	    # Just print a warning and add the library to dependency_libs so
leo_sobral@2
  2529
	    # that the program can be linked against the static library.
leo_sobral@2
  2530
	    $echo
leo_sobral@2
  2531
	    $echo "*** Warning: This system can not link to static lib archive $lib."
leo_sobral@2
  2532
	    $echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  2533
	    $echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  2534
	    $echo "*** shared version of the library, which you do not appear to have."
leo_sobral@2
  2535
	    if test "$module" = yes; then
leo_sobral@2
  2536
	      $echo "*** But as you try to build a module library, libtool will still create "
leo_sobral@2
  2537
	      $echo "*** a static module, that should work as long as the dlopening application"
leo_sobral@2
  2538
	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
leo_sobral@2
  2539
	      if test -z "$global_symbol_pipe"; then
leo_sobral@2
  2540
		$echo
leo_sobral@2
  2541
		$echo "*** However, this would only work if libtool was able to extract symbol"
leo_sobral@2
  2542
		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
leo_sobral@2
  2543
		$echo "*** not find such a program.  So, this module is probably useless."
leo_sobral@2
  2544
		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
leo_sobral@2
  2545
	      fi
leo_sobral@2
  2546
	      if test "$build_old_libs" = no; then
leo_sobral@2
  2547
		build_libtool_libs=module
leo_sobral@2
  2548
		build_old_libs=yes
leo_sobral@2
  2549
	      else
leo_sobral@2
  2550
		build_libtool_libs=no
leo_sobral@2
  2551
	      fi
leo_sobral@2
  2552
	    fi
leo_sobral@2
  2553
	  else
leo_sobral@2
  2554
	    convenience="$convenience $dir/$old_library"
leo_sobral@2
  2555
	    old_convenience="$old_convenience $dir/$old_library"
leo_sobral@2
  2556
	    deplibs="$dir/$old_library $deplibs"
leo_sobral@2
  2557
	    link_static=yes
leo_sobral@2
  2558
	  fi
leo_sobral@2
  2559
	fi # link shared/static library?
leo_sobral@2
  2560
leo_sobral@2
  2561
	if test "$linkmode" = lib; then
leo_sobral@2
  2562
	  if test -n "$dependency_libs" &&
leo_sobral@2
  2563
	     { test "$hardcode_into_libs" != yes ||
leo_sobral@2
  2564
	       test "$build_old_libs" = yes ||
leo_sobral@2
  2565
	       test "$link_static" = yes; }; then
leo_sobral@2
  2566
	    # Extract -R from dependency_libs
leo_sobral@2
  2567
	    temp_deplibs=
leo_sobral@2
  2568
	    for libdir in $dependency_libs; do
leo_sobral@2
  2569
	      case $libdir in
leo_sobral@2
  2570
	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
leo_sobral@2
  2571
		   case " $xrpath " in
leo_sobral@2
  2572
		   *" $temp_xrpath "*) ;;
leo_sobral@2
  2573
		   *) xrpath="$xrpath $temp_xrpath";;
leo_sobral@2
  2574
		   esac;;
leo_sobral@2
  2575
	      *) temp_deplibs="$temp_deplibs $libdir";;
leo_sobral@2
  2576
	      esac
leo_sobral@2
  2577
	    done
leo_sobral@2
  2578
	    dependency_libs="$temp_deplibs"
leo_sobral@2
  2579
	  fi
leo_sobral@2
  2580
leo_sobral@2
  2581
	  newlib_search_path="$newlib_search_path $absdir"
leo_sobral@2
  2582
	  # Link against this library
leo_sobral@2
  2583
	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
leo_sobral@2
  2584
	  # ... and its dependency_libs
leo_sobral@2
  2585
	  tmp_libs=
leo_sobral@2
  2586
	  for deplib in $dependency_libs; do
leo_sobral@2
  2587
	    newdependency_libs="$deplib $newdependency_libs"
leo_sobral@2
  2588
	    if test "X$duplicate_deps" = "Xyes" ; then
leo_sobral@2
  2589
	      case "$tmp_libs " in
leo_sobral@2
  2590
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
leo_sobral@2
  2591
	      esac
leo_sobral@2
  2592
	    fi
leo_sobral@2
  2593
	    tmp_libs="$tmp_libs $deplib"
leo_sobral@2
  2594
	  done
leo_sobral@2
  2595
leo_sobral@2
  2596
	  if test "$link_all_deplibs" != no; then
leo_sobral@2
  2597
	    # Add the search paths of all dependency libraries
leo_sobral@2
  2598
	    for deplib in $dependency_libs; do
leo_sobral@2
  2599
	      case $deplib in
leo_sobral@2
  2600
	      -L*) path="$deplib" ;;
leo_sobral@2
  2601
	      *.la)
leo_sobral@2
  2602
		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  2603
		test "X$dir" = "X$deplib" && dir="."
leo_sobral@2
  2604
		# We need an absolute path.
leo_sobral@2
  2605
		case $dir in
leo_sobral@2
  2606
		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
leo_sobral@2
  2607
		*)
leo_sobral@2
  2608
		  absdir=`cd "$dir" && pwd`
leo_sobral@2
  2609
		  if test -z "$absdir"; then
leo_sobral@2
  2610
		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
leo_sobral@2
  2611
		    absdir="$dir"
leo_sobral@2
  2612
		  fi
leo_sobral@2
  2613
		  ;;
leo_sobral@2
  2614
		esac
leo_sobral@2
  2615
		if grep "^installed=no" $deplib > /dev/null; then
leo_sobral@2
  2616
		  path="$absdir/$objdir"
leo_sobral@2
  2617
		else
leo_sobral@2
  2618
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
leo_sobral@2
  2619
		  if test -z "$libdir"; then
leo_sobral@2
  2620
		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
leo_sobral@2
  2621
		    exit $EXIT_FAILURE
leo_sobral@2
  2622
		  fi
leo_sobral@2
  2623
		  if test "$absdir" != "$libdir"; then
leo_sobral@2
  2624
		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
leo_sobral@2
  2625
		  fi
leo_sobral@2
  2626
		  path="$absdir"
leo_sobral@2
  2627
		fi
leo_sobral@2
  2628
		depdepl=
leo_sobral@2
  2629
		case $host in
leo_sobral@2
  2630
		*-*-darwin*)
leo_sobral@2
  2631
		  # we do not want to link against static libs,
leo_sobral@2
  2632
		  # but need to link against shared
leo_sobral@2
  2633
		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
leo_sobral@2
  2634
		  if test -n "$deplibrary_names" ; then
leo_sobral@2
  2635
		    for tmp in $deplibrary_names ; do
leo_sobral@2
  2636
		      depdepl=$tmp
leo_sobral@2
  2637
		    done
leo_sobral@2
  2638
		    if test -f "$path/$depdepl" ; then
leo_sobral@2
  2639
		      depdepl="$path/$depdepl"
leo_sobral@2
  2640
		    fi
leo_sobral@2
  2641
		    # do not add paths which are already there
leo_sobral@2
  2642
		    case " $newlib_search_path " in
leo_sobral@2
  2643
		    *" $path "*) ;;
leo_sobral@2
  2644
		    *) newlib_search_path="$newlib_search_path $path";;
leo_sobral@2
  2645
		    esac
leo_sobral@2
  2646
		  fi
leo_sobral@2
  2647
		  path=""
leo_sobral@2
  2648
		  ;;
leo_sobral@2
  2649
		*)
leo_sobral@2
  2650
		  path="-L$path"
leo_sobral@2
  2651
		  ;;
leo_sobral@2
  2652
		esac
leo_sobral@2
  2653
		;;
leo_sobral@2
  2654
	      -l*)
leo_sobral@2
  2655
		case $host in
leo_sobral@2
  2656
		*-*-darwin*)
leo_sobral@2
  2657
		  # Again, we only want to link against shared libraries
leo_sobral@2
  2658
		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
leo_sobral@2
  2659
		  for tmp in $newlib_search_path ; do
leo_sobral@2
  2660
		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
leo_sobral@2
  2661
		      eval depdepl="$tmp/lib$tmp_libs.dylib"
leo_sobral@2
  2662
		      break
leo_sobral@2
  2663
		    fi
leo_sobral@2
  2664
		  done
leo_sobral@2
  2665
		  path=""
leo_sobral@2
  2666
		  ;;
leo_sobral@2
  2667
		*) continue ;;
leo_sobral@2
  2668
		esac
leo_sobral@2
  2669
		;;
leo_sobral@2
  2670
	      *) continue ;;
leo_sobral@2
  2671
	      esac
leo_sobral@2
  2672
	      case " $deplibs " in
leo_sobral@2
  2673
	      *" $depdepl "*) ;;
leo_sobral@2
  2674
	      *) deplibs="$depdepl $deplibs" ;;
leo_sobral@2
  2675
	      esac
leo_sobral@2
  2676
	      case " $deplibs " in
leo_sobral@2
  2677
	      *" $path "*) ;;
leo_sobral@2
  2678
	      *) deplibs="$deplibs $path" ;;
leo_sobral@2
  2679
	      esac
leo_sobral@2
  2680
	    done
leo_sobral@2
  2681
	  fi # link_all_deplibs != no
leo_sobral@2
  2682
	fi # linkmode = lib
leo_sobral@2
  2683
      done # for deplib in $libs
leo_sobral@2
  2684
      dependency_libs="$newdependency_libs"
leo_sobral@2
  2685
      if test "$pass" = dlpreopen; then
leo_sobral@2
  2686
	# Link the dlpreopened libraries before other libraries
leo_sobral@2
  2687
	for deplib in $save_deplibs; do
leo_sobral@2
  2688
	  deplibs="$deplib $deplibs"
leo_sobral@2
  2689
	done
leo_sobral@2
  2690
      fi
leo_sobral@2
  2691
      if test "$pass" != dlopen; then
leo_sobral@2
  2692
	if test "$pass" != conv; then
leo_sobral@2
  2693
	  # Make sure lib_search_path contains only unique directories.
leo_sobral@2
  2694
	  lib_search_path=
leo_sobral@2
  2695
	  for dir in $newlib_search_path; do
leo_sobral@2
  2696
	    case "$lib_search_path " in
leo_sobral@2
  2697
	    *" $dir "*) ;;
leo_sobral@2
  2698
	    *) lib_search_path="$lib_search_path $dir" ;;
leo_sobral@2
  2699
	    esac
leo_sobral@2
  2700
	  done
leo_sobral@2
  2701
	  newlib_search_path=
leo_sobral@2
  2702
	fi
leo_sobral@2
  2703
leo_sobral@2
  2704
	if test "$linkmode,$pass" != "prog,link"; then
leo_sobral@2
  2705
	  vars="deplibs"
leo_sobral@2
  2706
	else
leo_sobral@2
  2707
	  vars="compile_deplibs finalize_deplibs"
leo_sobral@2
  2708
	fi
leo_sobral@2
  2709
	for var in $vars dependency_libs; do
leo_sobral@2
  2710
	  # Add libraries to $var in reverse order
leo_sobral@2
  2711
	  eval tmp_libs=\"\$$var\"
leo_sobral@2
  2712
	  new_libs=
leo_sobral@2
  2713
	  for deplib in $tmp_libs; do
leo_sobral@2
  2714
	    # FIXME: Pedantically, this is the right thing to do, so
leo_sobral@2
  2715
	    #        that some nasty dependency loop isn't accidentally
leo_sobral@2
  2716
	    #        broken:
leo_sobral@2
  2717
	    #new_libs="$deplib $new_libs"
leo_sobral@2
  2718
	    # Pragmatically, this seems to cause very few problems in
leo_sobral@2
  2719
	    # practice:
leo_sobral@2
  2720
	    case $deplib in
leo_sobral@2
  2721
	    -L*) new_libs="$deplib $new_libs" ;;
leo_sobral@2
  2722
	    -R*) ;;
leo_sobral@2
  2723
	    *)
leo_sobral@2
  2724
	      # And here is the reason: when a library appears more
leo_sobral@2
  2725
	      # than once as an explicit dependence of a library, or
leo_sobral@2
  2726
	      # is implicitly linked in more than once by the
leo_sobral@2
  2727
	      # compiler, it is considered special, and multiple
leo_sobral@2
  2728
	      # occurrences thereof are not removed.  Compare this
leo_sobral@2
  2729
	      # with having the same library being listed as a
leo_sobral@2
  2730
	      # dependency of multiple other libraries: in this case,
leo_sobral@2
  2731
	      # we know (pedantically, we assume) the library does not
leo_sobral@2
  2732
	      # need to be listed more than once, so we keep only the
leo_sobral@2
  2733
	      # last copy.  This is not always right, but it is rare
leo_sobral@2
  2734
	      # enough that we require users that really mean to play
leo_sobral@2
  2735
	      # such unportable linking tricks to link the library
leo_sobral@2
  2736
	      # using -Wl,-lname, so that libtool does not consider it
leo_sobral@2
  2737
	      # for duplicate removal.
leo_sobral@2
  2738
	      case " $specialdeplibs " in
leo_sobral@2
  2739
	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
leo_sobral@2
  2740
	      *)
leo_sobral@2
  2741
		case " $new_libs " in
leo_sobral@2
  2742
		*" $deplib "*) ;;
leo_sobral@2
  2743
		*) new_libs="$deplib $new_libs" ;;
leo_sobral@2
  2744
		esac
leo_sobral@2
  2745
		;;
leo_sobral@2
  2746
	      esac
leo_sobral@2
  2747
	      ;;
leo_sobral@2
  2748
	    esac
leo_sobral@2
  2749
	  done
leo_sobral@2
  2750
	  tmp_libs=
leo_sobral@2
  2751
	  for deplib in $new_libs; do
leo_sobral@2
  2752
	    case $deplib in
leo_sobral@2
  2753
	    -L*)
leo_sobral@2
  2754
	      case " $tmp_libs " in
leo_sobral@2
  2755
	      *" $deplib "*) ;;
leo_sobral@2
  2756
	      *) tmp_libs="$tmp_libs $deplib" ;;
leo_sobral@2
  2757
	      esac
leo_sobral@2
  2758
	      ;;
leo_sobral@2
  2759
	    *) tmp_libs="$tmp_libs $deplib" ;;
leo_sobral@2
  2760
	    esac
leo_sobral@2
  2761
	  done
leo_sobral@2
  2762
	  eval $var=\"$tmp_libs\"
leo_sobral@2
  2763
	done # for var
leo_sobral@2
  2764
      fi
leo_sobral@2
  2765
      # Last step: remove runtime libs from dependency_libs
leo_sobral@2
  2766
      # (they stay in deplibs)
leo_sobral@2
  2767
      tmp_libs=
leo_sobral@2
  2768
      for i in $dependency_libs ; do
leo_sobral@2
  2769
	case " $predeps $postdeps $compiler_lib_search_path " in
leo_sobral@2
  2770
	*" $i "*)
leo_sobral@2
  2771
	  i=""
leo_sobral@2
  2772
	  ;;
leo_sobral@2
  2773
	esac
leo_sobral@2
  2774
	if test -n "$i" ; then
leo_sobral@2
  2775
	  tmp_libs="$tmp_libs $i"
leo_sobral@2
  2776
	fi
leo_sobral@2
  2777
      done
leo_sobral@2
  2778
      dependency_libs=$tmp_libs
leo_sobral@2
  2779
    done # for pass
leo_sobral@2
  2780
    if test "$linkmode" = prog; then
leo_sobral@2
  2781
      dlfiles="$newdlfiles"
leo_sobral@2
  2782
      dlprefiles="$newdlprefiles"
leo_sobral@2
  2783
    fi
leo_sobral@2
  2784
leo_sobral@2
  2785
    case $linkmode in
leo_sobral@2
  2786
    oldlib)
leo_sobral@2
  2787
      if test -n "$deplibs"; then
leo_sobral@2
  2788
	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
leo_sobral@2
  2789
      fi
leo_sobral@2
  2790
leo_sobral@2
  2791
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
leo_sobral@2
  2792
	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
leo_sobral@2
  2793
      fi
leo_sobral@2
  2794
leo_sobral@2
  2795
      if test -n "$rpath"; then
leo_sobral@2
  2796
	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
leo_sobral@2
  2797
      fi
leo_sobral@2
  2798
leo_sobral@2
  2799
      if test -n "$xrpath"; then
leo_sobral@2
  2800
	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
leo_sobral@2
  2801
      fi
leo_sobral@2
  2802
leo_sobral@2
  2803
      if test -n "$vinfo"; then
leo_sobral@2
  2804
	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
leo_sobral@2
  2805
      fi
leo_sobral@2
  2806
leo_sobral@2
  2807
      if test -n "$release"; then
leo_sobral@2
  2808
	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
leo_sobral@2
  2809
      fi
leo_sobral@2
  2810
leo_sobral@2
  2811
      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
leo_sobral@2
  2812
	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
leo_sobral@2
  2813
      fi
leo_sobral@2
  2814
leo_sobral@2
  2815
      # Now set the variables for building old libraries.
leo_sobral@2
  2816
      build_libtool_libs=no
leo_sobral@2
  2817
      oldlibs="$output"
leo_sobral@2
  2818
      objs="$objs$old_deplibs"
leo_sobral@2
  2819
      ;;
leo_sobral@2
  2820
leo_sobral@2
  2821
    lib)
leo_sobral@2
  2822
      # Make sure we only generate libraries of the form `libNAME.la'.
leo_sobral@2
  2823
      case $outputname in
leo_sobral@2
  2824
      lib*)
leo_sobral@2
  2825
	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
leo_sobral@2
  2826
	eval shared_ext=\"$shrext_cmds\"
leo_sobral@2
  2827
	eval libname=\"$libname_spec\"
leo_sobral@2
  2828
	;;
leo_sobral@2
  2829
      *)
leo_sobral@2
  2830
	if test "$module" = no; then
leo_sobral@2
  2831
	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
leo_sobral@2
  2832
	  $echo "$help" 1>&2
leo_sobral@2
  2833
	  exit $EXIT_FAILURE
leo_sobral@2
  2834
	fi
leo_sobral@2
  2835
	if test "$need_lib_prefix" != no; then
leo_sobral@2
  2836
	  # Add the "lib" prefix for modules if required
leo_sobral@2
  2837
	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
leo_sobral@2
  2838
	  eval shared_ext=\"$shrext_cmds\"
leo_sobral@2
  2839
	  eval libname=\"$libname_spec\"
leo_sobral@2
  2840
	else
leo_sobral@2
  2841
	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
leo_sobral@2
  2842
	fi
leo_sobral@2
  2843
	;;
leo_sobral@2
  2844
      esac
leo_sobral@2
  2845
leo_sobral@2
  2846
      if test -n "$objs"; then
leo_sobral@2
  2847
	if test "$deplibs_check_method" != pass_all; then
leo_sobral@2
  2848
	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
leo_sobral@2
  2849
	  exit $EXIT_FAILURE
leo_sobral@2
  2850
	else
leo_sobral@2
  2851
	  $echo
leo_sobral@2
  2852
	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
leo_sobral@2
  2853
	  $echo "*** objects $objs is not portable!"
leo_sobral@2
  2854
	  libobjs="$libobjs $objs"
leo_sobral@2
  2855
	fi
leo_sobral@2
  2856
      fi
leo_sobral@2
  2857
leo_sobral@2
  2858
      if test "$dlself" != no; then
leo_sobral@2
  2859
	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
leo_sobral@2
  2860
      fi
leo_sobral@2
  2861
leo_sobral@2
  2862
      set dummy $rpath
leo_sobral@2
  2863
      if test "$#" -gt 2; then
leo_sobral@2
  2864
	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
leo_sobral@2
  2865
      fi
leo_sobral@2
  2866
      install_libdir="$2"
leo_sobral@2
  2867
leo_sobral@2
  2868
      oldlibs=
leo_sobral@2
  2869
      if test -z "$rpath"; then
leo_sobral@2
  2870
	if test "$build_libtool_libs" = yes; then
leo_sobral@2
  2871
	  # Building a libtool convenience library.
leo_sobral@2
  2872
	  # Some compilers have problems with a `.al' extension so
leo_sobral@2
  2873
	  # convenience libraries should have the same extension an
leo_sobral@2
  2874
	  # archive normally would.
leo_sobral@2
  2875
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
leo_sobral@2
  2876
	  build_libtool_libs=convenience
leo_sobral@2
  2877
	  build_old_libs=yes
leo_sobral@2
  2878
	fi
leo_sobral@2
  2879
leo_sobral@2
  2880
	if test -n "$vinfo"; then
leo_sobral@2
  2881
	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
leo_sobral@2
  2882
	fi
leo_sobral@2
  2883
leo_sobral@2
  2884
	if test -n "$release"; then
leo_sobral@2
  2885
	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
leo_sobral@2
  2886
	fi
leo_sobral@2
  2887
      else
leo_sobral@2
  2888
leo_sobral@2
  2889
	# Parse the version information argument.
leo_sobral@2
  2890
	save_ifs="$IFS"; IFS=':'
leo_sobral@2
  2891
	set dummy $vinfo 0 0 0
leo_sobral@2
  2892
	IFS="$save_ifs"
leo_sobral@2
  2893
leo_sobral@2
  2894
	if test -n "$8"; then
leo_sobral@2
  2895
	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
leo_sobral@2
  2896
	  $echo "$help" 1>&2
leo_sobral@2
  2897
	  exit $EXIT_FAILURE
leo_sobral@2
  2898
	fi
leo_sobral@2
  2899
leo_sobral@2
  2900
	# convert absolute version numbers to libtool ages
leo_sobral@2
  2901
	# this retains compatibility with .la files and attempts
leo_sobral@2
  2902
	# to make the code below a bit more comprehensible
leo_sobral@2
  2903
leo_sobral@2
  2904
	case $vinfo_number in
leo_sobral@2
  2905
	yes)
leo_sobral@2
  2906
	  number_major="$2"
leo_sobral@2
  2907
	  number_minor="$3"
leo_sobral@2
  2908
	  number_revision="$4"
leo_sobral@2
  2909
	  #
leo_sobral@2
  2910
	  # There are really only two kinds -- those that
leo_sobral@2
  2911
	  # use the current revision as the major version
leo_sobral@2
  2912
	  # and those that subtract age and use age as
leo_sobral@2
  2913
	  # a minor version.  But, then there is irix
leo_sobral@2
  2914
	  # which has an extra 1 added just for fun
leo_sobral@2
  2915
	  #
leo_sobral@2
  2916
	  case $version_type in
leo_sobral@2
  2917
	  darwin|linux|osf|windows)
leo_sobral@2
  2918
	    current=`expr $number_major + $number_minor`
leo_sobral@2
  2919
	    age="$number_minor"
leo_sobral@2
  2920
	    revision="$number_revision"
leo_sobral@2
  2921
	    ;;
leo_sobral@2
  2922
	  freebsd-aout|freebsd-elf|sunos)
leo_sobral@2
  2923
	    current="$number_major"
leo_sobral@2
  2924
	    revision="$number_minor"
leo_sobral@2
  2925
	    age="0"
leo_sobral@2
  2926
	    ;;
leo_sobral@2
  2927
	  irix|nonstopux)
leo_sobral@2
  2928
	    current=`expr $number_major + $number_minor - 1`
leo_sobral@2
  2929
	    age="$number_minor"
leo_sobral@2
  2930
	    revision="$number_minor"
leo_sobral@2
  2931
	    ;;
leo_sobral@2
  2932
	  *)
leo_sobral@2
  2933
	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
leo_sobral@2
  2934
	    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
leo_sobral@2
  2935
	    exit $EXIT_FAILURE
leo_sobral@2
  2936
	    ;;
leo_sobral@2
  2937
	  esac
leo_sobral@2
  2938
	  ;;
leo_sobral@2
  2939
	no)
leo_sobral@2
  2940
	  current="$2"
leo_sobral@2
  2941
	  revision="$3"
leo_sobral@2
  2942
	  age="$4"
leo_sobral@2
  2943
	  ;;
leo_sobral@2
  2944
	esac
leo_sobral@2
  2945
leo_sobral@2
  2946
	# Check that each of the things are valid numbers.
leo_sobral@2
  2947
	case $current in
leo_sobral@2
  2948
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
leo_sobral@2
  2949
	*)
leo_sobral@2
  2950
	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
leo_sobral@2
  2951
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
leo_sobral@2
  2952
	  exit $EXIT_FAILURE
leo_sobral@2
  2953
	  ;;
leo_sobral@2
  2954
	esac
leo_sobral@2
  2955
leo_sobral@2
  2956
	case $revision in
leo_sobral@2
  2957
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
leo_sobral@2
  2958
	*)
leo_sobral@2
  2959
	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
leo_sobral@2
  2960
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
leo_sobral@2
  2961
	  exit $EXIT_FAILURE
leo_sobral@2
  2962
	  ;;
leo_sobral@2
  2963
	esac
leo_sobral@2
  2964
leo_sobral@2
  2965
	case $age in
leo_sobral@2
  2966
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
leo_sobral@2
  2967
	*)
leo_sobral@2
  2968
	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
leo_sobral@2
  2969
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
leo_sobral@2
  2970
	  exit $EXIT_FAILURE
leo_sobral@2
  2971
	  ;;
leo_sobral@2
  2972
	esac
leo_sobral@2
  2973
leo_sobral@2
  2974
	if test "$age" -gt "$current"; then
leo_sobral@2
  2975
	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
leo_sobral@2
  2976
	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
leo_sobral@2
  2977
	  exit $EXIT_FAILURE
leo_sobral@2
  2978
	fi
leo_sobral@2
  2979
leo_sobral@2
  2980
	# Calculate the version variables.
leo_sobral@2
  2981
	major=
leo_sobral@2
  2982
	versuffix=
leo_sobral@2
  2983
	verstring=
leo_sobral@2
  2984
	case $version_type in
leo_sobral@2
  2985
	none) ;;
leo_sobral@2
  2986
leo_sobral@2
  2987
	darwin)
leo_sobral@2
  2988
	  # Like Linux, but with the current version available in
leo_sobral@2
  2989
	  # verstring for coding it into the library header
leo_sobral@2
  2990
	  major=.`expr $current - $age`
leo_sobral@2
  2991
	  versuffix="$major.$age.$revision"
leo_sobral@2
  2992
	  # Darwin ld doesn't like 0 for these options...
leo_sobral@2
  2993
	  minor_current=`expr $current + 1`
leo_sobral@2
  2994
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
leo_sobral@2
  2995
	  ;;
leo_sobral@2
  2996
leo_sobral@2
  2997
	freebsd-aout)
leo_sobral@2
  2998
	  major=".$current"
leo_sobral@2
  2999
	  versuffix=".$current.$revision";
leo_sobral@2
  3000
	  ;;
leo_sobral@2
  3001
leo_sobral@2
  3002
	freebsd-elf)
leo_sobral@2
  3003
	  major=".$current"
leo_sobral@2
  3004
	  versuffix=".$current";
leo_sobral@2
  3005
	  ;;
leo_sobral@2
  3006
leo_sobral@2
  3007
	irix | nonstopux)
leo_sobral@2
  3008
	  major=`expr $current - $age + 1`
leo_sobral@2
  3009
leo_sobral@2
  3010
	  case $version_type in
leo_sobral@2
  3011
	    nonstopux) verstring_prefix=nonstopux ;;
leo_sobral@2
  3012
	    *)         verstring_prefix=sgi ;;
leo_sobral@2
  3013
	  esac
leo_sobral@2
  3014
	  verstring="$verstring_prefix$major.$revision"
leo_sobral@2
  3015
leo_sobral@2
  3016
	  # Add in all the interfaces that we are compatible with.
leo_sobral@2
  3017
	  loop=$revision
leo_sobral@2
  3018
	  while test "$loop" -ne 0; do
leo_sobral@2
  3019
	    iface=`expr $revision - $loop`
leo_sobral@2
  3020
	    loop=`expr $loop - 1`
leo_sobral@2
  3021
	    verstring="$verstring_prefix$major.$iface:$verstring"
leo_sobral@2
  3022
	  done
leo_sobral@2
  3023
leo_sobral@2
  3024
	  # Before this point, $major must not contain `.'.
leo_sobral@2
  3025
	  major=.$major
leo_sobral@2
  3026
	  versuffix="$major.$revision"
leo_sobral@2
  3027
	  ;;
leo_sobral@2
  3028
leo_sobral@2
  3029
	linux)
leo_sobral@2
  3030
	  major=.`expr $current - $age`
leo_sobral@2
  3031
	  versuffix="$major.$age.$revision"
leo_sobral@2
  3032
	  ;;
leo_sobral@2
  3033
leo_sobral@2
  3034
	osf)
leo_sobral@2
  3035
	  major=.`expr $current - $age`
leo_sobral@2
  3036
	  versuffix=".$current.$age.$revision"
leo_sobral@2
  3037
	  verstring="$current.$age.$revision"
leo_sobral@2
  3038
leo_sobral@2
  3039
	  # Add in all the interfaces that we are compatible with.
leo_sobral@2
  3040
	  loop=$age
leo_sobral@2
  3041
	  while test "$loop" -ne 0; do
leo_sobral@2
  3042
	    iface=`expr $current - $loop`
leo_sobral@2
  3043
	    loop=`expr $loop - 1`
leo_sobral@2
  3044
	    verstring="$verstring:${iface}.0"
leo_sobral@2
  3045
	  done
leo_sobral@2
  3046
leo_sobral@2
  3047
	  # Make executables depend on our current version.
leo_sobral@2
  3048
	  verstring="$verstring:${current}.0"
leo_sobral@2
  3049
	  ;;
leo_sobral@2
  3050
leo_sobral@2
  3051
	sunos)
leo_sobral@2
  3052
	  major=".$current"
leo_sobral@2
  3053
	  versuffix=".$current.$revision"
leo_sobral@2
  3054
	  ;;
leo_sobral@2
  3055
leo_sobral@2
  3056
	windows)
leo_sobral@2
  3057
	  # Use '-' rather than '.', since we only want one
leo_sobral@2
  3058
	  # extension on DOS 8.3 filesystems.
leo_sobral@2
  3059
	  major=`expr $current - $age`
leo_sobral@2
  3060
	  versuffix="-$major"
leo_sobral@2
  3061
	  ;;
leo_sobral@2
  3062
leo_sobral@2
  3063
	*)
leo_sobral@2
  3064
	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
leo_sobral@2
  3065
	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
leo_sobral@2
  3066
	  exit $EXIT_FAILURE
leo_sobral@2
  3067
	  ;;
leo_sobral@2
  3068
	esac
leo_sobral@2
  3069
leo_sobral@2
  3070
	# Clear the version info if we defaulted, and they specified a release.
leo_sobral@2
  3071
	if test -z "$vinfo" && test -n "$release"; then
leo_sobral@2
  3072
	  major=
leo_sobral@2
  3073
	  case $version_type in
leo_sobral@2
  3074
	  darwin)
leo_sobral@2
  3075
	    # we can't check for "0.0" in archive_cmds due to quoting
leo_sobral@2
  3076
	    # problems, so we reset it completely
leo_sobral@2
  3077
	    verstring=
leo_sobral@2
  3078
	    ;;
leo_sobral@2
  3079
	  *)
leo_sobral@2
  3080
	    verstring="0.0"
leo_sobral@2
  3081
	    ;;
leo_sobral@2
  3082
	  esac
leo_sobral@2
  3083
	  if test "$need_version" = no; then
leo_sobral@2
  3084
	    versuffix=
leo_sobral@2
  3085
	  else
leo_sobral@2
  3086
	    versuffix=".0.0"
leo_sobral@2
  3087
	  fi
leo_sobral@2
  3088
	fi
leo_sobral@2
  3089
leo_sobral@2
  3090
	# Remove version info from name if versioning should be avoided
leo_sobral@2
  3091
	if test "$avoid_version" = yes && test "$need_version" = no; then
leo_sobral@2
  3092
	  major=
leo_sobral@2
  3093
	  versuffix=
leo_sobral@2
  3094
	  verstring=""
leo_sobral@2
  3095
	fi
leo_sobral@2
  3096
leo_sobral@2
  3097
	# Check to see if the archive will have undefined symbols.
leo_sobral@2
  3098
	if test "$allow_undefined" = yes; then
leo_sobral@2
  3099
	  if test "$allow_undefined_flag" = unsupported; then
leo_sobral@2
  3100
	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
leo_sobral@2
  3101
	    build_libtool_libs=no
leo_sobral@2
  3102
	    build_old_libs=yes
leo_sobral@2
  3103
	  fi
leo_sobral@2
  3104
	else
leo_sobral@2
  3105
	  # Don't allow undefined symbols.
leo_sobral@2
  3106
	  allow_undefined_flag="$no_undefined_flag"
leo_sobral@2
  3107
	fi
leo_sobral@2
  3108
      fi
leo_sobral@2
  3109
leo_sobral@2
  3110
      if test "$mode" != relink; then
leo_sobral@2
  3111
	# Remove our outputs, but don't remove object files since they
leo_sobral@2
  3112
	# may have been created when compiling PIC objects.
leo_sobral@2
  3113
	removelist=
leo_sobral@2
  3114
	tempremovelist=`$echo "$output_objdir/*"`
leo_sobral@2
  3115
	for p in $tempremovelist; do
leo_sobral@2
  3116
	  case $p in
leo_sobral@2
  3117
	    *.$objext)
leo_sobral@2
  3118
	       ;;
leo_sobral@2
  3119
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
leo_sobral@2
  3120
	       if test "X$precious_files_regex" != "X"; then
leo_sobral@2
  3121
	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
leo_sobral@2
  3122
	         then
leo_sobral@2
  3123
		   continue
leo_sobral@2
  3124
		 fi
leo_sobral@2
  3125
	       fi
leo_sobral@2
  3126
	       removelist="$removelist $p"
leo_sobral@2
  3127
	       ;;
leo_sobral@2
  3128
	    *) ;;
leo_sobral@2
  3129
	  esac
leo_sobral@2
  3130
	done
leo_sobral@2
  3131
	if test -n "$removelist"; then
leo_sobral@2
  3132
	  $show "${rm}r $removelist"
leo_sobral@2
  3133
	  $run ${rm}r $removelist
leo_sobral@2
  3134
	fi
leo_sobral@2
  3135
      fi
leo_sobral@2
  3136
leo_sobral@2
  3137
      # Now set the variables for building old libraries.
leo_sobral@2
  3138
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
leo_sobral@2
  3139
	oldlibs="$oldlibs $output_objdir/$libname.$libext"
leo_sobral@2
  3140
leo_sobral@2
  3141
	# Transform .lo files to .o files.
leo_sobral@2
  3142
	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
leo_sobral@2
  3143
      fi
leo_sobral@2
  3144
leo_sobral@2
  3145
      # Eliminate all temporary directories.
leo_sobral@2
  3146
      for path in $notinst_path; do
leo_sobral@2
  3147
	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
leo_sobral@2
  3148
	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
leo_sobral@2
  3149
	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
leo_sobral@2
  3150
      done
leo_sobral@2
  3151
leo_sobral@2
  3152
      if test -n "$xrpath"; then
leo_sobral@2
  3153
	# If the user specified any rpath flags, then add them.
leo_sobral@2
  3154
	temp_xrpath=
leo_sobral@2
  3155
	for libdir in $xrpath; do
leo_sobral@2
  3156
	  temp_xrpath="$temp_xrpath -R$libdir"
leo_sobral@2
  3157
	  case "$finalize_rpath " in
leo_sobral@2
  3158
	  *" $libdir "*) ;;
leo_sobral@2
  3159
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
leo_sobral@2
  3160
	  esac
leo_sobral@2
  3161
	done
leo_sobral@2
  3162
	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
leo_sobral@2
  3163
	  dependency_libs="$temp_xrpath $dependency_libs"
leo_sobral@2
  3164
	fi
leo_sobral@2
  3165
      fi
leo_sobral@2
  3166
leo_sobral@2
  3167
      # Make sure dlfiles contains only unique files that won't be dlpreopened
leo_sobral@2
  3168
      old_dlfiles="$dlfiles"
leo_sobral@2
  3169
      dlfiles=
leo_sobral@2
  3170
      for lib in $old_dlfiles; do
leo_sobral@2
  3171
	case " $dlprefiles $dlfiles " in
leo_sobral@2
  3172
	*" $lib "*) ;;
leo_sobral@2
  3173
	*) dlfiles="$dlfiles $lib" ;;
leo_sobral@2
  3174
	esac
leo_sobral@2
  3175
      done
leo_sobral@2
  3176
leo_sobral@2
  3177
      # Make sure dlprefiles contains only unique files
leo_sobral@2
  3178
      old_dlprefiles="$dlprefiles"
leo_sobral@2
  3179
      dlprefiles=
leo_sobral@2
  3180
      for lib in $old_dlprefiles; do
leo_sobral@2
  3181
	case "$dlprefiles " in
leo_sobral@2
  3182
	*" $lib "*) ;;
leo_sobral@2
  3183
	*) dlprefiles="$dlprefiles $lib" ;;
leo_sobral@2
  3184
	esac
leo_sobral@2
  3185
      done
leo_sobral@2
  3186
leo_sobral@2
  3187
      if test "$build_libtool_libs" = yes; then
leo_sobral@2
  3188
	if test -n "$rpath"; then
leo_sobral@2
  3189
	  case $host in
leo_sobral@2
  3190
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
leo_sobral@2
  3191
	    # these systems don't actually have a c library (as such)!
leo_sobral@2
  3192
	    ;;
leo_sobral@2
  3193
	  *-*-rhapsody* | *-*-darwin1.[012])
leo_sobral@2
  3194
	    # Rhapsody C library is in the System framework
leo_sobral@2
  3195
	    deplibs="$deplibs -framework System"
leo_sobral@2
  3196
	    ;;
leo_sobral@2
  3197
	  *-*-netbsd*)
leo_sobral@2
  3198
	    # Don't link with libc until the a.out ld.so is fixed.
leo_sobral@2
  3199
	    ;;
leo_sobral@2
  3200
	  *-*-openbsd* | *-*-freebsd*)
leo_sobral@2
  3201
	    # Do not include libc due to us having libc/libc_r.
leo_sobral@2
  3202
	    test "X$arg" = "X-lc" && continue
leo_sobral@2
  3203
	    ;;
leo_sobral@2
  3204
 	  *)
leo_sobral@2
  3205
	    # Add libc to deplibs on all other systems if necessary.
leo_sobral@2
  3206
	    if test "$build_libtool_need_lc" = "yes"; then
leo_sobral@2
  3207
	      deplibs="$deplibs -lc"
leo_sobral@2
  3208
	    fi
leo_sobral@2
  3209
	    ;;
leo_sobral@2
  3210
	  esac
leo_sobral@2
  3211
	fi
leo_sobral@2
  3212
leo_sobral@2
  3213
	# Transform deplibs into only deplibs that can be linked in shared.
leo_sobral@2
  3214
	name_save=$name
leo_sobral@2
  3215
	libname_save=$libname
leo_sobral@2
  3216
	release_save=$release
leo_sobral@2
  3217
	versuffix_save=$versuffix
leo_sobral@2
  3218
	major_save=$major
leo_sobral@2
  3219
	# I'm not sure if I'm treating the release correctly.  I think
leo_sobral@2
  3220
	# release should show up in the -l (ie -lgmp5) so we don't want to
leo_sobral@2
  3221
	# add it in twice.  Is that correct?
leo_sobral@2
  3222
	release=""
leo_sobral@2
  3223
	versuffix=""
leo_sobral@2
  3224
	major=""
leo_sobral@2
  3225
	newdeplibs=
leo_sobral@2
  3226
	droppeddeps=no
leo_sobral@2
  3227
	case $deplibs_check_method in
leo_sobral@2
  3228
	pass_all)
leo_sobral@2
  3229
	  # Don't check for shared/static.  Everything works.
leo_sobral@2
  3230
	  # This might be a little naive.  We might want to check
leo_sobral@2
  3231
	  # whether the library exists or not.  But this is on
leo_sobral@2
  3232
	  # osf3 & osf4 and I'm not really sure... Just
leo_sobral@2
  3233
	  # implementing what was already the behavior.
leo_sobral@2
  3234
	  newdeplibs=$deplibs
leo_sobral@2
  3235
	  ;;
leo_sobral@2
  3236
	test_compile)
leo_sobral@2
  3237
	  # This code stresses the "libraries are programs" paradigm to its
leo_sobral@2
  3238
	  # limits. Maybe even breaks it.  We compile a program, linking it
leo_sobral@2
  3239
	  # against the deplibs as a proxy for the library.  Then we can check
leo_sobral@2
  3240
	  # whether they linked in statically or dynamically with ldd.
leo_sobral@2
  3241
	  $rm conftest.c
leo_sobral@2
  3242
	  cat > conftest.c <<EOF
leo_sobral@2
  3243
	  int main() { return 0; }
leo_sobral@2
  3244
EOF
leo_sobral@2
  3245
	  $rm conftest
leo_sobral@2
  3246
	  $LTCC -o conftest conftest.c $deplibs
leo_sobral@2
  3247
	  if test "$?" -eq 0 ; then
leo_sobral@2
  3248
	    ldd_output=`ldd conftest`
leo_sobral@2
  3249
	    for i in $deplibs; do
leo_sobral@2
  3250
	      name="`expr $i : '-l\(.*\)'`"
leo_sobral@2
  3251
	      # If $name is empty we are operating on a -L argument.
leo_sobral@2
  3252
              if test "$name" != "" && test "$name" -ne "0"; then
leo_sobral@2
  3253
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  3254
		  case " $predeps $postdeps " in
leo_sobral@2
  3255
		  *" $i "*)
leo_sobral@2
  3256
		    newdeplibs="$newdeplibs $i"
leo_sobral@2
  3257
		    i=""
leo_sobral@2
  3258
		    ;;
leo_sobral@2
  3259
		  esac
leo_sobral@2
  3260
	        fi
leo_sobral@2
  3261
		if test -n "$i" ; then
leo_sobral@2
  3262
		  libname=`eval \\$echo \"$libname_spec\"`
leo_sobral@2
  3263
		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
leo_sobral@2
  3264
		  set dummy $deplib_matches
leo_sobral@2
  3265
		  deplib_match=$2
leo_sobral@2
  3266
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
leo_sobral@2
  3267
		    newdeplibs="$newdeplibs $i"
leo_sobral@2
  3268
		  else
leo_sobral@2
  3269
		    droppeddeps=yes
leo_sobral@2
  3270
		    $echo
leo_sobral@2
  3271
		    $echo "*** Warning: dynamic linker does not accept needed library $i."
leo_sobral@2
  3272
		    $echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  3273
		    $echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  3274
		    $echo "*** shared version of the library, which I believe you do not have"
leo_sobral@2
  3275
		    $echo "*** because a test_compile did reveal that the linker did not use it for"
leo_sobral@2
  3276
		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
leo_sobral@2
  3277
		  fi
leo_sobral@2
  3278
		fi
leo_sobral@2
  3279
	      else
leo_sobral@2
  3280
		newdeplibs="$newdeplibs $i"
leo_sobral@2
  3281
	      fi
leo_sobral@2
  3282
	    done
leo_sobral@2
  3283
	  else
leo_sobral@2
  3284
	    # Error occurred in the first compile.  Let's try to salvage
leo_sobral@2
  3285
	    # the situation: Compile a separate program for each library.
leo_sobral@2
  3286
	    for i in $deplibs; do
leo_sobral@2
  3287
	      name="`expr $i : '-l\(.*\)'`"
leo_sobral@2
  3288
	      # If $name is empty we are operating on a -L argument.
leo_sobral@2
  3289
              if test "$name" != "" && test "$name" != "0"; then
leo_sobral@2
  3290
		$rm conftest
leo_sobral@2
  3291
		$LTCC -o conftest conftest.c $i
leo_sobral@2
  3292
		# Did it work?
leo_sobral@2
  3293
		if test "$?" -eq 0 ; then
leo_sobral@2
  3294
		  ldd_output=`ldd conftest`
leo_sobral@2
  3295
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  3296
		    case " $predeps $postdeps " in
leo_sobral@2
  3297
		    *" $i "*)
leo_sobral@2
  3298
		      newdeplibs="$newdeplibs $i"
leo_sobral@2
  3299
		      i=""
leo_sobral@2
  3300
		      ;;
leo_sobral@2
  3301
		    esac
leo_sobral@2
  3302
		  fi
leo_sobral@2
  3303
		  if test -n "$i" ; then
leo_sobral@2
  3304
		    libname=`eval \\$echo \"$libname_spec\"`
leo_sobral@2
  3305
		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
leo_sobral@2
  3306
		    set dummy $deplib_matches
leo_sobral@2
  3307
		    deplib_match=$2
leo_sobral@2
  3308
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
leo_sobral@2
  3309
		      newdeplibs="$newdeplibs $i"
leo_sobral@2
  3310
		    else
leo_sobral@2
  3311
		      droppeddeps=yes
leo_sobral@2
  3312
		      $echo
leo_sobral@2
  3313
		      $echo "*** Warning: dynamic linker does not accept needed library $i."
leo_sobral@2
  3314
		      $echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  3315
		      $echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  3316
		      $echo "*** shared version of the library, which you do not appear to have"
leo_sobral@2
  3317
		      $echo "*** because a test_compile did reveal that the linker did not use this one"
leo_sobral@2
  3318
		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
leo_sobral@2
  3319
		    fi
leo_sobral@2
  3320
		  fi
leo_sobral@2
  3321
		else
leo_sobral@2
  3322
		  droppeddeps=yes
leo_sobral@2
  3323
		  $echo
leo_sobral@2
  3324
		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
leo_sobral@2
  3325
		  $echo "***  make it link in!  You will probably need to install it or some"
leo_sobral@2
  3326
		  $echo "*** library that it depends on before this library will be fully"
leo_sobral@2
  3327
		  $echo "*** functional.  Installing it before continuing would be even better."
leo_sobral@2
  3328
		fi
leo_sobral@2
  3329
	      else
leo_sobral@2
  3330
		newdeplibs="$newdeplibs $i"
leo_sobral@2
  3331
	      fi
leo_sobral@2
  3332
	    done
leo_sobral@2
  3333
	  fi
leo_sobral@2
  3334
	  ;;
leo_sobral@2
  3335
	file_magic*)
leo_sobral@2
  3336
	  set dummy $deplibs_check_method
leo_sobral@2
  3337
	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
leo_sobral@2
  3338
	  for a_deplib in $deplibs; do
leo_sobral@2
  3339
	    name="`expr $a_deplib : '-l\(.*\)'`"
leo_sobral@2
  3340
	    # If $name is empty we are operating on a -L argument.
leo_sobral@2
  3341
            if test "$name" != "" && test  "$name" != "0"; then
leo_sobral@2
  3342
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  3343
		case " $predeps $postdeps " in
leo_sobral@2
  3344
		*" $a_deplib "*)
leo_sobral@2
  3345
		  newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3346
		  a_deplib=""
leo_sobral@2
  3347
		  ;;
leo_sobral@2
  3348
		esac
leo_sobral@2
  3349
	      fi
leo_sobral@2
  3350
	      if test -n "$a_deplib" ; then
leo_sobral@2
  3351
		libname=`eval \\$echo \"$libname_spec\"`
leo_sobral@2
  3352
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
leo_sobral@2
  3353
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
leo_sobral@2
  3354
		  for potent_lib in $potential_libs; do
leo_sobral@2
  3355
		      # Follow soft links.
leo_sobral@2
  3356
		      if ls -lLd "$potent_lib" 2>/dev/null \
leo_sobral@2
  3357
			 | grep " -> " >/dev/null; then
leo_sobral@2
  3358
			continue
leo_sobral@2
  3359
		      fi
leo_sobral@2
  3360
		      # The statement above tries to avoid entering an
leo_sobral@2
  3361
		      # endless loop below, in case of cyclic links.
leo_sobral@2
  3362
		      # We might still enter an endless loop, since a link
leo_sobral@2
  3363
		      # loop can be closed while we follow links,
leo_sobral@2
  3364
		      # but so what?
leo_sobral@2
  3365
		      potlib="$potent_lib"
leo_sobral@2
  3366
		      while test -h "$potlib" 2>/dev/null; do
leo_sobral@2
  3367
			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
leo_sobral@2
  3368
			case $potliblink in
leo_sobral@2
  3369
			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
leo_sobral@2
  3370
			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
leo_sobral@2
  3371
			esac
leo_sobral@2
  3372
		      done
leo_sobral@2
  3373
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
leo_sobral@2
  3374
			 | ${SED} 10q \
leo_sobral@2
  3375
			 | $EGREP "$file_magic_regex" > /dev/null; then
leo_sobral@2
  3376
			newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3377
			a_deplib=""
leo_sobral@2
  3378
			break 2
leo_sobral@2
  3379
		      fi
leo_sobral@2
  3380
		  done
leo_sobral@2
  3381
		done
leo_sobral@2
  3382
	      fi
leo_sobral@2
  3383
	      if test -n "$a_deplib" ; then
leo_sobral@2
  3384
		droppeddeps=yes
leo_sobral@2
  3385
		$echo
leo_sobral@2
  3386
		$echo "*** Warning: linker path does not have real file for library $a_deplib."
leo_sobral@2
  3387
		$echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  3388
		$echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  3389
		$echo "*** shared version of the library, which you do not appear to have"
leo_sobral@2
  3390
		$echo "*** because I did check the linker path looking for a file starting"
leo_sobral@2
  3391
		if test -z "$potlib" ; then
leo_sobral@2
  3392
		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
leo_sobral@2
  3393
		else
leo_sobral@2
  3394
		  $echo "*** with $libname and none of the candidates passed a file format test"
leo_sobral@2
  3395
		  $echo "*** using a file magic. Last file checked: $potlib"
leo_sobral@2
  3396
		fi
leo_sobral@2
  3397
	      fi
leo_sobral@2
  3398
	    else
leo_sobral@2
  3399
	      # Add a -L argument.
leo_sobral@2
  3400
	      newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3401
	    fi
leo_sobral@2
  3402
	  done # Gone through all deplibs.
leo_sobral@2
  3403
	  ;;
leo_sobral@2
  3404
	match_pattern*)
leo_sobral@2
  3405
	  set dummy $deplibs_check_method
leo_sobral@2
  3406
	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
leo_sobral@2
  3407
	  for a_deplib in $deplibs; do
leo_sobral@2
  3408
	    name="`expr $a_deplib : '-l\(.*\)'`"
leo_sobral@2
  3409
	    # If $name is empty we are operating on a -L argument.
leo_sobral@2
  3410
	    if test -n "$name" && test "$name" != "0"; then
leo_sobral@2
  3411
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  3412
		case " $predeps $postdeps " in
leo_sobral@2
  3413
		*" $a_deplib "*)
leo_sobral@2
  3414
		  newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3415
		  a_deplib=""
leo_sobral@2
  3416
		  ;;
leo_sobral@2
  3417
		esac
leo_sobral@2
  3418
	      fi
leo_sobral@2
  3419
	      if test -n "$a_deplib" ; then
leo_sobral@2
  3420
		libname=`eval \\$echo \"$libname_spec\"`
leo_sobral@2
  3421
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
leo_sobral@2
  3422
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
leo_sobral@2
  3423
		  for potent_lib in $potential_libs; do
leo_sobral@2
  3424
		    potlib="$potent_lib" # see symlink-check above in file_magic test
leo_sobral@2
  3425
		    if eval $echo \"$potent_lib\" 2>/dev/null \
leo_sobral@2
  3426
		        | ${SED} 10q \
leo_sobral@2
  3427
		        | $EGREP "$match_pattern_regex" > /dev/null; then
leo_sobral@2
  3428
		      newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3429
		      a_deplib=""
leo_sobral@2
  3430
		      break 2
leo_sobral@2
  3431
		    fi
leo_sobral@2
  3432
		  done
leo_sobral@2
  3433
		done
leo_sobral@2
  3434
	      fi
leo_sobral@2
  3435
	      if test -n "$a_deplib" ; then
leo_sobral@2
  3436
		droppeddeps=yes
leo_sobral@2
  3437
		$echo
leo_sobral@2
  3438
		$echo "*** Warning: linker path does not have real file for library $a_deplib."
leo_sobral@2
  3439
		$echo "*** I have the capability to make that library automatically link in when"
leo_sobral@2
  3440
		$echo "*** you link to this library.  But I can only do this if you have a"
leo_sobral@2
  3441
		$echo "*** shared version of the library, which you do not appear to have"
leo_sobral@2
  3442
		$echo "*** because I did check the linker path looking for a file starting"
leo_sobral@2
  3443
		if test -z "$potlib" ; then
leo_sobral@2
  3444
		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
leo_sobral@2
  3445
		else
leo_sobral@2
  3446
		  $echo "*** with $libname and none of the candidates passed a file format test"
leo_sobral@2
  3447
		  $echo "*** using a regex pattern. Last file checked: $potlib"
leo_sobral@2
  3448
		fi
leo_sobral@2
  3449
	      fi
leo_sobral@2
  3450
	    else
leo_sobral@2
  3451
	      # Add a -L argument.
leo_sobral@2
  3452
	      newdeplibs="$newdeplibs $a_deplib"
leo_sobral@2
  3453
	    fi
leo_sobral@2
  3454
	  done # Gone through all deplibs.
leo_sobral@2
  3455
	  ;;
leo_sobral@2
  3456
	none | unknown | *)
leo_sobral@2
  3457
	  newdeplibs=""
leo_sobral@2
  3458
	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
leo_sobral@2
  3459
	    -e 's/ -[LR][^ ]*//g'`
leo_sobral@2
  3460
	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
leo_sobral@2
  3461
	    for i in $predeps $postdeps ; do
leo_sobral@2
  3462
	      # can't use Xsed below, because $i might contain '/'
leo_sobral@2
  3463
	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
leo_sobral@2
  3464
	    done
leo_sobral@2
  3465
	  fi
leo_sobral@2
  3466
	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
leo_sobral@2
  3467
	    | grep . >/dev/null; then
leo_sobral@2
  3468
	    $echo
leo_sobral@2
  3469
	    if test "X$deplibs_check_method" = "Xnone"; then
leo_sobral@2
  3470
	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
leo_sobral@2
  3471
	    else
leo_sobral@2
  3472
	      $echo "*** Warning: inter-library dependencies are not known to be supported."
leo_sobral@2
  3473
	    fi
leo_sobral@2
  3474
	    $echo "*** All declared inter-library dependencies are being dropped."
leo_sobral@2
  3475
	    droppeddeps=yes
leo_sobral@2
  3476
	  fi
leo_sobral@2
  3477
	  ;;
leo_sobral@2
  3478
	esac
leo_sobral@2
  3479
	versuffix=$versuffix_save
leo_sobral@2
  3480
	major=$major_save
leo_sobral@2
  3481
	release=$release_save
leo_sobral@2
  3482
	libname=$libname_save
leo_sobral@2
  3483
	name=$name_save
leo_sobral@2
  3484
leo_sobral@2
  3485
	case $host in
leo_sobral@2
  3486
	*-*-rhapsody* | *-*-darwin1.[012])
leo_sobral@2
  3487
	  # On Rhapsody replace the C library is the System framework
leo_sobral@2
  3488
	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
leo_sobral@2
  3489
	  ;;
leo_sobral@2
  3490
	esac
leo_sobral@2
  3491
leo_sobral@2
  3492
	if test "$droppeddeps" = yes; then
leo_sobral@2
  3493
	  if test "$module" = yes; then
leo_sobral@2
  3494
	    $echo
leo_sobral@2
  3495
	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
leo_sobral@2
  3496
	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
leo_sobral@2
  3497
	    $echo "*** a static module, that should work as long as the dlopening"
leo_sobral@2
  3498
	    $echo "*** application is linked with the -dlopen flag."
leo_sobral@2
  3499
	    if test -z "$global_symbol_pipe"; then
leo_sobral@2
  3500
	      $echo
leo_sobral@2
  3501
	      $echo "*** However, this would only work if libtool was able to extract symbol"
leo_sobral@2
  3502
	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
leo_sobral@2
  3503
	      $echo "*** not find such a program.  So, this module is probably useless."
leo_sobral@2
  3504
	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
leo_sobral@2
  3505
	    fi
leo_sobral@2
  3506
	    if test "$build_old_libs" = no; then
leo_sobral@2
  3507
	      oldlibs="$output_objdir/$libname.$libext"
leo_sobral@2
  3508
	      build_libtool_libs=module
leo_sobral@2
  3509
	      build_old_libs=yes
leo_sobral@2
  3510
	    else
leo_sobral@2
  3511
	      build_libtool_libs=no
leo_sobral@2
  3512
	    fi
leo_sobral@2
  3513
	  else
leo_sobral@2
  3514
	    $echo "*** The inter-library dependencies that have been dropped here will be"
leo_sobral@2
  3515
	    $echo "*** automatically added whenever a program is linked with this library"
leo_sobral@2
  3516
	    $echo "*** or is declared to -dlopen it."
leo_sobral@2
  3517
leo_sobral@2
  3518
	    if test "$allow_undefined" = no; then
leo_sobral@2
  3519
	      $echo
leo_sobral@2
  3520
	      $echo "*** Since this library must not contain undefined symbols,"
leo_sobral@2
  3521
	      $echo "*** because either the platform does not support them or"
leo_sobral@2
  3522
	      $echo "*** it was explicitly requested with -no-undefined,"
leo_sobral@2
  3523
	      $echo "*** libtool will only create a static version of it."
leo_sobral@2
  3524
	      if test "$build_old_libs" = no; then
leo_sobral@2
  3525
		oldlibs="$output_objdir/$libname.$libext"
leo_sobral@2
  3526
		build_libtool_libs=module
leo_sobral@2
  3527
		build_old_libs=yes
leo_sobral@2
  3528
	      else
leo_sobral@2
  3529
		build_libtool_libs=no
leo_sobral@2
  3530
	      fi
leo_sobral@2
  3531
	    fi
leo_sobral@2
  3532
	  fi
leo_sobral@2
  3533
	fi
leo_sobral@2
  3534
	# Done checking deplibs!
leo_sobral@2
  3535
	deplibs=$newdeplibs
leo_sobral@2
  3536
      fi
leo_sobral@2
  3537
leo_sobral@2
  3538
      # All the library-specific variables (install_libdir is set above).
leo_sobral@2
  3539
      library_names=
leo_sobral@2
  3540
      old_library=
leo_sobral@2
  3541
      dlname=
leo_sobral@2
  3542
leo_sobral@2
  3543
      # Test again, we may have decided not to build it any more
leo_sobral@2
  3544
      if test "$build_libtool_libs" = yes; then
leo_sobral@2
  3545
	if test "$hardcode_into_libs" = yes; then
leo_sobral@2
  3546
	  # Hardcode the library paths
leo_sobral@2
  3547
	  hardcode_libdirs=
leo_sobral@2
  3548
	  dep_rpath=
leo_sobral@2
  3549
	  rpath="$finalize_rpath"
leo_sobral@2
  3550
	  test "$mode" != relink && rpath="$compile_rpath$rpath"
leo_sobral@2
  3551
	  for libdir in $rpath; do
leo_sobral@2
  3552
	    if test -n "$hardcode_libdir_flag_spec"; then
leo_sobral@2
  3553
	      if test -n "$hardcode_libdir_separator"; then
leo_sobral@2
  3554
		if test -z "$hardcode_libdirs"; then
leo_sobral@2
  3555
		  hardcode_libdirs="$libdir"
leo_sobral@2
  3556
		else
leo_sobral@2
  3557
		  # Just accumulate the unique libdirs.
leo_sobral@2
  3558
		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
leo_sobral@2
  3559
		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
leo_sobral@2
  3560
		    ;;
leo_sobral@2
  3561
		  *)
leo_sobral@2
  3562
		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
leo_sobral@2
  3563
		    ;;
leo_sobral@2
  3564
		  esac
leo_sobral@2
  3565
		fi
leo_sobral@2
  3566
	      else
leo_sobral@2
  3567
		eval flag=\"$hardcode_libdir_flag_spec\"
leo_sobral@2
  3568
		dep_rpath="$dep_rpath $flag"
leo_sobral@2
  3569
	      fi
leo_sobral@2
  3570
	    elif test -n "$runpath_var"; then
leo_sobral@2
  3571
	      case "$perm_rpath " in
leo_sobral@2
  3572
	      *" $libdir "*) ;;
leo_sobral@2
  3573
	      *) perm_rpath="$perm_rpath $libdir" ;;
leo_sobral@2
  3574
	      esac
leo_sobral@2
  3575
	    fi
leo_sobral@2
  3576
	  done
leo_sobral@2
  3577
	  # Substitute the hardcoded libdirs into the rpath.
leo_sobral@2
  3578
	  if test -n "$hardcode_libdir_separator" &&
leo_sobral@2
  3579
	     test -n "$hardcode_libdirs"; then
leo_sobral@2
  3580
	    libdir="$hardcode_libdirs"
leo_sobral@2
  3581
	    if test -n "$hardcode_libdir_flag_spec_ld"; then
leo_sobral@2
  3582
	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
leo_sobral@2
  3583
	    else
leo_sobral@2
  3584
	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
leo_sobral@2
  3585
	    fi
leo_sobral@2
  3586
	  fi
leo_sobral@2
  3587
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
leo_sobral@2
  3588
	    # We should set the runpath_var.
leo_sobral@2
  3589
	    rpath=
leo_sobral@2
  3590
	    for dir in $perm_rpath; do
leo_sobral@2
  3591
	      rpath="$rpath$dir:"
leo_sobral@2
  3592
	    done
leo_sobral@2
  3593
	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
leo_sobral@2
  3594
	  fi
leo_sobral@2
  3595
	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
leo_sobral@2
  3596
	fi
leo_sobral@2
  3597
leo_sobral@2
  3598
	shlibpath="$finalize_shlibpath"
leo_sobral@2
  3599
	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
leo_sobral@2
  3600
	if test -n "$shlibpath"; then
leo_sobral@2
  3601
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
leo_sobral@2
  3602
	fi
leo_sobral@2
  3603
leo_sobral@2
  3604
	# Get the real and link names of the library.
leo_sobral@2
  3605
	eval shared_ext=\"$shrext_cmds\"
leo_sobral@2
  3606
	eval library_names=\"$library_names_spec\"
leo_sobral@2
  3607
	set dummy $library_names
leo_sobral@2
  3608
	realname="$2"
leo_sobral@2
  3609
	shift; shift
leo_sobral@2
  3610
leo_sobral@2
  3611
	if test -n "$soname_spec"; then
leo_sobral@2
  3612
	  eval soname=\"$soname_spec\"
leo_sobral@2
  3613
	else
leo_sobral@2
  3614
	  soname="$realname"
leo_sobral@2
  3615
	fi
leo_sobral@2
  3616
	if test -z "$dlname"; then
leo_sobral@2
  3617
	  dlname=$soname
leo_sobral@2
  3618
	fi
leo_sobral@2
  3619
leo_sobral@2
  3620
	lib="$output_objdir/$realname"
leo_sobral@2
  3621
	for link
leo_sobral@2
  3622
	do
leo_sobral@2
  3623
	  linknames="$linknames $link"
leo_sobral@2
  3624
	done
leo_sobral@2
  3625
leo_sobral@2
  3626
	# Use standard objects if they are pic
leo_sobral@2
  3627
	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
leo_sobral@2
  3628
leo_sobral@2
  3629
	# Prepare the list of exported symbols
leo_sobral@2
  3630
	if test -z "$export_symbols"; then
leo_sobral@2
  3631
	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
leo_sobral@2
  3632
	    $show "generating symbol list for \`$libname.la'"
leo_sobral@2
  3633
	    export_symbols="$output_objdir/$libname.exp"
leo_sobral@2
  3634
	    $run $rm $export_symbols
leo_sobral@2
  3635
	    cmds=$export_symbols_cmds
leo_sobral@2
  3636
	    save_ifs="$IFS"; IFS='~'
leo_sobral@2
  3637
	    for cmd in $cmds; do
leo_sobral@2
  3638
	      IFS="$save_ifs"
leo_sobral@2
  3639
	      eval cmd=\"$cmd\"
leo_sobral@2
  3640
	      if len=`expr "X$cmd" : ".*"` &&
leo_sobral@2
  3641
	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
leo_sobral@2
  3642
	        $show "$cmd"
leo_sobral@2
  3643
	        $run eval "$cmd" || exit $?
leo_sobral@2
  3644
	        skipped_export=false
leo_sobral@2
  3645
	      else
leo_sobral@2
  3646
	        # The command line is too long to execute in one step.
leo_sobral@2
  3647
	        $show "using reloadable object file for export list..."
leo_sobral@2
  3648
	        skipped_export=:
leo_sobral@2
  3649
	      fi
leo_sobral@2
  3650
	    done
leo_sobral@2
  3651
	    IFS="$save_ifs"
leo_sobral@2
  3652
	    if test -n "$export_symbols_regex"; then
leo_sobral@2
  3653
	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
leo_sobral@2
  3654
	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
leo_sobral@2
  3655
	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
leo_sobral@2
  3656
	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
leo_sobral@2
  3657
	    fi
leo_sobral@2
  3658
	  fi
leo_sobral@2
  3659
	fi
leo_sobral@2
  3660
leo_sobral@2
  3661
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
leo_sobral@2
  3662
	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
leo_sobral@2
  3663
	fi
leo_sobral@2
  3664
leo_sobral@2
  3665
	tmp_deplibs=
leo_sobral@2
  3666
	for test_deplib in $deplibs; do
leo_sobral@2
  3667
		case " $convenience " in
leo_sobral@2
  3668
		*" $test_deplib "*) ;;
leo_sobral@2
  3669
		*)
leo_sobral@2
  3670
			tmp_deplibs="$tmp_deplibs $test_deplib"
leo_sobral@2
  3671
			;;
leo_sobral@2
  3672
		esac
leo_sobral@2
  3673
	done
leo_sobral@2
  3674
	deplibs="$tmp_deplibs"
leo_sobral@2
  3675
leo_sobral@2
  3676
	if test -n "$convenience"; then
leo_sobral@2
  3677
	  if test -n "$whole_archive_flag_spec"; then
leo_sobral@2
  3678
	    save_libobjs=$libobjs
leo_sobral@2
  3679
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
leo_sobral@2
  3680
	  else
leo_sobral@2
  3681
	    gentop="$output_objdir/${outputname}x"
leo_sobral@2
  3682
	    $show "${rm}r $gentop"
leo_sobral@2
  3683
	    $run ${rm}r "$gentop"
leo_sobral@2
  3684
	    $show "$mkdir $gentop"
leo_sobral@2
  3685
	    $run $mkdir "$gentop"
leo_sobral@2
  3686
	    status=$?
leo_sobral@2
  3687
	    if test "$status" -ne 0 && test ! -d "$gentop"; then
leo_sobral@2
  3688
	      exit $status
leo_sobral@2
  3689
	    fi
leo_sobral@2
  3690
	    generated="$generated $gentop"
leo_sobral@2
  3691
leo_sobral@2
  3692
	    for xlib in $convenience; do
leo_sobral@2
  3693
	      # Extract the objects.
leo_sobral@2
  3694
	      case $xlib in
leo_sobral@2
  3695
	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
leo_sobral@2
  3696
	      *) xabs=`pwd`"/$xlib" ;;
leo_sobral@2
  3697
	      esac
leo_sobral@2
  3698
	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  3699
	      xdir="$gentop/$xlib"
leo_sobral@2
  3700
leo_sobral@2
  3701
	      $show "${rm}r $xdir"
leo_sobral@2
  3702
	      $run ${rm}r "$xdir"
leo_sobral@2
  3703
	      $show "$mkdir $xdir"
leo_sobral@2
  3704
	      $run $mkdir "$xdir"
leo_sobral@2
  3705
	      status=$?
leo_sobral@2
  3706
	      if test "$status" -ne 0 && test ! -d "$xdir"; then
leo_sobral@2
  3707
		exit $status
leo_sobral@2
  3708
	      fi
leo_sobral@2
  3709
	      # We will extract separately just the conflicting names and we will no
leo_sobral@2
  3710
	      # longer touch any unique names. It is faster to leave these extract
leo_sobral@2
  3711
	      # automatically by $AR in one run.
leo_sobral@2
  3712
	      $show "(cd $xdir && $AR x $xabs)"
leo_sobral@2
  3713
	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
leo_sobral@2
  3714
	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
leo_sobral@2
  3715
		:
leo_sobral@2
  3716
	      else
leo_sobral@2
  3717
		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
leo_sobral@2
  3718
		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
leo_sobral@2
  3719
		$AR t "$xabs" | sort | uniq -cd | while read -r count name
leo_sobral@2
  3720
		do
leo_sobral@2
  3721
		  i=1
leo_sobral@2
  3722
		  while test "$i" -le "$count"
leo_sobral@2
  3723
		  do
leo_sobral@2
  3724
		   # Put our $i before any first dot (extension)
leo_sobral@2
  3725
		   # Never overwrite any file
leo_sobral@2
  3726
		   name_to="$name"
leo_sobral@2
  3727
		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
leo_sobral@2
  3728
		   do
leo_sobral@2
  3729
		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
leo_sobral@2
  3730
		   done
leo_sobral@2
  3731
		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
leo_sobral@2
  3732
		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
leo_sobral@2
  3733
		   i=`expr $i + 1`
leo_sobral@2
  3734
		  done
leo_sobral@2
  3735
		done
leo_sobral@2
  3736
	      fi
leo_sobral@2
  3737
leo_sobral@2
  3738
	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
leo_sobral@2
  3739
	    done
leo_sobral@2
  3740
	  fi
leo_sobral@2
  3741
	fi
leo_sobral@2
  3742
leo_sobral@2
  3743
	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
leo_sobral@2
  3744
	  eval flag=\"$thread_safe_flag_spec\"
leo_sobral@2
  3745
	  linker_flags="$linker_flags $flag"
leo_sobral@2
  3746
	fi
leo_sobral@2
  3747
leo_sobral@2
  3748
	# Make a backup of the uninstalled library when relinking
leo_sobral@2
  3749
	if test "$mode" = relink; then
leo_sobral@2
  3750
	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
leo_sobral@2
  3751
	fi
leo_sobral@2
  3752
leo_sobral@2
  3753
	# Do each of the archive commands.
leo_sobral@2
  3754
	if test "$module" = yes && test -n "$module_cmds" ; then
leo_sobral@2
  3755
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
leo_sobral@2
  3756
	    eval test_cmds=\"$module_expsym_cmds\"
leo_sobral@2
  3757
	    cmds=$module_expsym_cmds
leo_sobral@2
  3758
	  else
leo_sobral@2
  3759
	    eval test_cmds=\"$module_cmds\"
leo_sobral@2
  3760
	    cmds=$module_cmds
leo_sobral@2
  3761
	  fi
leo_sobral@2
  3762
	else
leo_sobral@2
  3763
	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
leo_sobral@2
  3764
	  eval test_cmds=\"$archive_expsym_cmds\"
leo_sobral@2
  3765
	  cmds=$archive_expsym_cmds
leo_sobral@2
  3766
	else
leo_sobral@2
  3767
	  eval test_cmds=\"$archive_cmds\"
leo_sobral@2
  3768
	  cmds=$archive_cmds
leo_sobral@2
  3769
	  fi
leo_sobral@2
  3770
	fi
leo_sobral@2
  3771
leo_sobral@2
  3772
	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
leo_sobral@2
  3773
	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
leo_sobral@2
  3774
	  :
leo_sobral@2
  3775
	else
leo_sobral@2
  3776
	  # The command line is too long to link in one step, link piecewise.
leo_sobral@2
  3777
	  $echo "creating reloadable object files..."
leo_sobral@2
  3778
leo_sobral@2
  3779
	  # Save the value of $output and $libobjs because we want to
leo_sobral@2
  3780
	  # use them later.  If we have whole_archive_flag_spec, we
leo_sobral@2
  3781
	  # want to use save_libobjs as it was before
leo_sobral@2
  3782
	  # whole_archive_flag_spec was expanded, because we can't
leo_sobral@2
  3783
	  # assume the linker understands whole_archive_flag_spec.
leo_sobral@2
  3784
	  # This may have to be revisited, in case too many
leo_sobral@2
  3785
	  # convenience libraries get linked in and end up exceeding
leo_sobral@2
  3786
	  # the spec.
leo_sobral@2
  3787
	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
leo_sobral@2
  3788
	    save_libobjs=$libobjs
leo_sobral@2
  3789
	  fi
leo_sobral@2
  3790
	  save_output=$output
leo_sobral@2
  3791
leo_sobral@2
  3792
	  # Clear the reloadable object creation command queue and
leo_sobral@2
  3793
	  # initialize k to one.
leo_sobral@2
  3794
	  test_cmds=
leo_sobral@2
  3795
	  concat_cmds=
leo_sobral@2
  3796
	  objlist=
leo_sobral@2
  3797
	  delfiles=
leo_sobral@2
  3798
	  last_robj=
leo_sobral@2
  3799
	  k=1
leo_sobral@2
  3800
	  output=$output_objdir/$save_output-${k}.$objext
leo_sobral@2
  3801
	  # Loop over the list of objects to be linked.
leo_sobral@2
  3802
	  for obj in $save_libobjs
leo_sobral@2
  3803
	  do
leo_sobral@2
  3804
	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
leo_sobral@2
  3805
	    if test "X$objlist" = X ||
leo_sobral@2
  3806
	       { len=`expr "X$test_cmds" : ".*"` &&
leo_sobral@2
  3807
		 test "$len" -le "$max_cmd_len"; }; then
leo_sobral@2
  3808
	      objlist="$objlist $obj"
leo_sobral@2
  3809
	    else
leo_sobral@2
  3810
	      # The command $test_cmds is almost too long, add a
leo_sobral@2
  3811
	      # command to the queue.
leo_sobral@2
  3812
	      if test "$k" -eq 1 ; then
leo_sobral@2
  3813
		# The first file doesn't have a previous command to add.
leo_sobral@2
  3814
		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
leo_sobral@2
  3815
	      else
leo_sobral@2
  3816
		# All subsequent reloadable object files will link in
leo_sobral@2
  3817
		# the last one created.
leo_sobral@2
  3818
		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
leo_sobral@2
  3819
	      fi
leo_sobral@2
  3820
	      last_robj=$output_objdir/$save_output-${k}.$objext
leo_sobral@2
  3821
	      k=`expr $k + 1`
leo_sobral@2
  3822
	      output=$output_objdir/$save_output-${k}.$objext
leo_sobral@2
  3823
	      objlist=$obj
leo_sobral@2
  3824
	      len=1
leo_sobral@2
  3825
	    fi
leo_sobral@2
  3826
	  done
leo_sobral@2
  3827
	  # Handle the remaining objects by creating one last
leo_sobral@2
  3828
	  # reloadable object file.  All subsequent reloadable object
leo_sobral@2
  3829
	  # files will link in the last one created.
leo_sobral@2
  3830
	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
leo_sobral@2
  3831
	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
leo_sobral@2
  3832
leo_sobral@2
  3833
	  if ${skipped_export-false}; then
leo_sobral@2
  3834
	    $show "generating symbol list for \`$libname.la'"
leo_sobral@2
  3835
	    export_symbols="$output_objdir/$libname.exp"
leo_sobral@2
  3836
	    $run $rm $export_symbols
leo_sobral@2
  3837
	    libobjs=$output
leo_sobral@2
  3838
	    # Append the command to create the export file.
leo_sobral@2
  3839
	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
leo_sobral@2
  3840
          fi
leo_sobral@2
  3841
leo_sobral@2
  3842
	  # Set up a command to remove the reloadale object files
leo_sobral@2
  3843
	  # after they are used.
leo_sobral@2
  3844
	  i=0
leo_sobral@2
  3845
	  while test "$i" -lt "$k"
leo_sobral@2
  3846
	  do
leo_sobral@2
  3847
	    i=`expr $i + 1`
leo_sobral@2
  3848
	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
leo_sobral@2
  3849
	  done
leo_sobral@2
  3850
leo_sobral@2
  3851
	  $echo "creating a temporary reloadable object file: $output"
leo_sobral@2
  3852
leo_sobral@2
  3853
	  # Loop through the commands generated above and execute them.
leo_sobral@2
  3854
	  save_ifs="$IFS"; IFS='~'
leo_sobral@2
  3855
	  for cmd in $concat_cmds; do
leo_sobral@2
  3856
	    IFS="$save_ifs"
leo_sobral@2
  3857
	    $show "$cmd"
leo_sobral@2
  3858
	    $run eval "$cmd" || exit $?
leo_sobral@2
  3859
	  done
leo_sobral@2
  3860
	  IFS="$save_ifs"
leo_sobral@2
  3861
leo_sobral@2
  3862
	  libobjs=$output
leo_sobral@2
  3863
	  # Restore the value of output.
leo_sobral@2
  3864
	  output=$save_output
leo_sobral@2
  3865
leo_sobral@2
  3866
	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
leo_sobral@2
  3867
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
leo_sobral@2
  3868
	  fi
leo_sobral@2
  3869
	  # Expand the library linking commands again to reset the
leo_sobral@2
  3870
	  # value of $libobjs for piecewise linking.
leo_sobral@2
  3871
leo_sobral@2
  3872
	  # Do each of the archive commands.
leo_sobral@2
  3873
	  if test "$module" = yes && test -n "$module_cmds" ; then
leo_sobral@2
  3874
	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
leo_sobral@2
  3875
	      cmds=$module_expsym_cmds
leo_sobral@2
  3876
	    else
leo_sobral@2
  3877
	      cmds=$module_cmds
leo_sobral@2
  3878
	    fi
leo_sobral@2
  3879
	  else
leo_sobral@2
  3880
	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
leo_sobral@2
  3881
	    cmds=$archive_expsym_cmds
leo_sobral@2
  3882
	  else
leo_sobral@2
  3883
	    cmds=$archive_cmds
leo_sobral@2
  3884
	    fi
leo_sobral@2
  3885
	  fi
leo_sobral@2
  3886
leo_sobral@2
  3887
	  # Append the command to remove the reloadable object files
leo_sobral@2
  3888
	  # to the just-reset $cmds.
leo_sobral@2
  3889
	  eval cmds=\"\$cmds~\$rm $delfiles\"
leo_sobral@2
  3890
	fi
leo_sobral@2
  3891
	save_ifs="$IFS"; IFS='~'
leo_sobral@2
  3892
	for cmd in $cmds; do
leo_sobral@2
  3893
	  IFS="$save_ifs"
leo_sobral@2
  3894
	  eval cmd=\"$cmd\"
leo_sobral@2
  3895
	  $show "$cmd"
leo_sobral@2
  3896
	  $run eval "$cmd" || exit $?
leo_sobral@2
  3897
	done
leo_sobral@2
  3898
	IFS="$save_ifs"
leo_sobral@2
  3899
leo_sobral@2
  3900
	# Restore the uninstalled library and exit
leo_sobral@2
  3901
	if test "$mode" = relink; then
leo_sobral@2
  3902
	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
leo_sobral@2
  3903
	  exit $EXIT_SUCCESS
leo_sobral@2
  3904
	fi
leo_sobral@2
  3905
leo_sobral@2
  3906
	# Create links to the real library.
leo_sobral@2
  3907
	for linkname in $linknames; do
leo_sobral@2
  3908
	  if test "$realname" != "$linkname"; then
leo_sobral@2
  3909
	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
leo_sobral@2
  3910
	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
leo_sobral@2
  3911
	  fi
leo_sobral@2
  3912
	done
leo_sobral@2
  3913
leo_sobral@2
  3914
	# If -module or -export-dynamic was specified, set the dlname.
leo_sobral@2
  3915
	if test "$module" = yes || test "$export_dynamic" = yes; then
leo_sobral@2
  3916
	  # On all known operating systems, these are identical.
leo_sobral@2
  3917
	  dlname="$soname"
leo_sobral@2
  3918
	fi
leo_sobral@2
  3919
      fi
leo_sobral@2
  3920
      ;;
leo_sobral@2
  3921
leo_sobral@2
  3922
    obj)
leo_sobral@2
  3923
      if test -n "$deplibs"; then
leo_sobral@2
  3924
	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
leo_sobral@2
  3925
      fi
leo_sobral@2
  3926
leo_sobral@2
  3927
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
leo_sobral@2
  3928
	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
leo_sobral@2
  3929
      fi
leo_sobral@2
  3930
leo_sobral@2
  3931
      if test -n "$rpath"; then
leo_sobral@2
  3932
	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
leo_sobral@2
  3933
      fi
leo_sobral@2
  3934
leo_sobral@2
  3935
      if test -n "$xrpath"; then
leo_sobral@2
  3936
	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
leo_sobral@2
  3937
      fi
leo_sobral@2
  3938
leo_sobral@2
  3939
      if test -n "$vinfo"; then
leo_sobral@2
  3940
	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
leo_sobral@2
  3941
      fi
leo_sobral@2
  3942
leo_sobral@2
  3943
      if test -n "$release"; then
leo_sobral@2
  3944
	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
leo_sobral@2
  3945
      fi
leo_sobral@2
  3946
leo_sobral@2
  3947
      case $output in
leo_sobral@2
  3948
      *.lo)
leo_sobral@2
  3949
	if test -n "$objs$old_deplibs"; then
leo_sobral@2
  3950
	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
leo_sobral@2
  3951
	  exit $EXIT_FAILURE
leo_sobral@2
  3952
	fi
leo_sobral@2
  3953
	libobj="$output"
leo_sobral@2
  3954
	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
leo_sobral@2
  3955
	;;
leo_sobral@2
  3956
      *)
leo_sobral@2
  3957
	libobj=
leo_sobral@2
  3958
	obj="$output"
leo_sobral@2
  3959
	;;
leo_sobral@2
  3960
      esac
leo_sobral@2
  3961
leo_sobral@2
  3962
      # Delete the old objects.
leo_sobral@2
  3963
      $run $rm $obj $libobj
leo_sobral@2
  3964
leo_sobral@2
  3965
      # Objects from convenience libraries.  This assumes
leo_sobral@2
  3966
      # single-version convenience libraries.  Whenever we create
leo_sobral@2
  3967
      # different ones for PIC/non-PIC, this we'll have to duplicate
leo_sobral@2
  3968
      # the extraction.
leo_sobral@2
  3969
      reload_conv_objs=
leo_sobral@2
  3970
      gentop=
leo_sobral@2
  3971
      # reload_cmds runs $LD directly, so let us get rid of
leo_sobral@2
  3972
      # -Wl from whole_archive_flag_spec
leo_sobral@2
  3973
      wl=
leo_sobral@2
  3974
leo_sobral@2
  3975
      if test -n "$convenience"; then
leo_sobral@2
  3976
	if test -n "$whole_archive_flag_spec"; then
leo_sobral@2
  3977
	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
leo_sobral@2
  3978
	else
leo_sobral@2
  3979
	  gentop="$output_objdir/${obj}x"
leo_sobral@2
  3980
	  $show "${rm}r $gentop"
leo_sobral@2
  3981
	  $run ${rm}r "$gentop"
leo_sobral@2
  3982
	  $show "$mkdir $gentop"
leo_sobral@2
  3983
	  $run $mkdir "$gentop"
leo_sobral@2
  3984
	  status=$?
leo_sobral@2
  3985
	  if test "$status" -ne 0 && test ! -d "$gentop"; then
leo_sobral@2
  3986
	    exit $status
leo_sobral@2
  3987
	  fi
leo_sobral@2
  3988
	  generated="$generated $gentop"
leo_sobral@2
  3989
leo_sobral@2
  3990
	  for xlib in $convenience; do
leo_sobral@2
  3991
	    # Extract the objects.
leo_sobral@2
  3992
	    case $xlib in
leo_sobral@2
  3993
	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
leo_sobral@2
  3994
	    *) xabs=`pwd`"/$xlib" ;;
leo_sobral@2
  3995
	    esac
leo_sobral@2
  3996
	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  3997
	    xdir="$gentop/$xlib"
leo_sobral@2
  3998
leo_sobral@2
  3999
	    $show "${rm}r $xdir"
leo_sobral@2
  4000
	    $run ${rm}r "$xdir"
leo_sobral@2
  4001
	    $show "$mkdir $xdir"
leo_sobral@2
  4002
	    $run $mkdir "$xdir"
leo_sobral@2
  4003
	    status=$?
leo_sobral@2
  4004
	    if test "$status" -ne 0 && test ! -d "$xdir"; then
leo_sobral@2
  4005
	      exit $status
leo_sobral@2
  4006
	    fi
leo_sobral@2
  4007
	    # We will extract separately just the conflicting names and we will no
leo_sobral@2
  4008
	    # longer touch any unique names. It is faster to leave these extract
leo_sobral@2
  4009
	    # automatically by $AR in one run.
leo_sobral@2
  4010
	    $show "(cd $xdir && $AR x $xabs)"
leo_sobral@2
  4011
	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
leo_sobral@2
  4012
	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
leo_sobral@2
  4013
	      :
leo_sobral@2
  4014
	    else
leo_sobral@2
  4015
	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
leo_sobral@2
  4016
	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
leo_sobral@2
  4017
	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
leo_sobral@2
  4018
	      do
leo_sobral@2
  4019
		i=1
leo_sobral@2
  4020
		while test "$i" -le "$count"
leo_sobral@2
  4021
		do
leo_sobral@2
  4022
		 # Put our $i before any first dot (extension)
leo_sobral@2
  4023
		 # Never overwrite any file
leo_sobral@2
  4024
		 name_to="$name"
leo_sobral@2
  4025
		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
leo_sobral@2
  4026
		 do
leo_sobral@2
  4027
		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
leo_sobral@2
  4028
		 done
leo_sobral@2
  4029
		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
leo_sobral@2
  4030
		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
leo_sobral@2
  4031
		 i=`expr $i + 1`
leo_sobral@2
  4032
		done
leo_sobral@2
  4033
	      done
leo_sobral@2
  4034
	    fi
leo_sobral@2
  4035
leo_sobral@2
  4036
	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
leo_sobral@2
  4037
	  done
leo_sobral@2
  4038
	fi
leo_sobral@2
  4039
      fi
leo_sobral@2
  4040
leo_sobral@2
  4041
      # Create the old-style object.
leo_sobral@2
  4042
      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
leo_sobral@2
  4043
leo_sobral@2
  4044
      output="$obj"
leo_sobral@2
  4045
      cmds=$reload_cmds
leo_sobral@2
  4046
      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  4047
      for cmd in $cmds; do
leo_sobral@2
  4048
	IFS="$save_ifs"
leo_sobral@2
  4049
	eval cmd=\"$cmd\"
leo_sobral@2
  4050
	$show "$cmd"
leo_sobral@2
  4051
	$run eval "$cmd" || exit $?
leo_sobral@2
  4052
      done
leo_sobral@2
  4053
      IFS="$save_ifs"
leo_sobral@2
  4054
leo_sobral@2
  4055
      # Exit if we aren't doing a library object file.
leo_sobral@2
  4056
      if test -z "$libobj"; then
leo_sobral@2
  4057
	if test -n "$gentop"; then
leo_sobral@2
  4058
	  $show "${rm}r $gentop"
leo_sobral@2
  4059
	  $run ${rm}r $gentop
leo_sobral@2
  4060
	fi
leo_sobral@2
  4061
leo_sobral@2
  4062
	exit $EXIT_SUCCESS
leo_sobral@2
  4063
      fi
leo_sobral@2
  4064
leo_sobral@2
  4065
      if test "$build_libtool_libs" != yes; then
leo_sobral@2
  4066
	if test -n "$gentop"; then
leo_sobral@2
  4067
	  $show "${rm}r $gentop"
leo_sobral@2
  4068
	  $run ${rm}r $gentop
leo_sobral@2
  4069
	fi
leo_sobral@2
  4070
leo_sobral@2
  4071
	# Create an invalid libtool object if no PIC, so that we don't
leo_sobral@2
  4072
	# accidentally link it into a program.
leo_sobral@2
  4073
	# $show "echo timestamp > $libobj"
leo_sobral@2
  4074
	# $run eval "echo timestamp > $libobj" || exit $?
leo_sobral@2
  4075
	exit $EXIT_SUCCESS
leo_sobral@2
  4076
      fi
leo_sobral@2
  4077
leo_sobral@2
  4078
      if test -n "$pic_flag" || test "$pic_mode" != default; then
leo_sobral@2
  4079
	# Only do commands if we really have different PIC objects.
leo_sobral@2
  4080
	reload_objs="$libobjs $reload_conv_objs"
leo_sobral@2
  4081
	output="$libobj"
leo_sobral@2
  4082
	cmds=$reload_cmds
leo_sobral@2
  4083
	save_ifs="$IFS"; IFS='~'
leo_sobral@2
  4084
	for cmd in $cmds; do
leo_sobral@2
  4085
	  IFS="$save_ifs"
leo_sobral@2
  4086
	  eval cmd=\"$cmd\"
leo_sobral@2
  4087
	  $show "$cmd"
leo_sobral@2
  4088
	  $run eval "$cmd" || exit $?
leo_sobral@2
  4089
	done
leo_sobral@2
  4090
	IFS="$save_ifs"
leo_sobral@2
  4091
      fi
leo_sobral@2
  4092
leo_sobral@2
  4093
      if test -n "$gentop"; then
leo_sobral@2
  4094
	$show "${rm}r $gentop"
leo_sobral@2
  4095
	$run ${rm}r $gentop
leo_sobral@2
  4096
      fi
leo_sobral@2
  4097
leo_sobral@2
  4098
      exit $EXIT_SUCCESS
leo_sobral@2
  4099
      ;;
leo_sobral@2
  4100
leo_sobral@2
  4101
    prog)
leo_sobral@2
  4102
      case $host in
leo_sobral@2
  4103
	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
leo_sobral@2
  4104
      esac
leo_sobral@2
  4105
      if test -n "$vinfo"; then
leo_sobral@2
  4106
	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
leo_sobral@2
  4107
      fi
leo_sobral@2
  4108
leo_sobral@2
  4109
      if test -n "$release"; then
leo_sobral@2
  4110
	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
leo_sobral@2
  4111
      fi
leo_sobral@2
  4112
leo_sobral@2
  4113
      if test "$preload" = yes; then
leo_sobral@2
  4114
	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
leo_sobral@2
  4115
	   test "$dlopen_self_static" = unknown; then
leo_sobral@2
  4116
	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
leo_sobral@2
  4117
	fi
leo_sobral@2
  4118
      fi
leo_sobral@2
  4119
leo_sobral@2
  4120
      case $host in
leo_sobral@2
  4121
      *-*-rhapsody* | *-*-darwin1.[012])
leo_sobral@2
  4122
	# On Rhapsody replace the C library is the System framework
leo_sobral@2
  4123
	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
leo_sobral@2
  4124
	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
leo_sobral@2
  4125
	;;
leo_sobral@2
  4126
      esac
leo_sobral@2
  4127
leo_sobral@2
  4128
      case $host in
leo_sobral@2
  4129
      *darwin*)
leo_sobral@2
  4130
        # Don't allow lazy linking, it breaks C++ global constructors
leo_sobral@2
  4131
        if test "$tagname" = CXX ; then
leo_sobral@2
  4132
        compile_command="$compile_command ${wl}-bind_at_load"
leo_sobral@2
  4133
        finalize_command="$finalize_command ${wl}-bind_at_load"
leo_sobral@2
  4134
        fi
leo_sobral@2
  4135
        ;;
leo_sobral@2
  4136
      esac
leo_sobral@2
  4137
leo_sobral@2
  4138
      compile_command="$compile_command $compile_deplibs"
leo_sobral@2
  4139
      finalize_command="$finalize_command $finalize_deplibs"
leo_sobral@2
  4140
leo_sobral@2
  4141
      if test -n "$rpath$xrpath"; then
leo_sobral@2
  4142
	# If the user specified any rpath flags, then add them.
leo_sobral@2
  4143
	for libdir in $rpath $xrpath; do
leo_sobral@2
  4144
	  # This is the magic to use -rpath.
leo_sobral@2
  4145
	  case "$finalize_rpath " in
leo_sobral@2
  4146
	  *" $libdir "*) ;;
leo_sobral@2
  4147
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
leo_sobral@2
  4148
	  esac
leo_sobral@2
  4149
	done
leo_sobral@2
  4150
      fi
leo_sobral@2
  4151
leo_sobral@2
  4152
      # Now hardcode the library paths
leo_sobral@2
  4153
      rpath=
leo_sobral@2
  4154
      hardcode_libdirs=
leo_sobral@2
  4155
      for libdir in $compile_rpath $finalize_rpath; do
leo_sobral@2
  4156
	if test -n "$hardcode_libdir_flag_spec"; then
leo_sobral@2
  4157
	  if test -n "$hardcode_libdir_separator"; then
leo_sobral@2
  4158
	    if test -z "$hardcode_libdirs"; then
leo_sobral@2
  4159
	      hardcode_libdirs="$libdir"
leo_sobral@2
  4160
	    else
leo_sobral@2
  4161
	      # Just accumulate the unique libdirs.
leo_sobral@2
  4162
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
leo_sobral@2
  4163
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
leo_sobral@2
  4164
		;;
leo_sobral@2
  4165
	      *)
leo_sobral@2
  4166
		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
leo_sobral@2
  4167
		;;
leo_sobral@2
  4168
	      esac
leo_sobral@2
  4169
	    fi
leo_sobral@2
  4170
	  else
leo_sobral@2
  4171
	    eval flag=\"$hardcode_libdir_flag_spec\"
leo_sobral@2
  4172
	    rpath="$rpath $flag"
leo_sobral@2
  4173
	  fi
leo_sobral@2
  4174
	elif test -n "$runpath_var"; then
leo_sobral@2
  4175
	  case "$perm_rpath " in
leo_sobral@2
  4176
	  *" $libdir "*) ;;
leo_sobral@2
  4177
	  *) perm_rpath="$perm_rpath $libdir" ;;
leo_sobral@2
  4178
	  esac
leo_sobral@2
  4179
	fi
leo_sobral@2
  4180
	case $host in
leo_sobral@2
  4181
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
leo_sobral@2
  4182
	  case :$dllsearchpath: in
leo_sobral@2
  4183
	  *":$libdir:"*) ;;
leo_sobral@2
  4184
	  *) dllsearchpath="$dllsearchpath:$libdir";;
leo_sobral@2
  4185
	  esac
leo_sobral@2
  4186
	  ;;
leo_sobral@2
  4187
	esac
leo_sobral@2
  4188
      done
leo_sobral@2
  4189
      # Substitute the hardcoded libdirs into the rpath.
leo_sobral@2
  4190
      if test -n "$hardcode_libdir_separator" &&
leo_sobral@2
  4191
	 test -n "$hardcode_libdirs"; then
leo_sobral@2
  4192
	libdir="$hardcode_libdirs"
leo_sobral@2
  4193
	eval rpath=\" $hardcode_libdir_flag_spec\"
leo_sobral@2
  4194
      fi
leo_sobral@2
  4195
      compile_rpath="$rpath"
leo_sobral@2
  4196
leo_sobral@2
  4197
      rpath=
leo_sobral@2
  4198
      hardcode_libdirs=
leo_sobral@2
  4199
      for libdir in $finalize_rpath; do
leo_sobral@2
  4200
	if test -n "$hardcode_libdir_flag_spec"; then
leo_sobral@2
  4201
	  if test -n "$hardcode_libdir_separator"; then
leo_sobral@2
  4202
	    if test -z "$hardcode_libdirs"; then
leo_sobral@2
  4203
	      hardcode_libdirs="$libdir"
leo_sobral@2
  4204
	    else
leo_sobral@2
  4205
	      # Just accumulate the unique libdirs.
leo_sobral@2
  4206
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
leo_sobral@2
  4207
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
leo_sobral@2
  4208
		;;
leo_sobral@2
  4209
	      *)
leo_sobral@2
  4210
		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
leo_sobral@2
  4211
		;;
leo_sobral@2
  4212
	      esac
leo_sobral@2
  4213
	    fi
leo_sobral@2
  4214
	  else
leo_sobral@2
  4215
	    eval flag=\"$hardcode_libdir_flag_spec\"
leo_sobral@2
  4216
	    rpath="$rpath $flag"
leo_sobral@2
  4217
	  fi
leo_sobral@2
  4218
	elif test -n "$runpath_var"; then
leo_sobral@2
  4219
	  case "$finalize_perm_rpath " in
leo_sobral@2
  4220
	  *" $libdir "*) ;;
leo_sobral@2
  4221
	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
leo_sobral@2
  4222
	  esac
leo_sobral@2
  4223
	fi
leo_sobral@2
  4224
      done
leo_sobral@2
  4225
      # Substitute the hardcoded libdirs into the rpath.
leo_sobral@2
  4226
      if test -n "$hardcode_libdir_separator" &&
leo_sobral@2
  4227
	 test -n "$hardcode_libdirs"; then
leo_sobral@2
  4228
	libdir="$hardcode_libdirs"
leo_sobral@2
  4229
	eval rpath=\" $hardcode_libdir_flag_spec\"
leo_sobral@2
  4230
      fi
leo_sobral@2
  4231
      finalize_rpath="$rpath"
leo_sobral@2
  4232
leo_sobral@2
  4233
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
leo_sobral@2
  4234
	# Transform all the library objects into standard objects.
leo_sobral@2
  4235
	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
leo_sobral@2
  4236
	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
leo_sobral@2
  4237
      fi
leo_sobral@2
  4238
leo_sobral@2
  4239
      dlsyms=
leo_sobral@2
  4240
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
leo_sobral@2
  4241
	if test -n "$NM" && test -n "$global_symbol_pipe"; then
leo_sobral@2
  4242
	  dlsyms="${outputname}S.c"
leo_sobral@2
  4243
	else
leo_sobral@2
  4244
	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
leo_sobral@2
  4245
	fi
leo_sobral@2
  4246
      fi
leo_sobral@2
  4247
leo_sobral@2
  4248
      if test -n "$dlsyms"; then
leo_sobral@2
  4249
	case $dlsyms in
leo_sobral@2
  4250
	"") ;;
leo_sobral@2
  4251
	*.c)
leo_sobral@2
  4252
	  # Discover the nlist of each of the dlfiles.
leo_sobral@2
  4253
	  nlist="$output_objdir/${outputname}.nm"
leo_sobral@2
  4254
leo_sobral@2
  4255
	  $show "$rm $nlist ${nlist}S ${nlist}T"
leo_sobral@2
  4256
	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
leo_sobral@2
  4257
leo_sobral@2
  4258
	  # Parse the name list into a source file.
leo_sobral@2
  4259
	  $show "creating $output_objdir/$dlsyms"
leo_sobral@2
  4260
leo_sobral@2
  4261
	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
leo_sobral@2
  4262
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
leo_sobral@2
  4263
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
leo_sobral@2
  4264
leo_sobral@2
  4265
#ifdef __cplusplus
leo_sobral@2
  4266
extern \"C\" {
leo_sobral@2
  4267
#endif
leo_sobral@2
  4268
leo_sobral@2
  4269
/* Prevent the only kind of declaration conflicts we can make. */
leo_sobral@2
  4270
#define lt_preloaded_symbols some_other_symbol
leo_sobral@2
  4271
leo_sobral@2
  4272
/* External symbol declarations for the compiler. */\
leo_sobral@2
  4273
"
leo_sobral@2
  4274
leo_sobral@2
  4275
	  if test "$dlself" = yes; then
leo_sobral@2
  4276
	    $show "generating symbol list for \`$output'"
leo_sobral@2
  4277
leo_sobral@2
  4278
	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
leo_sobral@2
  4279
leo_sobral@2
  4280
	    # Add our own program objects to the symbol list.
leo_sobral@2
  4281
	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
leo_sobral@2
  4282
	    for arg in $progfiles; do
leo_sobral@2
  4283
	      $show "extracting global C symbols from \`$arg'"
leo_sobral@2
  4284
	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
leo_sobral@2
  4285
	    done
leo_sobral@2
  4286
leo_sobral@2
  4287
	    if test -n "$exclude_expsyms"; then
leo_sobral@2
  4288
	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
leo_sobral@2
  4289
	      $run eval '$mv "$nlist"T "$nlist"'
leo_sobral@2
  4290
	    fi
leo_sobral@2
  4291
leo_sobral@2
  4292
	    if test -n "$export_symbols_regex"; then
leo_sobral@2
  4293
	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
leo_sobral@2
  4294
	      $run eval '$mv "$nlist"T "$nlist"'
leo_sobral@2
  4295
	    fi
leo_sobral@2
  4296
leo_sobral@2
  4297
	    # Prepare the list of exported symbols
leo_sobral@2
  4298
	    if test -z "$export_symbols"; then
leo_sobral@2
  4299
	      export_symbols="$output_objdir/$output.exp"
leo_sobral@2
  4300
	      $run $rm $export_symbols
leo_sobral@2
  4301
	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
leo_sobral@2
  4302
	    else
leo_sobral@2
  4303
	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
leo_sobral@2
  4304
	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
leo_sobral@2
  4305
	      $run eval 'mv "$nlist"T "$nlist"'
leo_sobral@2
  4306
	    fi
leo_sobral@2
  4307
	  fi
leo_sobral@2
  4308
leo_sobral@2
  4309
	  for arg in $dlprefiles; do
leo_sobral@2
  4310
	    $show "extracting global C symbols from \`$arg'"
leo_sobral@2
  4311
	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
leo_sobral@2
  4312
	    $run eval '$echo ": $name " >> "$nlist"'
leo_sobral@2
  4313
	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
leo_sobral@2
  4314
	  done
leo_sobral@2
  4315
leo_sobral@2
  4316
	  if test -z "$run"; then
leo_sobral@2
  4317
	    # Make sure we have at least an empty file.
leo_sobral@2
  4318
	    test -f "$nlist" || : > "$nlist"
leo_sobral@2
  4319
leo_sobral@2
  4320
	    if test -n "$exclude_expsyms"; then
leo_sobral@2
  4321
	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
leo_sobral@2
  4322
	      $mv "$nlist"T "$nlist"
leo_sobral@2
  4323
	    fi
leo_sobral@2
  4324
leo_sobral@2
  4325
	    # Try sorting and uniquifying the output.
leo_sobral@2
  4326
	    if grep -v "^: " < "$nlist" |
leo_sobral@2
  4327
		if sort -k 3 </dev/null >/dev/null 2>&1; then
leo_sobral@2
  4328
		  sort -k 3
leo_sobral@2
  4329
		else
leo_sobral@2
  4330
		  sort +2
leo_sobral@2
  4331
		fi |
leo_sobral@2
  4332
		uniq > "$nlist"S; then
leo_sobral@2
  4333
	      :
leo_sobral@2
  4334
	    else
leo_sobral@2
  4335
	      grep -v "^: " < "$nlist" > "$nlist"S
leo_sobral@2
  4336
	    fi
leo_sobral@2
  4337
leo_sobral@2
  4338
	    if test -f "$nlist"S; then
leo_sobral@2
  4339
	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
leo_sobral@2
  4340
	    else
leo_sobral@2
  4341
	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
leo_sobral@2
  4342
	    fi
leo_sobral@2
  4343
leo_sobral@2
  4344
	    $echo >> "$output_objdir/$dlsyms" "\
leo_sobral@2
  4345
leo_sobral@2
  4346
#undef lt_preloaded_symbols
leo_sobral@2
  4347
leo_sobral@2
  4348
#if defined (__STDC__) && __STDC__
leo_sobral@2
  4349
# define lt_ptr void *
leo_sobral@2
  4350
#else
leo_sobral@2
  4351
# define lt_ptr char *
leo_sobral@2
  4352
# define const
leo_sobral@2
  4353
#endif
leo_sobral@2
  4354
leo_sobral@2
  4355
/* The mapping between symbol names and symbols. */
leo_sobral@2
  4356
const struct {
leo_sobral@2
  4357
  const char *name;
leo_sobral@2
  4358
  lt_ptr address;
leo_sobral@2
  4359
}
leo_sobral@2
  4360
lt_preloaded_symbols[] =
leo_sobral@2
  4361
{\
leo_sobral@2
  4362
"
leo_sobral@2
  4363
leo_sobral@2
  4364
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
leo_sobral@2
  4365
leo_sobral@2
  4366
	    $echo >> "$output_objdir/$dlsyms" "\
leo_sobral@2
  4367
  {0, (lt_ptr) 0}
leo_sobral@2
  4368
};
leo_sobral@2
  4369
leo_sobral@2
  4370
/* This works around a problem in FreeBSD linker */
leo_sobral@2
  4371
#ifdef FREEBSD_WORKAROUND
leo_sobral@2
  4372
static const void *lt_preloaded_setup() {
leo_sobral@2
  4373
  return lt_preloaded_symbols;
leo_sobral@2
  4374
}
leo_sobral@2
  4375
#endif
leo_sobral@2
  4376
leo_sobral@2
  4377
#ifdef __cplusplus
leo_sobral@2
  4378
}
leo_sobral@2
  4379
#endif\
leo_sobral@2
  4380
"
leo_sobral@2
  4381
	  fi
leo_sobral@2
  4382
leo_sobral@2
  4383
	  pic_flag_for_symtable=
leo_sobral@2
  4384
	  case $host in
leo_sobral@2
  4385
	  # compiling the symbol table file with pic_flag works around
leo_sobral@2
  4386
	  # a FreeBSD bug that causes programs to crash when -lm is
leo_sobral@2
  4387
	  # linked before any other PIC object.  But we must not use
leo_sobral@2
  4388
	  # pic_flag when linking with -static.  The problem exists in
leo_sobral@2
  4389
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
leo_sobral@2
  4390
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
leo_sobral@2
  4391
	    case "$compile_command " in
leo_sobral@2
  4392
	    *" -static "*) ;;
leo_sobral@2
  4393
	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
leo_sobral@2
  4394
	    esac;;
leo_sobral@2
  4395
	  *-*-hpux*)
leo_sobral@2
  4396
	    case "$compile_command " in
leo_sobral@2
  4397
	    *" -static "*) ;;
leo_sobral@2
  4398
	    *) pic_flag_for_symtable=" $pic_flag";;
leo_sobral@2
  4399
	    esac
leo_sobral@2
  4400
	  esac
leo_sobral@2
  4401
leo_sobral@2
  4402
	  # Now compile the dynamic symbol file.
leo_sobral@2
  4403
	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
leo_sobral@2
  4404
	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
leo_sobral@2
  4405
leo_sobral@2
  4406
	  # Clean up the generated files.
leo_sobral@2
  4407
	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
leo_sobral@2
  4408
	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
leo_sobral@2
  4409
leo_sobral@2
  4410
	  # Transform the symbol file into the correct name.
leo_sobral@2
  4411
	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
leo_sobral@2
  4412
	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
leo_sobral@2
  4413
	  ;;
leo_sobral@2
  4414
	*)
leo_sobral@2
  4415
	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
leo_sobral@2
  4416
	  exit $EXIT_FAILURE
leo_sobral@2
  4417
	  ;;
leo_sobral@2
  4418
	esac
leo_sobral@2
  4419
      else
leo_sobral@2
  4420
	# We keep going just in case the user didn't refer to
leo_sobral@2
  4421
	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
leo_sobral@2
  4422
	# really was required.
leo_sobral@2
  4423
leo_sobral@2
  4424
	# Nullify the symbol file.
leo_sobral@2
  4425
	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
leo_sobral@2
  4426
	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
leo_sobral@2
  4427
      fi
leo_sobral@2
  4428
leo_sobral@2
  4429
      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
leo_sobral@2
  4430
	# Replace the output file specification.
leo_sobral@2
  4431
	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
leo_sobral@2
  4432
	link_command="$compile_command$compile_rpath"
leo_sobral@2
  4433
leo_sobral@2
  4434
	# We have no uninstalled library dependencies, so finalize right now.
leo_sobral@2
  4435
	$show "$link_command"
leo_sobral@2
  4436
	$run eval "$link_command"
leo_sobral@2
  4437
	status=$?
leo_sobral@2
  4438
leo_sobral@2
  4439
	# Delete the generated files.
leo_sobral@2
  4440
	if test -n "$dlsyms"; then
leo_sobral@2
  4441
	  $show "$rm $output_objdir/${outputname}S.${objext}"
leo_sobral@2
  4442
	  $run $rm "$output_objdir/${outputname}S.${objext}"
leo_sobral@2
  4443
	fi
leo_sobral@2
  4444
leo_sobral@2
  4445
	exit $status
leo_sobral@2
  4446
      fi
leo_sobral@2
  4447
leo_sobral@2
  4448
      if test -n "$shlibpath_var"; then
leo_sobral@2
  4449
	# We should set the shlibpath_var
leo_sobral@2
  4450
	rpath=
leo_sobral@2
  4451
	for dir in $temp_rpath; do
leo_sobral@2
  4452
	  case $dir in
leo_sobral@2
  4453
	  [\\/]* | [A-Za-z]:[\\/]*)
leo_sobral@2
  4454
	    # Absolute path.
leo_sobral@2
  4455
	    rpath="$rpath$dir:"
leo_sobral@2
  4456
	    ;;
leo_sobral@2
  4457
	  *)
leo_sobral@2
  4458
	    # Relative path: add a thisdir entry.
leo_sobral@2
  4459
	    rpath="$rpath\$thisdir/$dir:"
leo_sobral@2
  4460
	    ;;
leo_sobral@2
  4461
	  esac
leo_sobral@2
  4462
	done
leo_sobral@2
  4463
	temp_rpath="$rpath"
leo_sobral@2
  4464
      fi
leo_sobral@2
  4465
leo_sobral@2
  4466
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
leo_sobral@2
  4467
	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
leo_sobral@2
  4468
      fi
leo_sobral@2
  4469
      if test -n "$finalize_shlibpath"; then
leo_sobral@2
  4470
	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
leo_sobral@2
  4471
      fi
leo_sobral@2
  4472
leo_sobral@2
  4473
      compile_var=
leo_sobral@2
  4474
      finalize_var=
leo_sobral@2
  4475
      if test -n "$runpath_var"; then
leo_sobral@2
  4476
	if test -n "$perm_rpath"; then
leo_sobral@2
  4477
	  # We should set the runpath_var.
leo_sobral@2
  4478
	  rpath=
leo_sobral@2
  4479
	  for dir in $perm_rpath; do
leo_sobral@2
  4480
	    rpath="$rpath$dir:"
leo_sobral@2
  4481
	  done
leo_sobral@2
  4482
	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
leo_sobral@2
  4483
	fi
leo_sobral@2
  4484
	if test -n "$finalize_perm_rpath"; then
leo_sobral@2
  4485
	  # We should set the runpath_var.
leo_sobral@2
  4486
	  rpath=
leo_sobral@2
  4487
	  for dir in $finalize_perm_rpath; do
leo_sobral@2
  4488
	    rpath="$rpath$dir:"
leo_sobral@2
  4489
	  done
leo_sobral@2
  4490
	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
leo_sobral@2
  4491
	fi
leo_sobral@2
  4492
      fi
leo_sobral@2
  4493
leo_sobral@2
  4494
      if test "$no_install" = yes; then
leo_sobral@2
  4495
	# We don't need to create a wrapper script.
leo_sobral@2
  4496
	link_command="$compile_var$compile_command$compile_rpath"
leo_sobral@2
  4497
	# Replace the output file specification.
leo_sobral@2
  4498
	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
leo_sobral@2
  4499
	# Delete the old output file.
leo_sobral@2
  4500
	$run $rm $output
leo_sobral@2
  4501
	# Link the executable and exit
leo_sobral@2
  4502
	$show "$link_command"
leo_sobral@2
  4503
	$run eval "$link_command" || exit $?
leo_sobral@2
  4504
	exit $EXIT_SUCCESS
leo_sobral@2
  4505
      fi
leo_sobral@2
  4506
leo_sobral@2
  4507
      if test "$hardcode_action" = relink; then
leo_sobral@2
  4508
	# Fast installation is not supported
leo_sobral@2
  4509
	link_command="$compile_var$compile_command$compile_rpath"
leo_sobral@2
  4510
	relink_command="$finalize_var$finalize_command$finalize_rpath"
leo_sobral@2
  4511
leo_sobral@2
  4512
	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
leo_sobral@2
  4513
	$echo "$modename: \`$output' will be relinked during installation" 1>&2
leo_sobral@2
  4514
      else
leo_sobral@2
  4515
	if test "$fast_install" != no; then
leo_sobral@2
  4516
	  link_command="$finalize_var$compile_command$finalize_rpath"
leo_sobral@2
  4517
	  if test "$fast_install" = yes; then
leo_sobral@2
  4518
	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
leo_sobral@2
  4519
	  else
leo_sobral@2
  4520
	    # fast_install is set to needless
leo_sobral@2
  4521
	    relink_command=
leo_sobral@2
  4522
	  fi
leo_sobral@2
  4523
	else
leo_sobral@2
  4524
	  link_command="$compile_var$compile_command$compile_rpath"
leo_sobral@2
  4525
	  relink_command="$finalize_var$finalize_command$finalize_rpath"
leo_sobral@2
  4526
	fi
leo_sobral@2
  4527
      fi
leo_sobral@2
  4528
leo_sobral@2
  4529
      # Replace the output file specification.
leo_sobral@2
  4530
      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
leo_sobral@2
  4531
leo_sobral@2
  4532
      # Delete the old output files.
leo_sobral@2
  4533
      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
leo_sobral@2
  4534
leo_sobral@2
  4535
      $show "$link_command"
leo_sobral@2
  4536
      $run eval "$link_command" || exit $?
leo_sobral@2
  4537
leo_sobral@2
  4538
      # Now create the wrapper script.
leo_sobral@2
  4539
      $show "creating $output"
leo_sobral@2
  4540
leo_sobral@2
  4541
      # Quote the relink command for shipping.
leo_sobral@2
  4542
      if test -n "$relink_command"; then
leo_sobral@2
  4543
	# Preserve any variables that may affect compiler behavior
leo_sobral@2
  4544
	for var in $variables_saved_for_relink; do
leo_sobral@2
  4545
	  if eval test -z \"\${$var+set}\"; then
leo_sobral@2
  4546
	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
leo_sobral@2
  4547
	  elif eval var_value=\$$var; test -z "$var_value"; then
leo_sobral@2
  4548
	    relink_command="$var=; export $var; $relink_command"
leo_sobral@2
  4549
	  else
leo_sobral@2
  4550
	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  4551
	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
leo_sobral@2
  4552
	  fi
leo_sobral@2
  4553
	done
leo_sobral@2
  4554
	relink_command="(cd `pwd`; $relink_command)"
leo_sobral@2
  4555
	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  4556
      fi
leo_sobral@2
  4557
leo_sobral@2
  4558
      # Quote $echo for shipping.
leo_sobral@2
  4559
      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
leo_sobral@2
  4560
	case $progpath in
leo_sobral@2
  4561
	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
leo_sobral@2
  4562
	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
leo_sobral@2
  4563
	esac
leo_sobral@2
  4564
	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  4565
      else
leo_sobral@2
  4566
	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  4567
      fi
leo_sobral@2
  4568
leo_sobral@2
  4569
      # Only actually do things if our run command is non-null.
leo_sobral@2
  4570
      if test -z "$run"; then
leo_sobral@2
  4571
	# win32 will think the script is a binary if it has
leo_sobral@2
  4572
	# a .exe suffix, so we strip it off here.
leo_sobral@2
  4573
	case $output in
leo_sobral@2
  4574
	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
leo_sobral@2
  4575
	esac
leo_sobral@2
  4576
	# test for cygwin because mv fails w/o .exe extensions
leo_sobral@2
  4577
	case $host in
leo_sobral@2
  4578
	  *cygwin*)
leo_sobral@2
  4579
	    exeext=.exe
leo_sobral@2
  4580
	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
leo_sobral@2
  4581
	  *) exeext= ;;
leo_sobral@2
  4582
	esac
leo_sobral@2
  4583
	case $host in
leo_sobral@2
  4584
	  *cygwin* | *mingw* )
leo_sobral@2
  4585
	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
leo_sobral@2
  4586
	    cwrapper=`$echo ${output}.exe`
leo_sobral@2
  4587
	    $rm $cwrappersource $cwrapper
leo_sobral@2
  4588
	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
leo_sobral@2
  4589
leo_sobral@2
  4590
	    cat > $cwrappersource <<EOF
leo_sobral@2
  4591
leo_sobral@2
  4592
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
leo_sobral@2
  4593
   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
leo_sobral@2
  4594
leo_sobral@2
  4595
   The $output program cannot be directly executed until all the libtool
leo_sobral@2
  4596
   libraries that it depends on are installed.
leo_sobral@2
  4597
leo_sobral@2
  4598
   This wrapper executable should never be moved out of the build directory.
leo_sobral@2
  4599
   If it is, it will not operate correctly.
leo_sobral@2
  4600
leo_sobral@2
  4601
   Currently, it simply execs the wrapper *script* "/bin/sh $output",
leo_sobral@2
  4602
   but could eventually absorb all of the scripts functionality and
leo_sobral@2
  4603
   exec $objdir/$outputname directly.
leo_sobral@2
  4604
*/
leo_sobral@2
  4605
EOF
leo_sobral@2
  4606
	    cat >> $cwrappersource<<"EOF"
leo_sobral@2
  4607
#include <stdio.h>
leo_sobral@2
  4608
#include <stdlib.h>
leo_sobral@2
  4609
#include <unistd.h>
leo_sobral@2
  4610
#include <malloc.h>
leo_sobral@2
  4611
#include <stdarg.h>
leo_sobral@2
  4612
#include <assert.h>
leo_sobral@2
  4613
leo_sobral@2
  4614
#if defined(PATH_MAX)
leo_sobral@2
  4615
# define LT_PATHMAX PATH_MAX
leo_sobral@2
  4616
#elif defined(MAXPATHLEN)
leo_sobral@2
  4617
# define LT_PATHMAX MAXPATHLEN
leo_sobral@2
  4618
#else
leo_sobral@2
  4619
# define LT_PATHMAX 1024
leo_sobral@2
  4620
#endif
leo_sobral@2
  4621
leo_sobral@2
  4622
#ifndef DIR_SEPARATOR
leo_sobral@2
  4623
#define DIR_SEPARATOR '/'
leo_sobral@2
  4624
#endif
leo_sobral@2
  4625
leo_sobral@2
  4626
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
leo_sobral@2
  4627
  defined (__OS2__)
leo_sobral@2
  4628
#define HAVE_DOS_BASED_FILE_SYSTEM
leo_sobral@2
  4629
#ifndef DIR_SEPARATOR_2
leo_sobral@2
  4630
#define DIR_SEPARATOR_2 '\\'
leo_sobral@2
  4631
#endif
leo_sobral@2
  4632
#endif
leo_sobral@2
  4633
leo_sobral@2
  4634
#ifndef DIR_SEPARATOR_2
leo_sobral@2
  4635
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
leo_sobral@2
  4636
#else /* DIR_SEPARATOR_2 */
leo_sobral@2
  4637
# define IS_DIR_SEPARATOR(ch) \
leo_sobral@2
  4638
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
leo_sobral@2
  4639
#endif /* DIR_SEPARATOR_2 */
leo_sobral@2
  4640
leo_sobral@2
  4641
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
leo_sobral@2
  4642
#define XFREE(stale) do { \
leo_sobral@2
  4643
  if (stale) { free ((void *) stale); stale = 0; } \
leo_sobral@2
  4644
} while (0)
leo_sobral@2
  4645
leo_sobral@2
  4646
const char *program_name = NULL;
leo_sobral@2
  4647
leo_sobral@2
  4648
void * xmalloc (size_t num);
leo_sobral@2
  4649
char * xstrdup (const char *string);
leo_sobral@2
  4650
char * basename (const char *name);
leo_sobral@2
  4651
char * fnqualify(const char *path);
leo_sobral@2
  4652
char * strendzap(char *str, const char *pat);
leo_sobral@2
  4653
void lt_fatal (const char *message, ...);
leo_sobral@2
  4654
leo_sobral@2
  4655
int
leo_sobral@2
  4656
main (int argc, char *argv[])
leo_sobral@2
  4657
{
leo_sobral@2
  4658
  char **newargz;
leo_sobral@2
  4659
  int i;
leo_sobral@2
  4660
leo_sobral@2
  4661
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
leo_sobral@2
  4662
  newargz = XMALLOC(char *, argc+2);
leo_sobral@2
  4663
EOF
leo_sobral@2
  4664
leo_sobral@2
  4665
	    cat >> $cwrappersource <<EOF
leo_sobral@2
  4666
  newargz[0] = "$SHELL";
leo_sobral@2
  4667
EOF
leo_sobral@2
  4668
leo_sobral@2
  4669
	    cat >> $cwrappersource <<"EOF"
leo_sobral@2
  4670
  newargz[1] = fnqualify(argv[0]);
leo_sobral@2
  4671
  /* we know the script has the same name, without the .exe */
leo_sobral@2
  4672
  /* so make sure newargz[1] doesn't end in .exe */
leo_sobral@2
  4673
  strendzap(newargz[1],".exe");
leo_sobral@2
  4674
  for (i = 1; i < argc; i++)
leo_sobral@2
  4675
    newargz[i+1] = xstrdup(argv[i]);
leo_sobral@2
  4676
  newargz[argc+1] = NULL;
leo_sobral@2
  4677
EOF
leo_sobral@2
  4678
leo_sobral@2
  4679
	    cat >> $cwrappersource <<EOF
leo_sobral@2
  4680
  execv("$SHELL",newargz);
leo_sobral@2
  4681
EOF
leo_sobral@2
  4682
leo_sobral@2
  4683
	    cat >> $cwrappersource <<"EOF"
leo_sobral@2
  4684
}
leo_sobral@2
  4685
leo_sobral@2
  4686
void *
leo_sobral@2
  4687
xmalloc (size_t num)
leo_sobral@2
  4688
{
leo_sobral@2
  4689
  void * p = (void *) malloc (num);
leo_sobral@2
  4690
  if (!p)
leo_sobral@2
  4691
    lt_fatal ("Memory exhausted");
leo_sobral@2
  4692
leo_sobral@2
  4693
  return p;
leo_sobral@2
  4694
}
leo_sobral@2
  4695
leo_sobral@2
  4696
char *
leo_sobral@2
  4697
xstrdup (const char *string)
leo_sobral@2
  4698
{
leo_sobral@2
  4699
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
leo_sobral@2
  4700
;
leo_sobral@2
  4701
}
leo_sobral@2
  4702
leo_sobral@2
  4703
char *
leo_sobral@2
  4704
basename (const char *name)
leo_sobral@2
  4705
{
leo_sobral@2
  4706
  const char *base;
leo_sobral@2
  4707
leo_sobral@2
  4708
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
leo_sobral@2
  4709
  /* Skip over the disk name in MSDOS pathnames. */
leo_sobral@2
  4710
  if (isalpha (name[0]) && name[1] == ':')
leo_sobral@2
  4711
    name += 2;
leo_sobral@2
  4712
#endif
leo_sobral@2
  4713
leo_sobral@2
  4714
  for (base = name; *name; name++)
leo_sobral@2
  4715
    if (IS_DIR_SEPARATOR (*name))
leo_sobral@2
  4716
      base = name + 1;
leo_sobral@2
  4717
  return (char *) base;
leo_sobral@2
  4718
}
leo_sobral@2
  4719
leo_sobral@2
  4720
char *
leo_sobral@2
  4721
fnqualify(const char *path)
leo_sobral@2
  4722
{
leo_sobral@2
  4723
  size_t size;
leo_sobral@2
  4724
  char *p;
leo_sobral@2
  4725
  char tmp[LT_PATHMAX + 1];
leo_sobral@2
  4726
leo_sobral@2
  4727
  assert(path != NULL);
leo_sobral@2
  4728
leo_sobral@2
  4729
  /* Is it qualified already? */
leo_sobral@2
  4730
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
leo_sobral@2
  4731
  if (isalpha (path[0]) && path[1] == ':')
leo_sobral@2
  4732
    return xstrdup (path);
leo_sobral@2
  4733
#endif
leo_sobral@2
  4734
  if (IS_DIR_SEPARATOR (path[0]))
leo_sobral@2
  4735
    return xstrdup (path);
leo_sobral@2
  4736
leo_sobral@2
  4737
  /* prepend the current directory */
leo_sobral@2
  4738
  /* doesn't handle '~' */
leo_sobral@2
  4739
  if (getcwd (tmp, LT_PATHMAX) == NULL)
leo_sobral@2
  4740
    lt_fatal ("getcwd failed");
leo_sobral@2
  4741
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
leo_sobral@2
  4742
  p = XMALLOC(char, size);
leo_sobral@2
  4743
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
leo_sobral@2
  4744
  return p;
leo_sobral@2
  4745
}
leo_sobral@2
  4746
leo_sobral@2
  4747
char *
leo_sobral@2
  4748
strendzap(char *str, const char *pat)
leo_sobral@2
  4749
{
leo_sobral@2
  4750
  size_t len, patlen;
leo_sobral@2
  4751
leo_sobral@2
  4752
  assert(str != NULL);
leo_sobral@2
  4753
  assert(pat != NULL);
leo_sobral@2
  4754
leo_sobral@2
  4755
  len = strlen(str);
leo_sobral@2
  4756
  patlen = strlen(pat);
leo_sobral@2
  4757
leo_sobral@2
  4758
  if (patlen <= len)
leo_sobral@2
  4759
  {
leo_sobral@2
  4760
    str += len - patlen;
leo_sobral@2
  4761
    if (strcmp(str, pat) == 0)
leo_sobral@2
  4762
      *str = '\0';
leo_sobral@2
  4763
  }
leo_sobral@2
  4764
  return str;
leo_sobral@2
  4765
}
leo_sobral@2
  4766
leo_sobral@2
  4767
static void
leo_sobral@2
  4768
lt_error_core (int exit_status, const char * mode,
leo_sobral@2
  4769
          const char * message, va_list ap)
leo_sobral@2
  4770
{
leo_sobral@2
  4771
  fprintf (stderr, "%s: %s: ", program_name, mode);
leo_sobral@2
  4772
  vfprintf (stderr, message, ap);
leo_sobral@2
  4773
  fprintf (stderr, ".\n");
leo_sobral@2
  4774
leo_sobral@2
  4775
  if (exit_status >= 0)
leo_sobral@2
  4776
    exit (exit_status);
leo_sobral@2
  4777
}
leo_sobral@2
  4778
leo_sobral@2
  4779
void
leo_sobral@2
  4780
lt_fatal (const char *message, ...)
leo_sobral@2
  4781
{
leo_sobral@2
  4782
  va_list ap;
leo_sobral@2
  4783
  va_start (ap, message);
leo_sobral@2
  4784
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
leo_sobral@2
  4785
  va_end (ap);
leo_sobral@2
  4786
}
leo_sobral@2
  4787
EOF
leo_sobral@2
  4788
	  # we should really use a build-platform specific compiler
leo_sobral@2
  4789
	  # here, but OTOH, the wrappers (shell script and this C one)
leo_sobral@2
  4790
	  # are only useful if you want to execute the "real" binary.
leo_sobral@2
  4791
	  # Since the "real" binary is built for $host, then this
leo_sobral@2
  4792
	  # wrapper might as well be built for $host, too.
leo_sobral@2
  4793
	  $run $LTCC -s -o $cwrapper $cwrappersource
leo_sobral@2
  4794
	  ;;
leo_sobral@2
  4795
	esac
leo_sobral@2
  4796
	$rm $output
leo_sobral@2
  4797
	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
leo_sobral@2
  4798
leo_sobral@2
  4799
	$echo > $output "\
leo_sobral@2
  4800
#! $SHELL
leo_sobral@2
  4801
leo_sobral@2
  4802
# $output - temporary wrapper script for $objdir/$outputname
leo_sobral@2
  4803
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
leo_sobral@2
  4804
#
leo_sobral@2
  4805
# The $output program cannot be directly executed until all the libtool
leo_sobral@2
  4806
# libraries that it depends on are installed.
leo_sobral@2
  4807
#
leo_sobral@2
  4808
# This wrapper script should never be moved out of the build directory.
leo_sobral@2
  4809
# If it is, it will not operate correctly.
leo_sobral@2
  4810
leo_sobral@2
  4811
# Sed substitution that helps us do robust quoting.  It backslashifies
leo_sobral@2
  4812
# metacharacters that are still active within double-quoted strings.
leo_sobral@2
  4813
Xsed='${SED} -e 1s/^X//'
leo_sobral@2
  4814
sed_quote_subst='$sed_quote_subst'
leo_sobral@2
  4815
leo_sobral@2
  4816
# The HP-UX ksh and POSIX shell print the target directory to stdout
leo_sobral@2
  4817
# if CDPATH is set.
leo_sobral@2
  4818
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
leo_sobral@2
  4819
leo_sobral@2
  4820
relink_command=\"$relink_command\"
leo_sobral@2
  4821
leo_sobral@2
  4822
# This environment variable determines our operation mode.
leo_sobral@2
  4823
if test \"\$libtool_install_magic\" = \"$magic\"; then
leo_sobral@2
  4824
  # install mode needs the following variable:
leo_sobral@2
  4825
  notinst_deplibs='$notinst_deplibs'
leo_sobral@2
  4826
else
leo_sobral@2
  4827
  # When we are sourced in execute mode, \$file and \$echo are already set.
leo_sobral@2
  4828
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
leo_sobral@2
  4829
    echo=\"$qecho\"
leo_sobral@2
  4830
    file=\"\$0\"
leo_sobral@2
  4831
    # Make sure echo works.
leo_sobral@2
  4832
    if test \"X\$1\" = X--no-reexec; then
leo_sobral@2
  4833
      # Discard the --no-reexec flag, and continue.
leo_sobral@2
  4834
      shift
leo_sobral@2
  4835
    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
leo_sobral@2
  4836
      # Yippee, \$echo works!
leo_sobral@2
  4837
      :
leo_sobral@2
  4838
    else
leo_sobral@2
  4839
      # Restart under the correct shell, and then maybe \$echo will work.
leo_sobral@2
  4840
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
leo_sobral@2
  4841
    fi
leo_sobral@2
  4842
  fi\
leo_sobral@2
  4843
"
leo_sobral@2
  4844
	$echo >> $output "\
leo_sobral@2
  4845
leo_sobral@2
  4846
  # Find the directory that this script lives in.
leo_sobral@2
  4847
  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
leo_sobral@2
  4848
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
leo_sobral@2
  4849
leo_sobral@2
  4850
  # Follow symbolic links until we get to the real thisdir.
leo_sobral@2
  4851
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
leo_sobral@2
  4852
  while test -n \"\$file\"; do
leo_sobral@2
  4853
    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
leo_sobral@2
  4854
leo_sobral@2
  4855
    # If there was a directory component, then change thisdir.
leo_sobral@2
  4856
    if test \"x\$destdir\" != \"x\$file\"; then
leo_sobral@2
  4857
      case \"\$destdir\" in
leo_sobral@2
  4858
      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
leo_sobral@2
  4859
      *) thisdir=\"\$thisdir/\$destdir\" ;;
leo_sobral@2
  4860
      esac
leo_sobral@2
  4861
    fi
leo_sobral@2
  4862
leo_sobral@2
  4863
    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
leo_sobral@2
  4864
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
leo_sobral@2
  4865
  done
leo_sobral@2
  4866
leo_sobral@2
  4867
  # Try to get the absolute directory name.
leo_sobral@2
  4868
  absdir=\`cd \"\$thisdir\" && pwd\`
leo_sobral@2
  4869
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
leo_sobral@2
  4870
"
leo_sobral@2
  4871
leo_sobral@2
  4872
	if test "$fast_install" = yes; then
leo_sobral@2
  4873
	  $echo >> $output "\
leo_sobral@2
  4874
  program=lt-'$outputname'$exeext
leo_sobral@2
  4875
  progdir=\"\$thisdir/$objdir\"
leo_sobral@2
  4876
leo_sobral@2
  4877
  if test ! -f \"\$progdir/\$program\" || \\
leo_sobral@2
  4878
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
leo_sobral@2
  4879
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
leo_sobral@2
  4880
leo_sobral@2
  4881
    file=\"\$\$-\$program\"
leo_sobral@2
  4882
leo_sobral@2
  4883
    if test ! -d \"\$progdir\"; then
leo_sobral@2
  4884
      $mkdir \"\$progdir\"
leo_sobral@2
  4885
    else
leo_sobral@2
  4886
      $rm \"\$progdir/\$file\"
leo_sobral@2
  4887
    fi"
leo_sobral@2
  4888
leo_sobral@2
  4889
	  $echo >> $output "\
leo_sobral@2
  4890
leo_sobral@2
  4891
    # relink executable if necessary
leo_sobral@2
  4892
    if test -n \"\$relink_command\"; then
leo_sobral@2
  4893
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
leo_sobral@2
  4894
      else
leo_sobral@2
  4895
	$echo \"\$relink_command_output\" >&2
leo_sobral@2
  4896
	$rm \"\$progdir/\$file\"
leo_sobral@2
  4897
	exit $EXIT_FAILURE
leo_sobral@2
  4898
      fi
leo_sobral@2
  4899
    fi
leo_sobral@2
  4900
leo_sobral@2
  4901
    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
leo_sobral@2
  4902
    { $rm \"\$progdir/\$program\";
leo_sobral@2
  4903
      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
leo_sobral@2
  4904
    $rm \"\$progdir/\$file\"
leo_sobral@2
  4905
  fi"
leo_sobral@2
  4906
	else
leo_sobral@2
  4907
	  $echo >> $output "\
leo_sobral@2
  4908
  program='$outputname'
leo_sobral@2
  4909
  progdir=\"\$thisdir/$objdir\"
leo_sobral@2
  4910
"
leo_sobral@2
  4911
	fi
leo_sobral@2
  4912
leo_sobral@2
  4913
	$echo >> $output "\
leo_sobral@2
  4914
leo_sobral@2
  4915
  if test -f \"\$progdir/\$program\"; then"
leo_sobral@2
  4916
leo_sobral@2
  4917
	# Export our shlibpath_var if we have one.
leo_sobral@2
  4918
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
leo_sobral@2
  4919
	  $echo >> $output "\
leo_sobral@2
  4920
    # Add our own library path to $shlibpath_var
leo_sobral@2
  4921
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
leo_sobral@2
  4922
leo_sobral@2
  4923
    # Some systems cannot cope with colon-terminated $shlibpath_var
leo_sobral@2
  4924
    # The second colon is a workaround for a bug in BeOS R4 sed
leo_sobral@2
  4925
    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
leo_sobral@2
  4926
leo_sobral@2
  4927
    export $shlibpath_var
leo_sobral@2
  4928
"
leo_sobral@2
  4929
	fi
leo_sobral@2
  4930
leo_sobral@2
  4931
	# fixup the dll searchpath if we need to.
leo_sobral@2
  4932
	if test -n "$dllsearchpath"; then
leo_sobral@2
  4933
	  $echo >> $output "\
leo_sobral@2
  4934
    # Add the dll search path components to the executable PATH
leo_sobral@2
  4935
    PATH=$dllsearchpath:\$PATH
leo_sobral@2
  4936
"
leo_sobral@2
  4937
	fi
leo_sobral@2
  4938
leo_sobral@2
  4939
	$echo >> $output "\
leo_sobral@2
  4940
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
leo_sobral@2
  4941
      # Run the actual program with our arguments.
leo_sobral@2
  4942
"
leo_sobral@2
  4943
	case $host in
leo_sobral@2
  4944
	# Backslashes separate directories on plain windows
leo_sobral@2
  4945
	*-*-mingw | *-*-os2*)
leo_sobral@2
  4946
	  $echo >> $output "\
leo_sobral@2
  4947
      exec \$progdir\\\\\$program \${1+\"\$@\"}
leo_sobral@2
  4948
"
leo_sobral@2
  4949
	  ;;
leo_sobral@2
  4950
leo_sobral@2
  4951
	*)
leo_sobral@2
  4952
	  $echo >> $output "\
leo_sobral@2
  4953
      exec \$progdir/\$program \${1+\"\$@\"}
leo_sobral@2
  4954
"
leo_sobral@2
  4955
	  ;;
leo_sobral@2
  4956
	esac
leo_sobral@2
  4957
	$echo >> $output "\
leo_sobral@2
  4958
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
leo_sobral@2
  4959
      exit $EXIT_FAILURE
leo_sobral@2
  4960
    fi
leo_sobral@2
  4961
  else
leo_sobral@2
  4962
    # The program doesn't exist.
leo_sobral@2
  4963
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
leo_sobral@2
  4964
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
leo_sobral@2
  4965
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
leo_sobral@2
  4966
    exit $EXIT_FAILURE
leo_sobral@2
  4967
  fi
leo_sobral@2
  4968
fi\
leo_sobral@2
  4969
"
leo_sobral@2
  4970
	chmod +x $output
leo_sobral@2
  4971
      fi
leo_sobral@2
  4972
      exit $EXIT_SUCCESS
leo_sobral@2
  4973
      ;;
leo_sobral@2
  4974
    esac
leo_sobral@2
  4975
leo_sobral@2
  4976
    # See if we need to build an old-fashioned archive.
leo_sobral@2
  4977
    for oldlib in $oldlibs; do
leo_sobral@2
  4978
leo_sobral@2
  4979
      if test "$build_libtool_libs" = convenience; then
leo_sobral@2
  4980
	oldobjs="$libobjs_save"
leo_sobral@2
  4981
	addlibs="$convenience"
leo_sobral@2
  4982
	build_libtool_libs=no
leo_sobral@2
  4983
      else
leo_sobral@2
  4984
	if test "$build_libtool_libs" = module; then
leo_sobral@2
  4985
	  oldobjs="$libobjs_save"
leo_sobral@2
  4986
	  build_libtool_libs=no
leo_sobral@2
  4987
	else
leo_sobral@2
  4988
	  oldobjs="$old_deplibs $non_pic_objects"
leo_sobral@2
  4989
	fi
leo_sobral@2
  4990
	addlibs="$old_convenience"
leo_sobral@2
  4991
      fi
leo_sobral@2
  4992
leo_sobral@2
  4993
      if test -n "$addlibs"; then
leo_sobral@2
  4994
	gentop="$output_objdir/${outputname}x"
leo_sobral@2
  4995
	$show "${rm}r $gentop"
leo_sobral@2
  4996
	$run ${rm}r "$gentop"
leo_sobral@2
  4997
	$show "$mkdir $gentop"
leo_sobral@2
  4998
	$run $mkdir "$gentop"
leo_sobral@2
  4999
	status=$?
leo_sobral@2
  5000
	if test "$status" -ne 0 && test ! -d "$gentop"; then
leo_sobral@2
  5001
	  exit $status
leo_sobral@2
  5002
	fi
leo_sobral@2
  5003
	generated="$generated $gentop"
leo_sobral@2
  5004
leo_sobral@2
  5005
	# Add in members from convenience archives.
leo_sobral@2
  5006
	for xlib in $addlibs; do
leo_sobral@2
  5007
	  # Extract the objects.
leo_sobral@2
  5008
	  case $xlib in
leo_sobral@2
  5009
	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
leo_sobral@2
  5010
	  *) xabs=`pwd`"/$xlib" ;;
leo_sobral@2
  5011
	  esac
leo_sobral@2
  5012
	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5013
	  xdir="$gentop/$xlib"
leo_sobral@2
  5014
leo_sobral@2
  5015
	  $show "${rm}r $xdir"
leo_sobral@2
  5016
	  $run ${rm}r "$xdir"
leo_sobral@2
  5017
	  $show "$mkdir $xdir"
leo_sobral@2
  5018
	  $run $mkdir "$xdir"
leo_sobral@2
  5019
	  status=$?
leo_sobral@2
  5020
	  if test "$status" -ne 0 && test ! -d "$xdir"; then
leo_sobral@2
  5021
	    exit $status
leo_sobral@2
  5022
	  fi
leo_sobral@2
  5023
	  # We will extract separately just the conflicting names and we will no
leo_sobral@2
  5024
	  # longer touch any unique names. It is faster to leave these extract
leo_sobral@2
  5025
	  # automatically by $AR in one run.
leo_sobral@2
  5026
	  $show "(cd $xdir && $AR x $xabs)"
leo_sobral@2
  5027
	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
leo_sobral@2
  5028
	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
leo_sobral@2
  5029
	    :
leo_sobral@2
  5030
	  else
leo_sobral@2
  5031
	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
leo_sobral@2
  5032
	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
leo_sobral@2
  5033
	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
leo_sobral@2
  5034
	    do
leo_sobral@2
  5035
	      i=1
leo_sobral@2
  5036
	      while test "$i" -le "$count"
leo_sobral@2
  5037
	      do
leo_sobral@2
  5038
	       # Put our $i before any first dot (extension)
leo_sobral@2
  5039
	       # Never overwrite any file
leo_sobral@2
  5040
	       name_to="$name"
leo_sobral@2
  5041
	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
leo_sobral@2
  5042
	       do
leo_sobral@2
  5043
		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
leo_sobral@2
  5044
	       done
leo_sobral@2
  5045
	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
leo_sobral@2
  5046
	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
leo_sobral@2
  5047
	       i=`expr $i + 1`
leo_sobral@2
  5048
	      done
leo_sobral@2
  5049
	    done
leo_sobral@2
  5050
	  fi
leo_sobral@2
  5051
leo_sobral@2
  5052
	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
leo_sobral@2
  5053
	done
leo_sobral@2
  5054
      fi
leo_sobral@2
  5055
leo_sobral@2
  5056
      # Do each command in the archive commands.
leo_sobral@2
  5057
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
leo_sobral@2
  5058
       cmds=$old_archive_from_new_cmds
leo_sobral@2
  5059
      else
leo_sobral@2
  5060
	eval cmds=\"$old_archive_cmds\"
leo_sobral@2
  5061
leo_sobral@2
  5062
	if len=`expr "X$cmds" : ".*"` &&
leo_sobral@2
  5063
	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
leo_sobral@2
  5064
	  cmds=$old_archive_cmds
leo_sobral@2
  5065
	else
leo_sobral@2
  5066
	  # the command line is too long to link in one step, link in parts
leo_sobral@2
  5067
	  $echo "using piecewise archive linking..."
leo_sobral@2
  5068
	  save_RANLIB=$RANLIB
leo_sobral@2
  5069
	  RANLIB=:
leo_sobral@2
  5070
	  objlist=
leo_sobral@2
  5071
	  concat_cmds=
leo_sobral@2
  5072
	  save_oldobjs=$oldobjs
leo_sobral@2
  5073
	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
leo_sobral@2
  5074
	  # encoded into archives.  This makes 'ar r' malfunction in
leo_sobral@2
  5075
	  # this piecewise linking case whenever conflicting object
leo_sobral@2
  5076
	  # names appear in distinct ar calls; check, warn and compensate.
leo_sobral@2
  5077
	    if (for obj in $save_oldobjs
leo_sobral@2
  5078
	    do
leo_sobral@2
  5079
	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
leo_sobral@2
  5080
	    done | sort | sort -uc >/dev/null 2>&1); then
leo_sobral@2
  5081
	    :
leo_sobral@2
  5082
	  else
leo_sobral@2
  5083
	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
leo_sobral@2
  5084
	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
leo_sobral@2
  5085
	    AR_FLAGS=cq
leo_sobral@2
  5086
	  fi
leo_sobral@2
  5087
	  # Is there a better way of finding the last object in the list?
leo_sobral@2
  5088
	  for obj in $save_oldobjs
leo_sobral@2
  5089
	  do
leo_sobral@2
  5090
	    last_oldobj=$obj
leo_sobral@2
  5091
	  done
leo_sobral@2
  5092
	  for obj in $save_oldobjs
leo_sobral@2
  5093
	  do
leo_sobral@2
  5094
	    oldobjs="$objlist $obj"
leo_sobral@2
  5095
	    objlist="$objlist $obj"
leo_sobral@2
  5096
	    eval test_cmds=\"$old_archive_cmds\"
leo_sobral@2
  5097
	    if len=`expr "X$test_cmds" : ".*"` &&
leo_sobral@2
  5098
	       test "$len" -le "$max_cmd_len"; then
leo_sobral@2
  5099
	      :
leo_sobral@2
  5100
	    else
leo_sobral@2
  5101
	      # the above command should be used before it gets too long
leo_sobral@2
  5102
	      oldobjs=$objlist
leo_sobral@2
  5103
	      if test "$obj" = "$last_oldobj" ; then
leo_sobral@2
  5104
	        RANLIB=$save_RANLIB
leo_sobral@2
  5105
	      fi
leo_sobral@2
  5106
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
leo_sobral@2
  5107
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
leo_sobral@2
  5108
	      objlist=
leo_sobral@2
  5109
	    fi
leo_sobral@2
  5110
	  done
leo_sobral@2
  5111
	  RANLIB=$save_RANLIB
leo_sobral@2
  5112
	  oldobjs=$objlist
leo_sobral@2
  5113
	  if test "X$oldobjs" = "X" ; then
leo_sobral@2
  5114
	    eval cmds=\"\$concat_cmds\"
leo_sobral@2
  5115
	  else
leo_sobral@2
  5116
	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
leo_sobral@2
  5117
	  fi
leo_sobral@2
  5118
	fi
leo_sobral@2
  5119
      fi
leo_sobral@2
  5120
      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  5121
      for cmd in $cmds; do
leo_sobral@2
  5122
        eval cmd=\"$cmd\"
leo_sobral@2
  5123
	IFS="$save_ifs"
leo_sobral@2
  5124
	$show "$cmd"
leo_sobral@2
  5125
	$run eval "$cmd" || exit $?
leo_sobral@2
  5126
      done
leo_sobral@2
  5127
      IFS="$save_ifs"
leo_sobral@2
  5128
    done
leo_sobral@2
  5129
leo_sobral@2
  5130
    if test -n "$generated"; then
leo_sobral@2
  5131
      $show "${rm}r$generated"
leo_sobral@2
  5132
      $run ${rm}r$generated
leo_sobral@2
  5133
    fi
leo_sobral@2
  5134
leo_sobral@2
  5135
    # Now create the libtool archive.
leo_sobral@2
  5136
    case $output in
leo_sobral@2
  5137
    *.la)
leo_sobral@2
  5138
      old_library=
leo_sobral@2
  5139
      test "$build_old_libs" = yes && old_library="$libname.$libext"
leo_sobral@2
  5140
      $show "creating $output"
leo_sobral@2
  5141
leo_sobral@2
  5142
      # Preserve any variables that may affect compiler behavior
leo_sobral@2
  5143
      for var in $variables_saved_for_relink; do
leo_sobral@2
  5144
	if eval test -z \"\${$var+set}\"; then
leo_sobral@2
  5145
	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
leo_sobral@2
  5146
	elif eval var_value=\$$var; test -z "$var_value"; then
leo_sobral@2
  5147
	  relink_command="$var=; export $var; $relink_command"
leo_sobral@2
  5148
	else
leo_sobral@2
  5149
	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5150
	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
leo_sobral@2
  5151
	fi
leo_sobral@2
  5152
      done
leo_sobral@2
  5153
      # Quote the link command for shipping.
leo_sobral@2
  5154
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
leo_sobral@2
  5155
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5156
      if test "$hardcode_automatic" = yes ; then
leo_sobral@2
  5157
	relink_command=
leo_sobral@2
  5158
      fi
leo_sobral@2
  5159
leo_sobral@2
  5160
leo_sobral@2
  5161
      # Only create the output if not a dry run.
leo_sobral@2
  5162
      if test -z "$run"; then
leo_sobral@2
  5163
	for installed in no yes; do
leo_sobral@2
  5164
	  if test "$installed" = yes; then
leo_sobral@2
  5165
	    if test -z "$install_libdir"; then
leo_sobral@2
  5166
	      break
leo_sobral@2
  5167
	    fi
leo_sobral@2
  5168
	    output="$output_objdir/$outputname"i
leo_sobral@2
  5169
	    # Replace all uninstalled libtool libraries with the installed ones
leo_sobral@2
  5170
	    newdependency_libs=
leo_sobral@2
  5171
	    for deplib in $dependency_libs; do
leo_sobral@2
  5172
	      case $deplib in
leo_sobral@2
  5173
	      *.la)
leo_sobral@2
  5174
		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5175
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
leo_sobral@2
  5176
		if test -z "$libdir"; then
leo_sobral@2
  5177
		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
leo_sobral@2
  5178
		  exit $EXIT_FAILURE
leo_sobral@2
  5179
		fi
leo_sobral@2
  5180
		newdependency_libs="$newdependency_libs $libdir/$name"
leo_sobral@2
  5181
		;;
leo_sobral@2
  5182
	      *) newdependency_libs="$newdependency_libs $deplib" ;;
leo_sobral@2
  5183
	      esac
leo_sobral@2
  5184
	    done
leo_sobral@2
  5185
	    dependency_libs="$newdependency_libs"
leo_sobral@2
  5186
	    newdlfiles=
leo_sobral@2
  5187
	    for lib in $dlfiles; do
leo_sobral@2
  5188
	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5189
	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
leo_sobral@2
  5190
	      if test -z "$libdir"; then
leo_sobral@2
  5191
		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
leo_sobral@2
  5192
		exit $EXIT_FAILURE
leo_sobral@2
  5193
	      fi
leo_sobral@2
  5194
	      newdlfiles="$newdlfiles $libdir/$name"
leo_sobral@2
  5195
	    done
leo_sobral@2
  5196
	    dlfiles="$newdlfiles"
leo_sobral@2
  5197
	    newdlprefiles=
leo_sobral@2
  5198
	    for lib in $dlprefiles; do
leo_sobral@2
  5199
	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5200
	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
leo_sobral@2
  5201
	      if test -z "$libdir"; then
leo_sobral@2
  5202
		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
leo_sobral@2
  5203
		exit $EXIT_FAILURE
leo_sobral@2
  5204
	      fi
leo_sobral@2
  5205
	      newdlprefiles="$newdlprefiles $libdir/$name"
leo_sobral@2
  5206
	    done
leo_sobral@2
  5207
	    dlprefiles="$newdlprefiles"
leo_sobral@2
  5208
	  else
leo_sobral@2
  5209
	    newdlfiles=
leo_sobral@2
  5210
	    for lib in $dlfiles; do
leo_sobral@2
  5211
	      case $lib in
leo_sobral@2
  5212
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
leo_sobral@2
  5213
		*) abs=`pwd`"/$lib" ;;
leo_sobral@2
  5214
	      esac
leo_sobral@2
  5215
	      newdlfiles="$newdlfiles $abs"
leo_sobral@2
  5216
	    done
leo_sobral@2
  5217
	    dlfiles="$newdlfiles"
leo_sobral@2
  5218
	    newdlprefiles=
leo_sobral@2
  5219
	    for lib in $dlprefiles; do
leo_sobral@2
  5220
	      case $lib in
leo_sobral@2
  5221
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
leo_sobral@2
  5222
		*) abs=`pwd`"/$lib" ;;
leo_sobral@2
  5223
	      esac
leo_sobral@2
  5224
	      newdlprefiles="$newdlprefiles $abs"
leo_sobral@2
  5225
	    done
leo_sobral@2
  5226
	    dlprefiles="$newdlprefiles"
leo_sobral@2
  5227
	  fi
leo_sobral@2
  5228
	  $rm $output
leo_sobral@2
  5229
	  # place dlname in correct position for cygwin
leo_sobral@2
  5230
	  tdlname=$dlname
leo_sobral@2
  5231
	  case $host,$output,$installed,$module,$dlname in
leo_sobral@2
  5232
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
leo_sobral@2
  5233
	  esac
leo_sobral@2
  5234
	  $echo > $output "\
leo_sobral@2
  5235
# $outputname - a libtool library file
leo_sobral@2
  5236
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
leo_sobral@2
  5237
#
leo_sobral@2
  5238
# Please DO NOT delete this file!
leo_sobral@2
  5239
# It is necessary for linking the library.
leo_sobral@2
  5240
leo_sobral@2
  5241
# The name that we can dlopen(3).
leo_sobral@2
  5242
dlname='$tdlname'
leo_sobral@2
  5243
leo_sobral@2
  5244
# Names of this library.
leo_sobral@2
  5245
library_names='$library_names'
leo_sobral@2
  5246
leo_sobral@2
  5247
# The name of the static archive.
leo_sobral@2
  5248
old_library='$old_library'
leo_sobral@2
  5249
leo_sobral@2
  5250
# Libraries that this one depends upon.
leo_sobral@2
  5251
dependency_libs='$dependency_libs'
leo_sobral@2
  5252
leo_sobral@2
  5253
# Version information for $libname.
leo_sobral@2
  5254
current=$current
leo_sobral@2
  5255
age=$age
leo_sobral@2
  5256
revision=$revision
leo_sobral@2
  5257
leo_sobral@2
  5258
# Is this an already installed library?
leo_sobral@2
  5259
installed=$installed
leo_sobral@2
  5260
leo_sobral@2
  5261
# Should we warn about portability when linking against -modules?
leo_sobral@2
  5262
shouldnotlink=$module
leo_sobral@2
  5263
leo_sobral@2
  5264
# Files to dlopen/dlpreopen
leo_sobral@2
  5265
dlopen='$dlfiles'
leo_sobral@2
  5266
dlpreopen='$dlprefiles'
leo_sobral@2
  5267
leo_sobral@2
  5268
# Directory that this library needs to be installed in:
leo_sobral@2
  5269
libdir='$install_libdir'"
leo_sobral@2
  5270
	  if test "$installed" = no && test "$need_relink" = yes; then
leo_sobral@2
  5271
	    $echo >> $output "\
leo_sobral@2
  5272
relink_command=\"$relink_command\""
leo_sobral@2
  5273
	  fi
leo_sobral@2
  5274
	done
leo_sobral@2
  5275
      fi
leo_sobral@2
  5276
leo_sobral@2
  5277
      # Do a symbolic link so that the libtool archive can be found in
leo_sobral@2
  5278
      # LD_LIBRARY_PATH before the program is installed.
leo_sobral@2
  5279
      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
leo_sobral@2
  5280
      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
leo_sobral@2
  5281
      ;;
leo_sobral@2
  5282
    esac
leo_sobral@2
  5283
    exit $EXIT_SUCCESS
leo_sobral@2
  5284
    ;;
leo_sobral@2
  5285
leo_sobral@2
  5286
  # libtool install mode
leo_sobral@2
  5287
  install)
leo_sobral@2
  5288
    modename="$modename: install"
leo_sobral@2
  5289
leo_sobral@2
  5290
    # There may be an optional sh(1) argument at the beginning of
leo_sobral@2
  5291
    # install_prog (especially on Windows NT).
leo_sobral@2
  5292
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
leo_sobral@2
  5293
       # Allow the use of GNU shtool's install command.
leo_sobral@2
  5294
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
leo_sobral@2
  5295
      # Aesthetically quote it.
leo_sobral@2
  5296
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5297
      case $arg in
leo_sobral@2
  5298
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
leo_sobral@2
  5299
	arg="\"$arg\""
leo_sobral@2
  5300
	;;
leo_sobral@2
  5301
      esac
leo_sobral@2
  5302
      install_prog="$arg "
leo_sobral@2
  5303
      arg="$1"
leo_sobral@2
  5304
      shift
leo_sobral@2
  5305
    else
leo_sobral@2
  5306
      install_prog=
leo_sobral@2
  5307
      arg="$nonopt"
leo_sobral@2
  5308
    fi
leo_sobral@2
  5309
leo_sobral@2
  5310
    # The real first argument should be the name of the installation program.
leo_sobral@2
  5311
    # Aesthetically quote it.
leo_sobral@2
  5312
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5313
    case $arg in
leo_sobral@2
  5314
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
leo_sobral@2
  5315
      arg="\"$arg\""
leo_sobral@2
  5316
      ;;
leo_sobral@2
  5317
    esac
leo_sobral@2
  5318
    install_prog="$install_prog$arg"
leo_sobral@2
  5319
leo_sobral@2
  5320
    # We need to accept at least all the BSD install flags.
leo_sobral@2
  5321
    dest=
leo_sobral@2
  5322
    files=
leo_sobral@2
  5323
    opts=
leo_sobral@2
  5324
    prev=
leo_sobral@2
  5325
    install_type=
leo_sobral@2
  5326
    isdir=no
leo_sobral@2
  5327
    stripme=
leo_sobral@2
  5328
    for arg
leo_sobral@2
  5329
    do
leo_sobral@2
  5330
      if test -n "$dest"; then
leo_sobral@2
  5331
	files="$files $dest"
leo_sobral@2
  5332
	dest="$arg"
leo_sobral@2
  5333
	continue
leo_sobral@2
  5334
      fi
leo_sobral@2
  5335
leo_sobral@2
  5336
      case $arg in
leo_sobral@2
  5337
      -d) isdir=yes ;;
leo_sobral@2
  5338
      -f) prev="-f" ;;
leo_sobral@2
  5339
      -g) prev="-g" ;;
leo_sobral@2
  5340
      -m) prev="-m" ;;
leo_sobral@2
  5341
      -o) prev="-o" ;;
leo_sobral@2
  5342
      -s)
leo_sobral@2
  5343
	stripme=" -s"
leo_sobral@2
  5344
	continue
leo_sobral@2
  5345
	;;
leo_sobral@2
  5346
      -*) ;;
leo_sobral@2
  5347
leo_sobral@2
  5348
      *)
leo_sobral@2
  5349
	# If the previous option needed an argument, then skip it.
leo_sobral@2
  5350
	if test -n "$prev"; then
leo_sobral@2
  5351
	  prev=
leo_sobral@2
  5352
	else
leo_sobral@2
  5353
	  dest="$arg"
leo_sobral@2
  5354
	  continue
leo_sobral@2
  5355
	fi
leo_sobral@2
  5356
	;;
leo_sobral@2
  5357
      esac
leo_sobral@2
  5358
leo_sobral@2
  5359
      # Aesthetically quote the argument.
leo_sobral@2
  5360
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5361
      case $arg in
leo_sobral@2
  5362
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
leo_sobral@2
  5363
	arg="\"$arg\""
leo_sobral@2
  5364
	;;
leo_sobral@2
  5365
      esac
leo_sobral@2
  5366
      install_prog="$install_prog $arg"
leo_sobral@2
  5367
    done
leo_sobral@2
  5368
leo_sobral@2
  5369
    if test -z "$install_prog"; then
leo_sobral@2
  5370
      $echo "$modename: you must specify an install program" 1>&2
leo_sobral@2
  5371
      $echo "$help" 1>&2
leo_sobral@2
  5372
      exit $EXIT_FAILURE
leo_sobral@2
  5373
    fi
leo_sobral@2
  5374
leo_sobral@2
  5375
    if test -n "$prev"; then
leo_sobral@2
  5376
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
leo_sobral@2
  5377
      $echo "$help" 1>&2
leo_sobral@2
  5378
      exit $EXIT_FAILURE
leo_sobral@2
  5379
    fi
leo_sobral@2
  5380
leo_sobral@2
  5381
    if test -z "$files"; then
leo_sobral@2
  5382
      if test -z "$dest"; then
leo_sobral@2
  5383
	$echo "$modename: no file or destination specified" 1>&2
leo_sobral@2
  5384
      else
leo_sobral@2
  5385
	$echo "$modename: you must specify a destination" 1>&2
leo_sobral@2
  5386
      fi
leo_sobral@2
  5387
      $echo "$help" 1>&2
leo_sobral@2
  5388
      exit $EXIT_FAILURE
leo_sobral@2
  5389
    fi
leo_sobral@2
  5390
leo_sobral@2
  5391
    # Strip any trailing slash from the destination.
leo_sobral@2
  5392
    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
leo_sobral@2
  5393
leo_sobral@2
  5394
    # Check to see that the destination is a directory.
leo_sobral@2
  5395
    test -d "$dest" && isdir=yes
leo_sobral@2
  5396
    if test "$isdir" = yes; then
leo_sobral@2
  5397
      destdir="$dest"
leo_sobral@2
  5398
      destname=
leo_sobral@2
  5399
    else
leo_sobral@2
  5400
      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  5401
      test "X$destdir" = "X$dest" && destdir=.
leo_sobral@2
  5402
      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5403
leo_sobral@2
  5404
      # Not a directory, so check to see that there is only one file specified.
leo_sobral@2
  5405
      set dummy $files
leo_sobral@2
  5406
      if test "$#" -gt 2; then
leo_sobral@2
  5407
	$echo "$modename: \`$dest' is not a directory" 1>&2
leo_sobral@2
  5408
	$echo "$help" 1>&2
leo_sobral@2
  5409
	exit $EXIT_FAILURE
leo_sobral@2
  5410
      fi
leo_sobral@2
  5411
    fi
leo_sobral@2
  5412
    case $destdir in
leo_sobral@2
  5413
    [\\/]* | [A-Za-z]:[\\/]*) ;;
leo_sobral@2
  5414
    *)
leo_sobral@2
  5415
      for file in $files; do
leo_sobral@2
  5416
	case $file in
leo_sobral@2
  5417
	*.lo) ;;
leo_sobral@2
  5418
	*)
leo_sobral@2
  5419
	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
leo_sobral@2
  5420
	  $echo "$help" 1>&2
leo_sobral@2
  5421
	  exit $EXIT_FAILURE
leo_sobral@2
  5422
	  ;;
leo_sobral@2
  5423
	esac
leo_sobral@2
  5424
      done
leo_sobral@2
  5425
      ;;
leo_sobral@2
  5426
    esac
leo_sobral@2
  5427
leo_sobral@2
  5428
    # This variable tells wrapper scripts just to set variables rather
leo_sobral@2
  5429
    # than running their programs.
leo_sobral@2
  5430
    libtool_install_magic="$magic"
leo_sobral@2
  5431
leo_sobral@2
  5432
    staticlibs=
leo_sobral@2
  5433
    future_libdirs=
leo_sobral@2
  5434
    current_libdirs=
leo_sobral@2
  5435
    for file in $files; do
leo_sobral@2
  5436
leo_sobral@2
  5437
      # Do each installation.
leo_sobral@2
  5438
      case $file in
leo_sobral@2
  5439
      *.$libext)
leo_sobral@2
  5440
	# Do the static libraries later.
leo_sobral@2
  5441
	staticlibs="$staticlibs $file"
leo_sobral@2
  5442
	;;
leo_sobral@2
  5443
leo_sobral@2
  5444
      *.la)
leo_sobral@2
  5445
	# Check to see that this really is a libtool archive.
leo_sobral@2
  5446
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
leo_sobral@2
  5447
	else
leo_sobral@2
  5448
	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
leo_sobral@2
  5449
	  $echo "$help" 1>&2
leo_sobral@2
  5450
	  exit $EXIT_FAILURE
leo_sobral@2
  5451
	fi
leo_sobral@2
  5452
leo_sobral@2
  5453
	library_names=
leo_sobral@2
  5454
	old_library=
leo_sobral@2
  5455
	relink_command=
leo_sobral@2
  5456
	# If there is no directory component, then add one.
leo_sobral@2
  5457
	case $file in
leo_sobral@2
  5458
	*/* | *\\*) . $file ;;
leo_sobral@2
  5459
	*) . ./$file ;;
leo_sobral@2
  5460
	esac
leo_sobral@2
  5461
leo_sobral@2
  5462
	# Add the libdir to current_libdirs if it is the destination.
leo_sobral@2
  5463
	if test "X$destdir" = "X$libdir"; then
leo_sobral@2
  5464
	  case "$current_libdirs " in
leo_sobral@2
  5465
	  *" $libdir "*) ;;
leo_sobral@2
  5466
	  *) current_libdirs="$current_libdirs $libdir" ;;
leo_sobral@2
  5467
	  esac
leo_sobral@2
  5468
	else
leo_sobral@2
  5469
	  # Note the libdir as a future libdir.
leo_sobral@2
  5470
	  case "$future_libdirs " in
leo_sobral@2
  5471
	  *" $libdir "*) ;;
leo_sobral@2
  5472
	  *) future_libdirs="$future_libdirs $libdir" ;;
leo_sobral@2
  5473
	  esac
leo_sobral@2
  5474
	fi
leo_sobral@2
  5475
leo_sobral@2
  5476
	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
leo_sobral@2
  5477
	test "X$dir" = "X$file/" && dir=
leo_sobral@2
  5478
	dir="$dir$objdir"
leo_sobral@2
  5479
leo_sobral@2
  5480
	if test -n "$relink_command"; then
leo_sobral@2
  5481
	  # Determine the prefix the user has applied to our future dir.
leo_sobral@2
  5482
	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
leo_sobral@2
  5483
leo_sobral@2
  5484
	  # Don't allow the user to place us outside of our expected
leo_sobral@2
  5485
	  # location b/c this prevents finding dependent libraries that
leo_sobral@2
  5486
	  # are installed to the same prefix.
leo_sobral@2
  5487
	  # At present, this check doesn't affect windows .dll's that
leo_sobral@2
  5488
	  # are installed into $libdir/../bin (currently, that works fine)
leo_sobral@2
  5489
	  # but it's something to keep an eye on.
leo_sobral@2
  5490
	  if test "$inst_prefix_dir" = "$destdir"; then
leo_sobral@2
  5491
	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
leo_sobral@2
  5492
	    exit $EXIT_FAILURE
leo_sobral@2
  5493
	  fi
leo_sobral@2
  5494
leo_sobral@2
  5495
	  if test -n "$inst_prefix_dir"; then
leo_sobral@2
  5496
	    # Stick the inst_prefix_dir data into the link command.
leo_sobral@2
  5497
	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
leo_sobral@2
  5498
	  else
leo_sobral@2
  5499
	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
leo_sobral@2
  5500
	  fi
leo_sobral@2
  5501
leo_sobral@2
  5502
	  $echo "$modename: warning: relinking \`$file'" 1>&2
leo_sobral@2
  5503
	  $show "$relink_command"
leo_sobral@2
  5504
	  if $run eval "$relink_command"; then :
leo_sobral@2
  5505
	  else
leo_sobral@2
  5506
	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
leo_sobral@2
  5507
	    exit $EXIT_FAILURE
leo_sobral@2
  5508
	  fi
leo_sobral@2
  5509
	fi
leo_sobral@2
  5510
leo_sobral@2
  5511
	# See the names of the shared library.
leo_sobral@2
  5512
	set dummy $library_names
leo_sobral@2
  5513
	if test -n "$2"; then
leo_sobral@2
  5514
	  realname="$2"
leo_sobral@2
  5515
	  shift
leo_sobral@2
  5516
	  shift
leo_sobral@2
  5517
leo_sobral@2
  5518
	  srcname="$realname"
leo_sobral@2
  5519
	  test -n "$relink_command" && srcname="$realname"T
leo_sobral@2
  5520
leo_sobral@2
  5521
	  # Install the shared library and build the symlinks.
leo_sobral@2
  5522
	  $show "$install_prog $dir/$srcname $destdir/$realname"
leo_sobral@2
  5523
	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
leo_sobral@2
  5524
	  if test -n "$stripme" && test -n "$striplib"; then
leo_sobral@2
  5525
	    $show "$striplib $destdir/$realname"
leo_sobral@2
  5526
	    $run eval "$striplib $destdir/$realname" || exit $?
leo_sobral@2
  5527
	  fi
leo_sobral@2
  5528
leo_sobral@2
  5529
	  if test "$#" -gt 0; then
leo_sobral@2
  5530
	    # Delete the old symlinks, and create new ones.
leo_sobral@2
  5531
	    for linkname
leo_sobral@2
  5532
	    do
leo_sobral@2
  5533
	      if test "$linkname" != "$realname"; then
leo_sobral@2
  5534
		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
leo_sobral@2
  5535
		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
leo_sobral@2
  5536
	      fi
leo_sobral@2
  5537
	    done
leo_sobral@2
  5538
	  fi
leo_sobral@2
  5539
leo_sobral@2
  5540
	  # Do each command in the postinstall commands.
leo_sobral@2
  5541
	  lib="$destdir/$realname"
leo_sobral@2
  5542
	  cmds=$postinstall_cmds
leo_sobral@2
  5543
	  save_ifs="$IFS"; IFS='~'
leo_sobral@2
  5544
	  for cmd in $cmds; do
leo_sobral@2
  5545
	    IFS="$save_ifs"
leo_sobral@2
  5546
	    eval cmd=\"$cmd\"
leo_sobral@2
  5547
	    $show "$cmd"
leo_sobral@2
  5548
	    $run eval "$cmd" || exit $?
leo_sobral@2
  5549
	  done
leo_sobral@2
  5550
	  IFS="$save_ifs"
leo_sobral@2
  5551
	fi
leo_sobral@2
  5552
leo_sobral@2
  5553
	# Install the pseudo-library for information purposes.
leo_sobral@2
  5554
	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5555
	instname="$dir/$name"i
leo_sobral@2
  5556
	$show "$install_prog $instname $destdir/$name"
leo_sobral@2
  5557
	$run eval "$install_prog $instname $destdir/$name" || exit $?
leo_sobral@2
  5558
leo_sobral@2
  5559
	# Maybe install the static library, too.
leo_sobral@2
  5560
	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
leo_sobral@2
  5561
	;;
leo_sobral@2
  5562
leo_sobral@2
  5563
      *.lo)
leo_sobral@2
  5564
	# Install (i.e. copy) a libtool object.
leo_sobral@2
  5565
leo_sobral@2
  5566
	# Figure out destination file name, if it wasn't already specified.
leo_sobral@2
  5567
	if test -n "$destname"; then
leo_sobral@2
  5568
	  destfile="$destdir/$destname"
leo_sobral@2
  5569
	else
leo_sobral@2
  5570
	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5571
	  destfile="$destdir/$destfile"
leo_sobral@2
  5572
	fi
leo_sobral@2
  5573
leo_sobral@2
  5574
	# Deduce the name of the destination old-style object file.
leo_sobral@2
  5575
	case $destfile in
leo_sobral@2
  5576
	*.lo)
leo_sobral@2
  5577
	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
leo_sobral@2
  5578
	  ;;
leo_sobral@2
  5579
	*.$objext)
leo_sobral@2
  5580
	  staticdest="$destfile"
leo_sobral@2
  5581
	  destfile=
leo_sobral@2
  5582
	  ;;
leo_sobral@2
  5583
	*)
leo_sobral@2
  5584
	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
leo_sobral@2
  5585
	  $echo "$help" 1>&2
leo_sobral@2
  5586
	  exit $EXIT_FAILURE
leo_sobral@2
  5587
	  ;;
leo_sobral@2
  5588
	esac
leo_sobral@2
  5589
leo_sobral@2
  5590
	# Install the libtool object if requested.
leo_sobral@2
  5591
	if test -n "$destfile"; then
leo_sobral@2
  5592
	  $show "$install_prog $file $destfile"
leo_sobral@2
  5593
	  $run eval "$install_prog $file $destfile" || exit $?
leo_sobral@2
  5594
	fi
leo_sobral@2
  5595
leo_sobral@2
  5596
	# Install the old object if enabled.
leo_sobral@2
  5597
	if test "$build_old_libs" = yes; then
leo_sobral@2
  5598
	  # Deduce the name of the old-style object file.
leo_sobral@2
  5599
	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
leo_sobral@2
  5600
leo_sobral@2
  5601
	  $show "$install_prog $staticobj $staticdest"
leo_sobral@2
  5602
	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
leo_sobral@2
  5603
	fi
leo_sobral@2
  5604
	exit $EXIT_SUCCESS
leo_sobral@2
  5605
	;;
leo_sobral@2
  5606
leo_sobral@2
  5607
      *)
leo_sobral@2
  5608
	# Figure out destination file name, if it wasn't already specified.
leo_sobral@2
  5609
	if test -n "$destname"; then
leo_sobral@2
  5610
	  destfile="$destdir/$destname"
leo_sobral@2
  5611
	else
leo_sobral@2
  5612
	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5613
	  destfile="$destdir/$destfile"
leo_sobral@2
  5614
	fi
leo_sobral@2
  5615
leo_sobral@2
  5616
	# If the file is missing, and there is a .exe on the end, strip it
leo_sobral@2
  5617
	# because it is most likely a libtool script we actually want to
leo_sobral@2
  5618
	# install
leo_sobral@2
  5619
	stripped_ext=""
leo_sobral@2
  5620
	case $file in
leo_sobral@2
  5621
	  *.exe)
leo_sobral@2
  5622
	    if test ! -f "$file"; then
leo_sobral@2
  5623
	      file=`$echo $file|${SED} 's,.exe$,,'`
leo_sobral@2
  5624
	      stripped_ext=".exe"
leo_sobral@2
  5625
	    fi
leo_sobral@2
  5626
	    ;;
leo_sobral@2
  5627
	esac
leo_sobral@2
  5628
leo_sobral@2
  5629
	# Do a test to see if this is really a libtool program.
leo_sobral@2
  5630
	case $host in
leo_sobral@2
  5631
	*cygwin*|*mingw*)
leo_sobral@2
  5632
	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
leo_sobral@2
  5633
	    ;;
leo_sobral@2
  5634
	*)
leo_sobral@2
  5635
	    wrapper=$file
leo_sobral@2
  5636
	    ;;
leo_sobral@2
  5637
	esac
leo_sobral@2
  5638
	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
leo_sobral@2
  5639
	  notinst_deplibs=
leo_sobral@2
  5640
	  relink_command=
leo_sobral@2
  5641
leo_sobral@2
  5642
	  # To insure that "foo" is sourced, and not "foo.exe",
leo_sobral@2
  5643
	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
leo_sobral@2
  5644
	  # which disallows the automatic-append-.exe behavior.
leo_sobral@2
  5645
	  case $build in
leo_sobral@2
  5646
	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
leo_sobral@2
  5647
	  *) wrapperdot=${wrapper} ;;
leo_sobral@2
  5648
	  esac
leo_sobral@2
  5649
	  # If there is no directory component, then add one.
leo_sobral@2
  5650
	  case $file in
leo_sobral@2
  5651
	  */* | *\\*) . ${wrapperdot} ;;
leo_sobral@2
  5652
	  *) . ./${wrapperdot} ;;
leo_sobral@2
  5653
	  esac
leo_sobral@2
  5654
leo_sobral@2
  5655
	  # Check the variables that should have been set.
leo_sobral@2
  5656
	  if test -z "$notinst_deplibs"; then
leo_sobral@2
  5657
	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
leo_sobral@2
  5658
	    exit $EXIT_FAILURE
leo_sobral@2
  5659
	  fi
leo_sobral@2
  5660
leo_sobral@2
  5661
	  finalize=yes
leo_sobral@2
  5662
	  for lib in $notinst_deplibs; do
leo_sobral@2
  5663
	    # Check to see that each library is installed.
leo_sobral@2
  5664
	    libdir=
leo_sobral@2
  5665
	    if test -f "$lib"; then
leo_sobral@2
  5666
	      # If there is no directory component, then add one.
leo_sobral@2
  5667
	      case $lib in
leo_sobral@2
  5668
	      */* | *\\*) . $lib ;;
leo_sobral@2
  5669
	      *) . ./$lib ;;
leo_sobral@2
  5670
	      esac
leo_sobral@2
  5671
	    fi
leo_sobral@2
  5672
	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
leo_sobral@2
  5673
	    if test -n "$libdir" && test ! -f "$libfile"; then
leo_sobral@2
  5674
	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
leo_sobral@2
  5675
	      finalize=no
leo_sobral@2
  5676
	    fi
leo_sobral@2
  5677
	  done
leo_sobral@2
  5678
leo_sobral@2
  5679
	  relink_command=
leo_sobral@2
  5680
	  # To insure that "foo" is sourced, and not "foo.exe",
leo_sobral@2
  5681
	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
leo_sobral@2
  5682
	  # which disallows the automatic-append-.exe behavior.
leo_sobral@2
  5683
	  case $build in
leo_sobral@2
  5684
	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
leo_sobral@2
  5685
	  *) wrapperdot=${wrapper} ;;
leo_sobral@2
  5686
	  esac
leo_sobral@2
  5687
	  # If there is no directory component, then add one.
leo_sobral@2
  5688
	  case $file in
leo_sobral@2
  5689
	  */* | *\\*) . ${wrapperdot} ;;
leo_sobral@2
  5690
	  *) . ./${wrapperdot} ;;
leo_sobral@2
  5691
	  esac
leo_sobral@2
  5692
leo_sobral@2
  5693
	  outputname=
leo_sobral@2
  5694
	  if test "$fast_install" = no && test -n "$relink_command"; then
leo_sobral@2
  5695
	    if test "$finalize" = yes && test -z "$run"; then
leo_sobral@2
  5696
	      tmpdir="/tmp"
leo_sobral@2
  5697
	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
leo_sobral@2
  5698
	      tmpdir="$tmpdir/libtool-$$"
leo_sobral@2
  5699
	      save_umask=`umask`
leo_sobral@2
  5700
	      umask 0077
leo_sobral@2
  5701
	      if $mkdir "$tmpdir"; then
leo_sobral@2
  5702
	        umask $save_umask
leo_sobral@2
  5703
	      else
leo_sobral@2
  5704
	        umask $save_umask
leo_sobral@2
  5705
		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
leo_sobral@2
  5706
		continue
leo_sobral@2
  5707
	      fi
leo_sobral@2
  5708
	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5709
	      outputname="$tmpdir/$file"
leo_sobral@2
  5710
	      # Replace the output file specification.
leo_sobral@2
  5711
	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
leo_sobral@2
  5712
leo_sobral@2
  5713
	      $show "$relink_command"
leo_sobral@2
  5714
	      if $run eval "$relink_command"; then :
leo_sobral@2
  5715
	      else
leo_sobral@2
  5716
		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
leo_sobral@2
  5717
		${rm}r "$tmpdir"
leo_sobral@2
  5718
		continue
leo_sobral@2
  5719
	      fi
leo_sobral@2
  5720
	      file="$outputname"
leo_sobral@2
  5721
	    else
leo_sobral@2
  5722
	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
leo_sobral@2
  5723
	    fi
leo_sobral@2
  5724
	  else
leo_sobral@2
  5725
	    # Install the binary that we compiled earlier.
leo_sobral@2
  5726
	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
leo_sobral@2
  5727
	  fi
leo_sobral@2
  5728
	fi
leo_sobral@2
  5729
leo_sobral@2
  5730
	# remove .exe since cygwin /usr/bin/install will append another
leo_sobral@2
  5731
	# one anyways
leo_sobral@2
  5732
	case $install_prog,$host in
leo_sobral@2
  5733
	*/usr/bin/install*,*cygwin*)
leo_sobral@2
  5734
	  case $file:$destfile in
leo_sobral@2
  5735
	  *.exe:*.exe)
leo_sobral@2
  5736
	    # this is ok
leo_sobral@2
  5737
	    ;;
leo_sobral@2
  5738
	  *.exe:*)
leo_sobral@2
  5739
	    destfile=$destfile.exe
leo_sobral@2
  5740
	    ;;
leo_sobral@2
  5741
	  *:*.exe)
leo_sobral@2
  5742
	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
leo_sobral@2
  5743
	    ;;
leo_sobral@2
  5744
	  esac
leo_sobral@2
  5745
	  ;;
leo_sobral@2
  5746
	esac
leo_sobral@2
  5747
	$show "$install_prog$stripme $file $destfile"
leo_sobral@2
  5748
	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
leo_sobral@2
  5749
	test -n "$outputname" && ${rm}r "$tmpdir"
leo_sobral@2
  5750
	;;
leo_sobral@2
  5751
      esac
leo_sobral@2
  5752
    done
leo_sobral@2
  5753
leo_sobral@2
  5754
    for file in $staticlibs; do
leo_sobral@2
  5755
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  5756
leo_sobral@2
  5757
      # Set up the ranlib parameters.
leo_sobral@2
  5758
      oldlib="$destdir/$name"
leo_sobral@2
  5759
leo_sobral@2
  5760
      $show "$install_prog $file $oldlib"
leo_sobral@2
  5761
      $run eval "$install_prog \$file \$oldlib" || exit $?
leo_sobral@2
  5762
leo_sobral@2
  5763
      if test -n "$stripme" && test -n "$old_striplib"; then
leo_sobral@2
  5764
	$show "$old_striplib $oldlib"
leo_sobral@2
  5765
	$run eval "$old_striplib $oldlib" || exit $?
leo_sobral@2
  5766
      fi
leo_sobral@2
  5767
leo_sobral@2
  5768
      # Do each command in the postinstall commands.
leo_sobral@2
  5769
      cmds=$old_postinstall_cmds
leo_sobral@2
  5770
      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  5771
      for cmd in $cmds; do
leo_sobral@2
  5772
	IFS="$save_ifs"
leo_sobral@2
  5773
	eval cmd=\"$cmd\"
leo_sobral@2
  5774
	$show "$cmd"
leo_sobral@2
  5775
	$run eval "$cmd" || exit $?
leo_sobral@2
  5776
      done
leo_sobral@2
  5777
      IFS="$save_ifs"
leo_sobral@2
  5778
    done
leo_sobral@2
  5779
leo_sobral@2
  5780
    if test -n "$future_libdirs"; then
leo_sobral@2
  5781
      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
leo_sobral@2
  5782
    fi
leo_sobral@2
  5783
leo_sobral@2
  5784
    if test -n "$current_libdirs"; then
leo_sobral@2
  5785
      # Maybe just do a dry run.
leo_sobral@2
  5786
      test -n "$run" && current_libdirs=" -n$current_libdirs"
leo_sobral@2
  5787
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
leo_sobral@2
  5788
    else
leo_sobral@2
  5789
      exit $EXIT_SUCCESS
leo_sobral@2
  5790
    fi
leo_sobral@2
  5791
    ;;
leo_sobral@2
  5792
leo_sobral@2
  5793
  # libtool finish mode
leo_sobral@2
  5794
  finish)
leo_sobral@2
  5795
    modename="$modename: finish"
leo_sobral@2
  5796
    libdirs="$nonopt"
leo_sobral@2
  5797
    admincmds=
leo_sobral@2
  5798
leo_sobral@2
  5799
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
leo_sobral@2
  5800
      for dir
leo_sobral@2
  5801
      do
leo_sobral@2
  5802
	libdirs="$libdirs $dir"
leo_sobral@2
  5803
      done
leo_sobral@2
  5804
leo_sobral@2
  5805
      for libdir in $libdirs; do
leo_sobral@2
  5806
	if test -n "$finish_cmds"; then
leo_sobral@2
  5807
	  # Do each command in the finish commands.
leo_sobral@2
  5808
	  cmds=$finish_cmds
leo_sobral@2
  5809
	  save_ifs="$IFS"; IFS='~'
leo_sobral@2
  5810
	  for cmd in $cmds; do
leo_sobral@2
  5811
	    IFS="$save_ifs"
leo_sobral@2
  5812
	    eval cmd=\"$cmd\"
leo_sobral@2
  5813
	    $show "$cmd"
leo_sobral@2
  5814
	    $run eval "$cmd" || admincmds="$admincmds
leo_sobral@2
  5815
       $cmd"
leo_sobral@2
  5816
	  done
leo_sobral@2
  5817
	  IFS="$save_ifs"
leo_sobral@2
  5818
	fi
leo_sobral@2
  5819
	if test -n "$finish_eval"; then
leo_sobral@2
  5820
	  # Do the single finish_eval.
leo_sobral@2
  5821
	  eval cmds=\"$finish_eval\"
leo_sobral@2
  5822
	  $run eval "$cmds" || admincmds="$admincmds
leo_sobral@2
  5823
       $cmds"
leo_sobral@2
  5824
	fi
leo_sobral@2
  5825
      done
leo_sobral@2
  5826
    fi
leo_sobral@2
  5827
leo_sobral@2
  5828
    # Exit here if they wanted silent mode.
leo_sobral@2
  5829
    test "$show" = : && exit $EXIT_SUCCESS
leo_sobral@2
  5830
leo_sobral@2
  5831
    $echo "----------------------------------------------------------------------"
leo_sobral@2
  5832
    $echo "Libraries have been installed in:"
leo_sobral@2
  5833
    for libdir in $libdirs; do
leo_sobral@2
  5834
      $echo "   $libdir"
leo_sobral@2
  5835
    done
leo_sobral@2
  5836
    $echo
leo_sobral@2
  5837
    $echo "If you ever happen to want to link against installed libraries"
leo_sobral@2
  5838
    $echo "in a given directory, LIBDIR, you must either use libtool, and"
leo_sobral@2
  5839
    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
leo_sobral@2
  5840
    $echo "flag during linking and do at least one of the following:"
leo_sobral@2
  5841
    if test -n "$shlibpath_var"; then
leo_sobral@2
  5842
      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
leo_sobral@2
  5843
      $echo "     during execution"
leo_sobral@2
  5844
    fi
leo_sobral@2
  5845
    if test -n "$runpath_var"; then
leo_sobral@2
  5846
      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
leo_sobral@2
  5847
      $echo "     during linking"
leo_sobral@2
  5848
    fi
leo_sobral@2
  5849
    if test -n "$hardcode_libdir_flag_spec"; then
leo_sobral@2
  5850
      libdir=LIBDIR
leo_sobral@2
  5851
      eval flag=\"$hardcode_libdir_flag_spec\"
leo_sobral@2
  5852
leo_sobral@2
  5853
      $echo "   - use the \`$flag' linker flag"
leo_sobral@2
  5854
    fi
leo_sobral@2
  5855
    if test -n "$admincmds"; then
leo_sobral@2
  5856
      $echo "   - have your system administrator run these commands:$admincmds"
leo_sobral@2
  5857
    fi
leo_sobral@2
  5858
    if test -f /etc/ld.so.conf; then
leo_sobral@2
  5859
      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
leo_sobral@2
  5860
    fi
leo_sobral@2
  5861
    $echo
leo_sobral@2
  5862
    $echo "See any operating system documentation about shared libraries for"
leo_sobral@2
  5863
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
leo_sobral@2
  5864
    $echo "----------------------------------------------------------------------"
leo_sobral@2
  5865
    exit $EXIT_SUCCESS
leo_sobral@2
  5866
    ;;
leo_sobral@2
  5867
leo_sobral@2
  5868
  # libtool execute mode
leo_sobral@2
  5869
  execute)
leo_sobral@2
  5870
    modename="$modename: execute"
leo_sobral@2
  5871
leo_sobral@2
  5872
    # The first argument is the command name.
leo_sobral@2
  5873
    cmd="$nonopt"
leo_sobral@2
  5874
    if test -z "$cmd"; then
leo_sobral@2
  5875
      $echo "$modename: you must specify a COMMAND" 1>&2
leo_sobral@2
  5876
      $echo "$help"
leo_sobral@2
  5877
      exit $EXIT_FAILURE
leo_sobral@2
  5878
    fi
leo_sobral@2
  5879
leo_sobral@2
  5880
    # Handle -dlopen flags immediately.
leo_sobral@2
  5881
    for file in $execute_dlfiles; do
leo_sobral@2
  5882
      if test ! -f "$file"; then
leo_sobral@2
  5883
	$echo "$modename: \`$file' is not a file" 1>&2
leo_sobral@2
  5884
	$echo "$help" 1>&2
leo_sobral@2
  5885
	exit $EXIT_FAILURE
leo_sobral@2
  5886
      fi
leo_sobral@2
  5887
leo_sobral@2
  5888
      dir=
leo_sobral@2
  5889
      case $file in
leo_sobral@2
  5890
      *.la)
leo_sobral@2
  5891
	# Check to see that this really is a libtool archive.
leo_sobral@2
  5892
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
leo_sobral@2
  5893
	else
leo_sobral@2
  5894
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
leo_sobral@2
  5895
	  $echo "$help" 1>&2
leo_sobral@2
  5896
	  exit $EXIT_FAILURE
leo_sobral@2
  5897
	fi
leo_sobral@2
  5898
leo_sobral@2
  5899
	# Read the libtool library.
leo_sobral@2
  5900
	dlname=
leo_sobral@2
  5901
	library_names=
leo_sobral@2
  5902
leo_sobral@2
  5903
	# If there is no directory component, then add one.
leo_sobral@2
  5904
	case $file in
leo_sobral@2
  5905
	*/* | *\\*) . $file ;;
leo_sobral@2
  5906
	*) . ./$file ;;
leo_sobral@2
  5907
	esac
leo_sobral@2
  5908
leo_sobral@2
  5909
	# Skip this library if it cannot be dlopened.
leo_sobral@2
  5910
	if test -z "$dlname"; then
leo_sobral@2
  5911
	  # Warn if it was a shared library.
leo_sobral@2
  5912
	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
leo_sobral@2
  5913
	  continue
leo_sobral@2
  5914
	fi
leo_sobral@2
  5915
leo_sobral@2
  5916
	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  5917
	test "X$dir" = "X$file" && dir=.
leo_sobral@2
  5918
leo_sobral@2
  5919
	if test -f "$dir/$objdir/$dlname"; then
leo_sobral@2
  5920
	  dir="$dir/$objdir"
leo_sobral@2
  5921
	else
leo_sobral@2
  5922
	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
leo_sobral@2
  5923
	  exit $EXIT_FAILURE
leo_sobral@2
  5924
	fi
leo_sobral@2
  5925
	;;
leo_sobral@2
  5926
leo_sobral@2
  5927
      *.lo)
leo_sobral@2
  5928
	# Just add the directory containing the .lo file.
leo_sobral@2
  5929
	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  5930
	test "X$dir" = "X$file" && dir=.
leo_sobral@2
  5931
	;;
leo_sobral@2
  5932
leo_sobral@2
  5933
      *)
leo_sobral@2
  5934
	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
leo_sobral@2
  5935
	continue
leo_sobral@2
  5936
	;;
leo_sobral@2
  5937
      esac
leo_sobral@2
  5938
leo_sobral@2
  5939
      # Get the absolute pathname.
leo_sobral@2
  5940
      absdir=`cd "$dir" && pwd`
leo_sobral@2
  5941
      test -n "$absdir" && dir="$absdir"
leo_sobral@2
  5942
leo_sobral@2
  5943
      # Now add the directory to shlibpath_var.
leo_sobral@2
  5944
      if eval "test -z \"\$$shlibpath_var\""; then
leo_sobral@2
  5945
	eval "$shlibpath_var=\"\$dir\""
leo_sobral@2
  5946
      else
leo_sobral@2
  5947
	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
leo_sobral@2
  5948
      fi
leo_sobral@2
  5949
    done
leo_sobral@2
  5950
leo_sobral@2
  5951
    # This variable tells wrapper scripts just to set shlibpath_var
leo_sobral@2
  5952
    # rather than running their programs.
leo_sobral@2
  5953
    libtool_execute_magic="$magic"
leo_sobral@2
  5954
leo_sobral@2
  5955
    # Check if any of the arguments is a wrapper script.
leo_sobral@2
  5956
    args=
leo_sobral@2
  5957
    for file
leo_sobral@2
  5958
    do
leo_sobral@2
  5959
      case $file in
leo_sobral@2
  5960
      -*) ;;
leo_sobral@2
  5961
      *)
leo_sobral@2
  5962
	# Do a test to see if this is really a libtool program.
leo_sobral@2
  5963
	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  5964
	  # If there is no directory component, then add one.
leo_sobral@2
  5965
	  case $file in
leo_sobral@2
  5966
	  */* | *\\*) . $file ;;
leo_sobral@2
  5967
	  *) . ./$file ;;
leo_sobral@2
  5968
	  esac
leo_sobral@2
  5969
leo_sobral@2
  5970
	  # Transform arg to wrapped name.
leo_sobral@2
  5971
	  file="$progdir/$program"
leo_sobral@2
  5972
	fi
leo_sobral@2
  5973
	;;
leo_sobral@2
  5974
      esac
leo_sobral@2
  5975
      # Quote arguments (to preserve shell metacharacters).
leo_sobral@2
  5976
      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
leo_sobral@2
  5977
      args="$args \"$file\""
leo_sobral@2
  5978
    done
leo_sobral@2
  5979
leo_sobral@2
  5980
    if test -z "$run"; then
leo_sobral@2
  5981
      if test -n "$shlibpath_var"; then
leo_sobral@2
  5982
	# Export the shlibpath_var.
leo_sobral@2
  5983
	eval "export $shlibpath_var"
leo_sobral@2
  5984
      fi
leo_sobral@2
  5985
leo_sobral@2
  5986
      # Restore saved environment variables
leo_sobral@2
  5987
      if test "${save_LC_ALL+set}" = set; then
leo_sobral@2
  5988
	LC_ALL="$save_LC_ALL"; export LC_ALL
leo_sobral@2
  5989
      fi
leo_sobral@2
  5990
      if test "${save_LANG+set}" = set; then
leo_sobral@2
  5991
	LANG="$save_LANG"; export LANG
leo_sobral@2
  5992
      fi
leo_sobral@2
  5993
leo_sobral@2
  5994
      # Now prepare to actually exec the command.
leo_sobral@2
  5995
      exec_cmd="\$cmd$args"
leo_sobral@2
  5996
    else
leo_sobral@2
  5997
      # Display what would be done.
leo_sobral@2
  5998
      if test -n "$shlibpath_var"; then
leo_sobral@2
  5999
	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
leo_sobral@2
  6000
	$echo "export $shlibpath_var"
leo_sobral@2
  6001
      fi
leo_sobral@2
  6002
      $echo "$cmd$args"
leo_sobral@2
  6003
      exit $EXIT_SUCCESS
leo_sobral@2
  6004
    fi
leo_sobral@2
  6005
    ;;
leo_sobral@2
  6006
leo_sobral@2
  6007
  # libtool clean and uninstall mode
leo_sobral@2
  6008
  clean | uninstall)
leo_sobral@2
  6009
    modename="$modename: $mode"
leo_sobral@2
  6010
    rm="$nonopt"
leo_sobral@2
  6011
    files=
leo_sobral@2
  6012
    rmforce=
leo_sobral@2
  6013
    exit_status=0
leo_sobral@2
  6014
leo_sobral@2
  6015
    # This variable tells wrapper scripts just to set variables rather
leo_sobral@2
  6016
    # than running their programs.
leo_sobral@2
  6017
    libtool_install_magic="$magic"
leo_sobral@2
  6018
leo_sobral@2
  6019
    for arg
leo_sobral@2
  6020
    do
leo_sobral@2
  6021
      case $arg in
leo_sobral@2
  6022
      -f) rm="$rm $arg"; rmforce=yes ;;
leo_sobral@2
  6023
      -*) rm="$rm $arg" ;;
leo_sobral@2
  6024
      *) files="$files $arg" ;;
leo_sobral@2
  6025
      esac
leo_sobral@2
  6026
    done
leo_sobral@2
  6027
leo_sobral@2
  6028
    if test -z "$rm"; then
leo_sobral@2
  6029
      $echo "$modename: you must specify an RM program" 1>&2
leo_sobral@2
  6030
      $echo "$help" 1>&2
leo_sobral@2
  6031
      exit $EXIT_FAILURE
leo_sobral@2
  6032
    fi
leo_sobral@2
  6033
leo_sobral@2
  6034
    rmdirs=
leo_sobral@2
  6035
leo_sobral@2
  6036
    origobjdir="$objdir"
leo_sobral@2
  6037
    for file in $files; do
leo_sobral@2
  6038
      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
leo_sobral@2
  6039
      if test "X$dir" = "X$file"; then
leo_sobral@2
  6040
	dir=.
leo_sobral@2
  6041
	objdir="$origobjdir"
leo_sobral@2
  6042
      else
leo_sobral@2
  6043
	objdir="$dir/$origobjdir"
leo_sobral@2
  6044
      fi
leo_sobral@2
  6045
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
leo_sobral@2
  6046
      test "$mode" = uninstall && objdir="$dir"
leo_sobral@2
  6047
leo_sobral@2
  6048
      # Remember objdir for removal later, being careful to avoid duplicates
leo_sobral@2
  6049
      if test "$mode" = clean; then
leo_sobral@2
  6050
	case " $rmdirs " in
leo_sobral@2
  6051
	  *" $objdir "*) ;;
leo_sobral@2
  6052
	  *) rmdirs="$rmdirs $objdir" ;;
leo_sobral@2
  6053
	esac
leo_sobral@2
  6054
      fi
leo_sobral@2
  6055
leo_sobral@2
  6056
      # Don't error if the file doesn't exist and rm -f was used.
leo_sobral@2
  6057
      if (test -L "$file") >/dev/null 2>&1 \
leo_sobral@2
  6058
	|| (test -h "$file") >/dev/null 2>&1 \
leo_sobral@2
  6059
	|| test -f "$file"; then
leo_sobral@2
  6060
	:
leo_sobral@2
  6061
      elif test -d "$file"; then
leo_sobral@2
  6062
	exit_status=1
leo_sobral@2
  6063
	continue
leo_sobral@2
  6064
      elif test "$rmforce" = yes; then
leo_sobral@2
  6065
	continue
leo_sobral@2
  6066
      fi
leo_sobral@2
  6067
leo_sobral@2
  6068
      rmfiles="$file"
leo_sobral@2
  6069
leo_sobral@2
  6070
      case $name in
leo_sobral@2
  6071
      *.la)
leo_sobral@2
  6072
	# Possibly a libtool archive, so verify it.
leo_sobral@2
  6073
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  6074
	  . $dir/$name
leo_sobral@2
  6075
leo_sobral@2
  6076
	  # Delete the libtool libraries and symlinks.
leo_sobral@2
  6077
	  for n in $library_names; do
leo_sobral@2
  6078
	    rmfiles="$rmfiles $objdir/$n"
leo_sobral@2
  6079
	  done
leo_sobral@2
  6080
	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
leo_sobral@2
  6081
	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
leo_sobral@2
  6082
leo_sobral@2
  6083
	  if test "$mode" = uninstall; then
leo_sobral@2
  6084
	    if test -n "$library_names"; then
leo_sobral@2
  6085
	      # Do each command in the postuninstall commands.
leo_sobral@2
  6086
	      cmds=$postuninstall_cmds
leo_sobral@2
  6087
	      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  6088
	      for cmd in $cmds; do
leo_sobral@2
  6089
		IFS="$save_ifs"
leo_sobral@2
  6090
		eval cmd=\"$cmd\"
leo_sobral@2
  6091
		$show "$cmd"
leo_sobral@2
  6092
		$run eval "$cmd"
leo_sobral@2
  6093
		if test "$?" -ne 0 && test "$rmforce" != yes; then
leo_sobral@2
  6094
		  exit_status=1
leo_sobral@2
  6095
		fi
leo_sobral@2
  6096
	      done
leo_sobral@2
  6097
	      IFS="$save_ifs"
leo_sobral@2
  6098
	    fi
leo_sobral@2
  6099
leo_sobral@2
  6100
	    if test -n "$old_library"; then
leo_sobral@2
  6101
	      # Do each command in the old_postuninstall commands.
leo_sobral@2
  6102
	      cmds=$old_postuninstall_cmds
leo_sobral@2
  6103
	      save_ifs="$IFS"; IFS='~'
leo_sobral@2
  6104
	      for cmd in $cmds; do
leo_sobral@2
  6105
		IFS="$save_ifs"
leo_sobral@2
  6106
		eval cmd=\"$cmd\"
leo_sobral@2
  6107
		$show "$cmd"
leo_sobral@2
  6108
		$run eval "$cmd"
leo_sobral@2
  6109
		if test "$?" -ne 0 && test "$rmforce" != yes; then
leo_sobral@2
  6110
		  exit_status=1
leo_sobral@2
  6111
		fi
leo_sobral@2
  6112
	      done
leo_sobral@2
  6113
	      IFS="$save_ifs"
leo_sobral@2
  6114
	    fi
leo_sobral@2
  6115
	    # FIXME: should reinstall the best remaining shared library.
leo_sobral@2
  6116
	  fi
leo_sobral@2
  6117
	fi
leo_sobral@2
  6118
	;;
leo_sobral@2
  6119
leo_sobral@2
  6120
      *.lo)
leo_sobral@2
  6121
	# Possibly a libtool object, so verify it.
leo_sobral@2
  6122
	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  6123
leo_sobral@2
  6124
	  # Read the .lo file
leo_sobral@2
  6125
	  . $dir/$name
leo_sobral@2
  6126
leo_sobral@2
  6127
	  # Add PIC object to the list of files to remove.
leo_sobral@2
  6128
	  if test -n "$pic_object" \
leo_sobral@2
  6129
	     && test "$pic_object" != none; then
leo_sobral@2
  6130
	    rmfiles="$rmfiles $dir/$pic_object"
leo_sobral@2
  6131
	  fi
leo_sobral@2
  6132
leo_sobral@2
  6133
	  # Add non-PIC object to the list of files to remove.
leo_sobral@2
  6134
	  if test -n "$non_pic_object" \
leo_sobral@2
  6135
	     && test "$non_pic_object" != none; then
leo_sobral@2
  6136
	    rmfiles="$rmfiles $dir/$non_pic_object"
leo_sobral@2
  6137
	  fi
leo_sobral@2
  6138
	fi
leo_sobral@2
  6139
	;;
leo_sobral@2
  6140
leo_sobral@2
  6141
      *)
leo_sobral@2
  6142
	if test "$mode" = clean ; then
leo_sobral@2
  6143
	  noexename=$name
leo_sobral@2
  6144
	  case $file in
leo_sobral@2
  6145
	  *.exe)
leo_sobral@2
  6146
	    file=`$echo $file|${SED} 's,.exe$,,'`
leo_sobral@2
  6147
	    noexename=`$echo $name|${SED} 's,.exe$,,'`
leo_sobral@2
  6148
	    # $file with .exe has already been added to rmfiles,
leo_sobral@2
  6149
	    # add $file without .exe
leo_sobral@2
  6150
	    rmfiles="$rmfiles $file"
leo_sobral@2
  6151
	    ;;
leo_sobral@2
  6152
	  esac
leo_sobral@2
  6153
	  # Do a test to see if this is a libtool program.
leo_sobral@2
  6154
	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
leo_sobral@2
  6155
	    relink_command=
leo_sobral@2
  6156
	    . $dir/$noexename
leo_sobral@2
  6157
leo_sobral@2
  6158
	    # note $name still contains .exe if it was in $file originally
leo_sobral@2
  6159
	    # as does the version of $file that was added into $rmfiles
leo_sobral@2
  6160
	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
leo_sobral@2
  6161
	    if test "$fast_install" = yes && test -n "$relink_command"; then
leo_sobral@2
  6162
	      rmfiles="$rmfiles $objdir/lt-$name"
leo_sobral@2
  6163
	    fi
leo_sobral@2
  6164
	    if test "X$noexename" != "X$name" ; then
leo_sobral@2
  6165
	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
leo_sobral@2
  6166
	    fi
leo_sobral@2
  6167
	  fi
leo_sobral@2
  6168
	fi
leo_sobral@2
  6169
	;;
leo_sobral@2
  6170
      esac
leo_sobral@2
  6171
      $show "$rm $rmfiles"
leo_sobral@2
  6172
      $run $rm $rmfiles || exit_status=1
leo_sobral@2
  6173
    done
leo_sobral@2
  6174
    objdir="$origobjdir"
leo_sobral@2
  6175
leo_sobral@2
  6176
    # Try to remove the ${objdir}s in the directories where we deleted files
leo_sobral@2
  6177
    for dir in $rmdirs; do
leo_sobral@2
  6178
      if test -d "$dir"; then
leo_sobral@2
  6179
	$show "rmdir $dir"
leo_sobral@2
  6180
	$run rmdir $dir >/dev/null 2>&1
leo_sobral@2
  6181
      fi
leo_sobral@2
  6182
    done
leo_sobral@2
  6183
leo_sobral@2
  6184
    exit $exit_status
leo_sobral@2
  6185
    ;;
leo_sobral@2
  6186
leo_sobral@2
  6187
  "")
leo_sobral@2
  6188
    $echo "$modename: you must specify a MODE" 1>&2
leo_sobral@2
  6189
    $echo "$generic_help" 1>&2
leo_sobral@2
  6190
    exit $EXIT_FAILURE
leo_sobral@2
  6191
    ;;
leo_sobral@2
  6192
  esac
leo_sobral@2
  6193
leo_sobral@2
  6194
  if test -z "$exec_cmd"; then
leo_sobral@2
  6195
    $echo "$modename: invalid operation mode \`$mode'" 1>&2
leo_sobral@2
  6196
    $echo "$generic_help" 1>&2
leo_sobral@2
  6197
    exit $EXIT_FAILURE
leo_sobral@2
  6198
  fi
leo_sobral@2
  6199
fi # test -z "$show_help"
leo_sobral@2
  6200
leo_sobral@2
  6201
if test -n "$exec_cmd"; then
leo_sobral@2
  6202
  eval exec $exec_cmd
leo_sobral@2
  6203
  exit $EXIT_FAILURE
leo_sobral@2
  6204
fi
leo_sobral@2
  6205
leo_sobral@2
  6206
# We need to display help for each of the modes.
leo_sobral@2
  6207
case $mode in
leo_sobral@2
  6208
"") $echo \
leo_sobral@2
  6209
"Usage: $modename [OPTION]... [MODE-ARG]...
leo_sobral@2
  6210
leo_sobral@2
  6211
Provide generalized library-building support services.
leo_sobral@2
  6212
leo_sobral@2
  6213
    --config          show all configuration variables
leo_sobral@2
  6214
    --debug           enable verbose shell tracing
leo_sobral@2
  6215
-n, --dry-run         display commands without modifying any files
leo_sobral@2
  6216
    --features        display basic configuration information and exit
leo_sobral@2
  6217
    --finish          same as \`--mode=finish'
leo_sobral@2
  6218
    --help            display this help message and exit
leo_sobral@2
  6219
    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
leo_sobral@2
  6220
    --quiet           same as \`--silent'
leo_sobral@2
  6221
    --silent          don't print informational messages
leo_sobral@2
  6222
    --tag=TAG         use configuration variables from tag TAG
leo_sobral@2
  6223
    --version         print version information
leo_sobral@2
  6224
leo_sobral@2
  6225
MODE must be one of the following:
leo_sobral@2
  6226
leo_sobral@2
  6227
      clean           remove files from the build directory
leo_sobral@2
  6228
      compile         compile a source file into a libtool object
leo_sobral@2
  6229
      execute         automatically set library path, then run a program
leo_sobral@2
  6230
      finish          complete the installation of libtool libraries
leo_sobral@2
  6231
      install         install libraries or executables
leo_sobral@2
  6232
      link            create a library or an executable
leo_sobral@2
  6233
      uninstall       remove libraries from an installed directory
leo_sobral@2
  6234
leo_sobral@2
  6235
MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
leo_sobral@2
  6236
a more detailed description of MODE.
leo_sobral@2
  6237
leo_sobral@2
  6238
Report bugs to <bug-libtool@gnu.org>."
leo_sobral@2
  6239
  exit $EXIT_SUCCESS
leo_sobral@2
  6240
  ;;
leo_sobral@2
  6241
leo_sobral@2
  6242
clean)
leo_sobral@2
  6243
  $echo \
leo_sobral@2
  6244
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
leo_sobral@2
  6245
leo_sobral@2
  6246
Remove files from the build directory.
leo_sobral@2
  6247
leo_sobral@2
  6248
RM is the name of the program to use to delete files associated with each FILE
leo_sobral@2
  6249
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
leo_sobral@2
  6250
to RM.
leo_sobral@2
  6251
leo_sobral@2
  6252
If FILE is a libtool library, object or program, all the files associated
leo_sobral@2
  6253
with it are deleted. Otherwise, only FILE itself is deleted using RM."
leo_sobral@2
  6254
  ;;
leo_sobral@2
  6255
leo_sobral@2
  6256
compile)
leo_sobral@2
  6257
  $echo \
leo_sobral@2
  6258
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
leo_sobral@2
  6259
leo_sobral@2
  6260
Compile a source file into a libtool library object.
leo_sobral@2
  6261
leo_sobral@2
  6262
This mode accepts the following additional options:
leo_sobral@2
  6263
leo_sobral@2
  6264
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
leo_sobral@2
  6265
  -prefer-pic       try to building PIC objects only
leo_sobral@2
  6266
  -prefer-non-pic   try to building non-PIC objects only
leo_sobral@2
  6267
  -static           always build a \`.o' file suitable for static linking
leo_sobral@2
  6268
leo_sobral@2
  6269
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
leo_sobral@2
  6270
from the given SOURCEFILE.
leo_sobral@2
  6271
leo_sobral@2
  6272
The output file name is determined by removing the directory component from
leo_sobral@2
  6273
SOURCEFILE, then substituting the C source code suffix \`.c' with the
leo_sobral@2
  6274
library object suffix, \`.lo'."
leo_sobral@2
  6275
  ;;
leo_sobral@2
  6276
leo_sobral@2
  6277
execute)
leo_sobral@2
  6278
  $echo \
leo_sobral@2
  6279
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
leo_sobral@2
  6280
leo_sobral@2
  6281
Automatically set library path, then run a program.
leo_sobral@2
  6282
leo_sobral@2
  6283
This mode accepts the following additional options:
leo_sobral@2
  6284
leo_sobral@2
  6285
  -dlopen FILE      add the directory containing FILE to the library path
leo_sobral@2
  6286
leo_sobral@2
  6287
This mode sets the library path environment variable according to \`-dlopen'
leo_sobral@2
  6288
flags.
leo_sobral@2
  6289
leo_sobral@2
  6290
If any of the ARGS are libtool executable wrappers, then they are translated
leo_sobral@2
  6291
into their corresponding uninstalled binary, and any of their required library
leo_sobral@2
  6292
directories are added to the library path.
leo_sobral@2
  6293
leo_sobral@2
  6294
Then, COMMAND is executed, with ARGS as arguments."
leo_sobral@2
  6295
  ;;
leo_sobral@2
  6296
leo_sobral@2
  6297
finish)
leo_sobral@2
  6298
  $echo \
leo_sobral@2
  6299
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
leo_sobral@2
  6300
leo_sobral@2
  6301
Complete the installation of libtool libraries.
leo_sobral@2
  6302
leo_sobral@2
  6303
Each LIBDIR is a directory that contains libtool libraries.
leo_sobral@2
  6304
leo_sobral@2
  6305
The commands that this mode executes may require superuser privileges.  Use
leo_sobral@2
  6306
the \`--dry-run' option if you just want to see what would be executed."
leo_sobral@2
  6307
  ;;
leo_sobral@2
  6308
leo_sobral@2
  6309
install)
leo_sobral@2
  6310
  $echo \
leo_sobral@2
  6311
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
leo_sobral@2
  6312
leo_sobral@2
  6313
Install executables or libraries.
leo_sobral@2
  6314
leo_sobral@2
  6315
INSTALL-COMMAND is the installation command.  The first component should be
leo_sobral@2
  6316
either the \`install' or \`cp' program.
leo_sobral@2
  6317
leo_sobral@2
  6318
The rest of the components are interpreted as arguments to that command (only
leo_sobral@2
  6319
BSD-compatible install options are recognized)."
leo_sobral@2
  6320
  ;;
leo_sobral@2
  6321
leo_sobral@2
  6322
link)
leo_sobral@2
  6323
  $echo \
leo_sobral@2
  6324
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
leo_sobral@2
  6325
leo_sobral@2
  6326
Link object files or libraries together to form another library, or to
leo_sobral@2
  6327
create an executable program.
leo_sobral@2
  6328
leo_sobral@2
  6329
LINK-COMMAND is a command using the C compiler that you would use to create
leo_sobral@2
  6330
a program from several object files.
leo_sobral@2
  6331
leo_sobral@2
  6332
The following components of LINK-COMMAND are treated specially:
leo_sobral@2
  6333
leo_sobral@2
  6334
  -all-static       do not do any dynamic linking at all
leo_sobral@2
  6335
  -avoid-version    do not add a version suffix if possible
leo_sobral@2
  6336
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
leo_sobral@2
  6337
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
leo_sobral@2
  6338
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
leo_sobral@2
  6339
  -export-symbols SYMFILE
leo_sobral@2
  6340
		    try to export only the symbols listed in SYMFILE
leo_sobral@2
  6341
  -export-symbols-regex REGEX
leo_sobral@2
  6342
		    try to export only the symbols matching REGEX
leo_sobral@2
  6343
  -LLIBDIR          search LIBDIR for required installed libraries
leo_sobral@2
  6344
  -lNAME            OUTPUT-FILE requires the installed library libNAME
leo_sobral@2
  6345
  -module           build a library that can dlopened
leo_sobral@2
  6346
  -no-fast-install  disable the fast-install mode
leo_sobral@2
  6347
  -no-install       link a not-installable executable
leo_sobral@2
  6348
  -no-undefined     declare that a library does not refer to external symbols
leo_sobral@2
  6349
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
leo_sobral@2
  6350
  -objectlist FILE  Use a list of object files found in FILE to specify objects
leo_sobral@2
  6351
  -precious-files-regex REGEX
leo_sobral@2
  6352
                    don't remove output files matching REGEX
leo_sobral@2
  6353
  -release RELEASE  specify package release information
leo_sobral@2
  6354
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
leo_sobral@2
  6355
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
leo_sobral@2
  6356
  -static           do not do any dynamic linking of libtool libraries
leo_sobral@2
  6357
  -version-info CURRENT[:REVISION[:AGE]]
leo_sobral@2
  6358
		    specify library version info [each variable defaults to 0]
leo_sobral@2
  6359
leo_sobral@2
  6360
All other options (arguments beginning with \`-') are ignored.
leo_sobral@2
  6361
leo_sobral@2
  6362
Every other argument is treated as a filename.  Files ending in \`.la' are
leo_sobral@2
  6363
treated as uninstalled libtool libraries, other files are standard or library
leo_sobral@2
  6364
object files.
leo_sobral@2
  6365
leo_sobral@2
  6366
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
leo_sobral@2
  6367
only library objects (\`.lo' files) may be specified, and \`-rpath' is
leo_sobral@2
  6368
required, except when creating a convenience library.
leo_sobral@2
  6369
leo_sobral@2
  6370
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
leo_sobral@2
  6371
using \`ar' and \`ranlib', or on Windows using \`lib'.
leo_sobral@2
  6372
leo_sobral@2
  6373
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
leo_sobral@2
  6374
is created, otherwise an executable program is created."
leo_sobral@2
  6375
  ;;
leo_sobral@2
  6376
leo_sobral@2
  6377
uninstall)
leo_sobral@2
  6378
  $echo \
leo_sobral@2
  6379
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
leo_sobral@2
  6380
leo_sobral@2
  6381
Remove libraries from an installation directory.
leo_sobral@2
  6382
leo_sobral@2
  6383
RM is the name of the program to use to delete files associated with each FILE
leo_sobral@2
  6384
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
leo_sobral@2
  6385
to RM.
leo_sobral@2
  6386
leo_sobral@2
  6387
If FILE is a libtool library, all the files associated with it are deleted.
leo_sobral@2
  6388
Otherwise, only FILE itself is deleted using RM."
leo_sobral@2
  6389
  ;;
leo_sobral@2
  6390
leo_sobral@2
  6391
*)
leo_sobral@2
  6392
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
leo_sobral@2
  6393
  $echo "$help" 1>&2
leo_sobral@2
  6394
  exit $EXIT_FAILURE
leo_sobral@2
  6395
  ;;
leo_sobral@2
  6396
esac
leo_sobral@2
  6397
leo_sobral@2
  6398
$echo
leo_sobral@2
  6399
$echo "Try \`$modename --help' for more information about other modes."
leo_sobral@2
  6400
leo_sobral@2
  6401
exit $EXIT_SUCCESS
leo_sobral@2
  6402
leo_sobral@2
  6403
# The TAGs below are defined such that we never get into a situation
leo_sobral@2
  6404
# in which we disable both kinds of libraries.  Given conflicting
leo_sobral@2
  6405
# choices, we go for a static library, that is the most portable,
leo_sobral@2
  6406
# since we can't tell whether shared libraries were disabled because
leo_sobral@2
  6407
# the user asked for that or because the platform doesn't support
leo_sobral@2
  6408
# them.  This is particularly important on AIX, because we don't
leo_sobral@2
  6409
# support having both static and shared libraries enabled at the same
leo_sobral@2
  6410
# time on that platform, so we default to a shared-only configuration.
leo_sobral@2
  6411
# If a disable-shared tag is given, we'll fallback to a static-only
leo_sobral@2
  6412
# configuration.  But we'll never go from static-only to shared-only.
leo_sobral@2
  6413
leo_sobral@2
  6414
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
leo_sobral@2
  6415
build_libtool_libs=no
leo_sobral@2
  6416
build_old_libs=yes
leo_sobral@2
  6417
# ### END LIBTOOL TAG CONFIG: disable-shared
leo_sobral@2
  6418
leo_sobral@2
  6419
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
leo_sobral@2
  6420
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
leo_sobral@2
  6421
# ### END LIBTOOL TAG CONFIG: disable-static
leo_sobral@2
  6422
leo_sobral@2
  6423
# Local Variables:
leo_sobral@2
  6424
# mode:shell-script
leo_sobral@2
  6425
# sh-indentation:2
leo_sobral@2
  6426
# End: