~muktupavels/metacity/adwaita-icon-theme-lp-1414613

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-01 12:43:53 UTC
  • mto: (2.2.1 sid) (1.4.2)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20070501124353-qjwng2k8l9i1afqo
Tags: upstream-2.19.5
ImportĀ upstreamĀ versionĀ 2.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
PROGRAM=ltmain.sh
45
45
PACKAGE=libtool
46
 
VERSION="1.5.22 Debian 1.5.22-4"
47
 
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
46
VERSION=1.5.18
 
47
TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
48
48
 
49
49
# See if we are running on zsh, and set the options which allow our
50
50
# commands through without removal of \ escapes.
88
88
Xsed="${SED}"' -e 1s/^X//'
89
89
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90
90
# 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'
 
91
case `echo A|tr A '\301'` in
 
92
 A) # EBCDIC based system
 
93
  SP2NL="tr '\100' '\n'"
 
94
  NL2SP="tr '\r\n' '\100\100'"
96
95
  ;;
97
 
 *) # EBCDIC based system
98
 
  SP2NL='tr \100 \n'
99
 
  NL2SP='tr \r\n \100\100'
 
96
 *) # Assume ASCII based system
 
97
  SP2NL="tr '\040' '\012'"
 
98
  NL2SP="tr '\015\012' '\040\040'"
100
99
  ;;
101
100
esac
102
101
 
132
131
show="$echo"
133
132
show_help=
134
133
execute_dlfiles=
135
 
duplicate_deps=no
136
 
preserve_args=
137
134
lo2o="s/\\.lo\$/.${objext}/"
138
135
o2lo="s/\\.${objext}\$/.lo/"
 
136
quote_scanset='[[~#^*{};<>?'"'"'        ]'
139
137
 
140
138
#####################################
141
139
# Shell function definitions:
142
140
# This seems to be the best place for them
143
141
 
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
 
 
180
 
 
181
142
# func_win32_libid arg
182
143
# return the library type of file 'arg'
183
144
#
196
157
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
197
158
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
198
159
      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
 
160
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
 
161
      if test "X$win32_nmres" = "Ximport" ; then
 
162
        win32_libid_type="x86 archive import"
 
163
      else
 
164
        win32_libid_type="x86 archive static"
 
165
      fi
204
166
    fi
205
167
    ;;
206
168
  *DLL*)
230
192
      CC_quoted=
231
193
      for arg in $CC; do
232
194
        case $arg in
233
 
          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
 
195
          *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
234
196
          arg="\"$arg\""
235
197
          ;;
236
198
        esac
251
213
            for arg in $CC; do
252
214
            # Double-quote args containing other shell metacharacters.
253
215
            case $arg in
254
 
              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
216
              *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
255
217
              arg="\"$arg\""
256
218
              ;;
257
219
            esac
333
295
      $run ${rm}r "$my_xdir"
334
296
      $show "$mkdir $my_xdir"
335
297
      $run $mkdir "$my_xdir"
336
 
      exit_status=$?
337
 
      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
338
 
        exit $exit_status
 
298
      status=$?
 
299
      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
 
300
        exit $status
339
301
      fi
340
302
      case $host in
341
303
      *-darwin*)
375
337
            func_extract_an_archive "$my_xdir" "$my_xabs"
376
338
          fi # $darwin_arches
377
339
        fi # $run
378
 
        ;;
 
340
      ;;
379
341
      *)
380
342
        func_extract_an_archive "$my_xdir" "$my_xabs"
381
343
        ;;
390
352
# Darwin sucks
391
353
eval std_shrext=\"$shrext_cmds\"
392
354
 
393
 
disable_libs=no
394
 
 
395
355
# Parse our command line options once, thoroughly.
396
356
while test "$#" -gt 0
397
357
do
508
468
    preserve_args="$preserve_args $arg"
509
469
    ;;
510
470
 
511
 
  --tag)
512
 
    prevopt="--tag"
513
 
    prev=tag
514
 
    preserve_args="$preserve_args --tag"
515
 
    ;;
 
471
  --tag) prevopt="--tag" prev=tag ;;
516
472
  --tag=*)
517
473
    set tag "$optarg" ${1+"$@"}
518
474
    shift
544
500
  exit $EXIT_FAILURE
545
501
fi
546
502
 
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
 
 
559
503
# If this variable is set in any of the actions, the command in it
560
504
# will be execed at the end.  This prevents here-documents from being
561
505
# left over by shells.
632
576
 
633
577
    for arg
634
578
    do
635
 
      case $arg_mode in
 
579
      case "$arg_mode" in
636
580
      arg  )
637
581
        # do not "continue".  Instead, add this to base_compile
638
582
        lastarg="$arg"
683
627
            # Many Bourne shells cannot handle close brackets correctly
684
628
            # in scan sets, so we specify it separately.
685
629
            case $arg in
686
 
              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
630
              *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
687
631
              arg="\"$arg\""
688
632
              ;;
689
633
            esac
718
662
      # in scan sets (worked around with variable expansion),
719
663
      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
720
664
      # at all, so we specify them separately.
721
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
665
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
722
666
        lastarg="\"$lastarg\""
723
667
        ;;
724
668
      esac
793
737
 
794
738
    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
795
739
    case $qlibobj in
796
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
740
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
797
741
        qlibobj="\"$qlibobj\"" ;;
798
742
    esac
799
 
    test "X$libobj" != "X$qlibobj" \
800
 
        && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
801
 
        && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
 
743
    if test "X$libobj" != "X$qlibobj"; then
 
744
        $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
 
745
        exit $EXIT_FAILURE
 
746
    fi
802
747
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
803
748
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
804
749
    if test "X$xdir" = "X$obj"; then
879
824
    fi
880
825
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
881
826
    case $qsrcfile in
882
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
827
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
883
828
      qsrcfile="\"$qsrcfile\"" ;;
884
829
    esac
885
830
 
912
857
      if test ! -d "${xdir}$objdir"; then
913
858
        $show "$mkdir ${xdir}$objdir"
914
859
        $run $mkdir ${xdir}$objdir
915
 
        exit_status=$?
916
 
        if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
917
 
          exit $exit_status
 
860
        status=$?
 
861
        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
 
862
          exit $status
918
863
        fi
919
864
      fi
920
865
 
1117
1062
    no_install=no
1118
1063
    objs=
1119
1064
    non_pic_objects=
1120
 
    notinst_path= # paths that contain not-installed libtool libraries
