/[pcre]/code/trunk/ltmain.sh
ViewVC logotype

Diff of /code/trunk/ltmain.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 86 by nigel, Sat Feb 24 21:41:06 2007 UTC revision 87 by nigel, Sat Feb 24 21:41:21 2007 UTC
# Line 46  EXIT_FAILURE=1 Line 46  EXIT_FAILURE=1
46    
47  PROGRAM=ltmain.sh  PROGRAM=ltmain.sh
48  PACKAGE=libtool  PACKAGE=libtool
49  VERSION=1.5.18  VERSION=1.5.22
50  TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)"  TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
51    
52  # See if we are running on zsh, and set the options which allow our  # See if we are running on zsh, and set the options which allow our
53  # commands through without removal of \ escapes.  # commands through without removal of \ escapes.
# Line 98  rm="rm -f" Line 98  rm="rm -f"
98  Xsed="${SED}"' -e 1s/^X//'  Xsed="${SED}"' -e 1s/^X//'
99  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
100  # test EBCDIC or ASCII  # test EBCDIC or ASCII
101  case `echo A|tr A '\301'` in  case `echo X|tr X '\101'` in
102   A) # EBCDIC based system   A) # ASCII based system
103    SP2NL="tr '\100' '\n'"      # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
104    NL2SP="tr '\r\n' '\100\100'"    SP2NL='tr \040 \012'
105      NL2SP='tr \015\012 \040\040'
106    ;;    ;;
107   *) # Assume ASCII based system   *) # EBCDIC based system
108    SP2NL="tr '\040' '\012'"    SP2NL='tr \100 \n'
109    NL2SP="tr '\015\012' '\040\040'"    NL2SP='tr \r\n \100\100'
110    ;;    ;;
111  esac  esac
112    
# Line 141  run= Line 142  run=
142  show="$echo"  show="$echo"
143  show_help=  show_help=
144  execute_dlfiles=  execute_dlfiles=
145    duplicate_deps=no
146    preserve_args=
147  lo2o="s/\\.lo\$/.${objext}/"  lo2o="s/\\.lo\$/.${objext}/"
148  o2lo="s/\\.${objext}\$/.lo/"  o2lo="s/\\.${objext}\$/.lo/"
 quote_scanset='[[~#^*{};<>?'"'"'        ]'  
149    
150  if test -z "$max_cmd_len"; then  if test -z "$max_cmd_len"; then
151    i=0    i=0
# Line 173  fi Line 175  fi
175  # Shell function definitions:  # Shell function definitions:
176  # This seems to be the best place for them  # This seems to be the best place for them
177    
178    # func_mktempdir [string]
179    # Make a temporary directory that won't clash with other running
180    # libtool processes, and avoids race conditions if possible.  If
181    # given, STRING is the basename for that directory.
182    func_mktempdir ()
183    {
184        my_template="${TMPDIR-/tmp}/${1-$progname}"
185    
186        if test "$run" = ":"; then
187          # Return a directory name, but don't create it in dry-run mode
188          my_tmpdir="${my_template}-$$"
189        else
190    
191          # If mktemp works, use that first and foremost
192          my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
193    
194          if test ! -d "$my_tmpdir"; then
195            # Failing that, at least try and use $RANDOM to avoid a race
196            my_tmpdir="${my_template}-${RANDOM-0}$$"
197    
198            save_mktempdir_umask=`umask`
199            umask 0077
200            $mkdir "$my_tmpdir"
201            umask $save_mktempdir_umask
202          fi
203    
204          # If we're not in dry-run mode, bomb out on failure
205          test -d "$my_tmpdir" || {
206            $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
207            exit $EXIT_FAILURE
208          }
209        fi
210    
211        $echo "X$my_tmpdir" | $Xsed
212    }
213    
214    
215  # func_win32_libid arg  # func_win32_libid arg
216  # return the library type of file 'arg'  # return the library type of file 'arg'
217  #  #
# Line 191  func_win32_libid () Line 230  func_win32_libid ()
230      if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \      if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
231        $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then        $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
232        win32_nmres=`eval $NM -f posix -A $1 | \        win32_nmres=`eval $NM -f posix -A $1 | \
233          sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`          $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
234        if test "X$win32_nmres" = "Ximport" ; then        case $win32_nmres in
235          win32_libid_type="x86 archive import"        import*)  win32_libid_type="x86 archive import";;
236        else        *)        win32_libid_type="x86 archive static";;
237          win32_libid_type="x86 archive static"        esac
       fi  
238      fi      fi
239      ;;      ;;
240    *DLL*)    *DLL*)
# Line 226  func_infer_tag () Line 264  func_infer_tag ()
264        CC_quoted=        CC_quoted=
265        for arg in $CC; do        for arg in $CC; do
266          case $arg in          case $arg in
267            *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
268            arg="\"$arg\""            arg="\"$arg\""
269            ;;            ;;
270          esac          esac
# Line 247  func_infer_tag () Line 285  func_infer_tag ()
285              for arg in $CC; do              for arg in $CC; do
286              # Double-quote args containing other shell metacharacters.              # Double-quote args containing other shell metacharacters.
287              case $arg in              case $arg in
288                *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")                *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
289                arg="\"$arg\""                arg="\"$arg\""
290                ;;                ;;
291              esac              esac
# Line 257  func_infer_tag () Line 295  func_infer_tag ()
295              trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`              trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
296              # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc              # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
297              extendcc=${host}-${CC}              extendcc=${host}-${CC}
298                # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
299                # (Gentoo-specific hack because we always export $CHOST)
300                mungedcc=${CHOST-${host}}-${trimedcc}
301              case "$@ " in              case "$@ " in
302                "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\                "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
303                "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)                "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
# Line 264  func_infer_tag () Line 305  func_infer_tag ()
305                break ;;                break ;;
306                "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\                "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
307                "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\                "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
308                  "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
309                " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)                " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
310                # The compiler in the base compile command matches                # The compiler in the base compile command matches
311                # the one in the tagged configuration.                # the one in the tagged configuration.
# Line 339  func_extract_archives () Line 381  func_extract_archives ()
381        $run ${rm}r "$my_xdir"        $run ${rm}r "$my_xdir"
382        $show "$mkdir $my_xdir"        $show "$mkdir $my_xdir"
383        $run $mkdir "$my_xdir"        $run $mkdir "$my_xdir"
384        status=$?        exit_status=$?
385        if test "$status" -ne 0 && test ! -d "$my_xdir"; then        if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
386          exit $status          exit $exit_status
387        fi        fi
388        case $host in        case $host in
389        *-darwin*)        *-darwin*)
# Line 381  func_extract_archives () Line 423  func_extract_archives ()
423              func_extract_an_archive "$my_xdir" "$my_xabs"              func_extract_an_archive "$my_xdir" "$my_xabs"
424            fi # $darwin_arches            fi # $darwin_arches
425          fi # $run          fi # $run
426        ;;          ;;
427        *)        *)
428          func_extract_an_archive "$my_xdir" "$my_xabs"          func_extract_an_archive "$my_xdir" "$my_xabs"
429          ;;          ;;
# Line 396  func_extract_archives () Line 438  func_extract_archives ()
438  # Darwin sucks  # Darwin sucks
439  eval std_shrext=\"$shrext_cmds\"  eval std_shrext=\"$shrext_cmds\"
440    
441    disable_libs=no
442    
443  # Parse our command line options once, thoroughly.  # Parse our command line options once, thoroughly.
444  while test "$#" -gt 0  while test "$#" -gt 0
445  do  do
# Line 512  do Line 556  do
556      preserve_args="$preserve_args $arg"      preserve_args="$preserve_args $arg"
557      ;;      ;;
558    
559    --tag) prevopt="--tag" prev=tag ;;    --tag)
560        prevopt="--tag"
561        prev=tag
562        preserve_args="$preserve_args --tag"
563        ;;
564    --tag=*)    --tag=*)
565      set tag "$optarg" ${1+"$@"}      set tag "$optarg" ${1+"$@"}
566      shift      shift
# Line 544  if test -n "$prevopt"; then Line 592  if test -n "$prevopt"; then
592    exit $EXIT_FAILURE    exit $EXIT_FAILURE
593  fi  fi
594    
595    case $disable_libs in
596    no)
597      ;;
598    shared)
599      build_libtool_libs=no
600      build_old_libs=yes
601      ;;
602    static)
603      build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
604      ;;
605    esac
606    
607  # If this variable is set in any of the actions, the command in it  # If this variable is set in any of the actions, the command in it
608  # will be execed at the end.  This prevents here-documents from being  # will be execed at the end.  This prevents here-documents from being
609  # left over by shells.  # left over by shells.
# Line 620  if test -z "$show_help"; then Line 680  if test -z "$show_help"; then
680    
681      for arg      for arg
682      do      do
683        case "$arg_mode" in        case $arg_mode in
684        arg  )        arg  )
685          # do not "continue".  Instead, add this to base_compile          # do not "continue".  Instead, add this to base_compile
686          lastarg="$arg"          lastarg="$arg"
# Line 671  if test -z "$show_help"; then Line 731  if test -z "$show_help"; then
731              # Many Bourne shells cannot handle close brackets correctly              # Many Bourne shells cannot handle close brackets correctly
732              # in scan sets, so we specify it separately.              # in scan sets, so we specify it separately.
733              case $arg in              case $arg in
734                *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")                *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
735                arg="\"$arg\""                arg="\"$arg\""
736                ;;                ;;
737              esac              esac
# Line 706  if test -z "$show_help"; then Line 766  if test -z "$show_help"; then
766        # in scan sets (worked around with variable expansion),        # in scan sets (worked around with variable expansion),
767        # and furthermore cannot handle '|' '&' '(' ')' in scan sets        # and furthermore cannot handle '|' '&' '(' ')' in scan sets
768        # at all, so we specify them separately.        # at all, so we specify them separately.
769        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
770          lastarg="\"$lastarg\""          lastarg="\"$lastarg\""
771          ;;          ;;
772        esac        esac
# Line 781  if test -z "$show_help"; then Line 841  if test -z "$show_help"; then
841    
842      qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`      qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
843      case $qlibobj in      case $qlibobj in
844        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
845          qlibobj="\"$qlibobj\"" ;;          qlibobj="\"$qlibobj\"" ;;
846      esac      esac
847      if test "X$libobj" != "X$qlibobj"; then      test "X$libobj" != "X$qlibobj" \
848          $echo "$modename: libobj name \`$libobj' may not contain shell special characters."          && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
849          exit $EXIT_FAILURE          && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
     fi  
850      objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`      objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
851      xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`      xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
852      if test "X$xdir" = "X$obj"; then      if test "X$xdir" = "X$obj"; then
# Line 868  compiler." Line 927  compiler."
927      fi      fi
928      qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`      qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
929      case $qsrcfile in      case $qsrcfile in
930        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
931        qsrcfile="\"$qsrcfile\"" ;;        qsrcfile="\"$qsrcfile\"" ;;
932      esac      esac
933    
# Line 901  EOF Line 960  EOF
960        if test ! -d "${xdir}$objdir"; then        if test ! -d "${xdir}$objdir"; then
961          $show "$mkdir ${xdir}$objdir"          $show "$mkdir ${xdir}$objdir"
962          $run $mkdir ${xdir}$objdir          $run $mkdir ${xdir}$objdir
963          status=$?          exit_status=$?
964          if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then          if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
965            exit $status            exit $exit_status
966          fi          fi
967        fi        fi
968    
# Line 1106  EOF Line 1165  EOF
1165      no_install=no      no_install=no
1166      objs=      objs=
1167      non_pic_objects=      non_pic_objects=
1168        notinst_path= # paths that contain not-installed libtool libraries
1169      precious_files_regex=      precious_files_regex=
1170      prefer_static_libs=no      prefer_static_libs=no
1171      preload=no      preload=no
# Line 1134  EOF Line 1194  EOF
1194            if test -n "$link_static_flag"; then            if test -n "$link_static_flag"; then
1195              dlopen_self=$dlopen_self_static              dlopen_self=$dlopen_self_static
1196            fi            fi
1197              prefer_static_libs=yes
1198          else          else
1199            if test -z "$pic_flag" && test -n "$link_static_flag"; then            if test -z "$pic_flag" && test -n "$link_static_flag"; then
1200              dlopen_self=$dlopen_self_static              dlopen_self=$dlopen_self_static
1201            fi            fi
1202              prefer_static_libs=built
1203          fi          fi
1204          build_libtool_libs=no          build_libtool_libs=no
1205          build_old_libs=yes          build_old_libs=yes
         prefer_static_libs=yes  
