~ubuntu-branches/ubuntu/trusty/yelp/trusty

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-02-16 15:11:05 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120216151105-bjszac6qy4q76hax
Tags: 3.3.3-0ubuntu1
* New upstream release
* debian/patches/06_setup_error_on_missing_dbus.patch:
  - Applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Generated from ltmain.m4sh.
1
2
 
2
 
# libtool (GNU libtool) 2.4
 
3
# libtool (GNU libtool) 2.2.10
3
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
5
 
5
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
69
70
#         compiler:             $LTCC
70
71
#         compiler flags:               $LTCFLAGS
71
72
#         linker:               $LD (gnu? $with_gnu_ld)
72
 
#         $progname:    (GNU libtool) 2.4
 
73
#         $progname:    (GNU libtool) 2.2.10
73
74
#         automake:     $automake_version
74
75
#         autoconf:     $autoconf_version
75
76
#
76
77
# Report bugs to <bug-libtool@gnu.org>.
77
 
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
78
 
# General help using GNU software: <http://www.gnu.org/gethelp/>.
79
78
 
80
79
PROGRAM=libtool
81
80
PACKAGE=libtool
82
 
VERSION=2.4
 
81
VERSION=2.2.10
83
82
TIMESTAMP=""
84
 
package_revision=1.3293
 
83
package_revision=1.3175
85
84
 
86
85
# Be Bourne compatible
87
86
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
164
163
dirname="s,/[^/]*$,,"
165
164
basename="s,^.*/,,"
166
165
 
167
 
# func_dirname file append nondir_replacement
168
 
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
169
 
# otherwise set result to NONDIR_REPLACEMENT.
170
 
func_dirname ()
171
 
{
172
 
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
173
 
    if test "X$func_dirname_result" = "X${1}"; then
174
 
      func_dirname_result="${3}"
175
 
    else
176
 
      func_dirname_result="$func_dirname_result${2}"
177
 
    fi
178
 
} # func_dirname may be replaced by extended shell implementation
179
 
 
180
 
 
181
 
# func_basename file
182
 
func_basename ()
183
 
{
184
 
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
185
 
} # func_basename may be replaced by extended shell implementation
186
 
 
187
 
 
188
166
# func_dirname_and_basename file append nondir_replacement
189
167
# perform func_basename and func_dirname in a single function
190
168
# call:
199
177
# those functions but instead duplicate the functionality here.
200
178
func_dirname_and_basename ()
201
179
{
202
 
    # Extract subdirectory from the argument.
203
 
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
204
 
    if test "X$func_dirname_result" = "X${1}"; then
205
 
      func_dirname_result="${3}"
206
 
    else
207
 
      func_dirname_result="$func_dirname_result${2}"
208
 
    fi
209
 
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
210
 
} # func_dirname_and_basename may be replaced by extended shell implementation
211
 
 
212
 
 
213
 
# func_stripname prefix suffix name
214
 
# strip PREFIX and SUFFIX off of NAME.
215
 
# PREFIX and SUFFIX must not contain globbing or regex special
216
 
# characters, hashes, percent signs, but SUFFIX may contain a leading
217
 
# dot (in which case that matches only a dot).
218
 
# func_strip_suffix prefix name
219
 
func_stripname ()
220
 
{
221
 
    case ${2} in
222
 
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
223
 
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
224
 
    esac
225
 
} # func_stripname may be replaced by extended shell implementation
226
 
 
 
180
  # Extract subdirectory from the argument.
 
181
  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
 
182
  if test "X$func_dirname_result" = "X${1}"; then
 
183
    func_dirname_result="${3}"
 
184
  else
 
185
    func_dirname_result="$func_dirname_result${2}"
 
186
  fi
 
187
  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
 
188
}
 
189
 
 
190
# Generated shell functions inserted here.
227
191
 
228
192
# These SED scripts presuppose an absolute path with a trailing slash.
229
193
pathcar='s,^/\([^/]*\).*$,\1,'
406
370
# Same as above, but do not quote variable references.
407
371
double_quote_subst='s/\(["`\\]\)/\\\1/g'
408
372
 
409
 
# Sed substitution that turns a string into a regex matching for the
410
 
# string literally.
411
 
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
412
 
 
413
 
# Sed substitution that converts a w32 file name or path
414
 
# which contains forward slashes, into one that contains
415
 
# (escaped) backslashes.  A very naive implementation.
416
 
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
417
 
 
418
373
# Re-`\' parameter expansions in output of double_quote_subst that were
419
374
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
420
375
# in input to double_quote_subst, that '$' was protected from expansion.
443
398
# name if it has been set yet.
444
399
func_echo ()
445
400
{
446
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
 
401
    $ECHO "$progname${mode+: }$mode: $*"
447
402
}
448
403
 
449
404
# func_verbose arg...
469
424
# Echo program name prefixed message to standard error.
470
425
func_error ()
471
426
{
472
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
 
427
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
473
428
}
474
429
 
475
430
# func_warning arg...
476
431
# Echo program name prefixed warning message to standard error.
477
432
func_warning ()
478
433
{
479
 
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
 
434
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
480
435
 
481
436
    # bash bug again:
482
437
    :
695
650
    fi
696
651
}
697
652
 
698
 
# func_tr_sh
699
 
# Turn $1 into a string suitable for a shell variable name.
700
 
# Result is stored in $func_tr_sh_result.  All characters
701
 
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
702
 
# if $1 begins with a digit, a '_' is prepended as well.
703
 
func_tr_sh ()
704
 
{
705
 
  case $1 in
706
 
  [0-9]* | *[!a-zA-Z0-9_]*)
707
 
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
708
 
    ;;
709
 
  * )
710
 
    func_tr_sh_result=$1
711
 
    ;;
712
 
  esac
713
 
}
714
 
 
715
653
 
716
654
# func_version
717
655
# Echo version message to standard output and exit.
718
656
func_version ()
719
657
{
720
 
    $opt_debug
721
 
 
722
658
    $SED -n '/(C)/!b go
723
659
        :more
724
660
        /\./!{
740
676
# Echo short help message to standard output and exit.
741
677
func_usage ()
742
678
{
743
 
    $opt_debug
744
 
 
745
679
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
746
680
        s/^# //
747
681
        s/^# *$//
758
692
# unless 'noexit' is passed as argument.
759
693
func_help ()
760
694
{
761
 
    $opt_debug
762
 
 
763
695
    $SED -n '/^# Usage:/,/# Report bugs to/ {
764
 
        :print
765
696
        s/^# //
766
697
        s/^# *$//
767
698
        s*\$progname*'$progname'*
774
705
        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
775
706
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
776
707
        p
777
 
        d
778
 
     }
779
 
     /^# .* home page:/b print
780
 
     /^# General help using/b print
781
 
     ' < "$progpath"
 
708
     }' < "$progpath"
782
709
    ret=$?
783
710
    if test -z "$1"; then
784
711
      exit $ret
790
717
# exit_cmd.
791
718
func_missing_arg ()
792
719
{
793
 
    $opt_debug
794
 
 
795
720
    func_error "missing argument for $1."
796
721
    exit_cmd=exit
797
722
}
798
723
 
799
 
 
800
 
# func_split_short_opt shortopt
801
 
# Set func_split_short_opt_name and func_split_short_opt_arg shell
802
 
# variables after splitting SHORTOPT after the 2nd character.
803
 
func_split_short_opt ()
804
 
{
805
 
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
806
 
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
807
 
 
808
 
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
809
 
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
810
 
} # func_split_short_opt may be replaced by extended shell implementation
811
 
 
812
 
 
813
 
# func_split_long_opt longopt
814
 
# Set func_split_long_opt_name and func_split_long_opt_arg shell
815
 
# variables after splitting LONGOPT at the `=' sign.
816
 
func_split_long_opt ()
817
 
{
818
 
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
819
 
    my_sed_long_arg='1s/^--[^=]*=//'
820
 
 
821
 
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
822
 
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
823
 
} # func_split_long_opt may be replaced by extended shell implementation
824
 
 
825
724
exit_cmd=:
826
725
 
827
726
 
828
727
 
829
728
 
830
729
 
 
730
 
831
731
magic="%%%MAGIC variable%%%"
832
732
magic_exe="%%%MAGIC EXE variable%%%"
833
733
 
834
734
# Global variables.
 
735
# $mode is unset
835
736
nonopt=
 
737
execute_dlfiles=
836
738
preserve_args=
837
739
lo2o="s/\\.lo\$/.${objext}/"
838
740
o2lo="s/\\.${objext}\$/.lo/"
839
741
extracted_archives=
840
742
extracted_serial=0
841
743
 
 
744
opt_dry_run=false
 
745
opt_duplicate_deps=false
 
746
opt_silent=false
 
747
opt_debug=:
 
748
 
842
749
# If this variable is set in any of the actions, the command in it
843
750
# will be execed at the end.  This prevents here-documents from being
844
751
# left over by shells.
845
752
exec_cmd=
846
753
 
847
 
# func_append var value
848
 
# Append VALUE to the end of shell variable VAR.
849
 
func_append ()
850
 
{
851
 
    eval "${1}=\$${1}\${2}"
852
 
} # func_append may be replaced by extended shell implementation
853
 
 
854
 
# func_append_quoted var value
855
 
# Quote VALUE and append to the end of shell variable VAR, separated
856
 
# by a space.
857
 
func_append_quoted ()
858
 
{
859
 
    func_quote_for_eval "${2}"
860
 
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
861
 
} # func_append_quoted may be replaced by extended shell implementation
862
 
 
863
 
 
864
 
# func_arith arithmetic-term...
865
 
func_arith ()
866
 
{
867
 
    func_arith_result=`expr "${@}"`
868
 
} # func_arith may be replaced by extended shell implementation
869
 
 
870
 
 
871
 
# func_len string
872
 
# STRING may not start with a hyphen.
873
 
func_len ()
874
 
{
875
 
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
876
 
} # func_len may be replaced by extended shell implementation
877
 
 
878
 
 
879
 
# func_lo2o object
880
 
func_lo2o ()
881
 
{
882
 
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
883
 
} # func_lo2o may be replaced by extended shell implementation
884
 
 
885
 
 
886
 
# func_xform libobj-or-source
887
 
func_xform ()
888
 
{
889
 
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
890
 
} # func_xform may be replaced by extended shell implementation
891
 
 
892
 
 
893
754
# func_fatal_configuration arg...
894
755
# Echo program name prefixed message to standard error, followed by
895
756
# a configuration failure hint, and exit.
979
840
  esac
980
841
}
981
842
 
 
843
# Parse options once, thoroughly.  This comes as soon as possible in
 
844
# the script to make things like `libtool --version' happen quickly.
 
845
{
 
846
 
 
847
  # Shorthand for --mode=foo, only valid as the first argument
 
848
  case $1 in
 
849
  clean|clea|cle|cl)
 
850
    shift; set dummy --mode clean ${1+"$@"}; shift
 
851
    ;;
 
852
  compile|compil|compi|comp|com|co|c)
 
853
    shift; set dummy --mode compile ${1+"$@"}; shift
 
854
    ;;
 
855
  execute|execut|execu|exec|exe|ex|e)
 
856
    shift; set dummy --mode execute ${1+"$@"}; shift
 
857
    ;;
 
858
  finish|finis|fini|fin|fi|f)
 
859
    shift; set dummy --mode finish ${1+"$@"}; shift
 
860
    ;;
 
861
  install|instal|insta|inst|ins|in|i)
 
862
    shift; set dummy --mode install ${1+"$@"}; shift
 
863
    ;;
 
864
  link|lin|li|l)
 
865
    shift; set dummy --mode link ${1+"$@"}; shift
 
866
    ;;
 
867
  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
 
868
    shift; set dummy --mode uninstall ${1+"$@"}; shift
 
869
    ;;
 
870
  esac
 
871
 
 
872
  # Parse non-mode specific arguments:
 
873
  while test "$#" -gt 0; do
 
874
    opt="$1"
 
875
    shift
 
876
 
 
877
    case $opt in
 
878
      --config)         func_config                                     ;;
 
879
 
 
880
      --debug)          preserve_args="$preserve_args $opt"
 
881
                        func_echo "enabling shell trace mode"
 
882
                        opt_debug='set -x'
 
883
                        $opt_debug
 
884
                        ;;
 
885
 
 
886
      -dlopen)          test "$#" -eq 0 && func_missing_arg "$opt" && break
 
887
                        execute_dlfiles="$execute_dlfiles $1"
 
888
                        shift
 
889
                        ;;
 
890
 
 
891
      --dry-run | -n)   opt_dry_run=:                                   ;;
 
892
      --features)       func_features                                   ;;
 
893
      --finish)         mode="finish"                                   ;;
 
894
 
 
895
      --mode)           test "$#" -eq 0 && func_missing_arg "$opt" && break
 
896
                        case $1 in
 
897
                          # Valid mode arguments:
 
898
                          clean)        ;;
 
899
                          compile)      ;;
 
900
                          execute)      ;;
 
901
                          finish)       ;;
 
902
                          install)      ;;
 
903
                          link)         ;;
 
904
                          relink)       ;;
 
905
                          uninstall)    ;;
 
906
 
 
907
                          # Catch anything else as an error
 
908
                          *) func_error "invalid argument for $opt"
 
909
                             exit_cmd=exit
 
910
                             break
 
911
                             ;;
 
912
                        esac
 
913
 
 
914
                        mode="$1"
 
915
                        shift
 
916
                        ;;
 
917
 
 
918
      --preserve-dup-deps)
 
919
                        opt_duplicate_deps=:                            ;;
 
920
 
 
921
      --quiet|--silent) preserve_args="$preserve_args $opt"
 
922
                        opt_silent=:
 
923
                        opt_verbose=false
 
924
                        ;;
 
925
 
 
926
      --no-quiet|--no-silent)
 
927
                        preserve_args="$preserve_args $opt"
 
928
                        opt_silent=false
 
929
                        ;;
 
930
 
 
931
      --verbose| -v)    preserve_args="$preserve_args $opt"
 
932
                        opt_silent=false
 
933
                        opt_verbose=:
 
934
                        ;;
 
935
 
 
936
      --no-verbose)     preserve_args="$preserve_args $opt"
 
937
                        opt_verbose=false
 
938
                        ;;
 
939
 
 
940
      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
 
941
                        preserve_args="$preserve_args $opt $1"
 
942
                        func_enable_tag "$1"    # tagname is set here
 
943
                        shift
 
944
                        ;;
 
945
 
 
946
      # Separate optargs to long options:
 
947
      -dlopen=*|--mode=*|--tag=*)
 
948
                        func_opt_split "$opt"
 
949
                        set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
 
950
                        shift
 
951
                        ;;
 
952
 
 
953
      -\?|-h)           func_usage                                      ;;
 
954
      --help)           opt_help=:                                      ;;
 
955
      --help-all)       opt_help=': help-all'                           ;;
 
956
      --version)        func_version                                    ;;
 
957
 
 
958
      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
 
959
 
 
960
      *)                nonopt="$opt"
 
961
                        break
 
962
                        ;;
 
963
    esac
 
964
  done
 
965
 
 
966
 
 
967
  case $host in
 
968
    *cygwin* | *mingw* | *pw32* | *cegcc*)
 
969
      # don't eliminate duplications in $postdeps and $predeps
 
970
      opt_duplicate_compiler_generated_deps=:
 
971
      ;;
 
972
    *)
 
973
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
 
974
      ;;
 
975
  esac
 
976
 
 
977
  # Having warned about all mis-specified options, bail out if
 
978
  # anything was wrong.
 
979
  $exit_cmd $EXIT_FAILURE
 
980
}
 
981
 
982
982
# func_check_version_match
983
983
# Ensure that we are using m4 macros, and libtool script from the same
984
984
# release of libtool.
1015
1015
}
1016
1016
 
1017
1017
 
1018
 
# Shorthand for --mode=foo, only valid as the first argument
1019
 
case $1 in
1020
 
clean|clea|cle|cl)
1021
 
  shift; set dummy --mode clean ${1+"$@"}; shift
1022
 
  ;;
1023
 
compile|compil|compi|comp|com|co|c)
1024
 
  shift; set dummy --mode compile ${1+"$@"}; shift
1025
 
  ;;
1026
 
execute|execut|execu|exec|exe|ex|e)
1027
 
  shift; set dummy --mode execute ${1+"$@"}; shift
1028
 
  ;;
1029
 
finish|finis|fini|fin|fi|f)
1030
 
  shift; set dummy --mode finish ${1+"$@"}; shift
1031
 
  ;;
1032
 
install|instal|insta|inst|ins|in|i)
1033
 
  shift; set dummy --mode install ${1+"$@"}; shift
1034
 
  ;;
1035
 
link|lin|li|l)
1036
 
  shift; set dummy --mode link ${1+"$@"}; shift
1037
 
  ;;
1038
 
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1039
 
  shift; set dummy --mode uninstall ${1+"$@"}; shift
1040
 
  ;;
1041
 
esac
1042
 
 
1043
 
 
1044
 
 
1045
 
# Option defaults:
1046
 
opt_debug=:
1047
 
opt_dry_run=false
1048
 
opt_config=false
1049
 
opt_preserve_dup_deps=false
1050
 
opt_features=false
1051
 
opt_finish=false
1052
 
opt_help=false
1053
 
opt_help_all=false
1054
 
opt_silent=:
1055
 
opt_verbose=:
1056
 
opt_silent=false
1057
 
opt_verbose=false
1058
 
 
1059
 
 
1060
 
# Parse options once, thoroughly.  This comes as soon as possible in the
1061
 
# script to make things like `--version' happen as quickly as we can.
1062
 
{
1063
 
  # this just eases exit handling
1064
 
  while test $# -gt 0; do
1065
 
    opt="$1"
1066
 
    shift
1067
 
    case $opt in
1068
 
      --debug|-x)       opt_debug='set -x'
1069
 
                        func_echo "enabling shell trace mode"
1070
 
                        $opt_debug
1071
 
                        ;;
1072
 
      --dry-run|--dryrun|-n)
1073
 
                        opt_dry_run=:
1074
 
                        ;;
1075
 
      --config)
1076
 
                        opt_config=:
1077
 
func_config
1078
 
                        ;;
1079
 
      --dlopen|-dlopen)
1080
 
                        optarg="$1"
1081
 
                        opt_dlopen="${opt_dlopen+$opt_dlopen
1082
 
}$optarg"
1083
 
                        shift
1084
 
                        ;;
1085
 
      --preserve-dup-deps)
1086
 
                        opt_preserve_dup_deps=:
1087
 
                        ;;
1088
 
      --features)
1089
 
                        opt_features=:
1090
 
func_features
1091
 
                        ;;
1092
 
      --finish)
1093
 
                        opt_finish=:
1094
 
set dummy --mode finish ${1+"$@"}; shift
1095
 
                        ;;
1096
 
      --help)
1097
 
                        opt_help=:
1098
 
                        ;;
1099
 
      --help-all)
1100
 
                        opt_help_all=:
1101
 
opt_help=': help-all'
1102
 
                        ;;
1103
 
      --mode)
1104
 
                        test $# = 0 && func_missing_arg $opt && break
1105
 
                        optarg="$1"
1106
 
                        opt_mode="$optarg"
1107
 
case $optarg in
1108
 
  # Valid mode arguments:
1109
 
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
1110
 
 
1111
 
  # Catch anything else as an error
1112
 
  *) func_error "invalid argument for $opt"
1113
 
     exit_cmd=exit
1114
 
     break
1115
 
     ;;
1116
 
esac
1117
 
                        shift