1121
1065
    precious_files_regex=
1122
1066
    prefer_static_libs=no
1123
1067
    preload=no
1146
1090
          if test -n "$link_static_flag"; then
1147
1091
            dlopen_self=$dlopen_self_static
1148
1092
          fi
1149
 
          prefer_static_libs=yes
1150
1093
        else
1151
1094
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
1152
1095
            dlopen_self=$dlopen_self_static
1153
1096
          fi
1154
 
          prefer_static_libs=built
1155
1097
        fi
1156
1098
        build_libtool_libs=no
1157
1099
        build_old_libs=yes
 
1100
        prefer_static_libs=yes
1158
1101
        break
1159
1102
        ;;
1160
1103
      esac
1168
1111
      arg="$1"
1169
1112
      shift
1170
1113
      case $arg in
1171
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
1114
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1172
1115
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1173
1116
        ;;
1174
1117
      *) qarg=$arg ;;
1329
1272
                  if test -z "$pic_object" || test "$pic_object" = none ; then
1330
1273
                    arg="$non_pic_object"
1331
1274
                  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"
1337
1275
                fi
1338
1276
              else
1339
1277
                # Only an error if not doing a dry-run.
1417
1355
          prev=
1418
1356
          continue
1419
1357
          ;;
1420
 
        darwin_framework|darwin_framework_skip)
1421
 
          test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
 
1358
        darwin_framework)
 
1359
          compiler_flags="$compiler_flags $arg"
1422
1360
          compile_command="$compile_command $arg"
1423
1361
          finalize_command="$finalize_command $arg"
1424
1362
          prev=
1482
1420
        continue
1483
1421
        ;;
1484
1422
 
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
 
1423
      -framework)
 
1424
        prev=darwin_framework
 
1425
        compiler_flags="$compiler_flags $arg"
1492
1426
        compile_command="$compile_command $arg"
1493
1427
        finalize_command="$finalize_command $arg"
1494
 
        continue
1495
 
        ;;
 
1428
        continue
 
1429
        ;;
1496
1430
 
1497
1431
      -inst-prefix-dir)
1498
1432
        prev=inst_prefix
1520
1454
          absdir=`cd "$dir" && pwd`
1521
1455
          if test -z "$absdir"; then
1522
1456
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1523
 
            absdir="$dir"
1524
 
            notinst_path="$notinst_path $dir"
 
1457
            exit $EXIT_FAILURE
1525
1458
          fi
1526
1459
          dir="$absdir"
1527
1460
          ;;
1535
1468
        esac
1536
1469
        case $host in
1537
1470
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1538
 
          testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1539
1471
          case :$dllsearchpath: in
1540
1472
          *":$dir:"*) ;;
1541
1473
          *) dllsearchpath="$dllsearchpath:$dir";;
1542
1474
          esac
1543
 
          case :$dllsearchpath: in
1544
 
          *":$testbindir:"*) ;;
1545
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
1546
 
          esac
1547
1475
          ;;
1548
1476
        esac
1549
1477
        continue
1552
1480
      -l*)
1553
1481
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1554
1482
          case $host in
1555
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 
1483
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
1556
1484
            # These systems don't actually have a C or math library (as such)
1557
1485
            continue
1558
1486
            ;;
1559
 
          *-*-os2*)
 
1487
          *-*-mingw* | *-*-os2*)
1560
1488
            # These systems don't actually have a C library (as such)
1561
1489
            test "X$arg" = "X-lc" && continue
1562
1490
            ;;
1568
1496
            # Rhapsody C and math libraries are in the System framework
1569
1497
            deplibs="$deplibs -framework System"
1570
1498
            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
 
            ;;
1580
1499
          esac
1581
1500
        elif test "X$arg" = "X-lc_r"; then
1582
1501
         case $host in
1618
1537
      # +DA*, +DD* enable 64-bit mode on the HP compiler
1619
1538
      # -q* pass through compiler args for the IBM compiler
1620
1539
      # -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*|@*)
 
1540
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1627
1541
 
1628
1542
        # Unknown arguments in both finalize_command and compile_command need
1629
1543
        # to be aesthetically quoted because they are evaled later.
1630
1544
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1631
1545
        case $arg in
1632
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
 
1546
        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1633
1547
          arg="\"$arg\""
1634
1548
          ;;
1635
1549
        esac
1636
1550
        compile_command="$compile_command $arg"
1637
1551
        finalize_command="$finalize_command $arg"
1638
 
        compiler_flags="$compiler_flags $arg"
 
1552
        if test "$with_gcc" = "yes" ; then
 
1553
          compiler_flags="$compiler_flags $arg"
 
1554
        fi
1639
1555
        continue
1640
1556
        ;;
1641
1557
 
1743
1659
        for flag in $args; do
1744
1660
          IFS="$save_ifs"
1745
1661
          case $flag in
1746
 
            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
 
1662
            *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1747
1663
            flag="\"$flag\""
1748
1664
            ;;
1749
1665
          esac
1761
1677
        for flag in $args; do
1762
1678
          IFS="$save_ifs"
1763
1679
          case $flag in
1764
 
            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
 
1680
            *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1765
1681
            flag="\"$flag\""
1766
1682
            ;;
1767
1683
          esac
1794
1710
        # to be aesthetically quoted because they are evaled later.
1795
1711
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1796
1712
        case $arg in
1797
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
 
1713
        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1798
1714
          arg="\"$arg\""
1799
1715
          ;;
1800
1716
        esac
1873
1789
            if test -z "$pic_object" || test "$pic_object" = none ; then
1874
1790
              arg="$non_pic_object"
1875
1791
            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"
1881
1792
          fi
1882
1793
        else
1883
1794
          # Only an error if not doing a dry-run.
1933
1844
        # to be aesthetically quoted because they are evaled later.
1934
1845
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1935
1846
        case $arg in
1936
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
 
1847
        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1937
1848
          arg="\"$arg\""
1938
1849
          ;;
1939
1850
        esac
1983
1894
    if test ! -d "$output_objdir"; then
1984
1895
      $show "$mkdir $output_objdir"
1985
1896
      $run $mkdir $output_objdir
1986
 
      exit_status=$?
1987
 
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
1988
 
        exit $exit_status
 
1897
      status=$?
 
1898
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
 
1899
        exit $status
1989
1900
      fi
1990
1901
    fi
1991
1902
 
2048
1959
    newlib_search_path=
2049
1960
    need_relink=no # whether we're linking any uninstalled libtool libraries