1206          break          break
1207          ;;          ;;
1208        esac        esac
# Line 1155  EOF Line 1216  EOF
1216        arg="$1"        arg="$1"
1217        shift        shift
1218        case $arg in        case $arg in
1219        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1220          qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test          qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1221          ;;          ;;
1222        *) qarg=$arg ;;        *) qarg=$arg ;;
# Line 1316  EOF Line 1377  EOF
1377                    if test -z "$pic_object" || test "$pic_object" = none ; then                    if test -z "$pic_object" || test "$pic_object" = none ; then
1378                      arg="$non_pic_object"                      arg="$non_pic_object"
1379                    fi                    fi
1380                    else
1381                      # If the PIC object exists, use it instead.
1382                      # $xdir was prepended to $pic_object above.
1383                      non_pic_object="$pic_object"
1384                      non_pic_objects="$non_pic_objects $non_pic_object"
1385                  fi                  fi
1386                else                else
1387                  # Only an error if not doing a dry-run.                  # Only an error if not doing a dry-run.
# Line 1399  EOF Line 1465  EOF
1465            prev=            prev=
1466            continue            continue
1467            ;;            ;;
1468          darwin_framework)          darwin_framework|darwin_framework_skip)
1469            compiler_flags="$compiler_flags $arg"            test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1470            compile_command="$compile_command $arg"            compile_command="$compile_command $arg"
1471            finalize_command="$finalize_command $arg"            finalize_command="$finalize_command $arg"
1472            prev=            prev=
# Line 1464  EOF Line 1530  EOF
1530          continue          continue
1531          ;;          ;;
1532    
1533        -framework)        -framework|-arch|-isysroot)
1534          prev=darwin_framework          case " $CC " in
1535          compiler_flags="$compiler_flags $arg"            *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1536                    prev=darwin_framework_skip ;;
1537              *) compiler_flags="$compiler_flags $arg"
1538                 prev=darwin_framework ;;
1539            esac
1540          compile_command="$compile_command $arg"          compile_command="$compile_command $arg"
1541          finalize_command="$finalize_command $arg"          finalize_command="$finalize_command $arg"
1542          continue          continue
1543          ;;          ;;
1544    
1545        -inst-prefix-dir)        -inst-prefix-dir)
1546          prev=inst_prefix          prev=inst_prefix
# Line 1498  EOF Line 1568  EOF
1568            absdir=`cd "$dir" && pwd`            absdir=`cd "$dir" && pwd`
1569            if test -z "$absdir"; then            if test -z "$absdir"; then
1570              $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2              $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1571              exit $EXIT_FAILURE              absdir="$dir"
1572                notinst_path="$notinst_path $dir"
1573            fi            fi
1574            dir="$absdir"            dir="$absdir"
1575            ;;            ;;
# Line 1512  EOF Line 1583  EOF
1583          esac          esac
1584          case $host in          case $host in
1585          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1586              testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1587            case :$dllsearchpath: in            case :$dllsearchpath: in
1588            *":$dir:"*) ;;            *":$dir:"*) ;;
1589            *) dllsearchpath="$dllsearchpath:$dir";;            *) dllsearchpath="$dllsearchpath:$dir";;
1590            esac            esac
1591              case :$dllsearchpath: in
1592              *":$testbindir:"*) ;;
1593              *) dllsearchpath="$dllsearchpath:$testbindir";;
1594              esac
1595            ;;            ;;
1596          esac          esac
1597          continue          continue
# Line 1524  EOF Line 1600  EOF
1600        -l*)        -l*)
1601          if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then          if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1602            case $host in            case $host in
1603            *-*-cygwin* | *-*-pw32* | *-*-beos*)            *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1604              # These systems don't actually have a C or math library (as such)              # These systems don't actually have a C or math library (as such)
1605              continue              continue
1606              ;;              ;;
1607            *-*-mingw* | *-*-os2*)            *-*-os2*)
1608              # These systems don't actually have a C library (as such)              # These systems don't actually have a C library (as such)
1609              test "X$arg" = "X-lc" && continue              test "X$arg" = "X-lc" && continue
1610              ;;              ;;
# Line 1540  EOF Line 1616  EOF
1616              # Rhapsody C and math libraries are in the System framework              # Rhapsody C and math libraries are in the System framework
1617              deplibs="$deplibs -framework System"              deplibs="$deplibs -framework System"
1618              continue              continue
1619                ;;
1620              *-*-sco3.2v5* | *-*-sco5v6*)
1621                # Causes problems with __ctype
1622                test "X$arg" = "X-lc" && continue
1623                ;;
1624              *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1625                # Compiler inserts libc in the correct place for threads to work
1626                test "X$arg" = "X-lc" && continue
1627                ;;
1628            esac            esac
1629          elif test "X$arg" = "X-lc_r"; then          elif test "X$arg" = "X-lc_r"; then
1630           case $host in           case $host in
# Line 1581  EOF Line 1666  EOF
1666        # +DA*, +DD* enable 64-bit mode on the HP compiler        # +DA*, +DD* enable 64-bit mode on the HP compiler
1667        # -q* pass through compiler args for the IBM compiler        # -q* pass through compiler args for the IBM compiler
1668        # -m* pass through architecture-specific compiler args for GCC        # -m* pass through architecture-specific compiler args for GCC
1669        -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)        # -m*, -t[45]*, -txscale* pass through architecture-specific
1670          # compiler args for GCC
1671          # -pg pass through profiling flag for GCC
1672          # @file GCC response files
1673          -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
1674          -t[45]*|-txscale*|@*)
1675    
1676          # Unknown arguments in both finalize_command and compile_command need          # Unknown arguments in both finalize_command and compile_command need
1677          # to be aesthetically quoted because they are evaled later.          # to be aesthetically quoted because they are evaled later.
1678          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1679          case $arg in          case $arg in
1680          *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1681            arg="\"$arg\""            arg="\"$arg\""
1682            ;;            ;;
1683          esac          esac
1684          compile_command="$compile_command $arg"          compile_command="$compile_command $arg"
1685          finalize_command="$finalize_command $arg"          finalize_command="$finalize_command $arg"
1686          if test "$with_gcc" = "yes" ; then          compiler_flags="$compiler_flags $arg"
           compiler_flags="$compiler_flags $arg"  
         fi  