1118
 
                        ;;
1119
 
      --no-silent|--no-quiet)
1120
 
                        opt_silent=false
1121
 
func_append preserve_args " $opt"
1122
 
                        ;;
1123
 
      --no-verbose)
1124
 
                        opt_verbose=false
1125
 
func_append preserve_args " $opt"
1126
 
                        ;;
1127
 
      --silent|--quiet)
1128
 
                        opt_silent=:
1129
 
func_append preserve_args " $opt"
1130
 
        opt_verbose=false
1131
 
                        ;;
1132
 
      --verbose|-v)
1133
 
                        opt_verbose=:
1134
 
func_append preserve_args " $opt"
1135
 
opt_silent=false
1136
 
                        ;;
1137
 
      --tag)
1138
 
                        test $# = 0 && func_missing_arg $opt && break
1139
 
                        optarg="$1"
1140
 
                        opt_tag="$optarg"
1141
 
func_append preserve_args " $opt $optarg"
1142
 
func_enable_tag "$optarg"
1143
 
                        shift
1144
 
                        ;;
1145
 
 
1146
 
      -\?|-h)           func_usage                              ;;
1147
 
      --help)           func_help                               ;;
1148
 
      --version)        func_version                            ;;
1149
 
 
1150
 
      # Separate optargs to long options:
1151
 
      --*=*)
1152
 
                        func_split_long_opt "$opt"
1153
 
                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1154
 
                        shift
1155
 
                        ;;
1156
 
 
1157
 
      # Separate non-argument short options:
1158
 
      -\?*|-h*|-n*|-v*)
1159
 
                        func_split_short_opt "$opt"
1160
 
                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1161
 
                        shift
1162
 
                        ;;
1163
 
 
1164
 
      --)               break                                   ;;
1165
 
      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
1166
 
      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
1167
 
    esac
1168
 
  done
1169
 
 
1170
 
  # Validate options:
1171
 
 
1172
 
  # save first non-option argument
1173
 
  if test "$#" -gt 0; then
1174
 
    nonopt="$opt"
1175
 
    shift
1176
 
  fi
1177
 
 
1178
 
  # preserve --debug
1179
 
  test "$opt_debug" = : || func_append preserve_args " --debug"
1180
 
 
1181
 
  case $host in
1182
 
    *cygwin* | *mingw* | *pw32* | *cegcc*)
1183
 
      # don't eliminate duplications in $postdeps and $predeps
1184
 
      opt_duplicate_compiler_generated_deps=:
1185
 
      ;;
1186
 
    *)
1187
 
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1188
 
      ;;
1189
 
  esac
1190
 
 
1191
 
  $opt_help || {
1192
 
    # Sanity checks first:
1193
 
    func_check_version_match
1194
 
 
1195
 
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1196
 
      func_fatal_configuration "not configured to build any kind of library"
1197
 
    fi
1198
 
 
1199
 
    # Darwin sucks
1200
 
    eval std_shrext=\"$shrext_cmds\"
1201
 
 
1202
 
    # Only execute mode is allowed to have -dlopen flags.
1203
 
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1204
 
      func_error "unrecognized option \`-dlopen'"
1205
 
      $ECHO "$help" 1>&2
1206
 
      exit $EXIT_FAILURE
1207
 
    fi
1208
 
 
1209
 
    # Change the help message to a mode-specific one.
1210
 
    generic_help="$help"
1211
 
    help="Try \`$progname --help --mode=$opt_mode' for more information."
1212
 
  }
1213
 
 
1214
 
 
1215
 
  # Bail if the options were screwed
1216
 
  $exit_cmd $EXIT_FAILURE
1217
 
}
1218
 
 
1219
 
 
1220
 
 
1221
 
 
1222
1018
## ----------- ##
1223
1019
##    Main.    ##
1224
1020
## ----------- ##
1225
1021
 
 
1022
$opt_help || {
 
1023
  # Sanity checks first:
 
1024
  func_check_version_match
 
1025
 
 
1026
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
 
1027
    func_fatal_configuration "not configured to build any kind of library"
 
1028
  fi
 
1029
 
 
1030
  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
 
1031
 
 
1032
 
 
1033
  # Darwin sucks
 
1034
  eval std_shrext=\"$shrext_cmds\"
 
1035
 
 
1036
 
 
1037
  # Only execute mode is allowed to have -dlopen flags.
 
1038
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
 
1039
    func_error "unrecognized option \`-dlopen'"
 
1040
    $ECHO "$help" 1>&2
 
1041
    exit $EXIT_FAILURE
 
1042
  fi
 
1043
 
 
1044
  # Change the help message to a mode-specific one.
 
1045
  generic_help="$help"
 
1046
  help="Try \`$progname --help --mode=$mode' for more information."
 
1047
}
 
1048
 
 
1049
 
1226
1050
# func_lalib_p file
1227
1051
# True iff FILE is a libtool `.la' library or `.lo' object file.
1228
1052
# This function is only a basic sanity check; it will hardly flush out
1286
1110
# temporary ltwrapper_script.
1287
1111
func_ltwrapper_scriptname ()
1288
1112
{
1289
 
    func_dirname_and_basename "$1" "" "."
1290
 
    func_stripname '' '.exe' "$func_basename_result"
1291
 
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 
1113
    func_ltwrapper_scriptname_result=""
 
1114
    if func_ltwrapper_executable_p "$1"; then
 
1115
        func_dirname_and_basename "$1" "" "."
 
1116
        func_stripname '' '.exe' "$func_basename_result"
 
1117
        func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 
1118
    fi
1292
1119
}
1293
1120
 
1294
1121
# func_ltwrapper_p file
1334
1161
}
1335
1162
 
1336
1163
 
1337
 
# func_resolve_sysroot PATH
1338
 
# Replace a leading = in PATH with a sysroot.  Store the result into
1339
 
# func_resolve_sysroot_result
1340
 
func_resolve_sysroot ()
1341
 
{
1342
 
  func_resolve_sysroot_result=$1
1343
 
  case $func_resolve_sysroot_result in
1344
 
  =*)
1345
 
    func_stripname '=' '' "$func_resolve_sysroot_result"
1346
 
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1347
 
    ;;
1348
 
  esac
1349
 
}
1350
 
 
1351
 
# func_replace_sysroot PATH
1352
 
# If PATH begins with the sysroot, replace it with = and
1353
 
# store the result into func_replace_sysroot_result.
1354
 
func_replace_sysroot ()
1355
 
{
1356
 
  case "$lt_sysroot:$1" in
1357
 
  ?*:"$lt_sysroot"*)
1358
 
    func_stripname "$lt_sysroot" '' "$1"
1359
 
    func_replace_sysroot_result="=$func_stripname_result"
1360
 
    ;;
1361
 
  *)
1362
 
    # Including no sysroot.
1363
 
    func_replace_sysroot_result=$1
1364
 
    ;;
1365
 
  esac
1366
 
}
1367
 
 
1368
1164
# func_infer_tag arg
1369
1165
# Infer tagged configuration to use if any are available and
1370
1166
# if one wasn't chosen via the "--tag" command line option.
1377
1173
    if test -n "$available_tags" && test -z "$tagname"; then
1378
1174
      CC_quoted=
1379
1175
      for arg in $CC; do
1380
 
        func_append_quoted CC_quoted "$arg"
 
1176
        func_quote_for_eval "$arg"
 
1177
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
1381
1178
      done
1382
1179
      CC_expanded=`func_echo_all $CC`
1383
1180
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1396
1193
            CC_quoted=
1397
1194
            for arg in $CC; do
1398
1195
              # Double-quote args containing other shell metacharacters.
1399
 
              func_append_quoted CC_quoted "$arg"
 
1196
              func_quote_for_eval "$arg"
 
1197
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
1400
1198
            done
1401
1199
            CC_expanded=`func_echo_all $CC`
1402
1200
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1465
1263
    }
1466
1264
}
1467
1265
 
1468
 
 
1469
 
##################################################
1470
 
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1471
 
##################################################
1472
 
 
1473
 
# func_convert_core_file_wine_to_w32 ARG
1474
 
# Helper function used by file name conversion functions when $build is *nix,
1475
 
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1476
 
# correctly configured wine environment available, with the winepath program
1477
 
# in $build's $PATH.
1478
 
#
1479
 
# ARG is the $build file name to be converted to w32 format.
1480
 
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1481
 
# be empty on error (or when ARG is empty)
1482
 
func_convert_core_file_wine_to_w32 ()
1483
 
{
1484
 
  $opt_debug
1485
 
  func_convert_core_file_wine_to_w32_result="$1"
1486
 
  if test -n "$1"; then
1487
 
    # Unfortunately, winepath does not exit with a non-zero error code, so we
1488
 
    # are forced to check the contents of stdout. On the other hand, if the
1489
 
    # command is not found, the shell will set an exit code of 127 and print
1490
 
    # *an error message* to stdout. So we must check for both error code of
1491
 
    # zero AND non-empty stdout, which explains the odd construction:
1492
 
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1493
 
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1494
 
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1495
 
        $SED -e "$lt_sed_naive_backslashify"`
1496
 
    else
1497
 
      func_convert_core_file_wine_to_w32_result=
1498
 
    fi
1499
 
  fi
1500
 
}
1501
 
# end: func_convert_core_file_wine_to_w32
1502
 
 
1503
 
 
1504
 
# func_convert_core_path_wine_to_w32 ARG
1505
 
# Helper function used by path conversion functions when $build is *nix, and
1506
 
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1507
 
# configured wine environment available, with the winepath program in $build's
1508
 
# $PATH. Assumes ARG has no leading or trailing path separator characters.
1509
 
#
1510
 
# ARG is path to be converted from $build format to win32.
1511
 
# Result is available in $func_convert_core_path_wine_to_w32_result.
1512
 
# Unconvertible file (directory) names in ARG are skipped; if no directory names
1513
 
# are convertible, then the result may be empty.
1514
 
func_convert_core_path_wine_to_w32 ()
1515
 
{
1516
 
  $opt_debug
1517
 
  # unfortunately, winepath doesn't convert paths, only file names
1518
 
  func_convert_core_path_wine_to_w32_result=""
1519
 
  if test -n "$1"; then
1520
 
    oldIFS=$IFS
1521
 
    IFS=:
1522
 
    for func_convert_core_path_wine_to_w32_f in $1; do
1523
 
      IFS=$oldIFS
1524
 
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1525
 
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1526
 
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
1527
 
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1528
 
        else
1529
 
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1530
 
        fi
1531
 
      fi
1532
 
    done
1533
 
    IFS=$oldIFS
1534
 
  fi
1535
 
}
1536
 
# end: func_convert_core_path_wine_to_w32
1537
 
 
1538
 
 
1539
 
# func_cygpath ARGS...
1540
 
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1541
 
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1542
 
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1543
 
# (2), returns the Cygwin file name or path in func_cygpath_result (input
1544
 
# file name or path is assumed to be in w32 format, as previously converted
1545
 
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1546
 
# or path in func_cygpath_result (input file name or path is assumed to be in
1547
 
# Cygwin format). Returns an empty string on error.
1548
 
#
1549
 
# ARGS are passed to cygpath, with the last one being the file name or path to
1550
 
# be converted.
1551
 
#
1552
 
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1553
 
# environment variable; do not put it in $PATH.
1554
 
func_cygpath ()
1555
 
{
1556
 
  $opt_debug
1557
 
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1558
 
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1559
 
    if test "$?" -ne 0; then
1560
 
      # on failure, ensure result is empty
1561
 
      func_cygpath_result=
1562
 
    fi
1563
 
  else
1564
 
    func_cygpath_result=
1565
 
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1566
 
  fi
1567
 
}
1568
 
#end: func_cygpath
1569
 
 
1570
 
 
1571
 
# func_convert_core_msys_to_w32 ARG
1572
 
# Convert file name or path ARG from MSYS format to w32 format.  Return
1573
 
# result in func_convert_core_msys_to_w32_result.
1574
 
func_convert_core_msys_to_w32 ()
1575
 
{
1576
 
  $opt_debug
1577
 
  # awkward: cmd appends spaces to result
1578
 
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1579
 
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1580
 
}
1581
 
#end: func_convert_core_msys_to_w32
1582
 
 
1583
 
 
1584
 
# func_convert_file_check ARG1 ARG2
1585
 
# Verify that ARG1 (a file name in $build format) was converted to $host
1586
 
# format in ARG2. Otherwise, emit an error message, but continue (resetting
1587
 
# func_to_host_file_result to ARG1).
1588
 
func_convert_file_check ()
1589
 
{
1590
 
  $opt_debug
1591
 
  if test -z "$2" && test -n "$1" ; then
1592
 
    func_error "Could not determine host file name corresponding to"
1593
 
    func_error "  \`$1'"
1594
 
    func_error "Continuing, but uninstalled executables may not work."
1595
 
    # Fallback:
1596
 
    func_to_host_file_result="$1"
1597
 
  fi
1598
 
}
1599
 
# end func_convert_file_check
1600
 
 
1601
 
 
1602
 
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1603
 
# Verify that FROM_PATH (a path in $build format) was converted to $host
1604
 
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1605
 
# func_to_host_file_result to a simplistic fallback value (see below).
1606
 
func_convert_path_check ()
1607
 
{
1608
 
  $opt_debug
1609
 
  if test -z "$4" && test -n "$3"; then
1610
 
    func_error "Could not determine the host path corresponding to"
1611
 
    func_error "  \`$3'"
1612
 
    func_error "Continuing, but uninstalled executables may not work."
1613
 
    # Fallback.  This is a deliberately simplistic "conversion" and
1614
 
    # should not be "improved".  See libtool.info.
1615
 
    if test "x$1" != "x$2"; then
1616
 
      lt_replace_pathsep_chars="s|$1|$2|g"
1617
 
      func_to_host_path_result=`echo "$3" |
1618
 
        $SED -e "$lt_replace_pathsep_chars"`
1619
 
    else
1620
 
      func_to_host_path_result="$3"
1621
 
    fi
1622
 
  fi
1623
 
}
1624
 
# end func_convert_path_check
1625
 
 
1626
 
 
1627
 
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1628
 
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1629
 
# and appending REPL if ORIG matches BACKPAT.
1630
 
func_convert_path_front_back_pathsep ()
1631
 
{
1632
 
  $opt_debug
1633
 
  case $4 in
1634
 
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1635
 
    ;;
1636
 
  esac
1637
 
  case $4 in
1638
 
  $2 ) func_append func_to_host_path_result "$3"
1639
 
    ;;
1640
 
  esac
1641
 
}
1642
 
# end func_convert_path_front_back_pathsep
1643
 
 
1644
 
 
1645
 
##################################################
1646
 
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1647
 
##################################################
1648
 
# invoked via `$to_host_file_cmd ARG'
1649
 
#
1650
 
# In each case, ARG is the path to be converted from $build to $host format.
1651
 
# Result will be available in $func_to_host_file_result.
1652
 
 
1653
 
 
1654
 
# func_to_host_file ARG
1655
 
# Converts the file name ARG from $build format to $host format. Return result
1656
 
# in func_to_host_file_result.
1657
 
func_to_host_file ()
1658
 
{
1659
 
  $opt_debug
1660
 
  $to_host_file_cmd "$1"
1661
 
}
1662
 
# end func_to_host_file
1663
 
 
1664
 
 
1665
 
# func_to_tool_file ARG LAZY
1666
 
# converts the file name ARG from $build format to toolchain format. Return
1667
 
# result in func_to_tool_file_result.  If the conversion in use is listed
1668
 
# in (the comma separated) LAZY, no conversion takes place.
1669
 
func_to_tool_file ()
1670
 
{
1671
 
  $opt_debug
1672
 
  case ,$2, in
1673
 
    *,"$to_tool_file_cmd",*)
1674
 
      func_to_tool_file_result=$1
1675
 
      ;;
1676
 
    *)
1677
 
      $to_tool_file_cmd "$1"
1678
 
      func_to_tool_file_result=$func_to_host_file_result
1679
 
      ;;
1680
 
  esac
1681
 
}
1682
 
# end func_to_tool_file
1683
 
 
1684
 
 
1685
 
# func_convert_file_noop ARG
1686
 
# Copy ARG to func_to_host_file_result.
1687
 
func_convert_file_noop ()
1688
 
{
1689
 
  func_to_host_file_result="$1"
1690
 
}
1691
 
# end func_convert_file_noop
1692
 
 
1693
 
 
1694
 
# func_convert_file_msys_to_w32 ARG
1695
 
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1696
 
# conversion to w32 is not available inside the cwrapper.  Returns result in
1697
 
# func_to_host_file_result.
1698
 
func_convert_file_msys_to_w32 ()
1699
 
{
1700
 
  $opt_debug
1701
 
  func_to_host_file_result="$1"
1702
 
  if test -n "$1"; then
1703
 
    func_convert_core_msys_to_w32 "$1"
1704
 
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1705
 
  fi
1706
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1707
 
}
1708
 
# end func_convert_file_msys_to_w32
1709
 
 
1710
 
 
1711
 
# func_convert_file_cygwin_to_w32 ARG
1712
 
# Convert file name ARG from Cygwin to w32 format.  Returns result in
1713
 
# func_to_host_file_result.
1714
 
func_convert_file_cygwin_to_w32 ()
1715
 
{
1716
 
  $opt_debug
1717
 
  func_to_host_file_result="$1"
1718
 
  if test -n "$1"; then
1719
 
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1720
 
    # LT_CYGPATH in this case.
1721
 
    func_to_host_file_result=`cygpath -m "$1"`
1722
 
  fi
1723
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1724
 
}
1725
 
# end func_convert_file_cygwin_to_w32
1726
 
 
1727
 
 
1728
 
# func_convert_file_nix_to_w32 ARG
1729
 
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
1730
 
# and a working winepath. Returns result in func_to_host_file_result.
1731
 
func_convert_file_nix_to_w32 ()
1732
 
{
1733
 
  $opt_debug
1734
 
  func_to_host_file_result="$1"
1735
 
  if test -n "$1"; then
1736
 
    func_convert_core_file_wine_to_w32 "$1"
1737
 
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1738
 
  fi
1739
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1740
 
}
1741
 
# end func_convert_file_nix_to_w32
1742
 
 
1743
 
 
1744
 
# func_convert_file_msys_to_cygwin ARG
1745
 
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
1746
 
# Returns result in func_to_host_file_result.
1747
 
func_convert_file_msys_to_cygwin ()
1748
 
{
1749
 
  $opt_debug
1750
 
  func_to_host_file_result="$1"
1751
 
  if test -n "$1"; then
1752
 
    func_convert_core_msys_to_w32 "$1"
1753
 
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
1754
 
    func_to_host_file_result="$func_cygpath_result"
1755
 
  fi
1756
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1757
 
}
1758
 
# end func_convert_file_msys_to_cygwin
1759
 
 
1760
 
 
1761
 
# func_convert_file_nix_to_cygwin ARG
1762
 
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
1763
 
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
1764
 
# in func_to_host_file_result.
1765
 
func_convert_file_nix_to_cygwin ()
1766
 
{
1767
 
  $opt_debug
1768
 
  func_to_host_file_result="$1"
1769
 
  if test -n "$1"; then
1770
 
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1771
 
    func_convert_core_file_wine_to_w32 "$1"
1772
 
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1773
 
    func_to_host_file_result="$func_cygpath_result"
1774
 
  fi
1775
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1776
 
}
1777
 
# end func_convert_file_nix_to_cygwin
1778
 
 
1779
 
 
1780
 
#############################################
1781
 
# $build to $host PATH CONVERSION FUNCTIONS #
1782
 