2050
1961
    notinst_deplibs= # not-installed libtool libraries
 
1962
    notinst_path= # paths that contain not-installed libtool libraries
2051
1963
    case $linkmode in
2052
1964
    lib)
2053
1965
        passes="conv link"
2082
1994
        case $pass in
2083
1995
        dlopen) libs="$dlfiles" ;;
2084
1996
        dlpreopen) libs="$dlprefiles" ;;
2085
 
        link)
2086
 
          libs="$deplibs %DEPLIBS%"
2087
 
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2088
 
          ;;
 
1997
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2089
1998
        esac
2090
1999
      fi
2091
2000
      if test "$pass" = dlopen; then
2286
2195
        esac # case $deplib
2287
2196
        if test "$found" = yes || test -f "$lib"; then :
2288
2197
        else
2289
 
          $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
 
2198
          $echo "$modename: cannot find the library \`$lib'" 1>&2
2290
2199
          exit $EXIT_FAILURE
2291
2200
        fi
2292
2201
 
2500
2409
              case "$temp_rpath " in
2501
2410
              *" $dir "*) ;;
2502
2411
              *" $absdir "*) ;;
2503
 
              *) temp_rpath="$temp_rpath $absdir" ;;
 
2412
              *) temp_rpath="$temp_rpath $dir" ;;
2504
2413
              esac
2505
2414
            fi
2506
2415
 
2537
2446
        fi
2538
2447
 
2539
2448
        link_static=no # Whether the deplib will be linked statically
2540
 
        use_static_libs=$prefer_static_libs
2541
 
        if test "$use_static_libs" = built && test "$installed" = yes ; then
2542
 
          use_static_libs=no
2543
 
        fi
2544
2449
        if test -n "$library_names" &&
2545
 
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
 
2450
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2546
2451
          if test "$installed" = no; then
2547
2452
            notinst_deplibs="$notinst_deplibs $lib"
2548
2453
            need_relink=yes
2655
2560
              if test "$hardcode_direct" = no; then
2656
2561
                add="$dir/$linklib"
2657
2562
                case $host in
2658
 
                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2659
 
                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2660
 
                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2661
 
                    *-*-unixware7*) add_dir="-L$dir" ;;
 
2563
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2662
2564
                  *-*-darwin* )
2663
2565
                    # if the lib is a module then we can not link against
2664
2566
                    # it, someone is ignoring the new warnings I added
2665
 
                    if /usr/bin/file -L $add 2> /dev/null |
2666
 
                      $EGREP ": [^:]* bundle" >/dev/null ; then
 
2567
                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2667
2568
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2668
2569
                      if test -z "$old_library" ; then
2669
2570
                        $echo
2694
2595
                add_dir="-L$dir"
2695
2596
                # Try looking first in the location we're being installed to.
2696
2597
                if test -n "$inst_prefix_dir"; then
2697
 
                  case $libdir in
 
2598
                  case "$libdir" in
2698
2599
                    [\\/]*)
2699
2600
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2700
2601
                      ;;
2767
2668
              add_dir="-L$libdir"
2768
2669
              # Try looking first in the location we're being installed to.
2769
2670
              if test -n "$inst_prefix_dir"; then
2770
 
                case $libdir in
 
2671
                case "$libdir" in
2771
2672
                  [\\/]*)
2772
2673
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2773
2674
                    ;;
2828
2729
              fi
2829
2730
            fi
2830
2731
          else
 
2732
            convenience="$convenience $dir/$old_library"
 
2733
            old_convenience="$old_convenience $dir/$old_library"
2831
2734
            deplibs="$dir/$old_library $deplibs"
2832
2735
            link_static=yes
2833
2736
          fi
3204
3107
            age="$number_minor"
3205
3108
            revision="$number_minor"
3206
3109
            ;;
3207
 
          *)
3208
 
            $echo "$modename: unknown library version type \`$version_type'" 1>&2
3209
 
            $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
3210
 
            exit $EXIT_FAILURE
3211
 
            ;;
3212
3110
          esac
3213
3111
          ;;
3214
3112
        no)
3419
3317
 
3420
3318
      # Eliminate all temporary directories.
3421
3319
      for path in $notinst_path; do
3422
 
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3423
 
        deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3424
 
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
 
3320
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
 
3321
        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
 
3322
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3425
3323
      done
3426
3324
 
3427
3325
      if test -n "$xrpath"; then
3474
3372
            ;;
3475
3373
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3476
3374
            # Do not include libc due to us having libc/libc_r.
3477
 
            ;;
3478
 
          *-*-sco3.2v5* | *-*-sco5v6*)
3479
 
            # Causes problems with __ctype
3480
 
            ;;
3481
 
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3482
 
            # Compiler inserts libc in the correct place for threads to work
 
3375
            test "X$arg" = "X-lc" && continue
3483
3376
            ;;
3484
3377
          *)
3485
3378
            # Add libc to deplibs on all other systems if necessary.
3523
3416
          int main() { return 0; }
3524
3417
EOF
3525
3418
          $rm conftest
3526
 
          $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
 
3419
          $LTCC -o conftest conftest.c $deplibs
3527
3420
          if test "$?" -eq 0 ; then
3528
3421
            ldd_output=`ldd conftest`
3529
3422
            for i in $deplibs; do
3530
 
              name=`expr $i : '-l\(.*\)'`
 
3423
              name="`expr $i : '-l\(.*\)'`"
3531
3424
              # If $name is empty we are operating on a -L argument.
3532
3425
              if test "$name" != "" && test "$name" -ne "0"; then
3533
3426
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3564
3457
            # Error occurred in the first compile.  Let's try to salvage
3565
3458
            # the situation: Compile a separate program for each library.
3566
3459
            for i in $deplibs; do
3567
 
              name=`expr $i : '-l\(.*\)'`
 
3460
              name="`expr $i : '-l\(.*\)'`"
3568
3461
              # If $name is empty we are operating on a -L argument.
3569
3462
              if test "$name" != "" && test "$name" != "0"; then
3570
3463
                $rm conftest
3571
 
                $LTCC $LTCFLAGS -o conftest conftest.c $i
 
3464
                $LTCC -o conftest conftest.c $i
3572
3465
                # Did it work?
3573
3466
                if test "$?" -eq 0 ; then
3574
3467
                  ldd_output=`ldd conftest`
3616
3509
          set dummy $deplibs_check_method
3617
3510
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3618
3511
          for a_deplib in $deplibs; do