1687          continue          continue
1688          ;;          ;;
1689    
# Line 1703  EOF Line 1791  EOF
1791          for flag in $args; do          for flag in $args; do
1792            IFS="$save_ifs"            IFS="$save_ifs"
1793            case $flag in            case $flag in
1794              *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1795              flag="\"$flag\""              flag="\"$flag\""
1796              ;;              ;;
1797            esac            esac
# Line 1721  EOF Line 1809  EOF
1809          for flag in $args; do          for flag in $args; do
1810            IFS="$save_ifs"            IFS="$save_ifs"
1811            case $flag in            case $flag in
1812              *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1813              flag="\"$flag\""              flag="\"$flag\""
1814              ;;              ;;
1815            esac            esac
# Line 1748  EOF Line 1836  EOF
1836          continue          continue
1837          ;;          ;;
1838    
       -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread )  
         compiler_flags="$compiler_flags $arg"  
         continue  
         ;;  
   
1839        # Some other compiler flag.        # Some other compiler flag.
1840        -* | +*)        -* | +*)
1841          # Unknown arguments in both finalize_command and compile_command need          # Unknown arguments in both finalize_command and compile_command need
1842          # to be aesthetically quoted because they are evaled later.          # to be aesthetically quoted because they are evaled later.
1843          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1844          case $arg in          case $arg in
1845          *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1846            arg="\"$arg\""            arg="\"$arg\""
1847            ;;            ;;
1848          esac          esac
# Line 1838  EOF Line 1921  EOF
1921              if test -z "$pic_object" || test "$pic_object" = none ; then              if test -z "$pic_object" || test "$pic_object" = none ; then
1922                arg="$non_pic_object"                arg="$non_pic_object"
1923              fi              fi
1924              else
1925                # If the PIC object exists, use it instead.
1926                # $xdir was prepended to $pic_object above.
1927                non_pic_object="$pic_object"
1928                non_pic_objects="$non_pic_objects $non_pic_object"
1929            fi            fi
1930          else          else
1931            # Only an error if not doing a dry-run.            # Only an error if not doing a dry-run.
# Line 1893  EOF Line 1981  EOF
1981          # to be aesthetically quoted because they are evaled later.          # to be aesthetically quoted because they are evaled later.
1982          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1983          case $arg in          case $arg in
1984          *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1985            arg="\"$arg\""            arg="\"$arg\""
1986            ;;            ;;
1987          esac          esac
# Line 1943  EOF Line 2031  EOF
2031      if test ! -d "$output_objdir"; then      if test ! -d "$output_objdir"; then
2032        $show "$mkdir $output_objdir"        $show "$mkdir $output_objdir"
2033        $run $mkdir $output_objdir        $run $mkdir $output_objdir
2034        status=$?        exit_status=$?
2035        if test "$status" -ne 0 && test ! -d "$output_objdir"; then        if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2036          exit $status          exit $exit_status
2037        fi        fi
2038      fi      fi
2039    
# Line 2008  EOF Line 2096  EOF
2096      newlib_search_path=      newlib_search_path=
2097      need_relink=no # whether we're linking any uninstalled libtool libraries      need_relink=no # whether we're linking any uninstalled libtool libraries
2098      notinst_deplibs= # not-installed libtool libraries      notinst_deplibs= # not-installed libtool libraries
     notinst_path= # paths that contain not-installed libtool libraries  
2099      case $linkmode in      case $linkmode in
2100      lib)      lib)
2101          passes="conv link"          passes="conv link"
# Line 2244  EOF Line 2331  EOF
2331          esac # case $deplib          esac # case $deplib
2332          if test "$found" = yes || test -f "$lib"; then :          if test "$found" = yes || test -f "$lib"; then :
2333          else          else
2334            $echo "$modename: cannot find the library \`$lib'" 1>&2            $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2335            exit $EXIT_FAILURE            exit $EXIT_FAILURE
2336          fi          fi
2337    
# Line 2458  EOF Line 2545  EOF
2545                case "$temp_rpath " in                case "$temp_rpath " in
2546                *" $dir "*) ;;                *" $dir "*) ;;
2547                *" $absdir "*) ;;                *" $absdir "*) ;;
2548                *) temp_rpath="$temp_rpath $dir" ;;                *) temp_rpath="$temp_rpath $absdir" ;;
2549                esac                esac
2550              fi              fi
2551    
# Line 2495  EOF Line 2582  EOF
2582          fi          fi
2583    
2584          link_static=no # Whether the deplib will be linked statically          link_static=no # Whether the deplib will be linked statically
2585            use_static_libs=$prefer_static_libs
2586            if test "$use_static_libs" = built && test "$installed" = yes ; then
2587              use_static_libs=no
2588            fi
2589          if test -n "$library_names" &&          if test -n "$library_names" &&
2590             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then             { test "$use_static_libs" = no || test -z "$old_library"; }; then
2591            if test "$installed" = no; then            if test "$installed" = no; then
2592              notinst_deplibs="$notinst_deplibs $lib"              notinst_deplibs="$notinst_deplibs $lib"
2593              need_relink=yes              need_relink=yes
# Line 2609  EOF Line 2700  EOF
2700                if test "$hardcode_direct" = no; then                if test "$hardcode_direct" = no; then
2701                  add="$dir/$linklib"                  add="$dir/$linklib"
2702                  case $host in                  case $host in
2703                    *-*-sco3.2v5* ) add_dir="-L$dir" ;;                    *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2704                      *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2705                      *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2706                        *-*-unixware7*) add_dir="-L$dir" ;;
2707                    *-*-darwin* )                    *-*-darwin* )
2708                      # if the lib is a module then we can not link against                      # if the lib is a module then we can not link against
2709                      # it, someone is ignoring the new warnings I added                      # it, someone is ignoring the new warnings I added
2710                      if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then                      if /usr/bin/file -L $add 2> /dev/null |
2711                          $EGREP ": [^:]* bundle" >/dev/null ; then
2712                        $echo "** Warning, lib $linklib is a module, not a shared library"                        $echo "** Warning, lib $linklib is a module, not a shared library"
2713                        if test -z "$old_library" ; then                        if test -z "$old_library" ; then
2714                          $echo                          $echo
# Line 2644  EOF Line 2739  EOF
2739                  add_dir="-L$dir"                  add_dir="-L$dir"
2740                  # Try looking first in the location we're being installed to.                  # Try looking first in the location we're being installed to.
2741                  if test -n "$inst_prefix_dir"; then                  if test -n "$inst_prefix_dir"; then
2742                    case "$libdir" in                    case $libdir in
2743                      [\\/]*)                      [\\/]*)
2744                        add_dir="$add_dir -L$inst_prefix_dir$libdir"                        add_dir="$add_dir -L$inst_prefix_dir$libdir"
2745                        ;;                        ;;
# Line 2717  EOF Line 2812  EOF
2812                add_dir="-L$libdir"                add_dir="-L$libdir"
2813                # Try looking first in the location we're being installed to.                # Try looking first in the location we're being installed to.
2814                if test -n "$inst_prefix_dir"; then                if test -n "$inst_prefix_dir"; then
2815                  case "$libdir" in                  case $libdir in
2816                    [\\/]*)                    [\\/]*)
2817                      add_dir="$add_dir -L$inst_prefix_dir$libdir"                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2818                      ;;                      ;;
# Line 2778  EOF Line 2873  EOF
2873                fi                fi
2874              fi              fi
2875            else            else
             convenience="$convenience $dir/$old_library"  
             old_convenience="$old_convenience $dir/$old_library"  