#############################################
1783
 
# invoked via `$to_host_path_cmd ARG'
1784
 
#
1785
 
# In each case, ARG is the path to be converted from $build to $host format.
1786
 
# The result will be available in $func_to_host_path_result.
1787
 
#
1788
 
# Path separators are also converted from $build format to $host format.  If
1789
 
# ARG begins or ends with a path separator character, it is preserved (but
1790
 
# converted to $host format) on output.
1791
 
#
1792
 
# All path conversion functions are named using the following convention:
1793
 
#   file name conversion function    : func_convert_file_X_to_Y ()
1794
 
#   path conversion function         : func_convert_path_X_to_Y ()
1795
 
# where, for any given $build/$host combination the 'X_to_Y' value is the
1796
 
# same.  If conversion functions are added for new $build/$host combinations,
1797
 
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1798
 
# will break.
1799
 
 
1800
 
 
1801
 
# func_init_to_host_path_cmd
1802
 
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1803
 
# appropriate value, based on the value of $to_host_file_cmd.
1804
 
to_host_path_cmd=
1805
 
func_init_to_host_path_cmd ()
1806
 
{
1807
 
  $opt_debug
1808
 
  if test -z "$to_host_path_cmd"; then
1809
 
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1810
 
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
1811
 
  fi
1812
 
}
1813
 
 
1814
 
 
1815
 
# func_to_host_path ARG
1816
 
# Converts the path ARG from $build format to $host format. Return result
1817
 
# in func_to_host_path_result.
1818
 
func_to_host_path ()
1819
 
{
1820
 
  $opt_debug
1821
 
  func_init_to_host_path_cmd
1822
 
  $to_host_path_cmd "$1"
1823
 
}
1824
 
# end func_to_host_path
1825
 
 
1826
 
 
1827
 
# func_convert_path_noop ARG
1828
 
# Copy ARG to func_to_host_path_result.
1829
 
func_convert_path_noop ()
1830
 
{
1831
 
  func_to_host_path_result="$1"
1832
 
}
1833
 
# end func_convert_path_noop
1834
 
 
1835
 
 
1836
 
# func_convert_path_msys_to_w32 ARG
1837
 
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1838
 
# conversion to w32 is not available inside the cwrapper.  Returns result in
1839
 
# func_to_host_path_result.
1840
 
func_convert_path_msys_to_w32 ()
1841
 
{
1842
 
  $opt_debug
1843
 
  func_to_host_path_result="$1"
1844
 
  if test -n "$1"; then
1845
 
    # Remove leading and trailing path separator characters from ARG.  MSYS
1846
 
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1847
 
    # and winepath ignores them completely.
1848
 
    func_stripname : : "$1"
1849
 
    func_to_host_path_tmp1=$func_stripname_result
1850
 
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1851
 
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1852
 
    func_convert_path_check : ";" \
1853
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1854
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1855
 
  fi
1856
 
}
1857
 
# end func_convert_path_msys_to_w32
1858
 
 
1859
 
 
1860
 
# func_convert_path_cygwin_to_w32 ARG
1861
 
# Convert path ARG from Cygwin to w32 format.  Returns result in
1862
 
# func_to_host_file_result.
1863
 
func_convert_path_cygwin_to_w32 ()
1864
 
{
1865
 
  $opt_debug
1866
 
  func_to_host_path_result="$1"
1867
 
  if test -n "$1"; then
1868
 
    # See func_convert_path_msys_to_w32:
1869
 
    func_stripname : : "$1"
1870
 
    func_to_host_path_tmp1=$func_stripname_result
1871
 
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1872
 
    func_convert_path_check : ";" \
1873
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1874
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1875
 
  fi
1876
 
}
1877
 
# end func_convert_path_cygwin_to_w32
1878
 
 
1879
 
 
1880
 
# func_convert_path_nix_to_w32 ARG
1881
 
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
1882
 
# a working winepath.  Returns result in func_to_host_file_result.
1883
 
func_convert_path_nix_to_w32 ()
1884
 
{
1885
 
  $opt_debug
1886
 
  func_to_host_path_result="$1"
1887
 
  if test -n "$1"; then
1888
 
    # See func_convert_path_msys_to_w32:
1889
 
    func_stripname : : "$1"
1890
 
    func_to_host_path_tmp1=$func_stripname_result
1891
 
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1892
 
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1893
 
    func_convert_path_check : ";" \
1894
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1895
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1896
 
  fi
1897
 
}
1898
 
# end func_convert_path_nix_to_w32
1899
 
 
1900
 
 
1901
 
# func_convert_path_msys_to_cygwin ARG
1902
 
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
1903
 
# Returns result in func_to_host_file_result.
1904
 
func_convert_path_msys_to_cygwin ()
1905
 
{
1906
 
  $opt_debug
1907
 
  func_to_host_path_result="$1"
1908
 
  if test -n "$1"; then
1909
 
    # See func_convert_path_msys_to_w32:
1910
 
    func_stripname : : "$1"
1911
 
    func_to_host_path_tmp1=$func_stripname_result
1912
 
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1913
 
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1914
 
    func_to_host_path_result="$func_cygpath_result"
1915
 
    func_convert_path_check : : \
1916
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1917
 
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1918
 
  fi
1919
 
}
1920
 
# end func_convert_path_msys_to_cygwin
1921
 
 
1922
 
 
1923
 
# func_convert_path_nix_to_cygwin ARG
1924
 
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
1925
 
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
1926
 
# func_to_host_file_result.
1927
 
func_convert_path_nix_to_cygwin ()
1928
 
{
1929
 
  $opt_debug
1930
 
  func_to_host_path_result="$1"
1931
 
  if test -n "$1"; then
1932
 
    # Remove leading and trailing path separator characters from
1933
 
    # ARG. msys behavior is inconsistent here, cygpath turns them
1934
 
    # into '.;' and ';.', and winepath ignores them completely.
1935
 
    func_stripname : : "$1"
1936
 
    func_to_host_path_tmp1=$func_stripname_result
1937
 
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1938
 
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1939
 
    func_to_host_path_result="$func_cygpath_result"
1940
 
    func_convert_path_check : : \
1941
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1942
 
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1943
 
  fi
1944
 
}
1945
 
# end func_convert_path_nix_to_cygwin
1946
 
 
1947
 
 
1948
1266
# func_mode_compile arg...
1949
1267
func_mode_compile ()
1950
1268
{
1985
1303
          ;;
1986
1304
 
1987
1305
        -pie | -fpie | -fPIE)
1988
 
          func_append pie_flag " $arg"
 
1306
          pie_flag="$pie_flag $arg"
1989
1307
          continue
1990
1308
          ;;
1991
1309
 
1992
1310
        -shared | -static | -prefer-pic | -prefer-non-pic)
1993
 
          func_append later " $arg"
 
1311
          later="$later $arg"
1994
1312
          continue
1995
1313
          ;;
1996
1314
 
2011
1329
          save_ifs="$IFS"; IFS=','
2012
1330
          for arg in $args; do
2013
1331
            IFS="$save_ifs"
2014
 
            func_append_quoted lastarg "$arg"
 
1332
            func_quote_for_eval "$arg"
 
1333
            lastarg="$lastarg $func_quote_for_eval_result"
2015
1334
          done
2016
1335
          IFS="$save_ifs"
2017
1336
          func_stripname ' ' '' "$lastarg"
2018
1337
          lastarg=$func_stripname_result
2019
1338
 
2020
1339
          # Add the arguments to base_compile.
2021
 
          func_append base_compile " $lastarg"
 
1340
          base_compile="$base_compile $lastarg"
2022
1341
          continue
2023
1342
          ;;
2024
1343
 
2034
1353
      esac    #  case $arg_mode
2035
1354
 
2036
1355
      # Aesthetically quote the previous argument.
2037
 
      func_append_quoted base_compile "$lastarg"
 
1356
      func_quote_for_eval "$lastarg"
 
1357
      base_compile="$base_compile $func_quote_for_eval_result"
2038
1358
    done # for arg
2039
1359
 
2040
1360
    case $arg_mode in
2165
1485
        $opt_dry_run || $RM $removelist
2166
1486
        exit $EXIT_FAILURE
2167
1487
      fi
2168
 
      func_append removelist " $output_obj"
 
1488
      removelist="$removelist $output_obj"
2169
1489
      $ECHO "$srcfile" > "$lockfile"
2170
1490
    fi
2171
1491
 
2172
1492
    $opt_dry_run || $RM $removelist
2173
 
    func_append removelist " $lockfile"
 
1493
    removelist="$removelist $lockfile"
2174
1494
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2175
1495
 
2176
 
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2177
 
    srcfile=$func_to_tool_file_result
 
1496
    if test -n "$fix_srcfile_path"; then
 
1497
      eval srcfile=\"$fix_srcfile_path\"
 
1498
    fi
2178
1499
    func_quote_for_eval "$srcfile"
2179
1500
    qsrcfile=$func_quote_for_eval_result
2180
1501
 
2194
1515
 
2195
1516
      if test -z "$output_obj"; then
2196
1517
        # Place PIC objects in $objdir
2197
 
        func_append command " -o $lobj"
 
1518
        command="$command -o $lobj"
2198
1519
      fi
2199
1520
 
2200
1521
      func_show_eval_locale "$command"  \
2241
1562
        command="$base_compile $qsrcfile $pic_flag"
2242
1563
      fi
2243
1564
      if test "$compiler_c_o" = yes; then
2244
 
        func_append command " -o $obj"
 
1565
        command="$command -o $obj"
2245
1566
      fi
2246
1567
 
2247
1568
      # Suppress compiler output if we already did a PIC compilation.
2248
 
      func_append command "$suppress_output"
 
1569
      command="$command$suppress_output"
2249
1570
      func_show_eval_locale "$command" \
2250
1571
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2251
1572
 
2290
1611
}
2291
1612
 
2292
1613
$opt_help || {
2293
 
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
 
1614
  test "$mode" = compile && func_mode_compile ${1+"$@"}
2294
1615
}
2295
1616
 
2296
1617
func_mode_help ()
2297
1618
{
2298
1619
    # We need to display help for each of the modes.
2299
 
    case $opt_mode in
 
1620
    case $mode in
2300
1621
      "")
2301
1622
        # Generic help is extracted from the usage comments
2302
1623
        # at the start of this file.
2472
1793
        ;;
2473
1794
 
2474
1795
      *)
2475
 
        func_fatal_help "invalid operation mode \`$opt_mode'"
 
1796
        func_fatal_help "invalid operation mode \`$mode'"
2476
1797
        ;;
2477
1798
    esac
2478
1799
 
2487
1808
  else
2488
1809
    {
2489
1810
      func_help noexit
2490
 
      for opt_mode in compile link execute install finish uninstall clean; do
 
1811
      for mode in compile link execute install finish uninstall clean; do
2491
1812
        func_mode_help
2492
1813
      done
2493
1814
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
2494
1815
    {
2495
1816
      func_help noexit
2496
 
      for opt_mode in compile link execute install finish uninstall clean; do
 
1817
      for mode in compile link execute install finish uninstall clean; do
2497
1818
        echo
2498
1819
        func_mode_help
2499
1820
      done
2522
1843
      func_fatal_help "you must specify a COMMAND"
2523
1844
 
2524
1845
    # Handle -dlopen flags immediately.
2525
 
    for file in $opt_dlopen; do
 
1846
    for file in $execute_dlfiles; do
2526
1847
      test -f "$file" \
2527
1848
        || func_fatal_help "\`$file' is not a file"
2528
1849
 
2529
1850
      dir=
2530
1851
      case $file in
2531
1852
      *.la)
2532
 
        func_resolve_sysroot "$file"
2533
 
        file=$func_resolve_sysroot_result
2534
 
 
2535
1853
        # Check to see that this really is a libtool archive.
2536
1854
        func_lalib_unsafe_p "$file" \
2537
1855
          || func_fatal_help "\`$lib' is not a valid libtool archive"
2553
1871
        dir="$func_dirname_result"
2554
1872
 
2555
1873
        if test -f "$dir/$objdir/$dlname"; then
2556
 
          func_append dir "/$objdir"
 
1874
          dir="$dir/$objdir"
2557
1875
        else
2558
1876
          if test ! -f "$dir/$dlname"; then
2559
1877
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2610
1928
        ;;
2611
1929
      esac
2612
1930
      # Quote arguments (to preserve shell metacharacters).
2613
 
      func_append_quoted args "$file"
 
1931
      func_quote_for_eval "$file"
 
1932
      args="$args $func_quote_for_eval_result"
2614
1933
    done
2615
1934
 
2616
1935
    if test "X$opt_dry_run" = Xfalse; then
2642
1961
    fi
2643
1962
}
2644
1963
 
2645
 
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
 
1964
test "$mode" = execute && func_mode_execute ${1+"$@"}
2646
1965
 
2647
1966
 
2648
1967
# func_mode_finish arg...
2649
1968
func_mode_finish ()
2650
1969
{
2651
1970
    $opt_debug
2652
 
    libs=
2653
 
    libdirs=
 
1971
    libdirs="$nonopt"
2654
1972
    admincmds=
2655
1973
 
2656
 
    for opt in "$nonopt" ${1+"$@"}
2657
 
    do
2658
 
      if test -d "$opt"; then
2659
 
        func_append libdirs " $opt"
2660
 
 
2661
 
      elif test -f "$opt"; then
2662
 
        if func_lalib_unsafe_p "$opt"; then
2663
 
          func_append libs " $opt"
2664
 
        else
2665
 
          func_warning "\`$opt' is not a valid libtool archive"
2666
 
        fi
2667
 
 
2668
 
      else
2669
 
        func_fatal_error "invalid argument \`$opt'"
2670
 
      fi
2671
 
    done
2672
 
 
2673
 
    if test -n "$libs"; then
2674
 
      if test -n "$lt_sysroot"; then
2675
 
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2676
 
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2677
 
      else
2678
 
        sysroot_cmd=
2679
 
      fi
2680
 
 
2681
 
      # Remove sysroot references
2682
 
      if $opt_dry_run; then
2683
 
        for lib in $libs; do
2684
 
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2685
 
        done
2686
 
      else
2687
 
        tmpdir=`func_mktempdir`
2688
 
        for lib in $libs; do
2689
 
          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2690
 
            > $tmpdir/tmp-la
2691
 
          mv -f $tmpdir/tmp-la $lib
2692
 
        done
2693
 
        ${RM}r "$tmpdir"
2694
 
      fi
2695
 
    fi
2696
 
 
2697
1974
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
 
1975
      for dir
 
1976
      do
 
1977
        libdirs="$libdirs $dir"
 
1978
      done
 
1979
 
2698
1980
      for libdir in $libdirs; do
2699
1981
        if test -n "$finish_cmds"; then
2700
1982
          # Do each command in the finish commands.
2704
1986
        if test -n "$finish_eval"; then
2705
1987
          # Do the single finish_eval.
2706
1988
          eval cmds=\"$finish_eval\"
2707
 
          $opt_dry_run || eval "$cmds" || func_append admincmds "
 
1989
          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
2708
1990
       $cmds"
2709
1991
        fi
2710
1992
      done
2713
1995
    # Exit here if they wanted silent mode.
2714
1996
    $opt_silent && exit $EXIT_SUCCESS
2715
1997
 
2716
 
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2717
 
      echo "----------------------------------------------------------------------"
2718
 
      echo "Libraries have been installed in:"
2719
 
      for libdir in $libdirs; do
2720
 
        $ECHO "   $libdir"
2721
 
      done
2722
 
      echo
2723
 
      echo "If you ever happen to want to link against installed libraries"
2724
 
      echo "in a given directory, LIBDIR, you must either use libtool, and"
2725
 
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2726
 
      echo "flag during linking and do at least one of the following:"
2727
 
      if test -n "$shlibpath_var"; then
2728
 
        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
2729
 
        echo "     during execution"
2730
 
      fi
2731
 
      if test -n "$runpath_var"; then
2732
 
        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
2733
 
        echo "     during linking"
2734
 
      fi
2735
 
      if test -n "$hardcode_libdir_flag_spec"; then
2736
 
        libdir=LIBDIR
2737
 
        eval flag=\"$hardcode_libdir_flag_spec\"
2738
 
 
2739
 
        $ECHO "   - use the \`$flag' linker flag"
2740
 
      fi
2741
 
      if test -n "$admincmds"; then
2742
 
        $ECHO "   - have your system administrator run these commands:$admincmds"
2743
 
      fi
2744
 
      if test -f /etc/ld.so.conf; then
2745
 
        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2746
 
      fi
2747
 
      echo
2748
 
 
2749
 
      echo "See any operating system documentation about shared libraries for"
2750
 
      case $host in
2751
 
        solaris2.[6789]|solaris2.1[0-9])
2752
 
          echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2753
 
          echo "pages."
2754
 
          ;;
2755
 
        *)
2756
 
          echo "more information, such as the ld(1) and ld.so(8) manual pages."
2757
 
          ;;
2758
 
      esac
2759
 
      echo "----------------------------------------------------------------------"
2760
 
    fi
 
1998
    echo "----------------------------------------------------------------------"
 
1999
    echo "Libraries have been installed in:"
 
2000
    for libdir in $libdirs; do
 
2001
      $ECHO "   $libdir"
 
2002
    done
 
2003
    echo
 
2004
    echo "If you ever happen to want to link against installed libraries"
 
2005
    echo "in a given directory, LIBDIR, you must either use libtool, and"
 
2006
    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
2007
    echo "flag during linking and do at least one of the following:"
 
2008
    if test -n "$shlibpath_var"; then
 
2009
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
2010
      echo "     during execution"
 
2011
    fi
 
2012
    if test -n "$runpath_var"; then
 
2013
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
2014
      echo "     during linking"
 
2015
    fi
 
2016
    if test -n "$hardcode_libdir_flag_spec"; then
 
2017
      libdir=LIBDIR
 
2018
      eval flag=\"$hardcode_libdir_flag_spec\"
 
2019
 
 
2020
      $ECHO "   - use the \`$flag' linker flag"
 
2021
    fi
 
2022
    if test -n "$admincmds"; then
 
2023
      $ECHO "   - have your system administrator run these commands:$admincmds"
 
2024
    fi
 
2025
    if test -f /etc/ld.so.conf; then
 
2026
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
2027
    fi
 
2028
    echo
 
2029
 
 
2030
    echo "See any operating system documentation about shared libraries for"
 
2031
    case $host in
 
2032
      solaris2.[6789]|solaris2.1[0-9])
 
2033
        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
2034
        echo "pages."
 
2035
        ;;
 
2036
      *)
 
2037
        echo "more information, such as the ld(1) and ld.so(8) manual pages."
 
2038
        ;;
 
2039
    esac
 
2040
    echo "----------------------------------------------------------------------"
2761
2041
    exit $EXIT_SUCCESS
2762
2042
}
2763
2043
 
2764
 
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
 
2044
test "$mode" = finish && func_mode_finish ${1+"$@"}
2765
2045
 
2766
2046
 
2767
2047
# func_mode_install arg...
2786
2066
    # The real first argument should be the name of the installation program.
2787
2067
    # Aesthetically quote it.
2788
2068
    func_quote_for_eval "$arg"
2789
 
    func_append install_prog "$func_quote_for_eval_result"
 
2069
    install_prog="$install_prog$func_quote_for_eval_result"
2790
2070
    install_shared_prog=$install_prog
2791
2071
    case " $install_prog " in
2792
2072
      *[\\\ /]cp\ *) install_cp=: ;;
2806
2086
    do
2807
2087
      arg2=