3619
 
            name=`expr $a_deplib : '-l\(.*\)'`
 
3512
            name="`expr $a_deplib : '-l\(.*\)'`"
3620
3513
            # If $name is empty we are operating on a -L argument.
3621
3514
            if test "$name" != "" && test  "$name" != "0"; then
3622
3515
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3685
3578
          set dummy $deplibs_check_method
3686
3579
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3687
3580
          for a_deplib in $deplibs; do
3688
 
            name=`expr $a_deplib : '-l\(.*\)'`
 
3581
            name="`expr $a_deplib : '-l\(.*\)'`"
3689
3582
            # If $name is empty we are operating on a -L argument.
3690
3583
            if test -n "$name" && test "$name" != "0"; then
3691
3584
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3815
3708
        deplibs=$newdeplibs
3816
3709
      fi
3817
3710
 
3818
 
 
3819
 
      # move library search paths that coincide with paths to not yet
3820
 
      # installed libraries to the beginning of the library search list
3821
 
      new_libs=
3822
 
      for path in $notinst_path; do
3823
 
        case " $new_libs " in
3824
 
        *" -L$path/$objdir "*) ;;
3825
 
        *)
3826
 
          case " $deplibs " in
3827
 
          *" -L$path/$objdir "*)
3828
 
            new_libs="$new_libs -L$path/$objdir" ;;
3829
 
          esac
3830
 
          ;;
3831
 
        esac
3832
 
      done
3833
 
      for deplib in $deplibs; do
3834
 
        case $deplib in
3835
 
        -L*)
3836
 
          case " $new_libs " in
3837
 
          *" $deplib "*) ;;
3838
 
          *) new_libs="$new_libs $deplib" ;;
3839
 
          esac
3840
 
          ;;
3841
 
        *) new_libs="$new_libs $deplib" ;;
3842
 
        esac
3843
 
      done
3844
 
      deplibs="$new_libs"
3845
 
 
3846
 
 
3847
3711
      # All the library-specific variables (install_libdir is set above).
3848
3712
      library_names=
3849
3713
      old_library=
3927
3791
        fi
3928
3792
 
3929
3793
        lib="$output_objdir/$realname"
3930
 
        linknames=
3931
3794
        for link
3932
3795
        do
3933
3796
          linknames="$linknames $link"
3956
3819
                # The command line is too long to execute in one step.
3957
3820
                $show "using reloadable object file for export list..."
3958
3821
                skipped_export=:
3959
 
                # Break out early, otherwise skipped_export may be
3960
 
                # set to false by a later but shorter cmd.
3961
 
                break
3962
3822
              fi
3963
3823
            done
3964
3824
            IFS="$save_ifs"
4028
3888
          fi
4029
3889
        fi
4030
3890
 
4031
 
        if test "X$skipped_export" != "X:" &&
4032
 
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
3891
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4033
3892
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4034
3893
          :
4035
3894
        else
4064
3923
          do
4065
3924
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4066
3925
            if test "X$objlist" = X ||
4067
 
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
3926
               { len=`expr "X$test_cmds" : ".*"` &&
4068
3927
                 test "$len" -le "$max_cmd_len"; }; then
4069
3928
              objlist="$objlist $obj"
4070
3929
            else
4154
4013
          IFS="$save_ifs"
4155
4014
          eval cmd=\"$cmd\"
4156
4015
          $show "$cmd"
4157
 
          $run eval "$cmd" || {
4158
 
            lt_exit=$?
4159
 
 
4160
 
            # Restore the uninstalled library and exit
4161
 
            if test "$mode" = relink; then
4162
 
              $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4163
 
            fi
4164
 
 
4165
 
            exit $lt_exit
4166
 
          }
 
4016
          $run eval "$cmd" || exit $?
4167
4017
        done
4168
4018
        IFS="$save_ifs"
4169
4019
 
4170
4020
        # Restore the uninstalled library and exit
4171
4021
        if test "$mode" = relink; then
4172
4022
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4173
 
 
4174
 
          if test -n "$convenience"; then
4175
 
            if test -z "$whole_archive_flag_spec"; then
4176
 
              $show "${rm}r $gentop"
4177
 
              $run ${rm}r "$gentop"
4178
 
            fi
4179
 
          fi
4180
 
 
4181
4023
          exit $EXIT_SUCCESS
4182
4024
        fi
4183
4025
 
4359
4201
        ;;
4360
4202
      esac
4361
4203
 
4362
 
 
4363
 
      # move library search paths that coincide with paths to not yet
4364
 
      # installed libraries to the beginning of the library search list
4365
 
      new_libs=
4366
 
      for path in $notinst_path; do
4367
 
        case " $new_libs " in
4368
 
        *" -L$path/$objdir "*) ;;
4369
 
        *)
4370
 
          case " $compile_deplibs " in
4371
 
          *" -L$path/$objdir "*)
4372
 
            new_libs="$new_libs -L$path/$objdir" ;;
4373
 
          esac
4374
 
          ;;
4375
 
        esac
4376
 
      done
4377
 
      for deplib in $compile_deplibs; do
4378
 
        case $deplib in
4379
 
        -L*)
4380
 
          case " $new_libs " in
4381
 
          *" $deplib "*) ;;
4382
 
          *) new_libs="$new_libs $deplib" ;;
4383
 
          esac
4384
 
          ;;
4385
 
        *) new_libs="$new_libs $deplib" ;;
4386
 
        esac
4387
 
      done
4388
 
      compile_deplibs="$new_libs"
4389
 
 
4390
 
 
4391
4204
      compile_command="$compile_command $compile_deplibs"
4392
4205
      finalize_command="$finalize_command $finalize_deplibs"
4393
4206
 
4432
4245
        fi
4433
4246
        case $host in
4434
4247
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4435
 
          testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4436
4248
          case :$dllsearchpath: in
4437
4249
          *":$libdir:"*) ;;
4438
4250
          *) dllsearchpath="$dllsearchpath:$libdir";;
4439
4251
          esac
4440
 
          case :$dllsearchpath: in
4441
 
          *":$testbindir:"*) ;;
4442
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
4443
 
          esac
4444
4252
          ;;
4445
4253
        esac
4446
4254
      done
4556
4364
            if test -z "$export_symbols"; then
4557
4365
              export_symbols="$output_objdir/$outputname.exp"
4558
4366
              $run $rm $export_symbols
4559
 
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4560
 
              case $host in
4561
 
              *cygwin* | *mingw* )