2876              deplibs="$dir/$old_library $deplibs"              deplibs="$dir/$old_library $deplibs"
2877              link_static=yes              link_static=yes
2878            fi            fi
# Line 3366  EOF Line 3459  EOF
3459    
3460        # Eliminate all temporary directories.        # Eliminate all temporary directories.
3461        for path in $notinst_path; do        for path in $notinst_path; do
3462          lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`          lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3463          deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`          deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3464          dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`          dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3465        done        done
3466    
3467        if test -n "$xrpath"; then        if test -n "$xrpath"; then
# Line 3421  EOF Line 3514  EOF
3514              ;;              ;;
3515            *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)            *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3516              # Do not include libc due to us having libc/libc_r.              # Do not include libc due to us having libc/libc_r.
3517              test "X$arg" = "X-lc" && continue              ;;
3518              *-*-sco3.2v5* | *-*-sco5v6*)
3519                # Causes problems with __ctype
3520                ;;
3521              *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3522                # Compiler inserts libc in the correct place for threads to work
3523              ;;              ;;
3524            *)            *)
3525              # Add libc to deplibs on all other systems if necessary.              # Add libc to deplibs on all other systems if necessary.
# Line 3465  EOF Line 3563  EOF
3563            int main() { return 0; }            int main() { return 0; }
3564  EOF  EOF
3565            $rm conftest            $rm conftest
3566            $LTCC -o conftest conftest.c $deplibs            $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3567            if test "$?" -eq 0 ; then            if test "$?" -eq 0 ; then
3568              ldd_output=`ldd conftest`              ldd_output=`ldd conftest`
3569              for i in $deplibs; do              for i in $deplibs; do
3570                name="`expr $i : '-l\(.*\)'`"                name=`expr $i : '-l\(.*\)'`
3571                # If $name is empty we are operating on a -L argument.                # If $name is empty we are operating on a -L argument.
3572                if test "$name" != "" && test "$name" -ne "0"; then                if test "$name" != "" && test "$name" -ne "0"; then
3573                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
# Line 3506  EOF Line 3604  EOF
3604              # Error occurred in the first compile.  Let's try to salvage              # Error occurred in the first compile.  Let's try to salvage
3605              # the situation: Compile a separate program for each library.              # the situation: Compile a separate program for each library.
3606              for i in $deplibs; do              for i in $deplibs; do
3607                name="`expr $i : '-l\(.*\)'`"                name=`expr $i : '-l\(.*\)'`
3608                # If $name is empty we are operating on a -L argument.                # If $name is empty we are operating on a -L argument.
3609                if test "$name" != "" && test "$name" != "0"; then                if test "$name" != "" && test "$name" != "0"; then
3610                  $rm conftest                  $rm conftest
3611                  $LTCC -o conftest conftest.c $i                  $LTCC $LTCFLAGS -o conftest conftest.c $i
3612                  # Did it work?                  # Did it work?
3613                  if test "$?" -eq 0 ; then                  if test "$?" -eq 0 ; then
3614                    ldd_output=`ldd conftest`                    ldd_output=`ldd conftest`
# Line 3558  EOF Line 3656  EOF
3656            set dummy $deplibs_check_method            set dummy $deplibs_check_method
3657            file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`            file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3658            for a_deplib in $deplibs; do            for a_deplib in $deplibs; do
3659              name="`expr $a_deplib : '-l\(.*\)'`"              name=`expr $a_deplib : '-l\(.*\)'`
3660              # If $name is empty we are operating on a -L argument.              # If $name is empty we are operating on a -L argument.
3661              if test "$name" != "" && test  "$name" != "0"; then              if test "$name" != "" && test  "$name" != "0"; then
3662                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
# Line 3634  EOF Line 3732  EOF
3732            set dummy $deplibs_check_method            set dummy $deplibs_check_method
3733            match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`            match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3734            for a_deplib in $deplibs; do            for a_deplib in $deplibs; do
3735              name="`expr $a_deplib : '-l\(.*\)'`"              name=`expr $a_deplib : '-l\(.*\)'`
3736              # If $name is empty we are operating on a -L argument.              # If $name is empty we are operating on a -L argument.
3737              if test -n "$name" && test "$name" != "0"; then              if test -n "$name" && test "$name" != "0"; then
3738                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
# Line 3764  EOF Line 3862  EOF
3862          deplibs=$newdeplibs          deplibs=$newdeplibs
3863        fi        fi
3864    
3865    
3866          # move library search paths that coincide with paths to not yet
3867          # installed libraries to the beginning of the library search list
3868          new_libs=
3869          for path in $notinst_path; do
3870            case " $new_libs " in
3871            *" -L$path/$objdir "*) ;;
3872            *)
3873              case " $deplibs " in
3874              *" -L$path/$objdir "*)
3875                new_libs="$new_libs -L$path/$objdir" ;;
3876              esac
3877              ;;
3878            esac
3879          done
3880          for deplib in $deplibs; do
3881            case $deplib in
3882            -L*)
3883              case " $new_libs " in
3884              *" $deplib "*) ;;
3885              *) new_libs="$new_libs $deplib" ;;
3886              esac
3887              ;;
3888            *) new_libs="$new_libs $deplib" ;;
3889            esac
3890          done
3891          deplibs="$new_libs"
3892    
3893    
3894        # All the library-specific variables (install_libdir is set above).        # All the library-specific variables (install_libdir is set above).
3895        library_names=        library_names=
3896        old_library=        old_library=
# Line 3847  EOF Line 3974  EOF
3974          fi          fi
3975    
3976          lib="$output_objdir/$realname"          lib="$output_objdir/$realname"
3977            linknames=
3978          for link          for link
3979          do          do
3980            linknames="$linknames $link"            linknames="$linknames $link"
# Line 3875  EOF Line 4003  EOF
4003                  # The command line is too long to execute in one step.                  # The command line is too long to execute in one step.
4004                  $show "using reloadable object file for export list..."                  $show "using reloadable object file for export list..."
4005                  skipped_export=:                  skipped_export=:
4006                    # Break out early, otherwise skipped_export may be
4007                    # set to false by a later but shorter cmd.
4008                    break
4009                fi                fi
4010              done              done
4011              IFS="$save_ifs"              IFS="$save_ifs"
# Line 3944  EOF Line 4075  EOF
4075            fi            fi
4076          fi          fi
4077    
4078          if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&          if test "X$skipped_export" != "X:" &&
4079               len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4080             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4081            :            :
4082          else          else
# Line 3979  EOF Line 4111  EOF
4111            do            do
4112              eval test_cmds=\"$reload_cmds $objlist $last_robj\"              eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4113              if test "X$objlist" = X ||              if test "X$objlist" = X ||
4114                 { len=`expr "X$test_cmds" : ".*"` &&                 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4115                   test "$len" -le "$max_cmd_len"; }; then                   test "$len" -le "$max_cmd_len"; }; then
4116                objlist="$objlist $obj"                objlist="$objlist $obj"
4117              else              else
# Line 4069  EOF Line 4201  EOF
4201            IFS="$save_ifs"            IFS="$save_ifs"
4202            eval cmd=\"$cmd\"            eval cmd=\"$cmd\"
4203            $show "$cmd"            $show "$cmd"
4204            $run eval "$cmd" || exit $?            $run eval "$cmd" || {
4205                lt_exit=$?
4206    
4207                # Restore the uninstalled library and exit
4208                if test "$mode" = relink; then
4209                  $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4210                fi
4211    
4212                exit $lt_exit
4213              }
4214          done          done
4215          IFS="$save_ifs"          IFS="$save_ifs"
4216    
4217          # Restore the uninstalled library and exit          # Restore the uninstalled library and exit
4218          if test "$mode" = relink; then          if test "$mode" = relink; then
4219            $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?            $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4220    
4221              if test -n "$convenience"; then
4222                if test -z "$whole_archive_flag_spec"; then
4223                  $show "${rm}r $gentop"
4224                  $run ${rm}r "$gentop"
4225                fi
4226              fi
4227    
4228            exit $EXIT_SUCCESS            exit $EXIT_SUCCESS
4229          fi          fi
4230    
# Line 4257  EOF Line 4406  EOF
4406          ;;          ;;
4407        esac        esac
4408    
4409    
4410          # move library search paths that coincide with paths to not yet
4411          # installed libraries to the beginning of the library search list
4412          new_libs=
4413          for path in $notinst_path; do
4414            case " $new_libs " in
4415            *" -L$path/$objdir "*) ;;
4416            *)
4417              case " $compile_deplibs " in
4418              *" -L$path/$objdir "*)
4419                new_libs="$new_libs -L$path/$objdir" ;;
4420              esac
4421              ;;
4422            esac
4423          done
4424          for deplib in $compile_deplibs; do
4425            case $deplib in
4426            -L*)
4427              case " $new_libs " in
4428              *" $deplib "*) ;;
4429              *) new_libs="$new_libs $deplib" ;;
4430              esac
4431              ;;
4432            *) new_libs="$new_libs $deplib" ;;
4433            esac
4434          done
4435          compile_deplibs="$new_libs"
4436    
4437    
4438        compile_command="$compile_command $compile_deplibs"        compile_command="$compile_command $compile_deplibs"
4439        finalize_command="$finalize_command $finalize_deplibs"        finalize_command="$finalize_command $finalize_deplibs"
4440    
# Line 4301  EOF Line 4479  EOF
4479          fi          fi
4480          case $host in          case $host in
4481          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4482              testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4483            case :$dllsearchpath: in            case :$dllsearchpath: in
4484            *":$libdir:"*) ;;            *":$libdir:"*) ;;
4485            *) dllsearchpath="$dllsearchpath:$libdir";;            *) dllsearchpath="$dllsearchpath:$libdir";;
4486            esac            esac
4487              case :$dllsearchpath: in
4488              *":$testbindir:"*) ;;
4489              *) dllsearchpath="$dllsearchpath:$testbindir";;
4490              esac
4491            ;;            ;;
4492          esac          esac
4493        done        done
# Line 4420  extern \"C\" { Line 4603  extern \"C\" {
4603              if test -z "$export_symbols"; then              if test -z "$export_symbols"; then
4604                export_symbols="$output_objdir/$outputname.exp"                export_symbols="$output_objdir/$outputname.exp"
4605                $run $rm $export_symbols                $run $rm $export_symbols
4606                $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'                $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4607                  case $host in
4608                  *cygwin* | *mingw* )
4609                    $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4610                    $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4611                    ;;
4612                  esac
4613              else              else
4614                $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'                $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4615                $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'                $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4616                $run eval 'mv "$nlist"T "$nlist"'                $run eval 'mv "$nlist"T "$nlist"'
4617                  case $host in
4618                  *cygwin* | *mingw* )
4619                    $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4620                    $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4621                    ;;
4622                  esac
4623              fi              fi
4624            fi            fi
4625    
# Line 4541  static const void *lt_preloaded_setup() Line 4736  static const void *lt_preloaded_setup()
4736            esac            esac
4737    
4738            # Now compile the dynamic symbol file.            # Now compile the dynamic symbol file.
4739            $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"            $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4740            $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?            $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4741    
4742            # Clean up the generated files.            # Clean up the generated files.
4743            $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"            $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4744            $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"            $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4745    
4746            # Transform the symbol file into the correct name.            # Transform the symbol file into the correct name.
4747            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`            case $host in
4748            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`            *cygwin* | *mingw* )
4749                if test -f "$output_objdir/${outputname}.def" ; then
4750                  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4751                  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4752                else
4753                  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4754                  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4755                 fi
4756                ;;
4757              * )
4758                compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4759                finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4760                ;;
4761              esac
4762            ;;            ;;
4763          *)          *)
4764            $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2            $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
# Line 4575  static const void *lt_preloaded_setup() Line 4783  static const void *lt_preloaded_setup()
4783          # We have no uninstalled library dependencies, so finalize right now.          # We have no uninstalled library dependencies, so finalize right now.
4784          $show "$link_command"          $show "$link_command"
4785          $run eval "$link_command"          $run eval "$link_command"
4786          status=$?          exit_status=$?
4787    
4788          # Delete the generated files.          # Delete the generated files.
4789          if test -n "$dlsyms"; then          if test -n "$dlsyms"; then
# Line 4583  static const void *lt_preloaded_setup() Line 4791  static const void *lt_preloaded_setup()
4791            $run $rm "$output_objdir/${outputname}S.${objext}"            $run $rm "$output_objdir/${outputname}S.${objext}"
4792          fi          fi
4793    
4794          exit $status          exit $exit_status
4795        fi        fi
4796    
4797        if test -n "$shlibpath_var"; then        if test -n "$shlibpath_var"; then
# Line 4723  static const void *lt_preloaded_setup() Line 4931  static const void *lt_preloaded_setup()
4931          esac          esac
4932          case $host in          case $host in
4933            *cygwin* | *mingw* )            *cygwin* | *mingw* )
4934              cwrappersource=`$echo ${objdir}/lt-${outputname}.c`              output_name=`basename $output`
4935              cwrapper=`$echo ${output}.exe`              output_path=`dirname $output`
4936              $rm $cwrappersource $cwrapper              cwrappersource="$output_path/$objdir/lt-$output_name.c"
4937              trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15              cwrapper="$output_path/$output_name.exe"
4938                $rm $cwrappersource $cwrapper
4939                trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4940    
4941              cat > $cwrappersource <<EOF              cat > $cwrappersource <<EOF
4942    
# Line 4751  EOF Line 4961  EOF
4961  #include <malloc.h>  #include <malloc.h>
4962  #include <stdarg.h>  #include <stdarg.h>
4963  #include <assert.h>  #include <assert.h>
4964    #include <string.h>
4965    #include <ctype.h>
4966    #include <sys/stat.h>
4967    
4968  #if defined(PATH_MAX)  #if defined(PATH_MAX)
4969  # define LT_PATHMAX PATH_MAX  # define LT_PATHMAX PATH_MAX
# Line 4761  EOF Line 4974  EOF
4974  #endif  #endif
4975    
4976  #ifndef DIR_SEPARATOR  #ifndef DIR_SEPARATOR
4977  #define DIR_SEPARATOR '/'  # define DIR_SEPARATOR '/'
4978    # define PATH_SEPARATOR ':'
4979  #endif  #endif
4980    
4981  #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \  #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4982    defined (__OS2__)    defined (__OS2__)
4983  #define HAVE_DOS_BASED_FILE_SYSTEM  # define HAVE_DOS_BASED_FILE_SYSTEM
4984  #ifndef DIR_SEPARATOR_2  # ifndef DIR_SEPARATOR_2
4985  #define DIR_SEPARATOR_2 '\\'  #  define DIR_SEPARATOR_2 '\\'
4986  #endif  # endif
4987    # ifndef PATH_SEPARATOR_2
4988    #  define PATH_SEPARATOR_2 ';'
4989    # endif
4990  #endif  #endif
4991    
4992  #ifndef DIR_SEPARATOR_2  #ifndef DIR_SEPARATOR_2
# Line 4779  EOF Line 4996  EOF
4996          (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))          (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4997  #endif /* DIR_SEPARATOR_2 */  #endif /* DIR_SEPARATOR_2 */
4998    
4999    #ifndef PATH_SEPARATOR_2
5000    # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5001    #else /* PATH_SEPARATOR_2 */
5002    # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5003    #endif /* PATH_SEPARATOR_2 */
5004    
5005  #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))  #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
5006  #define XFREE(stale) do { \  #define XFREE(stale) do { \
5007    if (stale) { free ((void *) stale); stale = 0; } \    if (stale) { free ((void *) stale); stale = 0; } \
5008  } while (0)  } while (0)
5009    
5010    /* -DDEBUG is fairly common in CFLAGS.  */
5011    #undef DEBUG
5012    #if defined DEBUGWRAPPER
5013    # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5014    #else
5015    # define DEBUG(format, ...)
5016    #endif
5017    
5018  const char *program_name = NULL;  const char *program_name = NULL;
5019    
5020  void * xmalloc (size_t num);  void * xmalloc (size_t num);
5021  char * xstrdup (const char *string);  char * xstrdup (const char *string);
5022  char * basename (const char *name);  const char * base_name (const char *name);
5023  char * fnqualify(const char *path);  char * find_executable(const char *wrapper);
5024    int    check_executable(const char *path);
5025  char * strendzap(char *str, const char *pat);  char * strendzap(char *str, const char *pat);
5026  void lt_fatal (const char *message, ...);  void lt_fatal (const char *message, ...);
5027    
# Line 4799  main (int argc, char *argv[]) Line 5031  main (int argc, char *argv[])
5031    char **newargz;    char **newargz;
5032    int i;    int i;
5033    
5034    program_name = (char *) xstrdup ((char *) basename (argv[0]));    program_name = (char *) xstrdup (base_name (argv[0]));
5035      DEBUG("(main) argv[0]      : %s\n",argv[0]);
5036      DEBUG("(main) program_name : %s\n",program_name);
5037    newargz = XMALLOC(char *, argc+2);    newargz = XMALLOC(char *, argc+2);
5038  EOF  EOF
5039    
5040              cat >> $cwrappersource <<EOF              cat >> $cwrappersource <<EOF
5041    newargz[0] = "$SHELL";    newargz[0] = (char *) xstrdup("$SHELL");
5042  EOF  EOF
5043    
5044              cat >> $cwrappersource <<"EOF"              cat >> $cwrappersource <<"EOF"
5045    newargz[1] = fnqualify(argv[0]);    newargz[1] = find_executable(argv[0]);
5046      if (newargz[1] == NULL)
5047        lt_fatal("Couldn't find %s", argv[0]);
5048      DEBUG("(main) found exe at : %s\n",newargz[1]);
5049    /* we know the script has the same name, without the .exe */    /* we know the script has the same name, without the .exe */
5050    /* so make sure newargz[1] doesn't end in .exe */    /* so make sure newargz[1] doesn't end in .exe */
5051    strendzap(newargz[1],".exe");    strendzap(newargz[1],".exe");
5052    for (i = 1; i < argc; i++)    for (i = 1; i < argc; i++)
5053      newargz[i+1] = xstrdup(argv[i]);      newargz[i+1] = xstrdup(argv[i]);
5054    newargz[argc+1] = NULL;    newargz[argc+1] = NULL;
5055    
5056      for (i=0; i<argc+1; i++)
5057      {
5058        DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
5059        ;
5060      }
5061    
5062  EOF  EOF
5063    
5064              cat >> $cwrappersource <<EOF              case $host_os in
5065                  mingw*)
5066                    cat >> $cwrappersource <<EOF
5067      execv("$SHELL",(char const **)newargz);
5068    EOF
5069                  ;;
5070                  *)
5071                    cat >> $cwrappersource <<EOF
5072    execv("$SHELL",newargz);    execv("$SHELL",newargz);
5073  EOF  EOF
5074                  ;;
5075                esac
5076    
5077              cat >> $cwrappersource <<"EOF"              cat >> $cwrappersource <<"EOF"
5078      return 127;
5079  }  }
5080    
5081  void *  void *
# Line 4841  xstrdup (const char *string) Line 5095  xstrdup (const char *string)
5095  ;  ;
5096  }  }
5097    
5098  char *  const char *
5099  basename (const char *name)  base_name (const char *name)
5100  {  {
5101    const char *base;    const char *base;
5102    
5103  #if defined (HAVE_DOS_BASED_FILE_SYSTEM)  #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5104    /* Skip over the disk name in MSDOS pathnames. */    /* Skip over the disk name in MSDOS pathnames. */
5105    if (isalpha (name[0]) && name[1] == ':')    if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5106      name += 2;      name += 2;
5107  #endif  #endif
5108    
5109    for (base = name; *name; name++)    for (base = name; *name; name++)
5110      if (IS_DIR_SEPARATOR (*name))      if (IS_DIR_SEPARATOR (*name))
5111        base = name + 1;        base = name + 1;
5112    return (char *) base;    return base;
5113  }  }
5114    
5115    int
5116    check_executable(const char * path)
5117    {
5118      struct stat st;
5119    
5120      DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5121      if ((!path) || (!*path))
5122        return 0;
5123    
5124      if ((stat (path, &st) >= 0) &&
5125          (
5126            /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5127    #if defined (S_IXOTH)
5128           ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5129    #endif
5130    #if defined (S_IXGRP)
5131           ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5132    #endif
5133           ((st.st_mode & S_IXUSR) == S_IXUSR))
5134          )
5135        return 1;
5136      else
5137        return 0;
5138    }
5139    
5140    /* Searches for the full path of the wrapper.  Returns
5141       newly allocated full path name if found, NULL otherwise */
5142  char *  char *
5143  fnqualify(const char *path)  find_executable (const char* wrapper)
5144  {  {
5145    size_t size;    int has_slash = 0;
5146    char *p;    const char* p;
5147      const char* p_next;
5148      /* static buffer for getcwd */
5149    char tmp[LT_PATHMAX + 1];    char tmp[LT_PATHMAX + 1];
5150      int tmp_len;
5151      char* concat_name;
5152    
5153    assert(path != NULL);    DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5154    
5155    /* Is it qualified already? */    if ((wrapper == NULL) || (*wrapper == '\0'))
5156        return NULL;
5157    
5158      /* Absolute path? */
5159    #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5160      if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5161      {
5162        concat_name = xstrdup (wrapper);
5163        if (check_executable(concat_name))
5164          return concat_name;
5165        XFREE(concat_name);
5166      }
5167      else
5168      {
5169    #endif
5170        if (IS_DIR_SEPARATOR (wrapper[0]))
5171        {
5172          concat_name = xstrdup (wrapper);
5173          if (check_executable(concat_name))
5174            return concat_name;
5175          XFREE(concat_name);
5176        }
5177  #if defined (HAVE_DOS_BASED_FILE_SYSTEM)  #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5178    if (isalpha (path[0]) && path[1] == ':')    }
     return xstrdup (path);  
5179  #endif  #endif
   if (IS_DIR_SEPARATOR (path[0]))  
     return xstrdup (path);  
5180    
5181    /* prepend the current directory */    for (p = wrapper; *p; p++)
5182    /* doesn't handle '~' */      if (*p == '/')
5183        {
5184          has_slash = 1;
5185          break;
5186        }
5187      if (!has_slash)
5188      {
5189        /* no slashes; search PATH */
5190        const char* path = getenv ("PATH");
5191        if (path != NULL)
5192        {
5193          for (p = path; *p; p = p_next)
5194          {
5195            const char* q;
5196            size_t p_len;
5197            for (q = p; *q; q++)
5198              if (IS_PATH_SEPARATOR(*q))
5199                break;
5200            p_len = q - p;
5201            p_next = (*q == '\0' ? q : q + 1);
5202            if (p_len == 0)
5203            {
5204              /* empty path: current directory */
5205              if (getcwd (tmp, LT_PATHMAX) == NULL)
5206                lt_fatal ("getcwd failed");
5207              tmp_len = strlen(tmp);
5208              concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5209              memcpy (concat_name, tmp, tmp_len);
5210              concat_name[tmp_len] = '/';
5211              strcpy (concat_name + tmp_len + 1, wrapper);
5212            }
5213            else
5214            {
5215              concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5216              memcpy (concat_name, p, p_len);
5217              concat_name[p_len] = '/';
5218              strcpy (concat_name + p_len + 1, wrapper);
5219            }
5220            if (check_executable(concat_name))
5221              return concat_name;
5222            XFREE(concat_name);
5223          }
5224        }
5225        /* not found in PATH; assume curdir */
5226      }
5227      /* Relative path | not found in path: prepend cwd */
5228    if (getcwd (tmp, LT_PATHMAX) == NULL)    if (getcwd (tmp, LT_PATHMAX) == NULL)
5229      lt_fatal ("getcwd failed");      lt_fatal ("getcwd failed");
5230    size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */    tmp_len = strlen(tmp);
5231    p = XMALLOC(char, size);    concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5232    sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);    memcpy (concat_name, tmp, tmp_len);
5233    return p;    concat_name[tmp_len] = '/';
5234      strcpy (concat_name + tmp_len + 1, wrapper);
5235    
5236      if (check_executable(concat_name))
5237        return concat_name;
5238      XFREE(concat_name);
5239      return NULL;
5240  }  }
5241    
5242  char *  char *
# Line 4926  lt_fatal (const char *message, ...) Line 5280  lt_fatal (const char *message, ...)
5280    va_end (ap);    va_end (ap);
5281  }  }
5282  EOF  EOF
5283            # we should really use a build-platform specific compiler            # we should really use a build-platform specific compiler
5284            # here, but OTOH, the wrappers (shell script and this C one)            # here, but OTOH, the wrappers (shell script and this C one)
5285            # are only useful if you want to execute the "real" binary.            # are only useful if you want to execute the "real" binary.
5286            # Since the "real" binary is built for $host, then this            # Since the "real" binary is built for $host, then this
5287            # wrapper might as well be built for $host, too.            # wrapper might as well be built for $host, too.
5288            $run $LTCC -s -o $cwrapper $cwrappersource            $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5289            ;;            ;;
5290          esac          esac
5291          $rm $output          $rm $output
5292          trap "$rm $output; exit $EXIT_FAILURE" 1 2 15          trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5293    
5294          $echo > $output "\          $echo > $output "\
5295  #! $SHELL  #! $SHELL
# Line 5080  else Line 5434  else
5434          $echo >> $output "\          $echo >> $output "\
5435      if test \"\$libtool_execute_magic\" != \"$magic\"; then      if test \"\$libtool_execute_magic\" != \"$magic\"; then
5436        # Run the actual program with our arguments.        # Run the actual program with our arguments.
5437    
5438          # Make sure env LD_LIBRARY_PATH does not mess us up
5439          if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5440            export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5441          fi
5442  "  "
5443          case $host in          case $host in
5444          # Backslashes separate directories on plain windows          # Backslashes separate directories on plain windows
5445          *-*-mingw | *-*-os2*)          *-*-mingw | *-*-os2*)
5446            $echo >> $output "\            $echo >> $output "\
5447        exec \$progdir\\\\\$program \${1+\"\$@\"}        exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5448  "  "
5449            ;;            ;;
5450    
5451          *)          *)
5452            $echo >> $output "\            $echo >> $output "\
5453        exec \$progdir/\$program \${1+\"\$@\"}        exec \"\$progdir/\$program\" \${1+\"\$@\"}
5454  "  "
5455            ;;            ;;
5456          esac          esac
# Line 5101  else Line 5460  else
5460      fi      fi
5461    else    else
5462      # The program doesn't exist.      # The program doesn't exist.
5463      \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2      \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5464      \$echo \"This script is just a wrapper for \$program.\" 1>&2      \$echo \"This script is just a wrapper for \$program.\" 1>&2
5465      $echo \"See the $PACKAGE documentation for more information.\" 1>&2      $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5466      exit $EXIT_FAILURE      exit $EXIT_FAILURE
# Line 5165  fi\ Line 5524  fi\
5524              $run ${rm}r "$gentop"              $run ${rm}r "$gentop"
5525              $show "$mkdir $gentop"              $show "$mkdir $gentop"
5526              $run $mkdir "$gentop"              $run $mkdir "$gentop"
5527              status=$?              exit_status=$?
5528              if test "$status" -ne 0 && test ! -d "$gentop"; then              if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5529                exit $status                exit $exit_status
5530              fi              fi
5531            fi            fi
5532    
# Line 5224  fi\ Line 5583  fi\
5583              oldobjs="$objlist $obj"              oldobjs="$objlist $obj"
5584              objlist="$objlist $obj"              objlist="$objlist $obj"
5585              eval test_cmds=\"$old_archive_cmds\"              eval test_cmds=\"$old_archive_cmds\"
5586              if len=`expr "X$test_cmds" : ".*"` &&              if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5587                 test "$len" -le "$max_cmd_len"; then                 test "$len" -le "$max_cmd_len"; then
5588                :                :
5589              else              else
# Line 5334  fi\ Line 5693  fi\
5693                    fi                    fi
5694                    # We do not want portage's build root ($S) present.                    # We do not want portage's build root ($S) present.
5695                    my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`                    my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
                   if test -n "$my_little_ninja_foo_2" && test "$S"; then  
                     mynewdependency_lib=""  