2808
2088
      if test -n "$dest"; then
2809
 
        func_append files " $dest"
 
2089
        files="$files $dest"
2810
2090
        dest=$arg
2811
2091
        continue
2812
2092
      fi
2844
2124
 
2845
2125
      # Aesthetically quote the argument.
2846
2126
      func_quote_for_eval "$arg"
2847
 
      func_append install_prog " $func_quote_for_eval_result"
 
2127
      install_prog="$install_prog $func_quote_for_eval_result"
2848
2128
      if test -n "$arg2"; then
2849
2129
        func_quote_for_eval "$arg2"
2850
2130
      fi
2851
 
      func_append install_shared_prog " $func_quote_for_eval_result"
 
2131
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
2852
2132
    done
2853
2133
 
2854
2134
    test -z "$install_prog" && \
2860
2140
    if test -n "$install_override_mode" && $no_mode; then
2861
2141
      if $install_cp; then :; else
2862
2142
        func_quote_for_eval "$install_override_mode"
2863
 
        func_append install_shared_prog " -m $func_quote_for_eval_result"
 
2143
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
2864
2144
      fi
2865
2145
    fi
2866
2146
 
2918
2198
      case $file in
2919
2199
      *.$libext)
2920
2200
        # Do the static libraries later.
2921
 
        func_append staticlibs " $file"
 
2201
        staticlibs="$staticlibs $file"
2922
2202
        ;;
2923
2203
 
2924
2204
      *.la)
2925
 
        func_resolve_sysroot "$file"
2926
 
        file=$func_resolve_sysroot_result
2927
 
 
2928
2205
        # Check to see that this really is a libtool archive.
2929
2206
        func_lalib_unsafe_p "$file" \
2930
2207
          || func_fatal_help "\`$file' is not a valid libtool archive"
2938
2215
        if test "X$destdir" = "X$libdir"; then
2939
2216
          case "$current_libdirs " in
2940
2217
          *" $libdir "*) ;;
2941
 
          *) func_append current_libdirs " $libdir" ;;
 
2218
          *) current_libdirs="$current_libdirs $libdir" ;;
2942
2219
          esac
2943
2220
        else
2944
2221
          # Note the libdir as a future libdir.
2945
2222
          case "$future_libdirs " in
2946
2223
          *" $libdir "*) ;;
2947
 
          *) func_append future_libdirs " $libdir" ;;
 
2224
          *) future_libdirs="$future_libdirs $libdir" ;;
2948
2225
          esac
2949
2226
        fi
2950
2227
 
2951
2228
        func_dirname "$file" "/" ""
2952
2229
        dir="$func_dirname_result"
2953
 
        func_append dir "$objdir"
 
2230
        dir="$dir$objdir"
2954
2231
 
2955
2232
        if test -n "$relink_command"; then
2956
2233
          # Determine the prefix the user has applied to our future dir.
3027
2304
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3028
2305
 
3029
2306
        # Maybe install the static library, too.
3030
 
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
 
2307
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3031
2308
        ;;
3032
2309
 
3033
2310
      *.lo)
3224
2501
    fi
3225
2502
}
3226
2503
 
3227
 
test "$opt_mode" = install && func_mode_install ${1+"$@"}
 
2504
test "$mode" = install && func_mode_install ${1+"$@"}
3228
2505
 
3229
2506
 
3230
2507
# func_generate_dlsyms outputname originator pic_p
3271
2548
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3272
2549
#endif
3273
2550
 
3274
 
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3275
 
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3276
 
/* DATA imports from DLLs on WIN32 con't be const, because runtime
3277
 
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3278
 
# define LT_DLSYM_CONST
3279
 
#elif defined(__osf__)
3280
 
/* This system does not cope well with relocations in const data.  */
3281
 
# define LT_DLSYM_CONST
3282
 
#else
3283
 
# define LT_DLSYM_CONST const
3284
 
#endif
3285
 
 
3286
2551
/* External symbol declarations for the compiler. */\
3287
2552
"
3288
2553
 
3294
2559
          # Add our own program objects to the symbol list.
3295
2560
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3296
2561
          for progfile in $progfiles; do
3297
 
            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3298
 
            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3299
 
            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 
2562
            func_verbose "extracting global C symbols from \`$progfile'"
 
2563
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
3300
2564
          done
3301
2565
 
3302
2566
          if test -n "$exclude_expsyms"; then
3345
2609
          func_verbose "extracting global C symbols from \`$dlprefile'"
3346
2610
          func_basename "$dlprefile"
3347
2611
          name="$func_basename_result"
3348
 
          case $host in
3349
 
            *cygwin* | *mingw* | *cegcc* )
3350
 
              # if an import library, we need to obtain dlname
3351
 
              if func_win32_import_lib_p "$dlprefile"; then
3352
 
                func_tr_sh "$dlprefile"
3353
 
                eval "curr_lafile=\$libfile_$func_tr_sh_result"
3354
 
                dlprefile_dlbasename=""
3355
 
                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3356
 
                  # Use subshell, to avoid clobbering current variable values
3357
 
                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3358
 
                  if test -n "$dlprefile_dlname" ; then
3359
 
                    func_basename "$dlprefile_dlname"
3360
 
                    dlprefile_dlbasename="$func_basename_result"
3361
 
                  else
3362
 
                    # no lafile. user explicitly requested -dlpreopen <import library>.
3363
 
                    $sharedlib_from_linklib_cmd "$dlprefile"
3364
 
                    dlprefile_dlbasename=$sharedlib_from_linklib_result
3365
 
                  fi
3366
 
                fi
3367
 
                $opt_dry_run || {
3368
 
                  if test -n "$dlprefile_dlbasename" ; then
3369
 
                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3370
 
                  else
3371
 
                    func_warning "Could not compute DLL name from $name"
3372
 
                    eval '$ECHO ": $name " >> "$nlist"'
3373
 
                  fi
3374
 
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3375
 
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3376
 
                    $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3377
 
                }
3378
 
              else # not an import lib
3379
 
                $opt_dry_run || {
3380
 
                  eval '$ECHO ": $name " >> "$nlist"'
3381
 
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3382
 
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3383
 
                }
3384
 
              fi
3385
 
            ;;
3386
 
            *)
3387
 
              $opt_dry_run || {
3388
 
                eval '$ECHO ": $name " >> "$nlist"'
3389
 
                func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3390
 
                eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3391
 
              }
3392
 
            ;;
3393
 
          esac
 
2612
          $opt_dry_run || {
 
2613
            eval '$ECHO ": $name " >> "$nlist"'
 
2614
            eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
 
2615
          }
3394
2616
        done
3395
2617
 
3396
2618
        $opt_dry_run || {
3428
2650
  const char *name;
3429
2651
  void *address;
3430
2652
} lt_dlsymlist;
3431
 
extern LT_DLSYM_CONST lt_dlsymlist
 
2653
"
 
2654
          case $host in
 
2655
          *cygwin* | *mingw* | *cegcc* )
 
2656
            echo >> "$output_objdir/$my_dlsyms" "\
 
2657
/* DATA imports from DLLs on WIN32 con't be const, because
 
2658
   runtime relocations are performed -- see ld's documentation
 
2659
   on pseudo-relocs.  */"
 
2660
            lt_dlsym_const= ;;
 
2661
          *osf5*)
 
2662
            echo >> "$output_objdir/$my_dlsyms" "\
 
2663
/* This system does not cope well with relocations in const data */"
 
2664
            lt_dlsym_const= ;;
 
2665
          *)
 
2666
            lt_dlsym_const=const ;;
 
2667
          esac
 
2668
 
 
2669
          echo >> "$output_objdir/$my_dlsyms" "\
 
2670
extern $lt_dlsym_const lt_dlsymlist
3432
2671
lt_${my_prefix}_LTX_preloaded_symbols[];
3433
 
LT_DLSYM_CONST lt_dlsymlist
 
2672
$lt_dlsym_const lt_dlsymlist
3434
2673
lt_${my_prefix}_LTX_preloaded_symbols[] =
3435
2674
{\
3436
2675
  { \"$my_originator\", (void *) 0 },"
3486
2725
        for arg in $LTCFLAGS; do
3487
2726
          case $arg in
3488
2727
          -pie | -fpie | -fPIE) ;;
3489
 
          *) func_append symtab_cflags " $arg" ;;
 
2728
          *) symtab_cflags="$symtab_cflags $arg" ;;
3490
2729
          esac
3491
2730
        done
3492
2731
 
3549
2788
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3550
2789
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3551
2790
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3552
 
      func_to_tool_file "$1" func_convert_file_msys_to_w32
3553
 
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
 
2791
      win32_nmres=`eval $NM -f posix -A $1 |
3554
2792
        $SED -n -e '
3555
2793
            1,100{
3556
2794
                / I /{
3579
2817
  $ECHO "$win32_libid_type"
3580
2818
}
3581
2819
 
3582
 
# func_cygming_dll_for_implib ARG
3583
 
#
3584
 
# Platform-specific function to extract the
3585
 
# name of the DLL associated with the specified
3586
 
# import library ARG.
3587
 
# Invoked by eval'ing the libtool variable
3588
 
#    $sharedlib_from_linklib_cmd
3589
 
# Result is available in the variable
3590
 
#    $sharedlib_from_linklib_result
3591
 
func_cygming_dll_for_implib ()
3592
 
{
3593
 
  $opt_debug
3594
 
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3595
 
}
3596
 
 
3597
 
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3598
 
#
3599
 
# The is the core of a fallback implementation of a
3600
 
# platform-specific function to extract the name of the
3601
 
# DLL associated with the specified import library LIBNAME.
3602
 
#
3603
 
# SECTION_NAME is either .idata$6 or .idata$7, depending
3604
 
# on the platform and compiler that created the implib.
3605
 
#
3606
 
# Echos the name of the DLL associated with the
3607
 
# specified import library.
3608
 
func_cygming_dll_for_implib_fallback_core ()
3609
 
{
3610
 
  $opt_debug
3611
 
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3612
 
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3613
 
    $SED '/^Contents of section '"$match_literal"':/{
3614
 
      # Place marker at beginning of archive member dllname section
3615
 
      s/.*/====MARK====/
3616
 
      p
3617
 
      d
3618
 
    }
3619
 
    # These lines can sometimes be longer than 43 characters, but
3620
 
    # are always uninteresting
3621
 
    /:[  ]*file format pe[i]\{,1\}-/d
3622
 
    /^In archive [^:]*:/d
3623
 
    # Ensure marker is printed
3624
 
    /^====MARK====/p
3625
 
    # Remove all lines with less than 43 characters
3626
 
    /^.\{43\}/!d
3627
 
    # From remaining lines, remove first 43 characters
3628
 
    s/^.\{43\}//' |
3629
 
    $SED -n '
3630
 
      # Join marker and all lines until next marker into a single line
3631
 
      /^====MARK====/ b para
3632
 
      H
3633
 
      $ b para
3634
 
      b
3635
 
      :para
3636
 
      x
3637
 
      s/\n//g
3638
 
      # Remove the marker
3639
 
      s/^====MARK====//
3640
 
      # Remove trailing dots and whitespace
3641
 
      s/[\. \t]*$//
3642
 
      # Print
3643
 
      /./p' |
3644
 
    # we now have a list, one entry per line, of the stringified
3645
 
    # contents of the appropriate section of all members of the
3646
 
    # archive which possess that section. Heuristic: eliminate
3647
 
    # all those which have a first or second character that is
3648
 
    # a '.' (that is, objdump's representation of an unprintable
3649
 
    # character.) This should work for all archives with less than
3650
 
    # 0x302f exports -- but will fail for DLLs whose name actually
3651
 
    # begins with a literal '.' or a single character followed by
3652
 
    # a '.'.
3653
 
    #
3654
 
    # Of those that remain, print the first one.
3655
 
    $SED -e '/^\./d;/^.\./d;q'
3656
 
}
3657
 
 
3658
 
# func_cygming_gnu_implib_p ARG
3659
 
# This predicate returns with zero status (TRUE) if
3660
 
# ARG is a GNU/binutils-style import library. Returns
3661
 
# with nonzero status (FALSE) otherwise.
3662
 
func_cygming_gnu_implib_p ()
3663
 
{
3664
 
  $opt_debug
3665
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3666
 
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3667
 
  test -n "$func_cygming_gnu_implib_tmp"
3668
 
}
3669
 
 
3670
 
# func_cygming_ms_implib_p ARG
3671
 
# This predicate returns with zero status (TRUE) if
3672
 
# ARG is an MS-style import library. Returns
3673
 
# with nonzero status (FALSE) otherwise.
3674
 
func_cygming_ms_implib_p ()
3675
 
{
3676
 
  $opt_debug
3677
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3678
 
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3679
 
  test -n "$func_cygming_ms_implib_tmp"
3680
 
}
3681
 
 
3682
 
# func_cygming_dll_for_implib_fallback ARG
3683
 
# Platform-specific function to extract the
3684
 
# name of the DLL associated with the specified
3685
 
# import library ARG.
3686
 
#
3687
 
# This fallback implementation is for use when $DLLTOOL
3688
 
# does not support the --identify-strict option.
3689
 
# Invoked by eval'ing the libtool variable
3690
 
#    $sharedlib_from_linklib_cmd
3691
 
# Result is available in the variable
3692
 
#    $sharedlib_from_linklib_result
3693
 
func_cygming_dll_for_implib_fallback ()
3694
 
{
3695
 
  $opt_debug
3696
 
  if func_cygming_gnu_implib_p "$1" ; then
3697
 
    # binutils import library
3698
 
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3699
 
  elif func_cygming_ms_implib_p "$1" ; then
3700
 
    # ms-generated import library
3701
 
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3702
 
  else
3703
 
    # unknown
3704
 
    sharedlib_from_linklib_result=""
3705
 
  fi
3706
 
}
3707
2820
 
3708
2821
 
3709
2822
# func_extract_an_archive dir oldlib
4082
3195
 
4083
3196
  if test -f \"\$progdir/\$program\"; then"
4084
3197
 
4085
 
        # fixup the dll searchpath if we need to.
4086
 
        #
4087
 
        # Fix the DLL searchpath if we need to.  Do this before prepending
4088
 
        # to shlibpath, because on Windows, both are PATH and uninstalled
4089
 
        # libraries must come first.
4090
 
        if test -n "$dllsearchpath"; then
4091
 
          $ECHO "\
4092
 
    # Add the dll search path components to the executable PATH
4093
 
    PATH=$dllsearchpath:\$PATH
4094
 
"
4095
 
        fi
4096
 
 
4097
3198
        # Export our shlibpath_var if we have one.
4098
3199
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4099
3200
          $ECHO "\
4108
3209
"
4109
3210
        fi
4110
3211
 
 
3212
        # fixup the dll searchpath if we need to.
 
3213
        if test -n "$dllsearchpath"; then
 
3214
          $ECHO "\
 
3215
    # Add the dll search path components to the executable PATH
 
3216
    PATH=$dllsearchpath:\$PATH
 
3217
"
 
3218
        fi
 
3219
 
4111
3220
        $ECHO "\
4112
3221
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
4113
3222
      # Run the actual program with our arguments.
4125
3234
}
4126
3235
 
4127
3236
 
 
3237
# func_to_host_path arg
 
3238
#
 
3239
# Convert paths to host format when used with build tools.
 
3240
# Intended for use with "native" mingw (where libtool itself
 
3241
# is running under the msys shell), or in the following cross-
 
3242
# build environments:
 
3243
#    $build          $host
 
3244
#    mingw (msys)    mingw  [e.g. native]
 
3245
#    cygwin          mingw
 
3246
#    *nix + wine     mingw
 
3247
# where wine is equipped with the `winepath' executable.
 
3248
# In the native mingw case, the (msys) shell automatically
 
3249
# converts paths for any non-msys applications it launches,
 
3250
# but that facility isn't available from inside the cwrapper.
 
3251
# Similar accommodations are necessary for $host mingw and
 
3252
# $build cygwin.  Calling this function does no harm for other
 
3253
# $host/$build combinations not listed above.
 
3254
#
 
3255
# ARG is the path (on $build) that should be converted to
 
3256
# the proper representation for $host. The result is stored
 
3257
# in $func_to_host_path_result.
 
3258
func_to_host_path ()
 
3259
{
 
3260
  func_to_host_path_result="$1"
 
3261
  if test -n "$1"; then
 
3262
    case $host in
 
3263
      *mingw* )
 
3264
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
 
3265
        case $build in
 
3266
          *mingw* ) # actually, msys
 
3267
            # awkward: cmd appends spaces to result
 
3268
            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
 
3269
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
3270
            ;;
 
3271
          *cygwin* )
 
3272
            func_to_host_path_result=`cygpath -w "$1" |
 
3273
              $SED -e "$lt_sed_naive_backslashify"`
 
3274
            ;;
 
3275
          * )
 
3276
            # Unfortunately, winepath does not exit with a non-zero
 
3277
            # error code, so we are forced to check the contents of
 
3278
            # stdout. On the other hand, if the command is not
 
3279
            # found, the shell will set an exit code of 127 and print
 
3280
            # *an error message* to stdout. So we must check for both
 
3281
            # error code of zero AND non-empty stdout, which explains
 
3282
            # the odd construction:
 
3283
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
 
3284
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
 
3285
              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
 
3286
                $SED -e "$lt_sed_naive_backslashify"`
 
3287
            else
 
3288
              # Allow warning below.
 
3289
              func_to_host_path_result=
 
3290
            fi
 
3291
            ;;
 
3292
        esac
 
3293
        if test -z "$func_to_host_path_result" ; then
 
3294
          func_error "Could not determine host path corresponding to"
 
3295
          func_error "  \`$1'"
 
3296
          func_error "Continuing, but uninstalled executables may not work."
 
3297
          # Fallback:
 
3298
          func_to_host_path_result="$1"
 
3299
        fi
 
3300
        ;;
 
3301
    esac
 
3302
  fi
 
3303
}
 
3304
# end: func_to_host_path
 
3305
 
 
3306
# func_to_host_pathlist arg
 
3307
#
 
3308
# Convert pathlists to host format when used with build tools.
 
3309
# See func_to_host_path(), above. This function supports the
 
3310
# following $build/$host combinations (but does no harm for
 
3311
# combinations not listed here):
 
3312
#    $build          $host
 
3313
#    mingw (msys)    mingw  [e.g. native]
 
3314
#    cygwin          mingw
 
3315
#    *nix + wine     mingw
 
3316
#
 
3317
# Path separators are also converted from $build format to
 
3318
# $host format. If ARG begins or ends with a path separator
 
3319
# character, it is preserved (but converted to $host format)
 
3320
# on output.
 
3321
#
 
3322
# ARG is a pathlist (on $build) that should be converted to
 
3323
# the proper representation on $host. The result is stored
 
3324
# in $func_to_host_pathlist_result.
 
3325
func_to_host_pathlist ()
 
3326
{
 
3327
  func_to_host_pathlist_result="$1"
 
3328
  if test -n "$1"; then
 
3329
    case $host in
 
3330
      *mingw* )
 
3331
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
 
3332
        # Remove leading and trailing path separator characters from
 
3333
        # ARG. msys behavior is inconsistent here, cygpath turns them
 
3334
        # into '.;' and ';.', and winepath ignores them completely.
 
3335
        func_stripname : : "$1"
 
3336
        func_to_host_pathlist_tmp1=$func_stripname_result
 
3337
        case $build in
 
3338
          *mingw* ) # Actually, msys.
 
3339
            # Awkward: cmd appends spaces to result.
 
3340
            func_to_host_pathlist_result=`
 
