Changeset 85

Show
Ignore:
Timestamp:
05/18/08 06:35:58
Author:
mhadji
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spatialindex/trunk/ltmain.sh

    r44 r85  
    22# NOTE: Changing this file will not affect anything until you rerun configure. 
    33# 
    4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 
     4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 
    55# Free Software Foundation, Inc. 
    66# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 
     
    1818# You should have received a copy of the GNU General Public License 
    1919# along with this program; if not, write to the Free Software 
    20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
     20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
    2121# 
    2222# As a special exception to the GNU General Public License, if you 
     
    3434progpath="$0" 
    3535 
     36# RH: define SED for historic ltconfig's generated by Libtool 1.3 
     37[ -z "$SED" ] && SED=sed 
     38 
    3639# The name of this program: 
    3740progname=`echo "$progpath" | $SED $basename` 
     
    4447PROGRAM=ltmain.sh 
    4548PACKAGE=libtool 
    46 VERSION=1.5.22 
    47 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 
    48  
    49 # See if we are running on zsh, and set the options which allow our 
    50 # commands through without removal of \ escapes. 
    51 if test -n "${ZSH_VERSION+set}" ; then 
    52   setopt NO_GLOB_SUBST 
    53 fi 
     49VERSION=1.5.6 
     50TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" 
     51EGREP="grep -E" 
     52 
    5453 
    5554# Check that we have a working $echo. 
     
    8988sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 
    9089# test EBCDIC or ASCII 
    91 case `echo X|tr X '\101'` in 
    92  A) # ASCII based system 
    93     # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 
    94   SP2NL='tr \040 \012' 
    95   NL2SP='tr \015\012 \040\040' 
     90case `echo A|tr A '\301'` in 
     91 A) # EBCDIC based system 
     92  SP2NL="tr '\100' '\n'" 
     93  NL2SP="tr '\r\n' '\100\100'" 
    9694  ;; 
    97  *) # EBCDIC based system 
    98   SP2NL='tr \100 \n' 
    99   NL2SP='tr \r\n \100\100' 
     95 *) # Assume ASCII based system 
     96  SP2NL="tr '\040' '\012'" 
     97  NL2SP="tr '\015\012' '\040\040'" 
    10098  ;; 
    10199esac 
     
    114112 
    115113# Make sure IFS has a sensible default 
    116 lt_nl=' 
    117 
    118 IFS="   $lt_nl" 
     114: ${IFS="        
     115"} 
    119116 
    120117if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 
     
    133130show_help= 
    134131execute_dlfiles= 
    135 duplicate_deps=no 
    136 preserve_args= 
    137132lo2o="s/\\.lo\$/.${objext}/" 
    138133o2lo="s/\\.${objext}\$/.lo/" 
     
    141136# Shell function definitions: 
    142137# This seems to be the best place for them 
    143  
    144 # func_mktempdir [string] 
    145 # Make a temporary directory that won't clash with other running 
    146 # libtool processes, and avoids race conditions if possible.  If 
    147 # given, STRING is the basename for that directory. 
    148 func_mktempdir () 
    149 { 
    150     my_template="${TMPDIR-/tmp}/${1-$progname}" 
    151  
    152     if test "$run" = ":"; then 
    153       # Return a directory name, but don't create it in dry-run mode 
    154       my_tmpdir="${my_template}-$$" 
    155     else 
    156  
    157       # If mktemp works, use that first and foremost 
    158       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 
    159  
    160       if test ! -d "$my_tmpdir"; then 
    161         # Failing that, at least try and use $RANDOM to avoid a race 
    162         my_tmpdir="${my_template}-${RANDOM-0}$$" 
    163  
    164         save_mktempdir_umask=`umask` 
    165         umask 0077 
    166         $mkdir "$my_tmpdir" 
    167         umask $save_mktempdir_umask 
    168       fi 
    169  
    170       # If we're not in dry-run mode, bomb out on failure 
    171       test -d "$my_tmpdir" || { 
    172         $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 
    173         exit $EXIT_FAILURE 
    174       } 
    175     fi 
    176  
    177     $echo "X$my_tmpdir" | $Xsed 
    178 } 
    179  
    180138 
    181139# func_win32_libid arg 
     
    185143# Has to be a shell function in order to 'eat' the argument 
    186144# that is supplied when $file_magic_command is called. 
    187 func_win32_libid () 
    188 
     145func_win32_libid () { 
    189146  win32_libid_type="unknown" 
    190147  win32_fileres=`file -L $1 2>/dev/null` 
     
    197154      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 
    198155      win32_nmres=`eval $NM -f posix -A $1 | \ 
    199         $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 
    200       case $win32_nmres in 
    201       import*)  win32_libid_type="x86 archive import";; 
    202       *)        win32_libid_type="x86 archive static";; 
    203       esac 
     156        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` 
     157      if test "X$win32_nmres" = "Ximport" ; then 
     158        win32_libid_type="x86 archive import" 
     159      else 
     160        win32_libid_type="x86 archive static" 
     161      fi 
    204162    fi 
    205163    ;; 
     
    225183# command doesn't match the default compiler. 
    226184# arg is usually of the form 'gcc ...' 
    227 func_infer_tag () 
    228 
     185func_infer_tag () { 
    229186    if test -n "$available_tags" && test -z "$tagname"; then 
    230187      CC_quoted= 
     
    283240    fi 
    284241} 
    285  
    286  
    287 # func_extract_an_archive dir oldlib 
    288 func_extract_an_archive () 
    289 { 
    290     f_ex_an_ar_dir="$1"; shift 
    291     f_ex_an_ar_oldlib="$1" 
    292  
    293     $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 
    294     $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 
    295     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 
    296      : 
    297     else 
    298       $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 
    299       exit $EXIT_FAILURE 
    300     fi 
    301 } 
    302  
    303 # func_extract_archives gentop oldlib ... 
    304 func_extract_archives () 
    305 { 
    306     my_gentop="$1"; shift 
    307     my_oldlibs=${1+"$@"} 
    308     my_oldobjs="" 
    309     my_xlib="" 
    310     my_xabs="" 
    311     my_xdir="" 
    312     my_status="" 
    313  
    314     $show "${rm}r $my_gentop" 
    315     $run ${rm}r "$my_gentop" 
    316     $show "$mkdir $my_gentop" 
    317     $run $mkdir "$my_gentop" 
    318     my_status=$? 
    319     if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 
    320       exit $my_status 
    321     fi 
    322  
    323     for my_xlib in $my_oldlibs; do 
    324       # Extract the objects. 
    325       case $my_xlib in 
    326         [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 
    327         *) my_xabs=`pwd`"/$my_xlib" ;; 
    328       esac 
    329       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` 
    330       my_xdir="$my_gentop/$my_xlib" 
    331  
    332       $show "${rm}r $my_xdir" 
    333       $run ${rm}r "$my_xdir" 
    334       $show "$mkdir $my_xdir" 
    335       $run $mkdir "$my_xdir" 
    336       exit_status=$? 
    337       if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 
    338         exit $exit_status 
    339       fi 
    340       case $host in 
    341       *-darwin*) 
    342         $show "Extracting $my_xabs" 
    343         # Do not bother doing anything if just a dry run 
    344         if test -z "$run"; then 
    345           darwin_orig_dir=`pwd` 
    346           cd $my_xdir || exit $? 
    347           darwin_archive=$my_xabs 
    348           darwin_curdir=`pwd` 
    349           darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 
    350           darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 
    351           if test -n "$darwin_arches"; then  
    352             darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 
    353             darwin_arch= 
    354             $show "$darwin_base_archive has multiple architectures $darwin_arches" 
    355             for darwin_arch in  $darwin_arches ; do 
    356               mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 
    357               lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 
    358               cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 
    359               func_extract_an_archive "`pwd`" "${darwin_base_archive}" 
    360               cd "$darwin_curdir" 
    361               $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 
    362             done # $darwin_arches 
    363       ## Okay now we have a bunch of thin objects, gotta fatten them up :) 
    364             darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 
    365             darwin_file= 
    366             darwin_files= 
    367             for darwin_file in $darwin_filelist; do 
    368               darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 
    369               lipo -create -output "$darwin_file" $darwin_files 
    370             done # $darwin_filelist 
    371             ${rm}r unfat-$$ 
    372             cd "$darwin_orig_dir" 
    373           else 
    374             cd "$darwin_orig_dir" 
    375             func_extract_an_archive "$my_xdir" "$my_xabs" 
    376           fi # $darwin_arches 
    377         fi # $run 
    378         ;; 
    379       *) 
    380         func_extract_an_archive "$my_xdir" "$my_xabs" 
    381         ;; 
    382       esac 
    383       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 
    384     done 
    385     func_extract_archives_result="$my_oldobjs" 
    386 } 
    387242# End of Shell function definitions 
    388243##################################### 
     
    390245# Darwin sucks 
    391246eval std_shrext=\"$shrext_cmds\" 
    392  
    393 disable_libs=no 
    394247 
    395248# Parse our command line options once, thoroughly. 
     
    457310    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 
    458311    $echo 
    459     $echo "Copyright (C) 2005  Free Software Foundation, Inc." 
     312    $echo "Copyright (C) 2003  Free Software Foundation, Inc." 
    460313    $echo "This is free software; see the source for copying conditions.  There is NO" 
    461314    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 
    462     exit $? 
     315    exit $EXIT_SUCCESS 
    463316    ;; 
    464317 
     
    469322      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 
    470323    done 
    471     exit $? 
     324    exit $EXIT_SUCCESS 
    472325    ;; 
    473326 
     
    494347      $echo "disable static libraries" 
    495348    fi 
    496     exit $? 
     349    exit $EXIT_SUCCESS 
    497350    ;; 
    498351 
     
    509362    ;; 
    510363 
    511   --tag) 
    512     prevopt="--tag" 
    513     prev=tag 
    514     preserve_args="$preserve_args --tag" 
    515     ;; 
     364  --tag) prevopt="--tag" prev=tag ;; 
    516365  --tag=*) 
    517366    set tag "$optarg" ${1+"$@"} 
     
    545394fi 
    546395 
    547 case $disable_libs in 
    548 no)  
    549   ;; 
    550 shared) 
    551   build_libtool_libs=no 
    552   build_old_libs=yes 
    553   ;; 
    554 static) 
    555   build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 
    556   ;; 
    557 esac 
    558  
    559396# If this variable is set in any of the actions, the command in it 
    560397# will be execed at the end.  This prevents here-documents from being 
     
    567404  if test -z "$mode"; then 
    568405    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 
    569     $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 
     406    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 
    570407    case $nonopt in 
    571408    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 
     
    633470    for arg 
    634471    do 
    635       case $arg_mode in 
     472      case "$arg_mode" in 
    636473      arg  ) 
    637474        # do not "continue".  Instead, add this to base_compile 
     
    715552      # Double-quote args containing other shell metacharacters. 
    716553      # Many Bourne shells cannot handle close brackets correctly 
    717       # in scan sets, and some SunOS ksh mistreat backslash-escaping 
    718       # in scan sets (worked around with variable expansion), 
    719       # and furthermore cannot handle '|' '&' '(' ')' in scan sets  
    720       # at all, so we specify them separately. 
     554      # in scan sets, so we specify it separately. 
    721555      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"") 
    722556        lastarg="\"$lastarg\"" 
     
    792626    done 
    793627 
    794     qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 
    795     case $qlibobj in 
    796       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"") 
    797         qlibobj="\"$qlibobj\"" ;; 
    798     esac 
    799     test "X$libobj" != "X$qlibobj" \ 
    800         && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \ 
    801         && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 
    802628    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 
    803629    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 
     
    872698        exit $EXIT_FAILURE 
    873699      fi 
    874       $echo "$srcfile" > "$lockfile" 
     700      $echo $srcfile > "$lockfile" 
    875701    fi 
    876702 
     
    878704      eval srcfile=\"$fix_srcfile_path\" 
    879705    fi 
    880     qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 
    881     case $qsrcfile in 
    882       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"") 
    883       qsrcfile="\"$qsrcfile\"" ;; 
    884     esac 
    885706 
    886707    $run $rm "$libobj" "${libobj}T" 
     
    904725 
    905726      if test "$pic_mode" != no; then 
    906         command="$base_compile $qsrcfile $pic_flag" 
     727        command="$base_compile $srcfile $pic_flag" 
    907728      else 
    908729        # Don't build PIC code 
    909         command="$base_compile $qsrcfile" 
     730        command="$base_compile $srcfile" 
    910731      fi 
    911732 
     
    913734        $show "$mkdir ${xdir}$objdir" 
    914735        $run $mkdir ${xdir}$objdir 
    915         exit_status=$? 
    916         if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 
    917           exit $exit_status 
     736        status=$? 
     737        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then 
     738          exit $status 
    918739        fi 
    919740      fi 
     
    987808      if test "$pic_mode" != yes; then 
    988809        # Don't build PIC code 
    989         command="$base_compile $qsrcfile" 
     810        command="$base_compile $srcfile" 
    990811      else 
    991         command="$base_compile $qsrcfile $pic_flag" 
     812        command="$base_compile $srcfile $pic_flag" 
    992813      fi 
    993814      if test "$compiler_c_o" = yes; then 
     
    1118939    objs= 
    1119940    non_pic_objects= 
    1120     notinst_path= # paths that contain not-installed libtool libraries 
    1121941    precious_files_regex= 
    1122942    prefer_static_libs=no 
     
    1147967            dlopen_self=$dlopen_self_static 
    1148968          fi 
    1149           prefer_static_libs=yes 
    1150969        else 
    1151970          if test -z "$pic_flag" && test -n "$link_static_flag"; then 
    1152971            dlopen_self=$dlopen_self_static 
    1153972          fi 
    1154           prefer_static_libs=built 
    1155973        fi 
    1156974        build_libtool_libs=no 
    1157975        build_old_libs=yes 
     976        prefer_static_libs=yes 
    1158977        break 
    1159978        ;; 
     
    13301149                    arg="$non_pic_object" 
    13311150                  fi 
    1332                 else 
    1333                   # If the PIC object exists, use it instead. 
    1334                   # $xdir was prepended to $pic_object above. 
    1335                   non_pic_object="$pic_object" 
    1336                   non_pic_objects="$non_pic_objects $non_pic_object" 
    13371151                fi 
    13381152              else 
     
    14181232          continue 
    14191233          ;; 
    1420         darwin_framework|darwin_framework_skip) 
    1421           test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 
    1422           compile_command="$compile_command $arg" 
    1423           finalize_command="$finalize_command $arg" 
    1424           prev= 
    1425           continue 
    1426           ;; 
    14271234        *) 
    14281235          eval "$prev=\"\$arg\"" 
     
    14801287          prev=expsyms_regex 
    14811288        fi 
    1482         continue 
    1483         ;; 
    1484  
    1485       -framework|-arch|-isysroot) 
    1486         case " $CC " in 
    1487           *" ${arg} ${1} "* | *" ${arg} ${1} "*)  
    1488                 prev=darwin_framework_skip ;; 
    1489           *) compiler_flags="$compiler_flags $arg" 
    1490              prev=darwin_framework ;; 
    1491         esac 
    1492         compile_command="$compile_command $arg" 
    1493         finalize_command="$finalize_command $arg" 
    14941289        continue 
    14951290        ;; 
     
    15211316          if test -z "$absdir"; then 
    15221317            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 
    1523             absdir="$dir" 
    1524             notinst_path="$notinst_path $dir" 
     1318            exit $EXIT_FAILURE 
    15251319          fi 
    15261320          dir="$absdir" 
     
    15361330        case $host in 
    15371331        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 
    1538           testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` 
    15391332          case :$dllsearchpath: in 
    15401333          *":$dir:"*) ;; 
    15411334          *) dllsearchpath="$dllsearchpath:$dir";; 
    15421335          esac 
    1543           case :$dllsearchpath: in 
    1544           *":$testbindir:"*) ;; 
    1545           *) dllsearchpath="$dllsearchpath:$testbindir";; 
    1546           esac 
    15471336          ;; 
    15481337        esac 
     
    15531342        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 
    15541343          case $host in 
    1555           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 
     1344          *-*-cygwin* | *-*-pw32* | *-*-beos*) 
    15561345            # These systems don't actually have a C or math library (as such) 
    15571346            continue 
    15581347            ;; 
    1559           *-*-os2*) 
     1348          *-*-mingw* | *-*-os2*) 
    15601349            # These systems don't actually have a C library (as such) 
    15611350            test "X$arg" = "X-lc" && continue 
    15621351            ;; 
    1563           *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*
     1352          *-*-openbsd* | *-*-freebsd*
    15641353            # Do not include libc due to us having libc/libc_r. 
    15651354            test "X$arg" = "X-lc" && continue 
     
    15691358            deplibs="$deplibs -framework System" 
    15701359            continue 
    1571             ;; 
    1572           *-*-sco3.2v5* | *-*-sco5v6*) 
    1573             # Causes problems with __ctype 
    1574             test "X$arg" = "X-lc" && continue 
    1575             ;; 
    1576           *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 
    1577             # Compiler inserts libc in the correct place for threads to work 
    1578             test "X$arg" = "X-lc" && continue 
    1579             ;; 
    15801360          esac 
    15811361        elif test "X$arg" = "X-lc_r"; then 
    15821362         case $host in 
    1583          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*
     1363         *-*-openbsd* | *-*-freebsd*
    15841364           # Do not include libc_r directly, use -pthread flag. 
    15851365           continue 
     
    15911371        ;; 
    15921372 
    1593       # Tru64 UNIX uses -model [arg] to determine the layout of C++ 
    1594       # classes, name mangling, and exception handling. 
    1595       -model) 
    1596         compile_command="$compile_command $arg" 
    1597         compiler_flags="$compiler_flags $arg" 
    1598         finalize_command="$finalize_command $arg" 
    1599         prev=xcompiler 
    1600         continue 
    1601         ;; 
    1602  
    16031373     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 
    1604         compiler_flags="$compiler_flags $arg" 
    1605         compile_command="$compile_command $arg" 
    1606         finalize_command="$finalize_command $arg" 
     1374        deplibs="$deplibs $arg" 
    16071375        continue 
    16081376        ;; 
     
    16131381        ;; 
    16141382 
    1615       # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 
    1616       # -r[0-9][0-9]* specifies the processor on the SGI compiler 
    1617       # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 
    1618       # +DA*, +DD* enable 64-bit mode on the HP compiler 
    1619       # -q* pass through compiler args for the IBM compiler 
    1620       # -m* pass through architecture-specific compiler args for GCC 
    1621       # -m*, -t[45]*, -txscale* pass through architecture-specific 
    1622       # compiler args for GCC 
    1623       # -pg pass through profiling flag for GCC 
    1624       # @file GCC response files 
    1625       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 
    1626       -t[45]*|-txscale*|@*) 
    1627  
     1383      # gcc -m* arguments should be passed to the linker via $compiler_flags 
     1384      # in order to pass architecture information to the linker 
     1385      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo 
     1386      # but this is not reliable with gcc because gcc may use -mfoo to 
     1387      # select a different linker, different libraries, etc, while 
     1388      # -Wl,-mfoo simply passes -mfoo to the linker. 
     1389      -m*) 
    16281390        # Unknown arguments in both finalize_command and compile_command need 
    16291391        # to be aesthetically quoted because they are evaled later. 
     
    16361398        compile_command="$compile_command $arg" 
    16371399        finalize_command="$finalize_command $arg" 
    1638         compiler_flags="$compiler_flags $arg" 
     1400        if test "$with_gcc" = "yes" ; then 
     1401          compiler_flags="$compiler_flags $arg" 
     1402        fi 
    16391403        continue 
    16401404        ;; 
     
    18741638              arg="$non_pic_object" 
    18751639            fi 
    1876           else 
    1877             # If the PIC object exists, use it instead. 
    1878             # $xdir was prepended to $pic_object above. 
    1879             non_pic_object="$pic_object" 
    1880             non_pic_objects="$non_pic_objects $non_pic_object" 
    18811640          fi 
    18821641        else 
     
    19841743      $show "$mkdir $output_objdir" 
    19851744      $run $mkdir $output_objdir 
    1986       exit_status=$? 
    1987       if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 
    1988         exit $exit_status 
     1745      status=$? 
     1746      if test "$status" -ne 0 && test ! -d "$output_objdir"; then 
     1747        exit $status 
    19891748      fi 
    19901749    fi 
     
    20491808    need_relink=no # whether we're linking any uninstalled libtool libraries 
    20501809    notinst_deplibs= # not-installed libtool libraries 
     1810    notinst_path= # paths that contain not-installed libtool libraries 
    20511811    case $linkmode in 
    20521812    lib) 
     
    21001860            finalize_deplibs="$deplib $finalize_deplibs" 
    21011861          else 
    2102             compiler_flags="$compiler_flags $deplib
     1862            deplibs="$deplib $deplibs
    21031863          fi 
    21041864          continue 
     
    21071867          if test "$linkmode" != lib && test "$linkmode" != prog; then 
    21081868            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 
     1869            continue 
     1870          fi 
     1871          if test "$pass" = conv; then 
     1872            deplibs="$deplib $deplibs" 
    21091873            continue 
    21101874          fi 
     
    22191983          case $linkmode in 
    22201984          lib) 
    2221             valid_a_lib=no 
    2222             case $deplibs_check_method in 
    2223               match_pattern*) 
    2224                 set dummy $deplibs_check_method 
    2225                 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 
    2226                 if eval $echo \"$deplib\" 2>/dev/null \ 
    2227                     | $SED 10q \ 
    2228                     | $EGREP "$match_pattern_regex" > /dev/null; then 
    2229                   valid_a_lib=yes 
    2230                 fi 
    2231                 ;; 
    2232               pass_all) 
    2233                 valid_a_lib=yes 
    2234                 ;; 
    2235             esac 
    2236             if test "$valid_a_lib" != yes; then 
     1985            if test "$deplibs_check_method" != pass_all; then 
    22371986              $echo 
    22381987              $echo "*** Warning: Trying to link with static lib archive $deplib." 
     
    22842033        if test "$found" = yes || test -f "$lib"; then : 
    22852034        else 
    2286           $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 
     2035          $echo "$modename: cannot find the library \`$lib'" 1>&2 
    22872036          exit $EXIT_FAILURE 
    22882037        fi 
     
    23082057        installed=yes 
    23092058        shouldnotlink=no 
    2310         avoidtemprpath= 
    2311  
    23122059 
    23132060        # Read the .la file 
     
    24082155            absdir="$libdir" 
    24092156          fi 
    2410           test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 
    24112157        else 
    2412           if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 
    2413             dir="$ladir" 
    2414             absdir="$abs_ladir" 
    2415             # Remove this search path later 
    2416             notinst_path="$notinst_path $abs_ladir" 
    2417           else 
    2418             dir="$ladir/$objdir" 
    2419             absdir="$abs_ladir/$objdir" 
    2420             # Remove this search path later 
    2421             notinst_path="$notinst_path $abs_ladir" 
    2422           fi 
     2158          dir="$ladir/$objdir" 
     2159          absdir="$abs_ladir/$objdir" 
     2160          # Remove this search path later 
     2161          notinst_path="$notinst_path $abs_ladir" 
    24232162        fi # $installed = yes 
    24242163        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 
     
    24932232             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 
    24942233            # We need to hardcode the library path 
    2495             if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 
     2234            if test -n "$shlibpath_var"; then 
    24962235              # Make sure the rpath contains only unique directories. 
    24972236              case "$temp_rpath " in 
    24982237              *" $dir "*) ;; 
    24992238              *" $absdir "*) ;; 
    2500               *) temp_rpath="$temp_rpath $absdir" ;; 
     2239              *) temp_rpath="$temp_rpath $dir" ;; 
    25012240              esac 
    25022241            fi 
     
    25352274 
    25362275        link_static=no # Whether the deplib will be linked statically 
    2537         use_static_libs=$prefer_static_libs 
    2538         if test "$use_static_libs" = built && test "$installed" = yes ; then 
    2539           use_static_libs=no 
    2540         fi 
    25412276        if test -n "$library_names" && 
    2542            { test "$use_static_libs" = no || test -z "$old_library"; }; then 
     2277           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 
    25432278          if test "$installed" = no; then 
    25442279            notinst_deplibs="$notinst_deplibs $lib" 
     
    26532388                add="$dir/$linklib" 
    26542389                case $host in 
    2655                   *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 
    2656                   *-*-sysv4*uw2*) add_dir="-L$dir" ;; 
    2657                   *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 
    2658                     *-*-unixware7*) add_dir="-L$dir" ;; 
     2390                  *-*-sco3.2v5* ) add_dir="-L$dir" ;; 
    26592391                  *-*-darwin* ) 
    26602392                    # if the lib is a module then we can not link against 
    26612393                    # it, someone is ignoring the new warnings I added 
    2662                     if /usr/bin/file -L $add 2> /dev/null | 
    2663                       $EGREP ": [^:]* bundle" >/dev/null ; then 
     2394                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then 
    26642395                      $echo "** Warning, lib $linklib is a module, not a shared library" 
    26652396                      if test -z "$old_library" ; then 
     
    26922423                # Try looking first in the location we're being installed to. 
    26932424                if test -n "$inst_prefix_dir"; then 
    2694                   case $libdir in 
     2425                  case "$libdir" in 
    26952426                    [\\/]*) 
    26962427                      add_dir="$add_dir -L$inst_prefix_dir$libdir" 
     
    27652496              # Try looking first in the location we're being installed to. 
    27662497              if test -n "$inst_prefix_dir"; then 
    2767                 case $libdir in 
     2498                case "$libdir" in 
    27682499                  [\\/]*) 
    27692500                    add_dir="$add_dir -L$inst_prefix_dir$libdir" 
     
    28262557            fi 
    28272558          else 
     2559            convenience="$convenience $dir/$old_library" 
     2560            old_convenience="$old_convenience $dir/$old_library" 
    28282561            deplibs="$dir/$old_library $deplibs" 
    28292562            link_static=yes 
     
    29432676              esac 
    29442677              case " $deplibs " in 
    2945               *" $path "*) ;; 
    2946               *) deplibs="$path $deplibs" ;; 
     2678              *" $depdepl "*) ;; 
     2679              *) deplibs="$depdepl $deplibs" ;; 
    29472680              esac 
    29482681              case " $deplibs " in 
    2949               *" $depdepl "*) ;; 
    2950               *) deplibs="$depdepl $deplibs" ;; 
     2682              *" $path "*) ;; 
     2683              *) deplibs="$deplibs $path" ;; 
    29512684              esac 
    29522685            done 
     
    32132946        # Check that each of the things are valid numbers. 
    32142947        case $current in 
    3215         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]) ;; 
     2948        [0-9]*) ;; 
    32162949        *) 
    3217           $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 
     2950          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 
    32182951          $echo "$modename: \`$vinfo' is not valid version information" 1>&2 
    32192952          exit $EXIT_FAILURE 
     
    32222955 
    32232956        case $revision in 
    3224         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]) ;; 
     2957        [0-9]*) ;; 
    32252958        *) 
    3226           $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 
     2959          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 
    32272960          $echo "$modename: \`$vinfo' is not valid version information" 1>&2 
    32282961          exit $EXIT_FAILURE 
     
    32312964 
    32322965        case $age in 
    3233         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]) ;; 
     2966        [0-9]*) ;; 
    32342967        *) 
    3235           $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 
     2968          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 
    32362969          $echo "$modename: \`$vinfo' is not valid version information" 1>&2 
    32372970          exit $EXIT_FAILURE 
     
    32592992          # Darwin ld doesn't like 0 for these options... 
    32602993          minor_current=`expr $current + 1` 
    3261           verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 
     2994          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 
    32622995          ;; 
    32632996 
     
    34123145      # Eliminate all temporary directories. 
    34133146      for path in $notinst_path; do 
    3414         lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"
    3415         deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"
    3416         dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"
     3147        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'
     3148        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'
     3149        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'
    34173150      done 
    34183151 
     
    34653198            # Don't link with libc until the a.out ld.so is fixed. 
    34663199            ;; 
    3467           *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*
     3200          *-*-openbsd* | *-*-freebsd*
    34683201            # Do not include libc due to us having libc/libc_r. 
    3469             ;; 
    3470           *-*-sco3.2v5* | *-*-sco5v6*) 
    3471             # Causes problems with __ctype 
    3472             ;; 
    3473           *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 
    3474             # Compiler inserts libc in the correct place for threads to work 
     3202            test "X$arg" = "X-lc" && continue 
    34753203            ;; 
    34763204          *) 
     
    35163244EOF 
    35173245          $rm conftest 
    3518           $LTCC $LTCFLAGS -o conftest conftest.c $deplibs 
     3246          $LTCC -o conftest conftest.c $deplibs 
    35193247          if test "$?" -eq 0 ; then 
    35203248            ldd_output=`ldd conftest` 
    35213249            for i in $deplibs; do 
    3522               name=`expr $i : '-l\(.*\)'` 
     3250              name="`expr $i : '-l\(.*\)'`" 
    35233251              # If $name is empty we are operating on a -L argument. 
    35243252              if test "$name" != "" && test "$name" -ne "0"; then 
     
    35573285            # the situation: Compile a separate program for each library. 
    35583286            for i in $deplibs; do 
    3559               name=`expr $i : '-l\(.*\)'` 
     3287              name="`expr $i : '-l\(.*\)'`" 
    35603288              # If $name is empty we are operating on a -L argument. 
    35613289              if test "$name" != "" && test "$name" != "0"; then 
    35623290                $rm conftest 
    3563                 $LTCC $LTCFLAGS -o conftest conftest.c $i 
     3291                $LTCC -o conftest conftest.c $i 
    35643292                # Did it work? 
    35653293                if test "$?" -eq 0 ; then 
     
    36093337          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 
    36103338          for a_deplib in $deplibs; do 
    3611             name=`expr $a_deplib : '-l\(.*\)'` 
     3339            name="`expr $a_deplib : '-l\(.*\)'`" 
    36123340            # If $name is empty we are operating on a -L argument. 
    36133341            if test "$name" != "" && test  "$name" != "0"; then 
     
    36783406          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 
    36793407          for a_deplib in $deplibs; do 
    3680             name=`expr $a_deplib : '-l\(.*\)'` 
     3408            name="`expr $a_deplib : '-l\(.*\)'`" 
    36813409            # If $name is empty we are operating on a -L argument. 
    36823410            if test -n "$name" && test "$name" != "0"; then 
     
    38083536      fi 
    38093537 
    3810  
    3811       # move library search paths that coincide with paths to not yet 
    3812       # installed libraries to the beginning of the library search list 
    3813       new_libs= 
    3814       for path in $notinst_path; do 
    3815         case " $new_libs " in 
    3816         *" -L$path/$objdir "*) ;; 
    3817         *) 
    3818           case " $deplibs " in 
    3819           *" -L$path/$objdir "*) 
    3820             new_libs="$new_libs -L$path/$objdir" ;; 
    3821           esac 
    3822           ;; 
    3823         esac 
    3824       done 
    3825       for deplib in $deplibs; do 
    3826         case $deplib in 
    3827         -L*) 
    3828           case " $new_libs " in 
    3829           *" $deplib "*) ;; 
    3830           *) new_libs="$new_libs $deplib" ;; 
    3831           esac 
    3832           ;; 
    3833         *) new_libs="$new_libs $deplib" ;; 
    3834         esac 
    3835       done 
    3836       deplibs="$new_libs" 
    3837  
    3838  
    38393538      # All the library-specific variables (install_libdir is set above). 
    38403539      library_names= 
     
    39203619 
    39213620        lib="$output_objdir/$realname" 
    3922         linknames= 
    39233621        for link 
    39243622        do 
     
    39493647                $show "using reloadable object file for export list..." 
    39503648                skipped_export=: 
    3951                 # Break out early, otherwise skipped_export may be 
    3952                 # set to false by a later but shorter cmd. 
    3953                 break 
    39543649              fi 
    39553650            done 
     
    39853680          else 
    39863681            gentop="$output_objdir/${outputname}x" 
     3682            $show "${rm}r $gentop" 
     3683            $run ${rm}r "$gentop" 
     3684            $show "$mkdir $gentop" 
     3685            $run $mkdir "$gentop" 
     3686            status=$? 
     3687            if test "$status" -ne 0 && test ! -d "$gentop"; then 
     3688              exit $status 
     3689            fi 
    39873690            generated="$generated $gentop" 
    39883691 
    3989             func_extract_archives $gentop $convenience 
    3990             libobjs="$libobjs $func_extract_archives_result" 
    3991           fi 
    3992         fi 
    3993          
     3692            for xlib in $convenience; do 
     3693              # Extract the objects. 
     3694              case $xlib in 
     3695              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 
     3696              *) xabs=`pwd`"/$xlib" ;; 
     3697              esac 
     3698              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 
     3699              xdir="$gentop/$xlib" 
     3700 
     3701              $show "${rm}r $xdir" 
     3702              $run ${rm}r "$xdir" 
     3703              $show "$mkdir $xdir" 
     3704              $run $mkdir "$xdir" 
     3705              status=$? 
     3706              if test "$status" -ne 0 && test ! -d "$xdir"; then 
     3707                exit $status 
     3708              fi 
     3709              # We will extract separately just the conflicting names and we will no 
     3710              # longer touch any unique names. It is faster to leave these extract 
     3711              # automatically by $AR in one run. 
     3712              $show "(cd $xdir && $AR x $xabs)" 
     3713              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 
     3714              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then 
     3715                : 
     3716