5696                    # We do not want portage's install root ($D) present.                    # We do not want portage's install root ($D) present.
5697                    my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`                    my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
5698                      if test -n "$my_little_ninja_foo_2" && test "$S"; then
5699                        mynewdependency_lib=""
5700                    elif test -n "$my_little_ninja_foo_3" && test "$D"; then                    elif test -n "$my_little_ninja_foo_3" && test "$D"; then
5701                      eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`                      eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5702                    else                    else
# Line 5469  relink_command=\"$relink_command\"" Line 5828  relink_command=\"$relink_command\""
5828      # install_prog (especially on Windows NT).      # install_prog (especially on Windows NT).
5829      if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||      if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5830         # Allow the use of GNU shtool's install command.         # Allow the use of GNU shtool's install command.
5831         $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then         $echo "X$nonopt" | grep shtool > /dev/null; then
5832        # Aesthetically quote it.        # Aesthetically quote it.
5833        arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`        arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5834        case $arg in        case $arg in
5835        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5836          arg="\"$arg\""          arg="\"$arg\""
5837          ;;          ;;
5838        esac        esac
# Line 5482  relink_command=\"$relink_command\"" Line 5841  relink_command=\"$relink_command\""
5841        shift        shift
5842      else      else
5843        install_prog=        install_prog=
5844        arg="$nonopt"        arg=$nonopt
5845      fi      fi
5846    
5847      # The real first argument should be the name of the installation program.      # The real first argument should be the name of the installation program.
5848      # Aesthetically quote it.      # Aesthetically quote it.
5849      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5850      case $arg in      case $arg in
5851      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5852        arg="\"$arg\""        arg="\"$arg\""
5853        ;;        ;;
5854      esac      esac
# Line 5507  relink_command=\"$relink_command\"" Line 5866  relink_command=\"$relink_command\""
5866      do      do
5867        if test -n "$dest"; then        if test -n "$dest"; then
5868          files="$files $dest"          files="$files $dest"
5869          dest="$arg"          dest=$arg
5870          continue          continue
5871        fi        fi
5872    
5873        case $arg in        case $arg in
5874        -d) isdir=yes ;;        -d) isdir=yes ;;
5875        -f) prev="-f" ;;        -f)
5876        -g) prev="-g" ;;          case " $install_prog " in
5877        -m) prev="-m" ;;          *[\\\ /]cp\ *) ;;
5878        -o) prev="-o" ;;          *) prev=$arg ;;
5879            esac
5880            ;;
5881          -g | -m | -o) prev=$arg ;;
5882        -s)        -s)
5883          stripme=" -s"          stripme=" -s"
5884          continue          continue
5885          ;;          ;;
5886        -*) ;;        -*)
5887            ;;
5888        *)        *)
5889          # If the previous option needed an argument, then skip it.          # If the previous option needed an argument, then skip it.
5890          if test -n "$prev"; then          if test -n "$prev"; then
5891            prev=            prev=
5892          else          else
5893            dest="$arg"            dest=$arg
5894            continue            continue
5895          fi          fi
5896          ;;          ;;
# Line 5537  relink_command=\"$relink_command\"" Line 5899  relink_command=\"$relink_command\""
5899        # Aesthetically quote the argument.        # Aesthetically quote the argument.
5900        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5901        case $arg in        case $arg in
5902        *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5903          arg="\"$arg\""          arg="\"$arg\""
5904          ;;          ;;
5905        esac        esac
# Line 5706  relink_command=\"$relink_command\"" Line 6068  relink_command=\"$relink_command\""
6068    
6069            if test "$#" -gt 0; then            if test "$#" -gt 0; then
6070              # Delete the old symlinks, and create new ones.              # Delete the old symlinks, and create new ones.
6071                # Try `ln -sf' first, because the `ln' binary might depend on
6072                # the symlink we replace!  Solaris /bin/ln does not understand -f,
6073                # so we also need to try rm && ln -s.
6074              for linkname              for linkname
6075              do              do
6076                if test "$linkname" != "$realname"; then                if test "$linkname" != "$realname"; then
6077                  $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"                  $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6078                  $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"                  $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6079                fi                fi
6080              done              done
6081            fi            fi
# Line 5723  relink_command=\"$relink_command\"" Line 6088  relink_command=\"$relink_command\""
6088              IFS="$save_ifs"              IFS="$save_ifs"
6089              eval cmd=\"$cmd\"              eval cmd=\"$cmd\"
6090              $show "$cmd"              $show "$cmd"
6091              $run eval "$cmd" || exit $?              $run eval "$cmd" || {
6092                  lt_exit=$?
6093    
6094                  # Restore the uninstalled library and exit
6095                  if test "$mode" = relink; then
6096                    $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6097                  fi
6098    
6099                  exit $lt_exit
6100                }
6101            done            done
6102            IFS="$save_ifs"            IFS="$save_ifs"
6103          fi          fi
# Line 5817  relink_command=\"$relink_command\"" Line 6191  relink_command=\"$relink_command\""
6191            notinst_deplibs=            notinst_deplibs=
6192            relink_command=            relink_command=
6193    
6194            # To insure that "foo" is sourced, and not "foo.exe",            # Note that it is not necessary on cygwin/mingw to append a dot to
6195            # finese the cygwin/MSYS system by explicitly sourcing "foo."            # foo even if both foo and FILE.exe exist: automatic-append-.exe
6196            # which disallows the automatic-append-.exe behavior.            # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6197            case $build in            # `FILE.' does not work on cygwin managed mounts.
6198            *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;            #
           *) wrapperdot=${wrapper} ;;  
           esac  