3341
              ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
 
3342
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
3343
            ;;
 
3344
          *cygwin* )
 
3345
            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
 
3346
              $SED -e "$lt_sed_naive_backslashify"`
 
3347
            ;;
 
3348
          * )
 
3349
            # unfortunately, winepath doesn't convert pathlists
 
3350
            func_to_host_pathlist_result=""
 
3351
            func_to_host_pathlist_oldIFS=$IFS
 
3352
            IFS=:
 
3353
            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
 
3354
              IFS=$func_to_host_pathlist_oldIFS
 
3355
              if test -n "$func_to_host_pathlist_f" ; then
 
3356
                func_to_host_path "$func_to_host_pathlist_f"
 
3357
                if test -n "$func_to_host_path_result" ; then
 
3358
                  if test -z "$func_to_host_pathlist_result" ; then
 
3359
                    func_to_host_pathlist_result="$func_to_host_path_result"
 
3360
                  else
 
3361
                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
 
3362
                  fi
 
3363
                fi
 
3364
              fi
 
3365
            done
 
3366
            IFS=$func_to_host_pathlist_oldIFS
 
3367
            ;;
 
3368
        esac
 
3369
        if test -z "$func_to_host_pathlist_result"; then
 
3370
          func_error "Could not determine the host path(s) corresponding to"
 
3371
          func_error "  \`$1'"
 
3372
          func_error "Continuing, but uninstalled executables may not work."
 
3373
          # Fallback. This may break if $1 contains DOS-style drive
 
3374
          # specifications. The fix is not to complicate the expression
 
3375
          # below, but for the user to provide a working wine installation
 
3376
          # with winepath so that path translation in the cross-to-mingw
 
3377
          # case works properly.
 
3378
          lt_replace_pathsep_nix_to_dos="s|:|;|g"
 
3379
          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
 
3380
            $SED -e "$lt_replace_pathsep_nix_to_dos"`
 
3381
        fi
 
3382
        # Now, add the leading and trailing path separators back
 
3383
        case "$1" in
 
3384
          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
 
3385
            ;;
 
3386
        esac
 
3387
        case "$1" in
 
3388
          *: ) func_append func_to_host_pathlist_result ";"
 
3389
            ;;
 
3390
        esac
 
3391
        ;;
 
3392
    esac
 
3393
  fi
 
3394
}
 
3395
# end: func_to_host_pathlist
 
3396
 
4128
3397
# func_emit_cwrapperexe_src
4129
3398
# emit the source code for a wrapper executable on stdout
4130
3399
# Must ONLY be called from within func_mode_link because
4294
3563
EOF
4295
3564
 
4296
3565
            cat <<EOF
4297
 
volatile const char * MAGIC_EXE = "$magic_exe";
 
3566
const char * MAGIC_EXE = "$magic_exe";
4298
3567
const char * LIB_PATH_VARNAME = "$shlibpath_var";
4299
3568
EOF
4300
3569
 
4301
3570
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4302
 
              func_to_host_path "$temp_rpath"
 
3571
              func_to_host_pathlist "$temp_rpath"
4303
3572
              cat <<EOF
4304
 
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
 
3573
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
4305
3574
EOF
4306
3575
            else
4307
3576
              cat <<"EOF"
4310
3579
            fi
4311
3580
 
4312
3581
            if test -n "$dllsearchpath"; then
4313
 
              func_to_host_path "$dllsearchpath:"
 
3582
              func_to_host_pathlist "$dllsearchpath:"
4314
3583
              cat <<EOF
4315
3584
const char * EXE_PATH_VARNAME = "PATH";
4316
 
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
 
3585
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
4317
3586
EOF
4318
3587
            else
4319
3588
              cat <<"EOF"
4496
3765
 
4497
3766
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4498
3767
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
4499
 
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
4500
 
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4501
 
     because on Windows, both *_VARNAMEs are PATH but uninstalled
4502
 
     libraries must come first. */
 
3768
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4503
3769
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4504
 
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4505
3770
 
4506
3771
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4507
3772
                  nonnull (lt_argv_zero));
5250
4515
            ;;
5251
4516
          *)
5252
4517
            if test "$prev" = dlfiles; then
5253
 
              func_append dlfiles " $arg"
 
4518
              dlfiles="$dlfiles $arg"
5254
4519
            else
5255
 
              func_append dlprefiles " $arg"
 
4520
              dlprefiles="$dlprefiles $arg"
5256
4521
            fi
5257
4522
            prev=
5258
4523
            continue
5276
4541
            *-*-darwin*)
5277
4542
              case "$deplibs " in
5278
4543
                *" $qarg.ltframework "*) ;;
5279
 
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
 
4544
                *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
5280
4545
                   ;;
5281
4546
              esac
5282
4547
              ;;
5295
4560
            moreargs=
5296
4561
            for fil in `cat "$save_arg"`
5297
4562
            do
5298
 
#             func_append moreargs " $fil"
 
4563
#             moreargs="$moreargs $fil"
5299
4564
              arg=$fil
5300
4565
              # A libtool-controlled object.
5301
4566
 
5324
4589
 
5325
4590
                  if test "$prev" = dlfiles; then
5326
4591
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5327
 
                      func_append dlfiles " $pic_object"
 
4592
                      dlfiles="$dlfiles $pic_object"
5328
4593
                      prev=
5329
4594
                      continue
5330
4595
                    else
5336
4601
                  # CHECK ME:  I think I busted this.  -Ossama
5337
4602
                  if test "$prev" = dlprefiles; then
5338
4603
                    # Preload the old-style object.
5339
 
                    func_append dlprefiles " $pic_object"
 
4604
                    dlprefiles="$dlprefiles $pic_object"
5340
4605
                    prev=
5341
4606
                  fi
5342
4607
 
5406
4671
          if test "$prev" = rpath; then
5407
4672
            case "$rpath " in
5408
4673
            *" $arg "*) ;;
5409
 
            *) func_append rpath " $arg" ;;
 
4674
            *) rpath="$rpath $arg" ;;
5410
4675
            esac
5411
4676
          else
5412
4677
            case "$xrpath " in
5413
4678
            *" $arg "*) ;;
5414
 
            *) func_append xrpath " $arg" ;;
 
4679
            *) xrpath="$xrpath $arg" ;;
5415
4680
            esac
5416
4681
          fi
5417
4682
          prev=
5423
4688
          continue
5424
4689
          ;;
5425
4690
        weak)
5426
 
          func_append weak_libs " $arg"
 
4691
          weak_libs="$weak_libs $arg"
5427
4692
          prev=
5428
4693
          continue
5429
4694
          ;;
5430
4695
        xcclinker)
5431
 
          func_append linker_flags " $qarg"
5432
 
          func_append compiler_flags " $qarg"
 
4696
          linker_flags="$linker_flags $qarg"
 
4697
          compiler_flags="$compiler_flags $qarg"
5433
4698
          prev=
5434
4699
          func_append compile_command " $qarg"
5435
4700
          func_append finalize_command " $qarg"
5436
4701
          continue
5437
4702
          ;;
5438
4703
        xcompiler)
5439
 
          func_append compiler_flags " $qarg"
 
4704
          compiler_flags="$compiler_flags $qarg"
5440
4705
          prev=
5441
4706
          func_append compile_command " $qarg"
5442
4707
          func_append finalize_command " $qarg"
5443
4708
          continue
5444
4709
          ;;
5445
4710
        xlinker)
5446
 
          func_append linker_flags " $qarg"
5447
 
          func_append compiler_flags " $wl$qarg"
 
4711
          linker_flags="$linker_flags $qarg"
 
4712
          compiler_flags="$compiler_flags $wl$qarg"
5448
4713
          prev=
5449
4714
          func_append compile_command " $wl$qarg"
5450
4715
          func_append finalize_command " $wl$qarg"
5535
4800
        ;;
5536
4801
 
5537
4802
      -L*)
5538
 
        func_stripname "-L" '' "$arg"
5539
 
        if test -z "$func_stripname_result"; then
 
4803
        func_stripname '-L' '' "$arg"
 
4804
        dir=$func_stripname_result
 
4805
        if test -z "$dir"; then
5540
4806
          if test "$#" -gt 0; then
5541
4807
            func_fatal_error "require no space between \`-L' and \`$1'"
5542
4808
          else
5543
4809
            func_fatal_error "need path for \`-L' option"
5544
4810
          fi
5545
4811
        fi
5546
 
        func_resolve_sysroot "$func_stripname_result"
5547
 
        dir=$func_resolve_sysroot_result
5548
4812
        # We need an absolute path.
5549
4813
        case $dir in
5550
4814
        [\\/]* | [A-Za-z]:[\\/]*) ;;
5556
4820
          ;;
5557
4821
        esac
5558
4822
        case "$deplibs " in
5559
 
        *" -L$dir "* | *" $arg "*)
5560
 
          # Will only happen for absolute or sysroot arguments
5561
 
          ;;
 
4823
        *" -L$dir "*) ;;
5562
4824
        *)
5563
 
          # Preserve sysroot, but never include relative directories
5564
 
          case $dir in
5565
 
            [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5566
 
            *) func_append deplibs " -L$dir" ;;
5567
 
          esac
5568
 
          func_append lib_search_path " $dir"
 
4825
          deplibs="$deplibs -L$dir"
 
4826
          lib_search_path="$lib_search_path $dir"
5569
4827
          ;;
5570
4828
        esac
5571
4829
        case $host in
5574
4832
          case :$dllsearchpath: in
5575
4833
          *":$dir:"*) ;;
5576
4834
          ::) dllsearchpath=$dir;;
5577
 
          *) func_append dllsearchpath ":$dir";;
 
4835
          *) dllsearchpath="$dllsearchpath:$dir";;
5578
4836
          esac
5579
4837
          case :$dllsearchpath: in
5580
4838
          *":$testbindir:"*) ;;
5581
4839
          ::) dllsearchpath=$testbindir;;
5582
 
          *) func_append dllsearchpath ":$testbindir";;
 
4840
          *) dllsearchpath="$dllsearchpath:$testbindir";;
5583
4841
          esac
5584
4842
          ;;
5585
4843
        esac
5603
4861
            ;;
5604
4862
          *-*-rhapsody* | *-*-darwin1.[012])
5605
4863
            # Rhapsody C and math libraries are in the System framework
5606
 
            func_append deplibs " System.ltframework"
 
4864
            deplibs="$deplibs System.ltframework"
5607
4865
            continue
5608
4866
            ;;
5609
4867
          *-*-sco3.2v5* | *-*-sco5v6*)
5623
4881
           ;;
5624
4882
         esac
5625
4883
        fi
5626
 
        func_append deplibs " $arg"
 
4884
        deplibs="$deplibs $arg"
5627
4885
        continue
5628
4886
        ;;
5629
4887
 
5635
4893
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
5636
4894
      # classes, name mangling, and exception handling.
5637
4895
      # Darwin uses the -arch flag to determine output architecture.
5638
 
      -model|-arch|-isysroot|--sysroot)
5639
 
        func_append compiler_flags " $arg"
 
4896
      -model|-arch|-isysroot)
 
4897
        compiler_flags="$compiler_flags $arg"
5640
4898
        func_append compile_command " $arg"
5641
4899
        func_append finalize_command " $arg"
5642
4900
        prev=xcompiler
5644
4902
        ;;
5645
4903
 
5646
4904
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5647
 
        func_append compiler_flags " $arg"
 
4905
        compiler_flags="$compiler_flags $arg"
5648
4906
        func_append compile_command " $arg"
5649
4907
        func_append finalize_command " $arg"
5650
4908
        case "$new_inherited_linker_flags " in
5651
4909
            *" $arg "*) ;;
5652
 
            * ) func_append new_inherited_linker_flags " $arg" ;;
 
4910
            * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
5653
4911
        esac
5654
4912
        continue
5655
4913
        ;;
5716
4974
        # We need an absolute path.
5717
4975
        case $dir in
5718
4976
        [\\/]* | [A-Za-z]:[\\/]*) ;;
5719
 
        =*)
5720
 
          func_stripname '=' '' "$dir"
5721
 
          dir=$lt_sysroot$func_stripname_result
5722
 
          ;;
5723
4977
        *)
5724
4978
          func_fatal_error "only absolute run-paths are allowed"
5725
4979
          ;;
5726
4980
        esac
5727
4981
        case "$xrpath " in
5728
4982
        *" $dir "*) ;;
5729
 
        *) func_append xrpath " $dir" ;;
 
4983
        *) xrpath="$xrpath $dir" ;;
5730
4984
        esac
5731
4985
        continue
5732
4986
        ;;
5779
5033
        for flag in $args; do
5780
5034
          IFS="$save_ifs"
5781
5035
          func_quote_for_eval "$flag"
5782
 
          func_append arg " $func_quote_for_eval_result"
5783
 
          func_append compiler_flags " $func_quote_for_eval_result"
 
5036
          arg="$arg $func_quote_for_eval_result"
 
5037
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
5784
5038
        done
5785
5039
        IFS="$save_ifs"
5786
5040
        func_stripname ' ' '' "$arg"
5795
5049
        for flag in $args; do
5796
5050
          IFS="$save_ifs"
5797
5051
          func_quote_for_eval "$flag"
5798
 
          func_append arg " $wl$func_quote_for_eval_result"
5799
 
          func_append compiler_flags " $wl$func_quote_for_eval_result"
5800
 
          func_append linker_flags " $func_quote_for_eval_result"
 
5052
          arg="$arg $wl$func_quote_for_eval_result"
 
5053
          compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
 
5054
          linker_flags="$linker_flags $func_quote_for_eval_result"
5801
5055
        done
5802
5056
        IFS="$save_ifs"
5803
5057
        func_stripname ' ' '' "$arg"
5836
5090
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
5837
5091
      # @file                GCC response files
5838
5092
      # -tp=*                Portland pgcc target processor selection
5839
 
      # --sysroot=*          for sysroot support
5840
 
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5841
5093
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5842
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5843
 
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
 
5094
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
5844
5095
        func_quote_for_eval "$arg"
5845
5096
        arg="$func_quote_for_eval_result"
5846
5097
        func_append compile_command " $arg"
5847
5098
        func_append finalize_command " $arg"
5848
 
        func_append compiler_flags " $arg"
 
5099
        compiler_flags="$compiler_flags $arg"
5849
5100
        continue
5850
5101
        ;;
5851
5102
 
5857
5108
 
5858
5109
      *.$objext)
5859
5110
        # A standard object.
5860
 
        func_append objs " $arg"
 
5111
        objs="$objs $arg"
5861
5112
        ;;
5862
5113
 
5863
5114
      *.lo)
5888
5139
 
5889
5140
            if test "$prev" = dlfiles; then
5890
5141
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5891
 
                func_append dlfiles " $pic_object"
 
5142
                dlfiles="$dlfiles $pic_object"
5892
5143
                prev=
5893
5144
                continue
5894
5145
              else
5900
5151
            # CHECK ME:  I think I busted this.  -Ossama
5901
5152
            if test "$prev" = dlprefiles; then
5902
5153
              # Preload the old-style object.
5903
 
              func_append dlprefiles " $pic_object"
 
5154
              dlprefiles="$dlprefiles $pic_object"
5904
5155
              prev=
5905
5156
            fi
5906
5157
 
5945
5196
 
5946
5197
      *.$libext)
5947
5198
        # An archive.
5948
 
        func_append deplibs " $arg"
5949
 
        func_append old_deplibs " $arg"
 
5199
        deplibs="$deplibs $arg"
 
5200
        old_deplibs="$old_deplibs $arg"
5950
5201
        continue
5951
5202
        ;;
5952
5203
 
5953
5204
      *.la)
5954
5205
        # A libtool-controlled library.
5955
5206
 
5956
 
        func_resolve_sysroot "$arg"
5957
5207
        if test "$prev" = dlfiles; then
5958
5208
          # This library was specified with -dlopen.
5959
 
          func_append dlfiles " $func_resolve_sysroot_result"
 
5209
          dlfiles="$dlfiles $arg"
5960
5210
          prev=
5961
5211
        elif test "$prev" = dlprefiles; then
5962
5212
          # The library was specified with -dlpreopen.
5963
 
          func_append dlprefiles " $func_resolve_sysroot_result"
 
5213
          dlprefiles="$dlprefiles $arg"
5964
5214
          prev=
5965
5215
        else
5966
 
          func_append deplibs " $func_resolve_sysroot_result"
 
5216
          deplibs="$deplibs $arg"
5967
5217
        fi
5968
5218
        continue
5969
5219
        ;;
6010
5260
 
6011
5261
    func_dirname "$output" "/" ""
6012
5262
    output_objdir="$func_dirname_result$objdir"
6013
 
    func_to_tool_file "$output_objdir/"
6014
 
    tool_output_objdir=$func_to_tool_file_result
6015
5263
    # Create the object directory.
6016
5264
    func_mkdir_p "$output_objdir"
6017
5265
 
6032
5280
    # Find all interdependent deplibs by searching for libraries
6033
5281
    # that are linked more than once (e.g. -la -lb -la)
6034
5282
    for deplib in $deplibs; do
6035
 
      if $opt_preserve_dup_deps ; then
 
5283
      if $opt_duplicate_deps ; then
6036
5284
        case "$libs " in
6037
 
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 
5285
        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6038
5286
        esac
6039
5287
      fi
6040
 
      func_append libs " $deplib"
 
5288
      libs="$libs $deplib"
6041
5289
    done
6042
5290
 
6043
5291
    if test "$linkmode" = lib; then
6050
5298
      if $opt_duplicate_compiler_generated_deps; then
6051
5299
        for pre_post_dep in $predeps $postdeps; do
6052
5300
          case "$pre_post_deps " in
6053
 
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
 
5301
          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
6054
5302
          esac
6055
 
          func_append pre_post_deps " $pre_post_dep"
 
5303
          pre_post_deps="$pre_post_deps $pre_post_dep"
6056
5304
        done
6057
5305
      fi
6058
5306
      pre_post_deps=
6119
5367
        for lib in $dlprefiles; do
6120
5368
          # Ignore non-libtool-libs
6121
5369
          dependency_libs=
6122
 
          func_resolve_sysroot "$lib"
6123
5370
          case $lib in
6124
 
          *.la) func_source "$func_resolve_sysroot_result" ;;
 
5371
          *.la) func_source "$lib" ;;
6125
5372
          esac
6126
5373
 
6127
5374
          # Collect preopened libtool deplibs, except any this library
6131
5378
            deplib_base=$func_basename_result
6132
5379
            case " $weak_libs " in
6133
5380
            *" $deplib_base "*) ;;
6134
 
            *) func_append deplibs " $deplib" ;;
 
5381
            *) deplibs="$deplibs $deplib" ;;
6135
5382
            esac
6136
5383
          done
6137
5384
        done
6152
5399
            compile_deplibs="$deplib $compile_deplibs"
6153
5400
            finalize_deplibs="$deplib $finalize_deplibs"
6154
5401
          else
6155
 
            func_append compiler_flags " $deplib"
 
5402
            compiler_flags="$compiler_flags $deplib"
6156
5403
            if test "$linkmode" = lib ; then
6157
5404
                case "$new_inherited_linker_flags " in
6158
5405
                    *" $deplib "*) ;;
6159
 
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
 
5406
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6160
5407
                esac
6161
5408
            fi
6162
5409
          fi
6241
5488
            if test "$linkmode" = lib ; then
6242
5489
                case "$new_inherited_linker_flags " in
6243
5490
                    *" $deplib "*) ;;
6244
 
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
 
5491
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6245
5492
                esac