4562
 
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4563
 
                $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4564
 
                ;;
4565
 
              esac
 
4367
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4566
4368
            else
4567
 
              $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
4369
              $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4568
4370
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4569
4371
              $run eval 'mv "$nlist"T "$nlist"'
4570
 
              case $host in
4571
 
              *cygwin* | *mingw* )
4572
 
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4573
 
                $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4574
 
                ;;
4575
 
              esac
4576
4372
            fi
4577
4373
          fi
4578
4374
 
4689
4485
          esac
4690
4486
 
4691
4487
          # Now compile the dynamic symbol file.
4692
 
          $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4693
 
          $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
4488
          $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
 
4489
          $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4694
4490
 
4695
4491
          # Clean up the generated files.
4696
4492
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4697
4493
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4698
4494
 
4699
4495
          # Transform the symbol file into the correct name.
4700
 
          case $host in
4701
 
          *cygwin* | *mingw* )
4702
 
            if test -f "$output_objdir/${outputname}.def" ; then
4703
 
              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4704
 
              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4705
 
            else
4706
 
              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4707
 
              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4708
 
             fi
4709
 
            ;;
4710
 
          * )
4711
 
            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4712
 
            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4713
 
            ;;
4714
 
          esac
 
4496
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4497
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4715
4498
          ;;
4716
4499
        *)
4717
4500
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4736
4519
        # We have no uninstalled library dependencies, so finalize right now.
4737
4520
        $show "$link_command"
4738
4521
        $run eval "$link_command"
4739
 
        exit_status=$?
 
4522
        status=$?
4740
4523
 
4741
4524
        # Delete the generated files.
4742
4525
        if test -n "$dlsyms"; then
4744
4527
          $run $rm "$output_objdir/${outputname}S.${objext}"
4745
4528
        fi
4746
4529
 
4747
 
        exit $exit_status
 
4530
        exit $status
4748
4531
      fi
4749
4532
 
4750
4533
      if test -n "$shlibpath_var"; then
4884
4667
        esac
4885
4668
        case $host in
4886
4669
          *cygwin* | *mingw* )
4887
 
            output_name=`basename $output`
4888
 
            output_path=`dirname $output`
4889
 
            cwrappersource="$output_path/$objdir/lt-$output_name.c"
4890
 
            cwrapper="$output_path/$output_name.exe"
4891
 
            $rm $cwrappersource $cwrapper
4892
 
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
4670
            cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
 
4671
            cwrapper=`$echo ${output}.exe`
 
4672
            $rm $cwrappersource $cwrapper
 
4673
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4893
4674
 
4894
4675
            cat > $cwrappersource <<EOF
4895
4676
 
4914
4695
#include <malloc.h>
4915
4696
#include <stdarg.h>
4916
4697
#include <assert.h>
4917
 
#include <string.h>
4918
 
#include <ctype.h>
4919
 
#include <sys/stat.h>
4920
4698
 
4921
4699
#if defined(PATH_MAX)
4922
4700
# define LT_PATHMAX PATH_MAX
4927
4705
#endif
4928
4706
 
4929
4707
#ifndef DIR_SEPARATOR
4930
 
# define DIR_SEPARATOR '/'
4931
 
# define PATH_SEPARATOR ':'
 
4708
#define DIR_SEPARATOR '/'
4932
4709
#endif
4933
4710
 
4934
4711
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4935
4712
  defined (__OS2__)
4936
 
# define HAVE_DOS_BASED_FILE_SYSTEM
4937
 
# ifndef DIR_SEPARATOR_2
4938
 
#  define DIR_SEPARATOR_2 '\\'
4939
 
# endif
4940
 
# ifndef PATH_SEPARATOR_2
4941
 
#  define PATH_SEPARATOR_2 ';'
4942
 
# endif
 
4713
#define HAVE_DOS_BASED_FILE_SYSTEM
 
4714
#ifndef DIR_SEPARATOR_2
 
4715
#define DIR_SEPARATOR_2 '\\'
 
4716
#endif
4943
4717
#endif
4944
4718
 
4945
4719
#ifndef DIR_SEPARATOR_2
4949
4723
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4950
4724
#endif /* DIR_SEPARATOR_2 */
4951
4725
 
4952
 
#ifndef PATH_SEPARATOR_2
4953
 
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4954
 
#else /* PATH_SEPARATOR_2 */
4955
 
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4956
 
#endif /* PATH_SEPARATOR_2 */
4957
 
 
4958
4726
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4959
4727
#define XFREE(stale) do { \
4960
4728
  if (stale) { free ((void *) stale); stale = 0; } \
4961
4729
} while (0)
4962
4730
 
4963
 
/* -DDEBUG is fairly common in CFLAGS.  */
4964
 
#undef DEBUG
4965
 
#if defined DEBUGWRAPPER
4966
 
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
4967
 
#else
4968
 
# define DEBUG(format, ...)
4969
 
#endif
4970
 
 
4971
4731
const char *program_name = NULL;
4972
4732
 
4973
4733
void * xmalloc (size_t num);
4974
4734
char * xstrdup (const char *string);
4975
 
const char * base_name (const char *name);
4976
 
char * find_executable(const char *wrapper);
4977
 
int    check_executable(const char *path);
 
4735
char * basename (const char *name);
 
4736
char * fnqualify(const char *path);
4978
4737
char * strendzap(char *str, const char *pat);
4979
4738
void lt_fatal (const char *message, ...);
4980
4739
 
4984
4743
  char **newargz;
4985
4744
  int i;
4986
4745
 
4987
 
  program_name = (char *) xstrdup (base_name (argv[0]));
4988
 
  DEBUG("(main) argv[0]      : %s\n",argv[0]);
4989
 
  DEBUG("(main) program_name : %s\n",program_name);
 
4746
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
4990
4747
  newargz = XMALLOC(char *, argc+2);
4991
4748
EOF
4992
4749
 
4993
 
            cat >> $cwrappersource <<EOF
4994
 
  newargz[0] = (char *) xstrdup("$SHELL");
 
4750
            cat >> $cwrappersource <<EOF
 
4751
  newargz[0] = "$SHELL";
4995
4752
EOF
4996
4753
 
4997
 
            cat >> $cwrappersource <<"EOF"
4998
 
  newargz[1] = find_executable(argv[0]);
4999
 
  if (newargz[1] == NULL)
5000
 
    lt_fatal("Couldn't find %s", argv[0]);
5001
 
  DEBUG("(main) found exe at : %s\n",newargz[1]);
 