6199            # If there is no directory component, then add one.            # If there is no directory component, then add one.
6200            case $file in            case $wrapper in
6201            */* | *\\*) . ${wrapperdot} ;;            */* | *\\*) . ${wrapper} ;;
6202            *) . ./${wrapperdot} ;;            *) . ./${wrapper} ;;
6203            esac            esac
6204    
6205            # Check the variables that should have been set.            # Check the variables that should have been set.
# Line 5855  relink_command=\"$relink_command\"" Line 6227  relink_command=\"$relink_command\""
6227            done            done
6228    
6229            relink_command=            relink_command=
6230            # To insure that "foo" is sourced, and not "foo.exe",            # Note that it is not necessary on cygwin/mingw to append a dot to
6231            # finese the cygwin/MSYS system by explicitly sourcing "foo."            # foo even if both foo and FILE.exe exist: automatic-append-.exe
6232            # which disallows the automatic-append-.exe behavior.            # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6233            case $build in            # `FILE.' does not work on cygwin managed mounts.
6234            *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;            #
           *) wrapperdot=${wrapper} ;;  
           esac  
6235            # If there is no directory component, then add one.            # If there is no directory component, then add one.
6236            case $file in            case $wrapper in
6237            */* | *\\*) . ${wrapperdot} ;;            */* | *\\*) . ${wrapper} ;;
6238            *) . ./${wrapperdot} ;;            *) . ./${wrapper} ;;
6239            esac            esac
6240    
6241            outputname=            outputname=
6242            if test "$fast_install" = no && test -n "$relink_command"; then            if test "$fast_install" = no && test -n "$relink_command"; then
6243              if test "$finalize" = yes && test -z "$run"; then              if test "$finalize" = yes && test -z "$run"; then
6244                tmpdir="/tmp"                tmpdir=`func_mktempdir`
               test -n "$TMPDIR" && tmpdir="$TMPDIR"  
               tmpdir="$tmpdir/libtool-$$"  
               save_umask=`umask`  
               umask 0077  
               if $mkdir "$tmpdir"; then  
                 umask $save_umask  
               else  
                 umask $save_umask  
                 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2  
                 continue  
               fi  