6246
5493
            fi
6247
5494
          fi
6254
5501
            test "$pass" = conv && continue
6255
5502
            newdependency_libs="$deplib $newdependency_libs"
6256
5503
            func_stripname '-L' '' "$deplib"
6257
 
            func_resolve_sysroot "$func_stripname_result"
6258
 
            func_append newlib_search_path " $func_resolve_sysroot_result"
 
5504
            newlib_search_path="$newlib_search_path $func_stripname_result"
6259
5505
            ;;
6260
5506
          prog)
6261
5507
            if test "$pass" = conv; then
6269
5515
              finalize_deplibs="$deplib $finalize_deplibs"
6270
5516
            fi
6271
5517
            func_stripname '-L' '' "$deplib"
6272
 
            func_resolve_sysroot "$func_stripname_result"
6273
 
            func_append newlib_search_path " $func_resolve_sysroot_result"
 
5518
            newlib_search_path="$newlib_search_path $func_stripname_result"
6274
5519
            ;;
6275
5520
          *)
6276
5521
            func_warning "\`-L' is ignored for archives/objects"
6281
5526
        -R*)
6282
5527
          if test "$pass" = link; then
6283
5528
            func_stripname '-R' '' "$deplib"
6284
 
            func_resolve_sysroot "$func_stripname_result"
6285
 
            dir=$func_resolve_sysroot_result
 
5529
            dir=$func_stripname_result
6286
5530
            # Make sure the xrpath contains only unique directories.
6287
5531
            case "$xrpath " in
6288
5532
            *" $dir "*) ;;
6289
 
            *) func_append xrpath " $dir" ;;
 
5533
            *) xrpath="$xrpath $dir" ;;
6290
5534
            esac
6291
5535
          fi
6292
5536
          deplibs="$deplib $deplibs"
6293
5537
          continue
6294
5538
          ;;
6295
 
        *.la)
6296
 
          func_resolve_sysroot "$deplib"
6297
 
          lib=$func_resolve_sysroot_result
6298
 
          ;;
 
5539
        *.la) lib="$deplib" ;;
6299
5540
        *.$libext)
6300
5541
          if test "$pass" = conv; then
6301
5542
            deplibs="$deplib $deplibs"
6358
5599
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6359
5600
              # If there is no dlopen support or we're linking statically,
6360
5601
              # we need to preload.
6361
 
              func_append newdlprefiles " $deplib"
 
5602
              newdlprefiles="$newdlprefiles $deplib"
6362
5603
              compile_deplibs="$deplib $compile_deplibs"
6363
5604
              finalize_deplibs="$deplib $finalize_deplibs"
6364
5605
            else
6365
 
              func_append newdlfiles " $deplib"
 
5606
              newdlfiles="$newdlfiles $deplib"
6366
5607
            fi
6367
5608
          fi
6368
5609
          continue
6408
5649
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6409
5650
            case " $new_inherited_linker_flags " in
6410
5651
              *" $tmp_inherited_linker_flag "*) ;;
6411
 
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
 
5652
              *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
6412
5653
            esac
6413
5654
          done
6414
5655
        fi
6416
5657
        if test "$linkmode,$pass" = "lib,link" ||
6417
5658
           test "$linkmode,$pass" = "prog,scan" ||
6418
5659
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6419
 
          test -n "$dlopen" && func_append dlfiles " $dlopen"
6420
 
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 
5660
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
 
5661
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
6421
5662
        fi
6422
5663
 
6423
5664
        if test "$pass" = conv; then
6428
5669
              func_fatal_error "cannot find name of link library for \`$lib'"
6429
5670
            fi
6430
5671
            # It is a libtool convenience library, so add in its objects.
6431
 
            func_append convenience " $ladir/$objdir/$old_library"
6432
 
            func_append old_convenience " $ladir/$objdir/$old_library"
 
5672
            convenience="$convenience $ladir/$objdir/$old_library"
 
5673
            old_convenience="$old_convenience $ladir/$objdir/$old_library"
6433
5674
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
6434
5675
            func_fatal_error "\`$lib' is not a convenience library"
6435
5676
          fi
6436
5677
          tmp_libs=
6437
5678
          for deplib in $dependency_libs; do
6438
5679
            deplibs="$deplib $deplibs"
6439
 
            if $opt_preserve_dup_deps ; then
 
5680
            if $opt_duplicate_deps ; then
6440
5681
              case "$tmp_libs " in
6441
 
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 
5682
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6442
5683
              esac
6443
5684
            fi
6444
 
            func_append tmp_libs " $deplib"
 
5685
            tmp_libs="$tmp_libs $deplib"
6445
5686
          done
6446
5687
          continue
6447
5688
        fi # $pass = conv
6449
5690
 
6450
5691
        # Get the name of the library we link against.
6451
5692
        linklib=
6452
 
        if test -n "$old_library" &&
6453
 
           { test "$prefer_static_libs" = yes ||
6454
 
             test "$prefer_static_libs,$installed" = "built,no"; }; then
6455
 
          linklib=$old_library
6456
 
        else
6457
 
          for l in $old_library $library_names; do
6458
 
            linklib="$l"
6459
 
          done
6460
 
        fi
 
5693
        for l in $old_library $library_names; do
 
5694
          linklib="$l"
 
5695
        done
6461
5696
        if test -z "$linklib"; then
6462
5697
          func_fatal_error "cannot find name of link library for \`$lib'"
6463
5698
        fi
6474
5709
            # statically, we need to preload.  We also need to preload any
6475
5710
            # dependent libraries so libltdl's deplib preloader doesn't
6476
5711
            # bomb out in the load deplibs phase.
6477
 
            func_append dlprefiles " $lib $dependency_libs"
 
5712
            dlprefiles="$dlprefiles $lib $dependency_libs"
6478
5713
          else
6479
 
            func_append newdlfiles " $lib"
 
5714
            newdlfiles="$newdlfiles $lib"
6480
5715
          fi
6481
5716
          continue
6482
5717
        fi # $pass = dlopen
6498
5733
 
6499
5734
        # Find the relevant object directory and library name.
6500
5735
        if test "X$installed" = Xyes; then
6501
 
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
5736
          if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6502
5737
            func_warning "library \`$lib' was moved."
6503
5738
            dir="$ladir"
6504
5739
            absdir="$abs_ladir"
6505
5740
            libdir="$abs_ladir"
6506
5741
          else
6507
 
            dir="$lt_sysroot$libdir"
6508
 
            absdir="$lt_sysroot$libdir"
 
5742
            dir="$libdir"
 
5743
            absdir="$libdir"
6509
5744
          fi
6510
5745
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6511
5746
        else
6513
5748
            dir="$ladir"
6514
5749
            absdir="$abs_ladir"
6515
5750
            # Remove this search path later
6516
 
            func_append notinst_path " $abs_ladir"
 
5751
            notinst_path="$notinst_path $abs_ladir"
6517
5752
          else
6518
5753
            dir="$ladir/$objdir"
6519
5754
            absdir="$abs_ladir/$objdir"
6520
5755
            # Remove this search path later
6521
 
            func_append notinst_path " $abs_ladir"
 
5756
            notinst_path="$notinst_path $abs_ladir"
6522
5757
          fi
6523
5758
        fi # $installed = yes
6524
5759
        func_stripname 'lib' '.la' "$laname"
6529
5764
          if test -z "$libdir" && test "$linkmode" = prog; then
6530
5765
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6531
5766
          fi
6532
 
          case "$host" in
6533
 
            # special handling for platforms with PE-DLLs.
6534
 
            *cygwin* | *mingw* | *cegcc* )
6535
 
              # Linker will automatically link against shared library if both
6536
 
              # static and shared are present.  Therefore, ensure we extract
6537
 
              # symbols from the import library if a shared library is present
6538
 
              # (otherwise, the dlopen module name will be incorrect).  We do
6539
 
              # this by putting the import library name into $newdlprefiles.
6540
 
              # We recover the dlopen module name by 'saving' the la file
6541
 
              # name in a special purpose variable, and (later) extracting the
6542
 
              # dlname from the la file.
6543
 
              if test -n "$dlname"; then
6544
 
                func_tr_sh "$dir/$linklib"
6545
 
                eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6546
 
                func_append newdlprefiles " $dir/$linklib"
6547
 
              else
6548
 
                func_append newdlprefiles " $dir/$old_library"
6549
 
                # Keep a list of preopened convenience libraries to check
6550
 
                # that they are being used correctly in the link pass.
6551
 
                test -z "$libdir" && \
6552
 
                  func_append dlpreconveniencelibs " $dir/$old_library"
6553
 
              fi
6554
 
            ;;
6555
 
            * )
6556
 
              # Prefer using a static library (so that no silly _DYNAMIC symbols
6557
 
              # are required to link).
6558
 
              if test -n "$old_library"; then
6559
 
                func_append newdlprefiles " $dir/$old_library"
6560
 
                # Keep a list of preopened convenience libraries to check
6561
 
                # that they are being used correctly in the link pass.
6562
 
                test -z "$libdir" && \
6563
 
                  func_append dlpreconveniencelibs " $dir/$old_library"
6564
 
              # Otherwise, use the dlname, so that lt_dlopen finds it.
6565
 
              elif test -n "$dlname"; then
6566
 
                func_append newdlprefiles " $dir/$dlname"
6567
 
              else
6568
 
                func_append newdlprefiles " $dir/$linklib"
6569
 
              fi
6570
 
            ;;
6571
 
          esac
 
5767
          # Prefer using a static library (so that no silly _DYNAMIC symbols
 
5768
          # are required to link).
 
5769
          if test -n "$old_library"; then
 
5770
            newdlprefiles="$newdlprefiles $dir/$old_library"
 
5771
            # Keep a list of preopened convenience libraries to check
 
5772
            # that they are being used correctly in the link pass.
 
5773
            test -z "$libdir" && \
 
5774
                dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
 
5775
          # Otherwise, use the dlname, so that lt_dlopen finds it.
 
5776
          elif test -n "$dlname"; then
 
5777
            newdlprefiles="$newdlprefiles $dir/$dlname"
 
5778
          else
 
5779
            newdlprefiles="$newdlprefiles $dir/$linklib"
 
5780
          fi
6572
5781
        fi # $pass = dlpreopen
6573
5782
 
6574
5783
        if test -z "$libdir"; then
6586
5795
 
6587
5796
 
6588
5797
        if test "$linkmode" = prog && test "$pass" != link; then
6589
 
          func_append newlib_search_path " $ladir"
 
5798
          newlib_search_path="$newlib_search_path $ladir"
6590
5799
          deplibs="$lib $deplibs"
6591
5800
 
6592
5801
          linkalldeplibs=no
6599
5808
          for deplib in $dependency_libs; do
6600
5809
            case $deplib in
6601
5810
            -L*) func_stripname '-L' '' "$deplib"
6602
 
                 func_resolve_sysroot "$func_stripname_result"
6603
 
                 func_append newlib_search_path " $func_resolve_sysroot_result"
 
5811
                 newlib_search_path="$newlib_search_path $func_stripname_result"
6604
5812
                 ;;
6605
5813
            esac
6606
5814
            # Need to link against all dependency_libs?
6611
5819
              # or/and link against static libraries
6612
5820
              newdependency_libs="$deplib $newdependency_libs"
6613
5821
            fi
6614
 
            if $opt_preserve_dup_deps ; then
 
5822
            if $opt_duplicate_deps ; then
6615
5823
              case "$tmp_libs " in
6616
 
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 
5824
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6617
5825
              esac
6618
5826
            fi
6619
 
            func_append tmp_libs " $deplib"
 
5827
            tmp_libs="$tmp_libs $deplib"
6620
5828
          done # for deplib
6621
5829
          continue
6622
5830
        fi # $linkmode = prog...
6631
5839
              # Make sure the rpath contains only unique directories.
6632
5840
              case "$temp_rpath:" in
6633
5841
              *"$absdir:"*) ;;
6634
 
              *) func_append temp_rpath "$absdir:" ;;
 
5842
              *) temp_rpath="$temp_rpath$absdir:" ;;
6635
5843
              esac
6636
5844
            fi
6637
5845
 
6643
5851
            *)
6644
5852
              case "$compile_rpath " in
6645
5853
              *" $absdir "*) ;;
6646
 
              *) func_append compile_rpath " $absdir" ;;
 
5854
              *) compile_rpath="$compile_rpath $absdir"
6647
5855
              esac
6648
5856
              ;;
6649
5857
            esac
6652
5860
            *)
6653
5861
              case "$finalize_rpath " in
6654
5862
              *" $libdir "*) ;;
6655
 
              *) func_append finalize_rpath " $libdir" ;;
 
5863
              *) finalize_rpath="$finalize_rpath $libdir"
6656
5864
              esac
6657
5865
              ;;
6658
5866
            esac
6677
5885
          case $host in
6678
5886
          *cygwin* | *mingw* | *cegcc*)
6679
5887
              # No point in relinking DLLs because paths are not encoded
6680
 
              func_append notinst_deplibs " $lib"
 
5888
              notinst_deplibs="$notinst_deplibs $lib"
6681
5889
              need_relink=no
6682
5890
            ;;
6683
5891
          *)
6684
5892
            if test "$installed" = no; then
6685
 
              func_append notinst_deplibs " $lib"
 
5893
              notinst_deplibs="$notinst_deplibs $lib"
6686
5894
              need_relink=yes
6687
5895
            fi
6688
5896
            ;;
6717
5925
            *)
6718
5926
              case "$compile_rpath " in
6719
5927
              *" $absdir "*) ;;
6720
 
              *) func_append compile_rpath " $absdir" ;;
 
5928
              *) compile_rpath="$compile_rpath $absdir"
6721
5929
              esac
6722
5930
              ;;
6723
5931
            esac
6726
5934
            *)
6727
5935
              case "$finalize_rpath " in
6728
5936
              *" $libdir "*) ;;
6729
 
              *) func_append finalize_rpath " $libdir" ;;
 
5937
              *) finalize_rpath="$finalize_rpath $libdir"
6730
5938
              esac
6731
5939
              ;;
6732
5940
            esac
6780
5988
            linklib=$newlib
6781
5989
          fi # test -n "$old_archive_from_expsyms_cmds"
6782
5990
 
6783
 
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
 
5991
          if test "$linkmode" = prog || test "$mode" != relink; then
6784
5992
            add_shlibpath=
6785
5993
            add_dir=
6786
5994
            add=
6836
6044
                if test -n "$inst_prefix_dir"; then
6837
6045
                  case $libdir in
6838
6046
                    [\\/]*)
6839
 
                      func_append add_dir " -L$inst_prefix_dir$libdir"
 
6047
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
6840
6048
                      ;;
6841
6049
                  esac
6842
6050
                fi
6858
6066
            if test -n "$add_shlibpath"; then
6859
6067
              case :$compile_shlibpath: in
6860
6068
              *":$add_shlibpath:"*) ;;
6861
 
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
 
6069
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6862
6070
              esac
6863
6071
            fi
6864
6072
            if test "$linkmode" = prog; then
6872
6080
                 test "$hardcode_shlibpath_var" = yes; then
6873
6081
                case :$finalize_shlibpath: in
6874
6082
                *":$libdir:"*) ;;
6875
 
                *) func_append finalize_shlibpath "$libdir:" ;;
 
6083
                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6876
6084
                esac
6877
6085
              fi
6878
6086
            fi
6879
6087
          fi
6880
6088
 
6881
 
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
 
6089
          if test "$linkmode" = prog || test "$mode" = relink; then
6882
6090
            add_shlibpath=
6883
6091
            add_dir=
6884
6092
            add=
6892
6100
            elif test "$hardcode_shlibpath_var" = yes; then
6893
6101
              case :$finalize_shlibpath: in
6894
6102
              *":$libdir:"*) ;;
6895
 
              *) func_append finalize_shlibpath "$libdir:" ;;
 
6103
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6896
6104
              esac
6897
6105
              add="-l$name"
6898
6106
            elif test "$hardcode_automatic" = yes; then
6909
6117
              if test -n "$inst_prefix_dir"; then
6910
6118
                case $libdir in
6911
6119
                  [\\/]*)
6912
 
                    func_append add_dir " -L$inst_prefix_dir$libdir"
 
6120
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
6913
6121
                    ;;
6914
6122
                esac
6915
6123
              fi
6986
6194
                   temp_xrpath=$func_stripname_result
6987
6195
                   case " $xrpath " in
6988
6196
                   *" $temp_xrpath "*) ;;
6989
 
                   *) func_append xrpath " $temp_xrpath";;
 
6197
                   *) xrpath="$xrpath $temp_xrpath";;
6990
6198
                   esac;;
6991
 
              *) func_append temp_deplibs " $libdir";;
 
6199
              *) temp_deplibs="$temp_deplibs $libdir";;
6992
6200
              esac
6993
6201
            done
6994
6202
            dependency_libs="$temp_deplibs"
6995
6203
          fi
6996
6204
 
6997
 
          func_append newlib_search_path " $absdir"
 
6205
          newlib_search_path="$newlib_search_path $absdir"
6998
6206
          # Link against this library
6999
6207
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7000
6208
          # ... and its dependency_libs
7001
6209
          tmp_libs=
7002
6210
          for deplib in $dependency_libs; do
7003
6211
            newdependency_libs="$deplib $newdependency_libs"
7004
 
            case $deplib in
7005
 
              -L*) func_stripname '-L' '' "$deplib"
7006
 
                   func_resolve_sysroot "$func_stripname_result";;
7007
 
              *) func_resolve_sysroot "$deplib" ;;
7008
 
            esac
7009
 
            if $opt_preserve_dup_deps ; then
 
6212
            if $opt_duplicate_deps ; then
7010
6213
              case "$tmp_libs " in
7011
 
              *" $func_resolve_sysroot_result "*)
7012
 
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
 
6214
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
7013
6215
              esac
7014
6216
            fi
7015
 
            func_append tmp_libs " $func_resolve_sysroot_result"
 
6217
            tmp_libs="$tmp_libs $deplib"
7016
6218
          done
7017
6219
 
7018
6220
          if test "$link_all_deplibs" != no; then
7022
6224
              case $deplib in
7023
6225
              -L*) path="$deplib" ;;
7024
6226
              *.la)
7025
 
                func_resolve_sysroot "$deplib"
7026
 
                deplib=$func_resolve_sysroot_result
7027
6227
                func_dirname "$deplib" "" "."
7028
 
                dir=$func_dirname_result
 
6228
                dir="$func_dirname_result"
7029
6229
                # We need an absolute path.
7030
6230
                case $dir in
7031
6231
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7052
6252
                      if test -z "$darwin_install_name"; then
7053
6253
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
7054
6254
                      fi
7055
 
                      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7056
 
                      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
 
6255
                      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
 
6256
                      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
7057
6257
                      path=
7058
6258
                    fi
7059
6259
                  fi
7103
6303
          for dir in $newlib_search_path; do
7104
6304
            case "$lib_search_path " in
7105
6305
            *" $dir "*) ;;
7106
 
            *) func_append lib_search_path " $dir" ;;
 
6306
            *) lib_search_path="$lib_search_path $dir" ;;
7107
6307
            esac
7108
6308
          done
7109
6309
          newlib_search_path=
7161
6361
            -L*)
7162
6362
              case " $tmp_libs " in
7163
6363
              *" $deplib "*) ;;
7164
 
              *) func_append tmp_libs " $deplib" ;;
 
6364
              *) tmp_libs="$tmp_libs $deplib" ;;
7165
6365
              esac
7166
6366
              ;;
7167
 
            *) func_append tmp_libs " $deplib" ;;
 
