IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3238 for trunk/psLib/ltmain.sh


Ignore:
Timestamp:
Feb 15, 2005, 3:01:56 PM (21 years ago)
Author:
desonia
Message:

added check so that config/etc is not installed on top of itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/ltmain.sh

    r3219 r3238  
    3434progpath="$0"
    3535
     36# RH: define SED for historic ltconfig's generated by Libtool 1.3
     37[ -z "$SED" ] && SED=sed
     38
    3639# The name of this program:
    3740progname=`echo "$progpath" | $SED $basename`
     
    4447PROGRAM=ltmain.sh
    4548PACKAGE=libtool
    46 VERSION=1.5.8
    47 TIMESTAMP=" (1.1220.2.118 2004/08/07 12:24:38)"
    48 
    49 # See if we are running on zsh, and set the options which allow our
    50 # commands through without removal of \ escapes.
    51 if test -n "${ZSH_VERSION+set}" ; then
    52   setopt NO_GLOB_SUBST
    53 fi
     49VERSION=1.5.6
     50TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
     51
    5452
    5553# Check that we have a working $echo.
     
    240238      esac
    241239    fi
    242 }
    243 
    244 
    245 # func_extract_archives gentop oldlib ...
    246 func_extract_archives () {
    247     my_gentop="$1"; shift
    248     my_oldlibs=${1+"$@"}
    249     my_oldobjs=""
    250     my_xlib=""
    251     my_xabs=""
    252     my_xdir=""
    253     my_status=""
    254 
    255     $show "${rm}r $my_gentop"
    256     $run ${rm}r "$my_gentop"
    257     $show "$mkdir $my_gentop"
    258     $run $mkdir "$my_gentop"
    259     my_status=$?
    260     if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
    261       exit $my_status
    262     fi
    263 
    264     for my_xlib in $my_oldlibs; do
    265       # Extract the objects.
    266       case $my_xlib in
    267         [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
    268         *) my_xabs=`pwd`"/$my_xlib" ;;
    269       esac
    270       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
    271       my_xdir="$my_gentop/$my_xlib"
    272 
    273       $show "${rm}r $my_xdir"
    274       $run ${rm}r "$my_xdir"
    275       $show "$mkdir $my_xdir"
    276       $run $mkdir "$my_xdir"
    277       status=$?
    278       if test "$status" -ne 0 && test ! -d "$my_xdir"; then
    279         exit $status
    280       fi
    281       case $host in
    282       *-darwin*)
    283         $show "Extracting $my_xabs"
    284         # Do not bother doing anything if just a dry run
    285         if test -z "$run"; then
    286           darwin_orig_dir=`pwd`
    287           cd $my_xdir || exit $?
    288           darwin_archive=$my_xabs
    289           darwin_curdir=`pwd`
    290           darwin_base_archive=`basename $darwin_archive`
    291           darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
    292           if test -n "$darwin_arches"; then
    293             darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
    294             darwin_arch=
    295             $show "$darwin_base_archive has multiple architectures $darwin_arches"
    296             for darwin_arch in  $darwin_arches ; do
    297               mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
    298               lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
    299               # Remove the table of contents from the thin files.
    300               $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
    301               $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
    302               cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
    303               $AR -xo "${darwin_base_archive}"
    304               rm "${darwin_base_archive}"
    305               cd "$darwin_curdir"
    306             done # $darwin_arches
    307       ## Okay now we have a bunch of thin objects, gotta fatten them up :)
    308             darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
    309             darwin_file=
    310             darwin_files=
    311             for darwin_file in $darwin_filelist; do
    312               darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
    313               lipo -create -output "$darwin_file" $darwin_files
    314             done # $darwin_filelist
    315             rm -rf unfat-$$
    316             cd "$darwin_orig_dir"
    317           else
    318             cd $darwin_orig_dir
    319             (cd $my_xdir && $AR x $my_xabs) || exit $?
    320           fi # $darwin_arches
    321         fi # $run
    322       ;;
    323       *)
    324         # We will extract separately just the conflicting names and we will
    325         # no longer touch any unique names. It is faster to leave these
    326         # extract automatically by $AR in one run.
    327         $show "(cd $my_xdir && $AR x $my_xabs)"
    328         $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
    329         if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
    330           :
    331         else
    332           $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
    333           $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
    334           $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
    335           do
    336             i=1
    337             while test "$i" -le "$count"
    338             do
    339               # Put our $i before any first dot (extension)
    340               # Never overwrite any file
    341               name_to="$name"
    342               while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
    343               do
    344                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
    345               done
    346               $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
    347               $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
    348               i=`expr $i + 1`
    349             done
    350           done
    351         fi
    352         ;;
    353       esac
    354       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
    355     done
    356 
    357     func_extract_archives_result="$my_oldobjs"
    358240}
    359241# End of Shell function definitions
     
    21001982          case $linkmode in
    21011983          lib)
    2102             valid_a_lib=no
    2103             case $deplibs_check_method in
    2104               match_pattern*)
    2105                 set dummy $deplibs_check_method
    2106                 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
    2107                 if eval $echo \"$deplib\" 2>/dev/null \
    2108                     | $SED 10q \
    2109                     | $EGREP "$match_pattern_regex" > /dev/null; then
    2110                   valid_a_lib=yes
    2111                 fi
    2112                 ;;
    2113               pass_all)
    2114                 valid_a_lib=yes
    2115                 ;;
    2116             esac
    2117             if test "$valid_a_lib" != yes; then
     1984            if test "$deplibs_check_method" != pass_all; then
    21181985              $echo
    21191986              $echo "*** Warning: Trying to link with static lib archive $deplib."
     
    22882155          fi
    22892156        else
    2290           if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
    2291             dir="$ladir"
    2292             absdir="$abs_ladir"
    2293             # Remove this search path later
    2294             notinst_path="$notinst_path $abs_ladir"
    2295           else
    2296             dir="$ladir/$objdir"
    2297             absdir="$abs_ladir/$objdir"
    2298             # Remove this search path later
    2299             notinst_path="$notinst_path $abs_ladir"
    2300           fi
     2157          dir="$ladir/$objdir"
     2158          absdir="$abs_ladir/$objdir"
     2159          # Remove this search path later
     2160          notinst_path="$notinst_path $abs_ladir"
    23012161        fi # $installed = yes
    23022162        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
     
    30852945        # Check that each of the things are valid numbers.
    30862946        case $current in
    3087         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2947        [0-9]*) ;;
    30882948        *)
    30892949          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
     
    30942954
    30952955        case $revision in
    3096         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2956        [0-9]*) ;;
    30972957        *)
    30982958          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
     
    31032963
    31042964        case $age in
    3105         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2965        [0-9]*) ;;
    31062966        *)
    31072967          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
     
    31312991          # Darwin ld doesn't like 0 for these options...
    31322992          minor_current=`expr $current + 1`
    3133           verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     2993          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
    31342994          ;;
    31352995
     
    38193679          else
    38203680            gentop="$output_objdir/${outputname}x"
     3681            $show "${rm}r $gentop"
     3682            $run ${rm}r "$gentop"
     3683            $show "$mkdir $gentop"
     3684            $run $mkdir "$gentop"
     3685            status=$?
     3686            if test "$status" -ne 0 && test ! -d "$gentop"; then
     3687              exit $status
     3688            fi
    38213689            generated="$generated $gentop"
    38223690
    3823             func_extract_archives $gentop $convenience
    3824             libobjs="$libobjs $func_extract_archives_result"
    3825           fi
    3826         fi
    3827        
     3691            for xlib in $convenience; do
     3692              # Extract the objects.
     3693              case $xlib in
     3694              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
     3695              *) xabs=`pwd`"/$xlib" ;;
     3696              esac
     3697              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
     3698              xdir="$gentop/$xlib"
     3699
     3700              $show "${rm}r $xdir"
     3701              $run ${rm}r "$xdir"
     3702              $show "$mkdir $xdir"
     3703              $run $mkdir "$xdir"
     3704              status=$?
     3705              if test "$status" -ne 0 && test ! -d "$xdir"; then
     3706                exit $status
     3707              fi
     3708              # We will extract separately just the conflicting names and we will no
     3709              # longer touch any unique names. It is faster to leave these extract
     3710              # automatically by $AR in one run.
     3711              $show "(cd $xdir && $AR x $xabs)"
     3712              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
     3713              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
     3714                :
     3715              else
     3716                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
     3717                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
     3718                $AR t "$xabs" | sort | uniq -cd | while read -r count name
     3719                do
     3720                  i=1
     3721                  while test "$i" -le "$count"
     3722                  do
     3723                   # Put our $i before any first dot (extension)
     3724                   # Never overwrite any file
     3725                   name_to="$name"
     3726                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
     3727                   do
     3728                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
     3729                   done
     3730                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
     3731                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
     3732                   i=`expr $i + 1`
     3733                  done
     3734                done
     3735              fi
     3736
     3737              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
     3738            done
     3739          fi
     3740        fi
     3741
    38283742        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
    38293743          eval flag=\"$thread_safe_flag_spec\"
     
    40633977        else
    40643978          gentop="$output_objdir/${obj}x"
     3979          $show "${rm}r $gentop"
     3980          $run ${rm}r "$gentop"
     3981          $show "$mkdir $gentop"
     3982          $run $mkdir "$gentop"
     3983          status=$?
     3984          if test "$status" -ne 0 && test ! -d "$gentop"; then
     3985            exit $status
     3986          fi
    40653987          generated="$generated $gentop"
    40663988
    4067           func_extract_archives $gentop $convenience
    4068           reload_conv_objs="$reload_objs $func_extract_archives_result"
     3989          for xlib in $convenience; do
     3990            # Extract the objects.
     3991            case $xlib in
     3992            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
     3993            *) xabs=`pwd`"/$xlib" ;;
     3994            esac
     3995            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
     3996            xdir="$gentop/$xlib"
     3997
     3998            $show "${rm}r $xdir"
     3999            $run ${rm}r "$xdir"
     4000            $show "$mkdir $xdir"
     4001            $run $mkdir "$xdir"
     4002            status=$?
     4003            if test "$status" -ne 0 && test ! -d "$xdir"; then
     4004              exit $status
     4005            fi
     4006            # We will extract separately just the conflicting names and we will no
     4007            # longer touch any unique names. It is faster to leave these extract
     4008            # automatically by $AR in one run.
     4009            $show "(cd $xdir && $AR x $xabs)"
     4010            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
     4011            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
     4012              :
     4013            else
     4014              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
     4015              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
     4016              $AR t "$xabs" | sort | uniq -cd | while read -r count name
     4017              do
     4018                i=1
     4019                while test "$i" -le "$count"
     4020                do
     4021                 # Put our $i before any first dot (extension)
     4022                 # Never overwrite any file
     4023                 name_to="$name"
     4024                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
     4025                 do
     4026                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
     4027                 done
     4028                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
     4029                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
     4030                 i=`expr $i + 1`
     4031                done
     4032              done
     4033            fi
     4034
     4035            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
     4036          done
    40694037        fi
    40704038      fi
     
    48474815# The HP-UX ksh and POSIX shell print the target directory to stdout
    48484816# if CDPATH is set.
    4849 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
     4817if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
    48504818
    48514819relink_command=\"$relink_command\"
     
    50244992      if test -n "$addlibs"; then
    50254993        gentop="$output_objdir/${outputname}x"
     4994        $show "${rm}r $gentop"
     4995        $run ${rm}r "$gentop"
     4996        $show "$mkdir $gentop"
     4997        $run $mkdir "$gentop"
     4998        status=$?
     4999        if test "$status" -ne 0 && test ! -d "$gentop"; then
     5000          exit $status
     5001        fi
    50265002        generated="$generated $gentop"
    50275003
    5028         func_extract_archives $gentop $addlibs
    5029         oldobjs="$oldobjs $func_extract_archives_result"
     5004        # Add in members from convenience archives.
     5005        for xlib in $addlibs; do
     5006          # Extract the objects.
     5007          case $xlib in
     5008          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
     5009          *) xabs=`pwd`"/$xlib" ;;
     5010          esac
     5011          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
     5012          xdir="$gentop/$xlib"
     5013
     5014          $show "${rm}r $xdir"
     5015          $run ${rm}r "$xdir"
     5016          $show "$mkdir $xdir"
     5017          $run $mkdir "$xdir"
     5018          status=$?
     5019          if test "$status" -ne 0 && test ! -d "$xdir"; then
     5020            exit $status
     5021          fi
     5022          # We will extract separately just the conflicting names and we will no
     5023          # longer touch any unique names. It is faster to leave these extract
     5024          # automatically by $AR in one run.
     5025          $show "(cd $xdir && $AR x $xabs)"
     5026          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
     5027          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
     5028            :
     5029          else
     5030            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
     5031            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
     5032            $AR t "$xabs" | sort | uniq -cd | while read -r count name
     5033            do
     5034              i=1
     5035              while test "$i" -le "$count"
     5036              do
     5037               # Put our $i before any first dot (extension)
     5038               # Never overwrite any file
     5039               name_to="$name"
     5040               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
     5041               do
     5042                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
     5043               done
     5044               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
     5045               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
     5046               i=`expr $i + 1`
     5047              done
     5048            done
     5049          fi
     5050
     5051          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
     5052        done
    50305053      fi
    50315054
     
    59695992
    59705993      # Now prepare to actually exec the command.
    5971       exec_cmd="\"\$cmd\"$args"
     5994      exec_cmd="\$cmd$args"
    59725995    else
    59735996      # Display what would be done.
     
    59765999        $echo "export $shlibpath_var"
    59776000      fi
    5978       eval \$echo \"\$cmd\"$args
     6001      $echo "$cmd$args"
    59796002      exit $EXIT_SUCCESS
    59806003    fi
Note: See TracChangeset for help on using the changeset viewer.