4754
            cat >> $cwrappersource <<"EOF"
 
4755
  newargz[1] = fnqualify(argv[0]);
5002
4756
  /* we know the script has the same name, without the .exe */
5003
4757
  /* so make sure newargz[1] doesn't end in .exe */
5004
4758
  strendzap(newargz[1],".exe");
5005
4759
  for (i = 1; i < argc; i++)
5006
4760
    newargz[i+1] = xstrdup(argv[i]);
5007
4761
  newargz[argc+1] = NULL;
5008
 
 
5009
 
  for (i=0; i<argc+1; i++)
5010
 
  {
5011
 
    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
5012
 
    ;
5013
 
  }
5014
 
 
5015
 
EOF
5016
 
 
5017
 
            case $host_os in
5018
 
              mingw*)
5019
 
                cat >> $cwrappersource <<EOF
5020
 
  execv("$SHELL",(char const **)newargz);
5021
 
EOF
5022
 
              ;;
5023
 
              *)
5024
 
                cat >> $cwrappersource <<EOF
 
4762
EOF
 
4763
 
 
4764
            cat >> $cwrappersource <<EOF
5025
4765
  execv("$SHELL",newargz);
5026
4766
EOF
5027
 
              ;;
5028
 
            esac
5029
4767
 
5030
 
            cat >> $cwrappersource <<"EOF"
5031
 
  return 127;
 
4768
            cat >> $cwrappersource <<"EOF"
5032
4769
}
5033
4770
 
5034
4771
void *
5048
4785
;
5049
4786
}
5050
4787
 
5051
 
const char *
5052
 
base_name (const char *name)
 
4788
char *
 
4789
basename (const char *name)
5053
4790
{
5054
4791
  const char *base;
5055
4792
 
5056
4793
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5057
4794
  /* Skip over the disk name in MSDOS pathnames. */
5058
 
  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
 
4795
  if (isalpha (name[0]) && name[1] == ':')
5059
4796
    name += 2;
5060
4797
#endif
5061
4798
 
5062
4799
  for (base = name; *name; name++)
5063
4800
    if (IS_DIR_SEPARATOR (*name))
5064
4801
      base = name + 1;
5065
 
  return base;
5066
 
}
5067
 
 
5068
 
int
5069
 
check_executable(const char * path)
5070
 
{
5071
 
  struct stat st;
5072
 
 
5073
 
  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5074
 
  if ((!path) || (!*path))
5075
 
    return 0;
5076
 
 
5077
 
  if ((stat (path, &st) >= 0) &&
5078
 
      (
5079
 
        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5080
 
#if defined (S_IXOTH)
5081
 
       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5082
 
#endif
5083
 
#if defined (S_IXGRP)
5084
 
       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5085
 
#endif
5086
 
       ((st.st_mode & S_IXUSR) == S_IXUSR))
5087
 
      )
5088
 
    return 1;
5089
 
  else
5090
 
    return 0;
5091
 
}
5092
 
 
5093
 
/* Searches for the full path of the wrapper.  Returns
5094
 
   newly allocated full path name if found, NULL otherwise */
 
4802
  return (char *) base;
 
4803
}
 
4804
 
5095
4805
char *
5096
 
find_executable (const char* wrapper)
 
4806
fnqualify(const char *path)
5097
4807
{
5098
 
  int has_slash = 0;
5099
 
  const char* p;
5100
 
  const char* p_next;
5101
 
  /* static buffer for getcwd */
 
4808
  size_t size;
 
4809
  char *p;
5102
4810
  char tmp[LT_PATHMAX + 1];
5103
 
  int tmp_len;
5104
 
  char* concat_name;
5105
 
 
5106
 
  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5107
 
 
5108
 
  if ((wrapper == NULL) || (*wrapper == '\0'))
5109
 
    return NULL;
5110
 
 
5111
 
  /* Absolute path? */
5112
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5113
 
  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5114
 
  {
5115
 
    concat_name = xstrdup (wrapper);
5116
 
    if (check_executable(concat_name))
5117
 
      return concat_name;
5118
 
    XFREE(concat_name);
5119
 
  }
5120
 
  else
5121
 
  {
5122
 
#endif
5123
 
    if (IS_DIR_SEPARATOR (wrapper[0]))
5124
 
    {
5125
 
      concat_name = xstrdup (wrapper);
5126
 
      if (check_executable(concat_name))
5127
 
        return concat_name;
5128
 
      XFREE(concat_name);
5129
 
    }
5130
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5131
 
  }
5132
 
#endif
5133
 
 
5134
 
  for (p = wrapper; *p; p++)
5135
 
    if (*p == '/')
5136
 
    {
5137
 
      has_slash = 1;
5138
 
      break;
5139
 
    }
5140
 
  if (!has_slash)
5141
 
  {
5142
 
    /* no slashes; search PATH */
5143
 
    const char* path = getenv ("PATH");
5144
 
    if (path != NULL)
5145
 
    {
5146
 
      for (p = path; *p; p = p_next)
5147
 
      {
5148
 
        const char* q;
5149
 
        size_t p_len;
5150
 
        for (q = p; *q; q++)
5151
 
          if (IS_PATH_SEPARATOR(*q))
5152
 
            break;
5153
 
        p_len = q - p;
5154
 
        p_next = (*q == '\0' ? q : q + 1);
5155
 
        if (p_len == 0)
5156
 
        {
5157
 
          /* empty path: current directory */
5158
 
          if (getcwd (tmp, LT_PATHMAX) == NULL)
5159
 
            lt_fatal ("getcwd failed");
5160
 
          tmp_len = strlen(tmp);
5161
 
          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5162
 
          memcpy (concat_name, tmp, tmp_len);
5163
 
          concat_name[tmp_len] = '/';
5164
 
          strcpy (concat_name + tmp_len + 1, wrapper);
5165
 
        }
5166
 
        else
5167
 
        {
5168
 
          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5169
 
          memcpy (concat_name, p, p_len);
5170
 
          concat_name[p_len] = '/';
5171
 
          strcpy (concat_name + p_len + 1, wrapper);
5172
 
        }
5173
 
        if (check_executable(concat_name))
5174
 
          return concat_name;
5175
 
        XFREE(concat_name);
5176
 
      }
5177
 
    }
5178
 
    /* not found in PATH; assume curdir */
5179
 
  }
5180
 
  /* Relative path | not found in path: prepend cwd */
 
4811
 
 
4812
  assert(path != NULL);
 
4813
 
 
4814
  /* Is it qualified already? */
 
4815
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
4816
  if (isalpha (path[0]) && path[1] == ':')
 
4817
    return xstrdup (path);
 
4818
#endif
 
4819
  if (IS_DIR_SEPARATOR (path[0]))
 
4820
    return xstrdup (path);
 
4821
 
 
4822
  /* prepend the current directory */
 
4823
  /* doesn't handle '~' */
5181
4824
  if (getcwd (tmp, LT_PATHMAX) == NULL)
5182
4825
    lt_fatal ("getcwd failed");
5183
 
  tmp_len = strlen(tmp);
5184
 
  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5185
 
  memcpy (concat_name, tmp, tmp_len);
5186
 
  concat_name[tmp_len] = '/';
5187
 
  strcpy (concat_name + tmp_len + 1, wrapper);
5188
 
 
5189
 
  if (check_executable(concat_name))
5190
 
    return concat_name;
5191
 
  XFREE(concat_name);
5192
 
  return NULL;
 
4826
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
 
4827
  p = XMALLOC(char, size);
 
4828
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
 
4829
  return p;
5193
4830
}
5194
4831
 