6367
            *) tmp_libs="$tmp_libs $deplib" ;;
7168
6368
            esac
7169
6369
          done
7170
6370
          eval $var=\"$tmp_libs\"
7180
6380
          ;;
7181
6381
        esac
7182
6382
        if test -n "$i" ; then
7183
 
          func_append tmp_libs " $i"
 
6383
          tmp_libs="$tmp_libs $i"
7184
6384
        fi
7185
6385
      done
7186
6386
      dependency_libs=$tmp_libs
7221
6421
      # Now set the variables for building old libraries.
7222
6422
      build_libtool_libs=no
7223
6423
      oldlibs="$output"
7224
 
      func_append objs "$old_deplibs"
 
6424
      objs="$objs$old_deplibs"
7225
6425
      ;;
7226
6426
 
7227
6427
    lib)
7257
6457
          echo
7258
6458
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7259
6459
          $ECHO "*** objects $objs is not portable!"
7260
 
          func_append libobjs " $objs"
 
6460
          libobjs="$libobjs $objs"
7261
6461
        fi
7262
6462
      fi
7263
6463
 
7455
6655
          done
7456
6656
 
7457
6657
          # Make executables depend on our current version.
7458
 
          func_append verstring ":${current}.0"
 
6658
          verstring="$verstring:${current}.0"
7459
6659
          ;;
7460
6660
 
7461
6661
        qnx)
7523
6723
      fi
7524
6724
 
7525
6725
      func_generate_dlsyms "$libname" "$libname" "yes"
7526
 
      func_append libobjs " $symfileobj"
 
6726
      libobjs="$libobjs $symfileobj"
7527
6727
      test "X$libobjs" = "X " && libobjs=
7528
6728
 
7529
 
      if test "$opt_mode" != relink; then
 
6729
      if test "$mode" != relink; then
7530
6730
        # Remove our outputs, but don't remove object files since they
7531
6731
        # may have been created when compiling PIC objects.
7532
6732
        removelist=
7542
6742
                   continue
7543
6743
                 fi
7544
6744
               fi
7545
 
               func_append removelist " $p"
 
6745
               removelist="$removelist $p"
7546
6746
               ;;
7547
6747
            *) ;;
7548
6748
          esac
7553
6753
 
7554
6754
      # Now set the variables for building old libraries.
7555
6755
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7556
 
        func_append oldlibs " $output_objdir/$libname.$libext"
 
6756
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
7557
6757
 
7558
6758
        # Transform .lo files to .o files.
7559
6759
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7570
6770
        # If the user specified any rpath flags, then add them.
7571
6771
        temp_xrpath=
7572
6772
        for libdir in $xrpath; do
7573
 
          func_replace_sysroot "$libdir"
7574
 
          func_append temp_xrpath " -R$func_replace_sysroot_result"
 
6773
          temp_xrpath="$temp_xrpath -R$libdir"
7575
6774
          case "$finalize_rpath " in
7576
6775
          *" $libdir "*) ;;
7577
 
          *) func_append finalize_rpath " $libdir" ;;
 
6776
          *) finalize_rpath="$finalize_rpath $libdir" ;;
7578
6777
          esac
7579
6778
        done
7580
6779
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7588
6787
      for lib in $old_dlfiles; do
7589
6788
        case " $dlprefiles $dlfiles " in
7590
6789
        *" $lib "*) ;;
7591
 
        *) func_append dlfiles " $lib" ;;
 
6790
        *) dlfiles="$dlfiles $lib" ;;
7592
6791
        esac
7593
6792
      done
7594
6793
 
7598
6797
      for lib in $old_dlprefiles; do
7599
6798
        case "$dlprefiles " in
7600
6799
        *" $lib "*) ;;
7601
 
        *) func_append dlprefiles " $lib" ;;
 
6800
        *) dlprefiles="$dlprefiles $lib" ;;
7602
6801
        esac
7603
6802
      done
7604
6803
 
7610
6809
            ;;
7611
6810
          *-*-rhapsody* | *-*-darwin1.[012])
7612
6811
            # Rhapsody C library is in the System framework
7613
 
            func_append deplibs " System.ltframework"
 
6812
            deplibs="$deplibs System.ltframework"
7614
6813
            ;;
7615
6814
          *-*-netbsd*)
7616
6815
            # Don't link with libc until the a.out ld.so is fixed.
7627
6826
          *)
7628
6827
            # Add libc to deplibs on all other systems if necessary.
7629
6828
            if test "$build_libtool_need_lc" = "yes"; then
7630
 
              func_append deplibs " -lc"
 
6829
              deplibs="$deplibs -lc"
7631
6830
            fi
7632
6831
            ;;
7633
6832
          esac
7676
6875
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7677
6876
                  case " $predeps $postdeps " in
7678
6877
                  *" $i "*)
7679
 
                    func_append newdeplibs " $i"
 
6878
                    newdeplibs="$newdeplibs $i"
7680
6879
                    i=""
7681
6880
                    ;;
7682
6881
                  esac
7687
6886
                  set dummy $deplib_matches; shift
7688
6887
                  deplib_match=$1
7689
6888
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7690
 
                    func_append newdeplibs " $i"
 
6889
                    newdeplibs="$newdeplibs $i"
7691
6890
                  else
7692
6891
                    droppeddeps=yes
7693
6892
                    echo
7701
6900
                fi
7702
6901
                ;;
7703
6902
              *)
7704
 
                func_append newdeplibs " $i"
 
6903
                newdeplibs="$newdeplibs $i"
7705
6904
                ;;
7706
6905
              esac
7707
6906
            done
7719
6918
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7720
6919
                    case " $predeps $postdeps " in
7721
6920
                    *" $i "*)
7722
 
                      func_append newdeplibs " $i"
 
6921
                      newdeplibs="$newdeplibs $i"
7723
6922
                      i=""
7724
6923
                      ;;
7725
6924
                    esac
7730
6929
                    set dummy $deplib_matches; shift
7731
6930
                    deplib_match=$1
7732
6931
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7733
 
                      func_append newdeplibs " $i"
 
6932
                      newdeplibs="$newdeplibs $i"
7734
6933
                    else
7735
6934
                      droppeddeps=yes
7736
6935
                      echo
7752
6951
                fi
7753
6952
                ;;
7754
6953
              *)
7755
 
                func_append newdeplibs " $i"
 
6954
                newdeplibs="$newdeplibs $i"
7756
6955
                ;;
7757
6956
              esac
7758
6957
            done
7769
6968
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7770
6969
                case " $predeps $postdeps " in
7771
6970
                *" $a_deplib "*)
7772
 
                  func_append newdeplibs " $a_deplib"
 
6971
                  newdeplibs="$newdeplibs $a_deplib"
7773
6972
                  a_deplib=""
7774
6973
                  ;;
7775
6974
                esac
7776
6975
              fi
7777
6976
              if test -n "$a_deplib" ; then
7778
6977
                libname=`eval "\\$ECHO \"$libname_spec\""`
7779
 
                if test -n "$file_magic_glob"; then
7780
 
                  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7781
 
                else
7782
 
                  libnameglob=$libname
7783
 
                fi
7784
 
                test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7785
6978
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7786
 
                  if test "$want_nocaseglob" = yes; then
7787
 
                    shopt -s nocaseglob
7788
 
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7789
 
                    $nocaseglob
7790
 
                  else
7791
 
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7792
 
                  fi
 
6979
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7793
6980
                  for potent_lib in $potential_libs; do
7794
6981
                      # Follow soft links.
7795
6982
                      if ls -lLd "$potent_lib" 2>/dev/null |
7812
6999
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7813
7000
                         $SED -e 10q |
7814
7001
                         $EGREP "$file_magic_regex" > /dev/null; then
7815
 
                        func_append newdeplibs " $a_deplib"
 
7002
                        newdeplibs="$newdeplibs $a_deplib"
7816
7003
                        a_deplib=""
7817
7004
                        break 2
7818
7005
                      fi
7837
7024
              ;;
7838
7025
            *)
7839
7026
              # Add a -L argument.
7840
 
              func_append newdeplibs " $a_deplib"
 
7027
              newdeplibs="$newdeplibs $a_deplib"
7841
7028
              ;;
7842
7029
            esac
7843
7030
          done # Gone through all deplibs.
7853
7040
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7854
7041
                case " $predeps $postdeps " in
7855
7042
                *" $a_deplib "*)
7856
 
                  func_append newdeplibs " $a_deplib"
 
7043
                  newdeplibs="$newdeplibs $a_deplib"
7857
7044
                  a_deplib=""
7858
7045
                  ;;
7859
7046
                esac
7866
7053
                    potlib="$potent_lib" # see symlink-check above in file_magic test
7867
7054
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7868
7055
                       $EGREP "$match_pattern_regex" > /dev/null; then
7869
 
                      func_append newdeplibs " $a_deplib"
 
7056
                      newdeplibs="$newdeplibs $a_deplib"
7870
7057
                      a_deplib=""
7871
7058
                      break 2
7872
7059
                    fi
7891
7078
              ;;
7892
7079
            *)
7893
7080
              # Add a -L argument.
7894
 
              func_append newdeplibs " $a_deplib"
 
7081
              newdeplibs="$newdeplibs $a_deplib"
7895
7082
              ;;
7896
7083
            esac
7897
7084
          done # Gone through all deplibs.
7995
7182
        *)
7996
7183
          case " $deplibs " in
7997
7184
          *" -L$path/$objdir "*)
7998
 
            func_append new_libs " -L$path/$objdir" ;;
 
7185
            new_libs="$new_libs -L$path/$objdir" ;;
7999
7186
          esac
8000
7187
          ;;
8001
7188
        esac
8005
7192
        -L*)
8006
7193
          case " $new_libs " in
8007
7194
          *" $deplib "*) ;;
8008
 
          *) func_append new_libs " $deplib" ;;
 
7195
          *) new_libs="$new_libs $deplib" ;;
8009
7196
          esac
8010
7197
          ;;
8011
 
        *) func_append new_libs " $deplib" ;;
 
7198
        *) new_libs="$new_libs $deplib" ;;
8012
7199
        esac
8013
7200
      done
8014
7201
      deplibs="$new_libs"
8025
7212
          hardcode_libdirs=
8026
7213
          dep_rpath=
8027
7214
          rpath="$finalize_rpath"
8028
 
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
 
7215
          test "$mode" != relink && rpath="$compile_rpath$rpath"
8029
7216
          for libdir in $rpath; do
8030
7217
            if test -n "$hardcode_libdir_flag_spec"; then
8031
7218
              if test -n "$hardcode_libdir_separator"; then
8032
 
                func_replace_sysroot "$libdir"
8033
 
                libdir=$func_replace_sysroot_result
8034
7219
                if test -z "$hardcode_libdirs"; then
8035
7220
                  hardcode_libdirs="$libdir"
8036
7221
                else
8039
7224
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8040
7225
                    ;;
8041
7226
                  *)
8042
 
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 
7227
                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8043
7228
                    ;;
8044
7229
                  esac
8045
7230
                fi
8046
7231
              else
8047
7232
                eval flag=\"$hardcode_libdir_flag_spec\"
8048
 
                func_append dep_rpath " $flag"
 
7233
                dep_rpath="$dep_rpath $flag"
8049
7234
              fi
8050
7235
            elif test -n "$runpath_var"; then
8051
7236
              case "$perm_rpath " in
8052
7237
              *" $libdir "*) ;;
8053
 
              *) func_apped perm_rpath " $libdir" ;;
 
7238
              *) perm_rpath="$perm_rpath $libdir" ;;
8054
7239
              esac
8055
7240
            fi
8056
7241
          done
8068
7253
            # We should set the runpath_var.
8069
7254
            rpath=
8070
7255
            for dir in $perm_rpath; do
8071
 
              func_append rpath "$dir:"
 
7256
              rpath="$rpath$dir:"
8072
7257
            done
8073
7258
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8074
7259
          fi
8076
7261
        fi
8077
7262
 
8078
7263
        shlibpath="$finalize_shlibpath"
8079
 
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 
7264
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8080
7265
        if test -n "$shlibpath"; then
8081
7266
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8082
7267
        fi
8102
7287
        linknames=
8103
7288
        for link
8104
7289
        do
8105
 
          func_append linknames " $link"
 
7290
          linknames="$linknames $link"
8106
7291
        done
8107
7292
 
8108
7293
        # Use standard objects if they are pic
8113
7298
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
8114
7299
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8115
7300
          export_symbols="$output_objdir/$libname.uexp"
8116
 
          func_append delfiles " $export_symbols"
 
7301
          delfiles="$delfiles $export_symbols"
8117
7302
        fi
8118
7303
 
8119
7304
        orig_export_symbols=
8144
7329
            $opt_dry_run || $RM $export_symbols
8145
7330
            cmds=$export_symbols_cmds
8146
7331
            save_ifs="$IFS"; IFS='~'
8147
 
            for cmd1 in $cmds; do
 
7332
            for cmd in $cmds; do
8148
7333
              IFS="$save_ifs"
8149
 
              # Take the normal branch if the nm_file_list_spec branch
8150
 
              # doesn't work or if tool conversion is not needed.
8151
 
              case $nm_file_list_spec~$to_tool_file_cmd in
8152
 
                *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8153
 
                  try_normal_branch=yes
8154
 
                  eval cmd=\"$cmd1\"
8155
 
                  func_len " $cmd"
8156
 
                  len=$func_len_result
8157
 
                  ;;
8158
 
                *)
8159
 
                  try_normal_branch=no
8160
 
                  ;;
8161
 
              esac
8162
 
              if test "$try_normal_branch" = yes \
8163
 
                 && { test "$len" -lt "$max_cmd_len" \
8164
 
                      || test "$max_cmd_len" -le -1; }
8165
 
              then
8166
 
                func_show_eval "$cmd" 'exit $?'
8167
 
                skipped_export=false
8168
 
              elif test -n "$nm_file_list_spec"; then
8169
 
                func_basename "$output"
8170
 
                output_la=$func_basename_result
8171
 
                save_libobjs=$libobjs
8172
 
                save_output=$output
8173
 
                output=${output_objdir}/${output_la}.nm
8174
 
                func_to_tool_file "$output"
8175
 
                libobjs=$nm_file_list_spec$func_to_tool_file_result
8176
 
                func_append delfiles " $output"
8177
 
                func_verbose "creating $NM input file list: $output"
8178
 
                for obj in $save_libobjs; do
8179
 
                  func_to_tool_file "$obj"
8180
 
                  $ECHO "$func_to_tool_file_result"
8181
 
                done > "$output"
8182
 
                eval cmd=\"$cmd1\"
8183
 
                func_show_eval "$cmd" 'exit $?'
8184
 
                output=$save_output
8185
 
                libobjs=$save_libobjs
 
7334
              eval cmd=\"$cmd\"
 
7335
              func_len " $cmd"
 
7336
              len=$func_len_result
 
7337
              if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 
7338
                func_show_eval "$cmd" 'exit $?'
8186
7339
                skipped_export=false
8187
7340
              else
8188
7341
                # The command line is too long to execute in one step.
8216
7369
          # global variables. join(1) would be nice here, but unfortunately
8217
7370
          # isn't a blessed tool.
8218
7371
          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8219
 
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 
7372
          delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8220
7373
          export_symbols=$output_objdir/$libname.def
8221
7374
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8222
7375
        fi
8226
7379
          case " $convenience " in
8227
7380
          *" $test_deplib "*) ;;
8228
7381
          *)
8229
 
            func_append tmp_deplibs " $test_deplib"
 
7382
            tmp_deplibs="$tmp_deplibs $test_deplib"
8230
7383
            ;;
8231
7384
          esac
8232
7385
        done
8246
7399
            test "X$libobjs" = "X " && libobjs=
8247
7400
          else
8248
7401
            gentop="$output_objdir/${outputname}x"
8249
 
            func_append generated " $gentop"
 
7402
            generated="$generated $gentop"
8250
7403
 
8251
7404
            func_extract_archives $gentop $convenience
8252
 
            func_append libobjs " $func_extract_archives_result"
 
7405
            libobjs="$libobjs $func_extract_archives_result"
8253
7406
            test "X$libobjs" = "X " && libobjs=
8254
7407
          fi
8255
7408
        fi
8256
7409
 
8257
7410
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8258
7411
          eval flag=\"$thread_safe_flag_spec\"
8259
 
          func_append linker_flags " $flag"
 
7412
          linker_flags="$linker_flags $flag"
8260
7413
        fi
8261
7414
 
8262
7415
        # Make a backup of the uninstalled library when relinking
8263
 
        if test "$opt_mode" = relink; then
 
7416
        if test "$mode" = relink; then
8264
7417
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8265
7418
        fi
8266
7419
 
8322
7475
            echo 'INPUT (' > $output
8323
7476
            for obj in $save_libobjs
8324
7477
            do
8325
 
              func_to_tool_file "$obj"
8326
 
              $ECHO "$func_to_tool_file_result" >> $output
 
7478
              $ECHO "$obj" >> $output
8327
7479
            done
8328
7480
            echo ')' >> $output
8329
 
            func_append delfiles " $output"
8330
 
            func_to_tool_file "$output"
8331
 
            output=$func_to_tool_file_result
 
7481
            delfiles="$delfiles $output"
8332
7482
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8333
7483
            output=${output_objdir}/${output_la}.lnk
8334
7484
            func_verbose "creating linker input file list: $output"
8342
7492
            fi
8343
7493
            for obj
8344
7494
            do
8345
 
              func_to_tool_file "$obj"
8346
 
              $ECHO "$func_to_tool_file_result" >> $output
 
7495
              $ECHO "$obj" >> $output
8347
7496
            done
8348
 
            func_append delfiles " $output"
8349
 
            func_to_tool_file "$output"
8350
 
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
 
7497
            delfiles="$delfiles $output"
 
7498
            output=$firstobj\"$file_list_spec$output\"
8351
7499
          else
8352
7500
            if test -n "$save_libobjs"; then
8353
7501
              func_verbose "creating reloadable object files..."
8398
7546
              if test -n "$last_robj"; then
8399
7547
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8400
7548
              fi
8401
 
              func_append delfiles " $output"
 
7549
              delfiles="$delfiles $output"
8402
7550
 
8403
7551
            else
8404
7552
              output=
8432
7580
                lt_exit=$?
8433
7581
 
8434
7582
                # Restore the uninstalled library and exit
8435
 
                if test "$opt_mode" = relink; then
 
7583
                if test "$mode" = relink; then
8436
7584
                  ( cd "$output_objdir" && \
8437
7585
                    $RM "${realname}T" && \
8438
7586
                    $MV "${realname}U" "$realname" )
8465
7613
              # global variables. join(1) would be nice here, but unfortunately
8466
7614
              # isn't a blessed tool.
8467
7615
              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8468
 
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 
7616
              delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8469
7617
              export_symbols=$output_objdir/$libname.def
8470
7618
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8471
7619
            fi
8506
7654
        # Add any objects from preloaded convenience libraries
8507
7655
        if test -n "$dlprefiles"; then
8508
7656
          gentop="$output_objdir/${outputname}x"
8509
 
          func_append generated " $gentop"
 
7657
          generated="$generated $gentop"
8510
7658
 
8511
7659
          func_extract_archives $gentop $dlprefiles
8512
 
          func_append libobjs " $func_extract_archives_result"
 
7660
          libobjs="$libobjs $func_extract_archives_result"
8513
7661
          test "X$libobjs" = "X " && libobjs=
8514
7662
        fi
8515
7663
 
8525
7673
            lt_exit=$?
8526
7674
 