6245                file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`                file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6246                outputname="$tmpdir/$file"                outputname="$tmpdir/$file"
6247                # Replace the output file specification.                # Replace the output file specification.
# Line 5906  relink_command=\"$relink_command\"" Line 6265  relink_command=\"$relink_command\""
6265          fi          fi
6266    
6267          # remove .exe since cygwin /usr/bin/install will append another          # remove .exe since cygwin /usr/bin/install will append another
6268          # one anyways          # one anyway
6269          case $install_prog,$host in          case $install_prog,$host in
6270          */usr/bin/install*,*cygwin*)          */usr/bin/install*,*cygwin*)
6271            case $file:$destfile in            case $file:$destfile in
# Line 6006  relink_command=\"$relink_command\"" Line 6365  relink_command=\"$relink_command\""
6365      # Exit here if they wanted silent mode.      # Exit here if they wanted silent mode.
6366      test "$show" = : && exit $EXIT_SUCCESS      test "$show" = : && exit $EXIT_SUCCESS
6367    
6368      $echo "----------------------------------------------------------------------"      $echo "X----------------------------------------------------------------------" | $Xsed
6369      $echo "Libraries have been installed in:"      $echo "Libraries have been installed in:"
6370      for libdir in $libdirs; do      for libdir in $libdirs; do
6371        $echo "   $libdir"        $echo "   $libdir"
# Line 6039  relink_command=\"$relink_command\"" Line 6398  relink_command=\"$relink_command\""
6398      $echo      $echo
6399      $echo "See any operating system documentation about shared libraries for"      $echo "See any operating system documentation about shared libraries for"
6400      $echo "more information, such as the ld(1) and ld.so(8) manual pages."      $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6401      $echo "----------------------------------------------------------------------"      $echo "X----------------------------------------------------------------------" | $Xsed
6402      exit $EXIT_SUCCESS      exit $EXIT_SUCCESS
6403      ;;      ;;
6404    
# Line 6256  relink_command=\"$relink_command\"" Line 6615  relink_command=\"$relink_command\""
6615              rmfiles="$rmfiles $objdir/$n"              rmfiles="$rmfiles $objdir/$n"
6616            done            done
6617            test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"            test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
           test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"  
6618    
6619            if test "$mode" = uninstall; then            case "$mode" in
6620              clean)
6621                case "  $library_names " in
6622                # "  " in the beginning catches empty $dlname
6623                *" $dlname "*) ;;
6624                *) rmfiles="$rmfiles $objdir/$dlname" ;;
6625                esac
6626                 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6627                ;;
6628              uninstall)
6629              if test -n "$library_names"; then              if test -n "$library_names"; then
6630                # Do each command in the postuninstall commands.                # Do each command in the postuninstall commands.
6631                cmds=$postuninstall_cmds                cmds=$postuninstall_cmds
# Line 6291  relink_command=\"$relink_command\"" Line 6658  relink_command=\"$relink_command\""
6658                IFS="$save_ifs"                IFS="$save_ifs"
6659              fi              fi
6660              # FIXME: should reinstall the best remaining shared library.              # FIXME: should reinstall the best remaining shared library.
6661            fi              ;;
6662              esac
6663          fi          fi
6664          ;;          ;;
6665    
# Line 6590  exit $? Line 6958  exit $?
6958  # configuration.  But we'll never go from static-only to shared-only.  # configuration.  But we'll never go from static-only to shared-only.
6959    
6960  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6961  build_libtool_libs=no  disable_libs=shared
 build_old_libs=yes  
6962  # ### END LIBTOOL TAG CONFIG: disable-shared  # ### END LIBTOOL TAG CONFIG: disable-shared
6963    
6964  # ### BEGIN LIBTOOL TAG CONFIG: disable-static  # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6965  build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`  disable_libs=static
6966  # ### END LIBTOOL TAG CONFIG: disable-static  # ### END LIBTOOL TAG CONFIG: disable-static
6967    
6968  # Local Variables:  # Local Variables:

Legend:
Removed from v.86  
changed lines
  Added in v.87

  ViewVC Help
Powered by ViewVC 1.1.5