5195
4832
char *
5233
4870
  va_end (ap);
5234
4871
}
5235
4872
EOF
5236
 
          # we should really use a build-platform specific compiler
5237
 
          # here, but OTOH, the wrappers (shell script and this C one)
5238
 
          # are only useful if you want to execute the "real" binary.
5239
 
          # Since the "real" binary is built for $host, then this
5240
 
          # wrapper might as well be built for $host, too.
5241
 
          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5242
 
          ;;
5243
 
        esac
5244
 
        $rm $output
5245
 
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
4873
          # we should really use a build-platform specific compiler
 
4874
          # here, but OTOH, the wrappers (shell script and this C one)
 
4875
          # are only useful if you want to execute the "real" binary.
 
4876
          # Since the "real" binary is built for $host, then this
 
4877
          # wrapper might as well be built for $host, too.
 
4878
          $run $LTCC -s -o $cwrapper $cwrappersource
 
4879
          ;;
 
4880
        esac
 
4881
        $rm $output
 
4882
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5246
4883
 
5247
4884
        $echo > $output "\
5248
4885
#! $SHELL
5392
5029
        # Backslashes separate directories on plain windows
5393
5030
        *-*-mingw | *-*-os2*)
5394
5031
          $echo >> $output "\
5395
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 
5032
      exec \$progdir\\\\\$program \${1+\"\$@\"}
5396
5033
"
5397
5034
          ;;
5398
5035
 
5399
5036
        *)
5400
5037
          $echo >> $output "\
5401
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 
5038
      exec \$progdir/\$program \${1+\"\$@\"}
5402
5039
"
5403
5040
          ;;
5404
5041
        esac
5408
5045
    fi
5409
5046
  else
5410
5047
    # The program doesn't exist.
5411
 
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
 
5048
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5412
5049
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
5413
5050
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5414
5051
    exit $EXIT_FAILURE
5472
5109
            $run ${rm}r "$gentop"
5473
5110
            $show "$mkdir $gentop"
5474
5111
            $run $mkdir "$gentop"
5475
 
            exit_status=$?
5476
 
            if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5477
 
              exit $exit_status
 
5112
            status=$?
 
5113
            if test "$status" -ne 0 && test ! -d "$gentop"; then
 
5114
              exit $status
5478
5115
            fi
5479
5116
          fi
5480
5117
 
5531
5168
            oldobjs="$objlist $obj"
5532
5169
            objlist="$objlist $obj"
5533
5170
            eval test_cmds=\"$old_archive_cmds\"
5534
 
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
5171
            if len=`expr "X$test_cmds" : ".*"` &&
5535
5172
               test "$len" -le "$max_cmd_len"; then
5536
5173
              :
5537
5174
            else
5728
5365
    # install_prog (especially on Windows NT).
5729
5366
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5730
5367
       # Allow the use of GNU shtool's install command.
5731
 
       $echo "X$nonopt" | grep shtool > /dev/null; then
 
5368
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5732
5369
      # Aesthetically quote it.
5733
5370
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5734
5371
      case $arg in
5735
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
5372
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5736
5373
        arg="\"$arg\""
5737
5374
        ;;
5738
5375
      esac
5741
5378
      shift
5742
5379
    else
5743
5380
      install_prog=
5744
 
      arg=$nonopt
 
5381
      arg="$nonopt"
5745
5382
    fi
5746
5383
 
5747
5384
    # The real first argument should be the name of the installation program.
5748
5385
    # Aesthetically quote it.
5749
5386
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5750
5387
    case $arg in
5751
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
 
5388
    *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5752
5389
      arg="\"$arg\""
5753
5390
      ;;
5754
5391
    esac
5766
5403
    do
5767
5404
      if test -n "$dest"; then
5768
5405
        files="$files $dest"
5769
 
        dest=$arg
 
5406
        dest="$arg"
5770
5407
        continue
5771
5408
      fi
5772
5409
 
5773
5410
      case $arg in
5774
5411
      -d) isdir=yes ;;
5775
 
      -f) 
5776
 
        case " $install_prog " in
5777
 
        *[\\\ /]cp\ *) ;;
5778
 
        *) prev=$arg ;;
5779
 
        esac
5780
 
        ;;
5781
 
      -g | -m | -o) prev=$arg ;;
 
5412
      -f) prev="-f" ;;
 
5413
      -g) prev="-g" ;;
 
5414
      -m) prev="-m" ;;
 
5415
      -o) prev="-o" ;;
5782
5416
      -s)
5783
5417
        stripme=" -s"
5784
5418
        continue
5785
5419
        ;;
5786
 
      -*)
5787
 
        ;;
 
5420
      -*) ;;
 
5421
 
5788
5422
      *)
5789
5423
        # If the previous option needed an argument, then skip it.
5790
5424
        if test -n "$prev"; then
5791
5425
          prev=
5792
5426
        else
5793
 
          dest=$arg
 
5427
          dest="$arg"
5794
5428
          continue
5795
5429
        fi
5796
5430
        ;;
5799
5433
      # Aesthetically quote the argument.
5800
5434
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5801
5435
      case $arg in
5802
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
5436
      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5803
5437
        arg="\"$arg\""
5804
5438
        ;;
5805
5439
      esac
5968
5602
 
5969
5603
          if test "$#" -gt 0; then