8527
7675
            # Restore the uninstalled library and exit
8528
 
            if test "$opt_mode" = relink; then
 
7676
            if test "$mode" = relink; then
8529
7677
              ( cd "$output_objdir" && \
8530
7678
                $RM "${realname}T" && \
8531
7679
                $MV "${realname}U" "$realname" )
8537
7685
        IFS="$save_ifs"
8538
7686
 
8539
7687
        # Restore the uninstalled library and exit
8540
 
        if test "$opt_mode" = relink; then
 
7688
        if test "$mode" = relink; then
8541
7689
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8542
7690
 
8543
7691
          if test -n "$convenience"; then
8621
7769
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8622
7770
        else
8623
7771
          gentop="$output_objdir/${obj}x"
8624
 
          func_append generated " $gentop"
 
7772
          generated="$generated $gentop"
8625
7773
 
8626
7774
          func_extract_archives $gentop $convenience
8627
7775
          reload_conv_objs="$reload_objs $func_extract_archives_result"
8628
7776
        fi
8629
7777
      fi
8630
7778
 
8631
 
      # If we're not building shared, we need to use non_pic_objs
8632
 
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8633
 
 
8634
7779
      # Create the old-style object.
8635
7780
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8636
7781
 
8704
7849
        if test "$tagname" = CXX ; then
8705
7850
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8706
7851
            10.[0123])
8707
 
              func_append compile_command " ${wl}-bind_at_load"
8708
 
              func_append finalize_command " ${wl}-bind_at_load"
 
7852
              compile_command="$compile_command ${wl}-bind_at_load"
 
7853
              finalize_command="$finalize_command ${wl}-bind_at_load"
8709
7854
            ;;
8710
7855
          esac
8711
7856
        fi
8725
7870
        *)
8726
7871
          case " $compile_deplibs " in
8727
7872
          *" -L$path/$objdir "*)
8728
 
            func_append new_libs " -L$path/$objdir" ;;
 
7873
            new_libs="$new_libs -L$path/$objdir" ;;
8729
7874
          esac
8730
7875
          ;;
8731
7876
        esac
8735
7880
        -L*)
8736
7881
          case " $new_libs " in
8737
7882
          *" $deplib "*) ;;
8738
 
          *) func_append new_libs " $deplib" ;;
 
7883
          *) new_libs="$new_libs $deplib" ;;
8739
7884
          esac
8740
7885
          ;;
8741
 
        *) func_append new_libs " $deplib" ;;
 
7886
        *) new_libs="$new_libs $deplib" ;;
8742
7887
        esac
8743
7888
      done
8744
7889
      compile_deplibs="$new_libs"
8745
7890
 
8746
7891
 
8747
 
      func_append compile_command " $compile_deplibs"
8748
 
      func_append finalize_command " $finalize_deplibs"
 
7892
      compile_command="$compile_command $compile_deplibs"
 
7893
      finalize_command="$finalize_command $finalize_deplibs"
8749
7894
 
8750
7895
      if test -n "$rpath$xrpath"; then
8751
7896
        # If the user specified any rpath flags, then add them.
8753
7898
          # This is the magic to use -rpath.
8754
7899
          case "$finalize_rpath " in
8755
7900
          *" $libdir "*) ;;
8756
 
          *) func_append finalize_rpath " $libdir" ;;
 
7901
          *) finalize_rpath="$finalize_rpath $libdir" ;;
8757
7902
          esac
8758
7903
        done
8759
7904
      fi
8772
7917
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8773
7918
                ;;
8774
7919
              *)
8775
 
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 
7920
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8776
7921
                ;;
8777
7922
              esac
8778
7923
            fi
8779
7924
          else
8780
7925
            eval flag=\"$hardcode_libdir_flag_spec\"
8781
 
            func_append rpath " $flag"
 
7926
            rpath="$rpath $flag"
8782
7927
          fi
8783
7928
        elif test -n "$runpath_var"; then
8784
7929
          case "$perm_rpath " in
8785
7930
          *" $libdir "*) ;;
8786
 
          *) func_append perm_rpath " $libdir" ;;
 
7931
          *) perm_rpath="$perm_rpath $libdir" ;;
8787
7932
          esac
8788
7933
        fi
8789
7934
        case $host in
8792
7937
          case :$dllsearchpath: in
8793
7938
          *":$libdir:"*) ;;
8794
7939
          ::) dllsearchpath=$libdir;;
8795
 
          *) func_append dllsearchpath ":$libdir";;
 
7940
          *) dllsearchpath="$dllsearchpath:$libdir";;
8796
7941
          esac
8797
7942
          case :$dllsearchpath: in
8798
7943
          *":$testbindir:"*) ;;
8799
7944
          ::) dllsearchpath=$testbindir;;
8800
 
          *) func_append dllsearchpath ":$testbindir";;
 
7945
          *) dllsearchpath="$dllsearchpath:$testbindir";;
8801
7946
          esac
8802
7947
          ;;
8803
7948
        esac
8823
7968
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8824
7969
                ;;
8825
7970
              *)
8826
 
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 
7971
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8827
7972
                ;;
8828
7973
              esac
8829
7974
            fi
8830
7975
          else
8831
7976
            eval flag=\"$hardcode_libdir_flag_spec\"
8832
 
            func_append rpath " $flag"
 
7977
            rpath="$rpath $flag"
8833
7978
          fi
8834
7979
        elif test -n "$runpath_var"; then
8835
7980
          case "$finalize_perm_rpath " in
8836
7981
          *" $libdir "*) ;;
8837
 
          *) func_append finalize_perm_rpath " $libdir" ;;
 
7982
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
8838
7983
          esac
8839
7984
        fi
8840
7985
      done
8885
8030
        exit_status=0
8886
8031
        func_show_eval "$link_command" 'exit_status=$?'
8887
8032
 
8888
 
        if test -n "$postlink_cmds"; then
8889
 
          func_to_tool_file "$output"
8890
 
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8891
 
          func_execute_cmds "$postlink_cmds" 'exit $?'
8892
 
        fi
8893
 
 
8894
8033
        # Delete the generated files.
8895
8034
        if test -f "$output_objdir/${outputname}S.${objext}"; then
8896
8035
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8913
8052
          # We should set the runpath_var.
8914
8053
          rpath=
8915
8054
          for dir in $perm_rpath; do
8916
 
            func_append rpath "$dir:"
 
8055
            rpath="$rpath$dir:"
8917
8056
          done
8918
8057
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8919
8058
        fi
8921
8060
          # We should set the runpath_var.
8922
8061
          rpath=
8923
8062
          for dir in $finalize_perm_rpath; do
8924
 
            func_append rpath "$dir:"
 
8063
            rpath="$rpath$dir:"
8925
8064
          done
8926
8065
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8927
8066
        fi
8936
8075
        $opt_dry_run || $RM $output
8937
8076
        # Link the executable and exit
8938
8077
        func_show_eval "$link_command" 'exit $?'
8939
 
 
8940
 
        if test -n "$postlink_cmds"; then
8941
 
          func_to_tool_file "$output"
8942
 
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8943
 
          func_execute_cmds "$postlink_cmds" 'exit $?'
8944
 
        fi
8945
 
 
8946
8078
        exit $EXIT_SUCCESS
8947
8079
      fi
8948
8080
 
8976
8108
 
8977
8109
      func_show_eval "$link_command" 'exit $?'
8978
8110
 
8979
 
      if test -n "$postlink_cmds"; then
8980
 
        func_to_tool_file "$output_objdir/$outputname"
8981
 
        postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8982
 
        func_execute_cmds "$postlink_cmds" 'exit $?'
8983
 
      fi
8984
 
 
8985
8111
      # Now create the wrapper script.
8986
8112
      func_verbose "creating $output"
8987
8113
 
9079
8205
        else
9080
8206
          oldobjs="$old_deplibs $non_pic_objects"
9081
8207
          if test "$preload" = yes && test -f "$symfileobj"; then
9082
 
            func_append oldobjs " $symfileobj"
 
8208
            oldobjs="$oldobjs $symfileobj"
9083
8209
          fi
9084
8210
        fi
9085
8211
        addlibs="$old_convenience"
9087
8213
 
9088
8214
      if test -n "$addlibs"; then
9089
8215
        gentop="$output_objdir/${outputname}x"
9090
 
        func_append generated " $gentop"
 
8216
        generated="$generated $gentop"
9091
8217
 
9092
8218
        func_extract_archives $gentop $addlibs
9093
 
        func_append oldobjs " $func_extract_archives_result"
 
8219
        oldobjs="$oldobjs $func_extract_archives_result"
9094
8220
      fi
9095
8221
 
9096
8222
      # Do each command in the archive commands.
9101
8227
        # Add any objects from preloaded convenience libraries
9102
8228
        if test -n "$dlprefiles"; then
9103
8229
          gentop="$output_objdir/${outputname}x"
9104
 
          func_append generated " $gentop"
 
8230
          generated="$generated $gentop"
9105
8231
 
9106
8232
          func_extract_archives $gentop $dlprefiles
9107
 
          func_append oldobjs " $func_extract_archives_result"
 
8233
          oldobjs="$oldobjs $func_extract_archives_result"
9108
8234
        fi
9109
8235
 
9110
8236
        # POSIX demands no paths to be encoded in archives.  We have
9122
8248
        else
9123
8249
          echo "copying selected object files to avoid basename conflicts..."
9124
8250
          gentop="$output_objdir/${outputname}x"
9125
 
          func_append generated " $gentop"
 
8251
          generated="$generated $gentop"
9126
8252
          func_mkdir_p "$gentop"
9127
8253
          save_oldobjs=$oldobjs
9128
8254
          oldobjs=
9146
8272
                esac
9147
8273
              done
9148
8274
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9149
 
              func_append oldobjs " $gentop/$newobj"
 
8275
              oldobjs="$oldobjs $gentop/$newobj"
9150
8276
              ;;
9151
 
            *) func_append oldobjs " $obj" ;;
 
8277
            *) oldobjs="$oldobjs $obj" ;;
9152
8278
            esac
9153
8279
          done
9154
8280
        fi
9158
8284
        len=$func_len_result
9159
8285
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9160
8286
          cmds=$old_archive_cmds
9161
 
        elif test -n "$archiver_list_spec"; then
9162
 
          func_verbose "using command file archive linking..."
9163
 
          for obj in $oldobjs
9164
 
          do
9165
 
            func_to_tool_file "$obj"
9166
 
            $ECHO "$func_to_tool_file_result"
9167
 
          done > $output_objdir/$libname.libcmd
9168
 
          func_to_tool_file "$output_objdir/$libname.libcmd"
9169
 
          oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9170
 
          cmds=$old_archive_cmds
9171
8287
        else
9172
8288
          # the command line is too long to link in one step, link in parts
9173
8289
          func_verbose "using piecewise archive linking..."
9264
8380
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9265
8381
                test -z "$libdir" && \
9266
8382
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
9267
 
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9268
 
                ;;
9269
 
              -L*)
9270
 
                func_stripname -L '' "$deplib"
9271
 
                func_replace_sysroot "$func_stripname_result"
9272
 
                func_append newdependency_libs " -L$func_replace_sysroot_result"
9273
 
                ;;
9274
 
              -R*)
9275
 
                func_stripname -R '' "$deplib"
9276
 
                func_replace_sysroot "$func_stripname_result"
9277
 
                func_append newdependency_libs " -R$func_replace_sysroot_result"
9278
 
                ;;
9279
 
              *) func_append newdependency_libs " $deplib" ;;
 
8383
                newdependency_libs="$newdependency_libs $libdir/$name"
 
8384
                ;;
 
8385
              *) newdependency_libs="$newdependency_libs $deplib" ;;
9280
8386
              esac
9281
8387
            done
9282
8388
            dependency_libs="$newdependency_libs"
9290
8396
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9291
8397
                test -z "$libdir" && \
9292
8398
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9293
 
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 
8399
                newdlfiles="$newdlfiles $libdir/$name"
9294
8400
                ;;
9295
 
              *) func_append newdlfiles " $lib" ;;
 
8401
              *) newdlfiles="$newdlfiles $lib" ;;
9296
8402
              esac
9297
8403
            done
9298
8404
            dlfiles="$newdlfiles"
9309
8415
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9310
8416
                test -z "$libdir" && \
9311
8417
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9312
 
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 
8418
                newdlprefiles="$newdlprefiles $libdir/$name"
9313
8419
                ;;
9314
8420
              esac
9315
8421
            done
9321
8427
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9322
8428
                *) abs=`pwd`"/$lib" ;;
9323
8429
              esac
9324
 
              func_append newdlfiles " $abs"
 
8430
              newdlfiles="$newdlfiles $abs"
9325
8431
            done
9326
8432
            dlfiles="$newdlfiles"
9327
8433
            newdlprefiles=
9330
8436
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9331
8437
                *) abs=`pwd`"/$lib" ;;
9332
8438
              esac
9333
 
              func_append newdlprefiles " $abs"
 
8439
              newdlprefiles="$newdlprefiles $abs"
9334
8440
            done
9335
8441
            dlprefiles="$newdlprefiles"
9336
8442
          fi
9415
8521
    exit $EXIT_SUCCESS
9416
8522
}
9417
8523
 
9418
 
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
 
8524
{ test "$mode" = link || test "$mode" = relink; } &&
9419
8525
    func_mode_link ${1+"$@"}
9420
8526
 
9421
8527
 
9435
8541
    for arg
9436
8542
    do
9437
8543
      case $arg in
9438
 
      -f) func_append RM " $arg"; rmforce=yes ;;
9439
 
      -*) func_append RM " $arg" ;;
9440
 
      *) func_append files " $arg" ;;
 
8544
      -f) RM="$RM $arg"; rmforce=yes ;;
 
8545
      -*) RM="$RM $arg" ;;
 
8546
      *) files="$files $arg" ;;
9441
8547
      esac
9442
8548
    done
9443
8549
 
9446
8552
 
9447
8553
    rmdirs=
9448
8554
 
 
8555
    origobjdir="$objdir"
9449
8556
    for file in $files; do
9450
8557
      func_dirname "$file" "" "."
9451
8558
      dir="$func_dirname_result"
9452
8559
      if test "X$dir" = X.; then
9453
 
        odir="$objdir"
 
8560
        objdir="$origobjdir"
9454
8561
      else
9455
 
        odir="$dir/$objdir"
 
8562
        objdir="$dir/$origobjdir"
9456
8563
      fi
9457
8564
      func_basename "$file"
9458
8565
      name="$func_basename_result"
9459
 
      test "$opt_mode" = uninstall && odir="$dir"
 
8566
      test "$mode" = uninstall && objdir="$dir"
9460
8567
 
9461
 
      # Remember odir for removal later, being careful to avoid duplicates
9462
 
      if test "$opt_mode" = clean; then
 
8568
      # Remember objdir for removal later, being careful to avoid duplicates
 
8569
      if test "$mode" = clean; then
9463
8570
        case " $rmdirs " in
9464
 
          *" $odir "*) ;;
9465
 
          *) func_append rmdirs " $odir" ;;
 
8571
          *" $objdir "*) ;;
 
8572
          *) rmdirs="$rmdirs $objdir" ;;
9466
8573
        esac
9467
8574
      fi
9468
8575
 
9488
8595
 
9489
8596
          # Delete the libtool libraries and symlinks.
9490
8597
          for n in $library_names; do
9491
 
            func_append rmfiles " $odir/$n"
 
8598
            rmfiles="$rmfiles $objdir/$n"
9492
8599
          done
9493
 
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
8600
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
9494
8601
 
9495
 
          case "$opt_mode" in
 
8602
          case "$mode" in
9496
8603
          clean)
9497
 
            case " $library_names " in
 
8604
            case "  $library_names " in
 
8605
            # "  " in the beginning catches empty $dlname
9498
8606
            *" $dlname "*) ;;
9499
 
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 
8607
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
9500
8608
            esac
9501
 
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 
8609
            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
9502
8610
            ;;
9503
8611
          uninstall)
9504
8612
            if test -n "$library_names"; then
9526
8634
          # Add PIC object to the list of files to remove.
9527
8635
          if test -n "$pic_object" &&
9528
8636
             test "$pic_object" != none; then
9529
 
            func_append rmfiles " $dir/$pic_object"
 
8637
            rmfiles="$rmfiles $dir/$pic_object"
9530
8638
          fi
9531
8639
 
9532
8640
          # Add non-PIC object to the list of files to remove.
9533
8641
          if test -n "$non_pic_object" &&
9534
8642
             test "$non_pic_object" != none; then
9535
 
            func_append rmfiles " $dir/$non_pic_object"
 
8643
            rmfiles="$rmfiles $dir/$non_pic_object"
9536
8644
          fi
9537
8645
        fi
9538
8646
        ;;
9539
8647
 
9540
8648
      *)
9541
 
        if test "$opt_mode" = clean ; then
 
8649
        if test "$mode" = clean ; then
9542
8650
          noexename=$name
9543
8651
          case $file in
9544
8652
          *.exe)
9548
8656
            noexename=$func_stripname_result
9549
8657
            # $file with .exe has already been added to rmfiles,
9550
8658
            # add $file without .exe
9551
 
            func_append rmfiles " $file"
 
8659
            rmfiles="$rmfiles $file"
9552
8660
            ;;
9553
8661
          esac
9554
8662
          # Do a test to see if this is a libtool program.
9557
8665
              func_ltwrapper_scriptname "$file"
9558
8666
              relink_command=
9559
8667
              func_source $func_ltwrapper_scriptname_result
9560
 
              func_append rmfiles " $func_ltwrapper_scriptname_result"
 
8668
              rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
9561
8669
            else
9562
8670
              relink_command=
9563
8671
              func_source $dir/$noexename
9565
8673
 
9566
8674
            # note $name still contains .exe if it was in $file originally
9567
8675
            # as does the version of $file that was added into $rmfiles
9568
 
            func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
 
8676
            rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
9569
8677
            if test "$fast_install" = yes && test -n "$relink_command"; then
9570
 
              func_append rmfiles " $odir/lt-$name"
 
8678
              rmfiles="$rmfiles $objdir/lt-$name"
9571
8679
            fi
9572
8680
            if test "X$noexename" != "X$name" ; then
9573
 
              func_append rmfiles " $odir/lt-${noexename}.c"
 
8681
              rmfiles="$rmfiles $objdir/lt-${noexename}.c"
9574
8682
            fi
9575
8683
          fi
9576
8684
        fi
9578
8686
      esac
9579
8687
      func_show_eval "$RM $rmfiles" 'exit_status=1'
9580
8688
    done
 
8689
    objdir="$origobjdir"
9581
8690
 
9582
8691
    # Try to remove the ${objdir}s in the directories where we deleted files
9583
8692
    for dir in $rmdirs; do
9589
8698
    exit $exit_status
9590
8699
}
9591
8700
 
9592
 
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
 
8701
{ test "$mode" = uninstall || test "$mode" = clean; } &&
9593
8702
    func_mode_uninstall ${1+"$@"}
9594
8703
 
9595
 
test -z "$opt_mode" && {
 
8704
test -z "$mode" && {
9596
8705
  help="$generic_help"
9597
8706
  func_fatal_help "you must specify a MODE"
9598
8707
}
9599
8708
 
9600
8709
test -z "$exec_cmd" && \
9601
 
  func_fatal_help "invalid operation mode \`$opt_mode'"
 
8710
  func_fatal_help "invalid operation mode \`$mode'"
9602
8711
 
9603
8712
if test -n "$exec_cmd"; then
9604
8713
  eval exec "$exec_cmd"