5970
5604
            # Delete the old symlinks, and create new ones.
5971
 
            # Try `ln -sf' first, because the `ln' binary might depend on
5972
 
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
5973
 
            # so we also need to try rm && ln -s.
5974
5605
            for linkname
5975
5606
            do
5976
5607
              if test "$linkname" != "$realname"; then
5977
 
                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5978
 
                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 
5608
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
5609
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5979
5610
              fi
5980
5611
            done
5981
5612
          fi
5988
5619
            IFS="$save_ifs"
5989
5620
            eval cmd=\"$cmd\"
5990
5621
            $show "$cmd"
5991
 
            $run eval "$cmd" || {
5992
 
              lt_exit=$?
5993
 
 
5994
 
              # Restore the uninstalled library and exit
5995
 
              if test "$mode" = relink; then
5996
 
                $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
5997
 
              fi
5998
 
 
5999
 
              exit $lt_exit
6000
 
            }
 
5622
            $run eval "$cmd" || exit $?
6001
5623
          done
6002
5624
          IFS="$save_ifs"
6003
5625
        fi
6091
5713
          notinst_deplibs=
6092
5714
          relink_command=
6093
5715
 
6094
 
          # Note that it is not necessary on cygwin/mingw to append a dot to
6095
 
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
6096
 
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6097
 
          # `FILE.' does not work on cygwin managed mounts.
6098
 
          #
 
5716
          # To insure that "foo" is sourced, and not "foo.exe",
 
5717
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
 
5718
          # which disallows the automatic-append-.exe behavior.
 
5719
          case $build in
 
5720
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
 
5721
          *) wrapperdot=${wrapper} ;;
 
5722
          esac
6099
5723
          # If there is no directory component, then add one.
6100
 
          case $wrapper in
6101
 
          */* | *\\*) . ${wrapper} ;;
6102
 
          *) . ./${wrapper} ;;
 
5724
          case $file in
 
5725
          */* | *\\*) . ${wrapperdot} ;;
 
5726
          *) . ./${wrapperdot} ;;
6103
5727
          esac
6104
5728
 
6105
5729
          # Check the variables that should have been set.
6127
5751
          done
6128
5752
 
6129
5753
          relink_command=
6130
 
          # Note that it is not necessary on cygwin/mingw to append a dot to
6131
 
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
6132
 
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6133
 
          # `FILE.' does not work on cygwin managed mounts.
6134
 
          #
 
5754
          # To insure that "foo" is sourced, and not "foo.exe",
 
5755
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
 
5756
          # which disallows the automatic-append-.exe behavior.
 
5757
          case $build in
 
5758
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
 
5759
          *) wrapperdot=${wrapper} ;;
 
5760
          esac
6135
5761
          # If there is no directory component, then add one.
6136
 
          case $wrapper in
6137
 
          */* | *\\*) . ${wrapper} ;;
6138
 
          *) . ./${wrapper} ;;
 
5762
          case $file in
 
5763
          */* | *\\*) . ${wrapperdot} ;;
 
5764
          *) . ./${wrapperdot} ;;
6139
5765
          esac
6140
5766
 
6141
5767
          outputname=
6142
5768
          if test "$fast_install" = no && test -n "$relink_command"; then
6143
5769
            if test "$finalize" = yes && test -z "$run"; then
6144
 
              tmpdir=`func_mktempdir`
 
5770
              tmpdir="/tmp"
 
5771
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
 
5772
              tmpdir="$tmpdir/libtool-$$"
 
5773
              save_umask=`umask`
 
5774
              umask 0077
 
5775
              if $mkdir "$tmpdir"; then
 
5776
                umask $save_umask
 
5777
              else
 
5778
                umask $save_umask
 
5779
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
 
5780
                continue
 
5781
              fi
6145
5782
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6146
5783
              outputname="$tmpdir/$file"
6147
5784
              # Replace the output file specification.
6165
5802
        fi
6166
5803
 
6167
5804
        # remove .exe since cygwin /usr/bin/install will append another
6168
 
        # one anyway 
 
5805
        # one anyways
6169
5806
        case $install_prog,$host in
6170
5807
        */usr/bin/install*,*cygwin*)
6171
5808
          case $file:$destfile in
6265
5902
    # Exit here if they wanted silent mode.
6266
5903
    test "$show" = : && exit $EXIT_SUCCESS
6267
5904
 
6268
 
    $echo "X----------------------------------------------------------------------" | $Xsed
 
5905
    $echo "----------------------------------------------------------------------"
6269
5906
    $echo "Libraries have been installed in:"
6270
5907
    for libdir in $libdirs; do
6271
5908
      $echo "   $libdir"
6298
5935
    $echo
6299
5936
    $echo "See any operating system documentation about shared libraries for"
6300
5937
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6301
 
    $echo "X----------------------------------------------------------------------" | $Xsed
 
5938
    $echo "----------------------------------------------------------------------"
6302
5939
    exit $EXIT_SUCCESS
6303
5940
    ;;
6304
5941
 
6515
6152
            rmfiles="$rmfiles $objdir/$n"
6516
6153
          done
6517
6154
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
 
6155
          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6518
6156
 
6519
 
          case "$mode" in
6520
 
          clean)
6521
 
            case "  $library_names " in
6522
 
            # "  " in the beginning catches empty $dlname
6523
 
            *" $dlname "*) ;;
6524
 
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
6525
 
            esac
6526
 
             test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6527
 
            ;;
6528
 
          uninstall)
 
6157
          if test "$mode" = uninstall; then
6529
6158
            if test -n "$library_names"; then
6530
6159
              # Do each command in the postuninstall commands.
6531
6160
              cmds=$postuninstall_cmds
6558
6187
              IFS="$save_ifs"
6559
6188
            fi
6560
6189
            # FIXME: should reinstall the best remaining shared library.
6561
 
            ;;
6562
 
          esac
 
6190
          fi
6563
6191
        fi
6564
6192
        ;;
6565
6193
 
6858
6486
# configuration.  But we'll never go from static-only to shared-only.
6859
6487
 
6860
6488
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6861
 
disable_libs=shared
 
6489
build_libtool_libs=no
 
6490
build_old_libs=yes
6862
6491
# ### END LIBTOOL TAG CONFIG: disable-shared
6863
6492
 
6864
6493
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6865
 
disable_libs=static
 
6494
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6866
6495
# ### END LIBTOOL TAG CONFIG: disable-static
6867
6496
 
6868
6497
# Local Variables: