~ubuntu-branches/ubuntu/precise/tiff/precise

« back to all changes in this revision

Viewing changes to config/ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-05-25 15:10:36 UTC
  • mfrom: (15.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110525151036-ywtggsucsvo1nl4a
Tags: 3.9.5-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - Enable multiarch build
    - debian/control: update depends for multiarch toolchain
    - debian/*.install: update /usr/lib paths
    - debian/rules:
      - add --libdir to DEB_CONFIGURE_EXTRA_FLAGS
      - update library path for .la files
  - debian/{control,rules}: enable PIE build for security hardening
* Dropped patches:
  - CVE-2010-2482.patch: upstream
  - CVE-2010-2595.patch: upstream
  - CVE-2010-2597.patch: upstream
  - CVE-2010-2630.patch: upstream
  - CVE-2011-0192.patch: upstream
  - CVE-2011-1167.patch: upstream
  - CVE-2009-5022.patch: upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Generated from ltmain.m4sh.
2
1
 
3
 
# libtool (GNU libtool) 2.2.10
 
2
# libtool (GNU libtool) 2.4
4
3
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
4
 
6
5
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
70
69
#         compiler:             $LTCC
71
70
#         compiler flags:               $LTCFLAGS
72
71
#         linker:               $LD (gnu? $with_gnu_ld)
73
 
#         $progname:    (GNU libtool) 2.2.10
 
72
#         $progname:    (GNU libtool) 2.4
74
73
#         automake:     $automake_version
75
74
#         autoconf:     $autoconf_version
76
75
#
77
76
# 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/>.
78
79
 
79
80
PROGRAM=libtool
80
81
PACKAGE=libtool
81
 
VERSION=2.2.10
 
82
VERSION=2.4
82
83
TIMESTAMP=""
83
 
package_revision=1.3175
 
84
package_revision=1.3293
84
85
 
85
86
# Be Bourne compatible
86
87
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
163
164
dirname="s,/[^/]*$,,"
164
165
basename="s,^.*/,,"
165
166
 
 
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
 
166
188
# func_dirname_and_basename file append nondir_replacement
167
189
# perform func_basename and func_dirname in a single function
168
190
# call:
177
199
# those functions but instead duplicate the functionality here.
178
200
func_dirname_and_basename ()
179
201
{
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.
 
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
 
191
227
 
192
228
# These SED scripts presuppose an absolute path with a trailing slash.
193
229
pathcar='s,^/\([^/]*\).*$,\1,'
370
406
# Same as above, but do not quote variable references.
371
407
double_quote_subst='s/\(["`\\]\)/\\\1/g'
372
408
 
 
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
 
373
418
# Re-`\' parameter expansions in output of double_quote_subst that were
374
419
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
375
420
# in input to double_quote_subst, that '$' was protected from expansion.
398
443
# name if it has been set yet.
399
444
func_echo ()
400
445
{
401
 
    $ECHO "$progname${mode+: }$mode: $*"
 
446
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
402
447
}
403
448
 
404
449
# func_verbose arg...
424
469
# Echo program name prefixed message to standard error.
425
470
func_error ()
426
471
{
427
 
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
 
472
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
428
473
}
429
474
 
430
475
# func_warning arg...
431
476
# Echo program name prefixed warning message to standard error.
432
477
func_warning ()
433
478
{
434
 
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
 
479
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
435
480
 
436
481
    # bash bug again:
437
482
    :
650
695
    fi
651
696
}
652
697
 
 
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
 
653
715
 
654
716
# func_version
655
717
# Echo version message to standard output and exit.
656
718
func_version ()
657
719
{
 
720
    $opt_debug
 
721
 
658
722
    $SED -n '/(C)/!b go
659
723
        :more
660
724
        /\./!{
676
740
# Echo short help message to standard output and exit.
677
741
func_usage ()
678
742
{
 
743
    $opt_debug
 
744
 
679
745
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
680
746
        s/^# //
681
747
        s/^# *$//
692
758
# unless 'noexit' is passed as argument.
693
759
func_help ()
694
760
{
 
761
    $opt_debug
 
762
 
695
763
    $SED -n '/^# Usage:/,/# Report bugs to/ {
 
764
        :print
696
765
        s/^# //
697
766
        s/^# *$//
698
767
        s*\$progname*'$progname'*
705
774
        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
706
775
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
707
776
        p
708
 
     }' < "$progpath"
 
777
        d
 
778
     }
 
779
     /^# .* home page:/b print
 
780
     /^# General help using/b print
 
781
     ' < "$progpath"
709
782
    ret=$?
710
783
    if test -z "$1"; then
711
784
      exit $ret
717
790
# exit_cmd.
718
791
func_missing_arg ()
719
792
{
 
793
    $opt_debug
 
794
 
720
795
    func_error "missing argument for $1."
721
796
    exit_cmd=exit
722
797
}
723
798
 
 
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
 
724
825
exit_cmd=:
725
826
 
726
827
 
727
828
 
728
829
 
729
830
 
730
 
 
731
831
magic="%%%MAGIC variable%%%"
732
832
magic_exe="%%%MAGIC EXE variable%%%"
733
833
 
734
834
# Global variables.
735
 
# $mode is unset
736
835
nonopt=
737
 
execute_dlfiles=
738
836
preserve_args=
739
837
lo2o="s/\\.lo\$/.${objext}/"
740
838
o2lo="s/\\.${objext}\$/.lo/"
741
839
extracted_archives=
742
840
extracted_serial=0
743
841
 
744
 
opt_dry_run=false
745
 
opt_duplicate_deps=false
746
 
opt_silent=false
747
 
opt_debug=:
748
 
 
749
842
# If this variable is set in any of the actions, the command in it
750
843
# will be execed at the end.  This prevents here-documents from being
751
844
# left over by shells.
752
845
exec_cmd=
753
846
 
 
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
 
754
893
# func_fatal_configuration arg...
755
894
# Echo program name prefixed message to standard error, followed by
756
895
# a configuration failure hint, and exit.
840
979
  esac
841
980
}
842
981
 
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
 
1018
1222
## ----------- ##
1019
1223
##    Main.    ##
1020
1224
## ----------- ##
1021
1225
 
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
 
 
1050
1226
# func_lalib_p file
1051
1227
# True iff FILE is a libtool `.la' library or `.lo' object file.
1052
1228
# This function is only a basic sanity check; it will hardly flush out
1110
1286
# temporary ltwrapper_script.
1111
1287
func_ltwrapper_scriptname ()
1112
1288
{
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
 
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"
1119
1292
}
1120
1293
 
1121
1294
# func_ltwrapper_p file
1161
1334
}
1162
1335
 
1163
1336
 
 
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
 
1164
1368
# func_infer_tag arg
1165
1369
# Infer tagged configuration to use if any are available and
1166
1370
# if one wasn't chosen via the "--tag" command line option.
1173
1377
    if test -n "$available_tags" && test -z "$tagname"; then
1174
1378
      CC_quoted=
1175
1379
      for arg in $CC; do
1176
 
        func_quote_for_eval "$arg"
1177
 
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1380
        func_append_quoted CC_quoted "$arg"
1178
1381
      done
1179
1382
      CC_expanded=`func_echo_all $CC`
1180
1383
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1193
1396
            CC_quoted=
1194
1397
            for arg in $CC; do
1195
1398
              # Double-quote args containing other shell metacharacters.
1196
 
              func_quote_for_eval "$arg"
1197
 
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1399
              func_append_quoted CC_quoted "$arg"
1198
1400
            done
1199
1401
            CC_expanded=`func_echo_all $CC`
1200
1402
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1263
1465
    }
1264
1466
}
1265
1467
 
 
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
 
1266
1948
# func_mode_compile arg...
1267
1949
func_mode_compile ()
1268
1950
{
1303
1985
          ;;
1304
1986
 
1305
1987
        -pie | -fpie | -fPIE)
1306
 
          pie_flag="$pie_flag $arg"
 
1988
          func_append pie_flag " $arg"
1307
1989
          continue
1308
1990
          ;;
1309
1991
 
1310
1992
        -shared | -static | -prefer-pic | -prefer-non-pic)
1311
 
          later="$later $arg"
 
1993
          func_append later " $arg"
1312
1994
          continue
1313
1995
          ;;
1314
1996
 
1329
2011
          save_ifs="$IFS"; IFS=','
1330
2012
          for arg in $args; do
1331
2013
            IFS="$save_ifs"
1332
 
            func_quote_for_eval "$arg"
1333
 
            lastarg="$lastarg $func_quote_for_eval_result"
 
2014
            func_append_quoted lastarg "$arg"
1334
2015
          done
1335
2016
          IFS="$save_ifs"
1336
2017
          func_stripname ' ' '' "$lastarg"
1337
2018
          lastarg=$func_stripname_result
1338
2019
 
1339
2020
          # Add the arguments to base_compile.
1340
 
          base_compile="$base_compile $lastarg"
 
2021
          func_append base_compile " $lastarg"
1341
2022
          continue
1342
2023
          ;;
1343
2024
 
1353
2034
      esac    #  case $arg_mode
1354
2035
 
1355
2036
      # Aesthetically quote the previous argument.
1356
 
      func_quote_for_eval "$lastarg"
1357
 
      base_compile="$base_compile $func_quote_for_eval_result"
 
2037
      func_append_quoted base_compile "$lastarg"
1358
2038
    done # for arg
1359
2039
 
1360
2040
    case $arg_mode in
1485
2165
        $opt_dry_run || $RM $removelist
1486
2166
        exit $EXIT_FAILURE
1487
2167
      fi
1488
 
      removelist="$removelist $output_obj"
 
2168
      func_append removelist " $output_obj"
1489
2169
      $ECHO "$srcfile" > "$lockfile"
1490
2170
    fi
1491
2171
 
1492
2172
    $opt_dry_run || $RM $removelist
1493
 
    removelist="$removelist $lockfile"
 
2173
    func_append removelist " $lockfile"
1494
2174
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1495
2175
 
1496
 
    if test -n "$fix_srcfile_path"; then
1497
 
      eval srcfile=\"$fix_srcfile_path\"
1498
 
    fi
 
2176
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
 
2177
    srcfile=$func_to_tool_file_result
1499
2178
    func_quote_for_eval "$srcfile"
1500
2179
    qsrcfile=$func_quote_for_eval_result
1501
2180
 
1515
2194
 
1516
2195
      if test -z "$output_obj"; then
1517
2196
        # Place PIC objects in $objdir
1518
 
        command="$command -o $lobj"
 
2197
        func_append command " -o $lobj"
1519
2198
      fi
1520
2199
 
1521
2200
      func_show_eval_locale "$command"  \
1562
2241
        command="$base_compile $qsrcfile $pic_flag"
1563
2242
      fi
1564
2243
      if test "$compiler_c_o" = yes; then
1565
 
        command="$command -o $obj"
 
2244
        func_append command " -o $obj"
1566
2245
      fi
1567
2246
 
1568
2247
      # Suppress compiler output if we already did a PIC compilation.
1569
 
      command="$command$suppress_output"
 
2248
      func_append command "$suppress_output"
1570
2249
      func_show_eval_locale "$command" \
1571
2250
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1572
2251
 
1611
2290
}
1612
2291
 
1613
2292
$opt_help || {
1614
 
  test "$mode" = compile && func_mode_compile ${1+"$@"}
 
2293
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
1615
2294
}
1616
2295
 
1617
2296
func_mode_help ()
1618
2297
{
1619
2298
    # We need to display help for each of the modes.
1620
 
    case $mode in
 
2299
    case $opt_mode in
1621
2300
      "")
1622
2301
        # Generic help is extracted from the usage comments
1623
2302
        # at the start of this file.
1793
2472
        ;;
1794
2473
 
1795
2474
      *)
1796
 
        func_fatal_help "invalid operation mode \`$mode'"
 
2475
        func_fatal_help "invalid operation mode \`$opt_mode'"
1797
2476
        ;;
1798
2477
    esac
1799
2478
 
1808
2487
  else
1809
2488
    {
1810
2489
      func_help noexit
1811
 
      for mode in compile link execute install finish uninstall clean; do
 
2490
      for opt_mode in compile link execute install finish uninstall clean; do
1812
2491
        func_mode_help
1813
2492
      done
1814
2493
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
1815
2494
    {
1816
2495
      func_help noexit
1817
 
      for mode in compile link execute install finish uninstall clean; do
 
2496
      for opt_mode in compile link execute install finish uninstall clean; do
1818
2497
        echo
1819
2498
        func_mode_help
1820
2499
      done
1843
2522
      func_fatal_help "you must specify a COMMAND"
1844
2523
 
1845
2524
    # Handle -dlopen flags immediately.
1846
 
    for file in $execute_dlfiles; do
 
2525
    for file in $opt_dlopen; do
1847
2526
      test -f "$file" \
1848
2527
        || func_fatal_help "\`$file' is not a file"
1849
2528
 
1850
2529
      dir=
1851
2530
      case $file in
1852
2531
      *.la)
 
2532
        func_resolve_sysroot "$file"
 
2533
        file=$func_resolve_sysroot_result
 
2534
 
1853
2535
        # Check to see that this really is a libtool archive.
1854
2536
        func_lalib_unsafe_p "$file" \
1855
2537
          || func_fatal_help "\`$lib' is not a valid libtool archive"
1871
2553
        dir="$func_dirname_result"
1872
2554
 
1873
2555
        if test -f "$dir/$objdir/$dlname"; then
1874
 
          dir="$dir/$objdir"
 
2556
          func_append dir "/$objdir"
1875
2557
        else
1876
2558
          if test ! -f "$dir/$dlname"; then
1877
2559
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1928
2610
        ;;
1929
2611
      esac
1930
2612
      # Quote arguments (to preserve shell metacharacters).
1931
 
      func_quote_for_eval "$file"
1932
 
      args="$args $func_quote_for_eval_result"
 
2613
      func_append_quoted args "$file"
1933
2614
    done
1934
2615
 
1935
2616
    if test "X$opt_dry_run" = Xfalse; then
1961
2642
    fi
1962
2643
}
1963
2644
 
1964
 
test "$mode" = execute && func_mode_execute ${1+"$@"}
 
2645
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
1965
2646
 
1966
2647
 
1967
2648
# func_mode_finish arg...
1968
2649
func_mode_finish ()
1969
2650
{
1970
2651
    $opt_debug
1971
 
    libdirs="$nonopt"
 
2652
    libs=
 
2653
    libdirs=
1972
2654
    admincmds=
1973
2655
 
 
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
 
1974
2697
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1975
 
      for dir
1976
 
      do
1977
 
        libdirs="$libdirs $dir"
1978
 
      done
1979
 
 
1980
2698
      for libdir in $libdirs; do
1981
2699
        if test -n "$finish_cmds"; then
1982
2700
          # Do each command in the finish commands.
1986
2704
        if test -n "$finish_eval"; then
1987
2705
          # Do the single finish_eval.
1988
2706
          eval cmds=\"$finish_eval\"
1989
 
          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
 
2707
          $opt_dry_run || eval "$cmds" || func_append admincmds "
1990
2708
       $cmds"
1991
2709
        fi
1992
2710
      done
1995
2713
    # Exit here if they wanted silent mode.
1996
2714
    $opt_silent && exit $EXIT_SUCCESS
1997
2715
 
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 "----------------------------------------------------------------------"
 
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
2041
2761
    exit $EXIT_SUCCESS
2042
2762
}
2043
2763
 
2044
 
test "$mode" = finish && func_mode_finish ${1+"$@"}
 
2764
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2045
2765
 
2046
2766
 
2047
2767
# func_mode_install arg...
2066
2786
    # The real first argument should be the name of the installation program.
2067
2787
    # Aesthetically quote it.
2068
2788
    func_quote_for_eval "$arg"
2069
 
    install_prog="$install_prog$func_quote_for_eval_result"
 
2789
    func_append install_prog "$func_quote_for_eval_result"
2070
2790
    install_shared_prog=$install_prog
2071
2791
    case " $install_prog " in
2072
2792
      *[\\\ /]cp\ *) install_cp=: ;;
2086
2806
    do
2087
2807
      arg2=
2088
2808
      if test -n "$dest"; then
2089
 
        files="$files $dest"
 
2809
        func_append files " $dest"
2090
2810
        dest=$arg
2091
2811
        continue
2092
2812
      fi
2124
2844
 
2125
2845
      # Aesthetically quote the argument.
2126
2846
      func_quote_for_eval "$arg"
2127
 
      install_prog="$install_prog $func_quote_for_eval_result"
 
2847
      func_append install_prog " $func_quote_for_eval_result"
2128
2848
      if test -n "$arg2"; then
2129
2849
        func_quote_for_eval "$arg2"
2130
2850
      fi
2131
 
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
 
2851
      func_append install_shared_prog " $func_quote_for_eval_result"
2132
2852
    done
2133
2853
 
2134
2854
    test -z "$install_prog" && \
2140
2860
    if test -n "$install_override_mode" && $no_mode; then
2141
2861
      if $install_cp; then :; else
2142
2862
        func_quote_for_eval "$install_override_mode"
2143
 
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
 
2863
        func_append install_shared_prog " -m $func_quote_for_eval_result"
2144
2864
      fi
2145
2865
    fi
2146
2866
 
2198
2918
      case $file in
2199
2919
      *.$libext)
2200
2920
        # Do the static libraries later.
2201
 
        staticlibs="$staticlibs $file"
 
2921
        func_append staticlibs " $file"
2202
2922
        ;;
2203
2923
 
2204
2924
      *.la)
 
2925
        func_resolve_sysroot "$file"
 
2926
        file=$func_resolve_sysroot_result
 
2927
 
2205
2928
        # Check to see that this really is a libtool archive.
2206
2929
        func_lalib_unsafe_p "$file" \
2207
2930
          || func_fatal_help "\`$file' is not a valid libtool archive"
2215
2938
        if test "X$destdir" = "X$libdir"; then
2216
2939
          case "$current_libdirs " in
2217
2940
          *" $libdir "*) ;;
2218
 
          *) current_libdirs="$current_libdirs $libdir" ;;
 
2941
          *) func_append current_libdirs " $libdir" ;;
2219
2942
          esac
2220
2943
        else
2221
2944
          # Note the libdir as a future libdir.
2222
2945
          case "$future_libdirs " in
2223
2946
          *" $libdir "*) ;;
2224
 
          *) future_libdirs="$future_libdirs $libdir" ;;
 
2947
          *) func_append future_libdirs " $libdir" ;;
2225
2948
          esac
2226
2949
        fi
2227
2950
 
2228
2951
        func_dirname "$file" "/" ""
2229
2952
        dir="$func_dirname_result"
2230
 
        dir="$dir$objdir"
 
2953
        func_append dir "$objdir"
2231
2954
 
2232
2955
        if test -n "$relink_command"; then
2233
2956
          # Determine the prefix the user has applied to our future dir.
2304
3027
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2305
3028
 
2306
3029
        # Maybe install the static library, too.
2307
 
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
 
3030
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
2308
3031
        ;;
2309
3032
 
2310
3033
      *.lo)
2501
3224
    fi
2502
3225
}
2503
3226
 
2504
 
test "$mode" = install && func_mode_install ${1+"$@"}
 
3227
test "$opt_mode" = install && func_mode_install ${1+"$@"}
2505
3228
 
2506
3229
 
2507
3230
# func_generate_dlsyms outputname originator pic_p
2548
3271
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
2549
3272
#endif
2550
3273
 
 
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
 
2551
3286
/* External symbol declarations for the compiler. */\
2552
3287
"
2553
3288
 
2559
3294
          # Add our own program objects to the symbol list.
2560
3295
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2561
3296
          for progfile in $progfiles; do
2562
 
            func_verbose "extracting global C symbols from \`$progfile'"
2563
 
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
 
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'"
2564
3300
          done
2565
3301
 
2566
3302
          if test -n "$exclude_expsyms"; then
2609
3345
          func_verbose "extracting global C symbols from \`$dlprefile'"
2610
3346
          func_basename "$dlprefile"
2611
3347
          name="$func_basename_result"
2612
 
          $opt_dry_run || {
2613
 
            eval '$ECHO ": $name " >> "$nlist"'
2614
 
            eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2615
 
          }
 
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
2616
3394
        done
2617
3395
 
2618
3396
        $opt_dry_run || {
2650
3428
  const char *name;
2651
3429
  void *address;
2652
3430
} 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
 
3431
extern LT_DLSYM_CONST lt_dlsymlist
2671
3432
lt_${my_prefix}_LTX_preloaded_symbols[];
2672
 
$lt_dlsym_const lt_dlsymlist
 
3433
LT_DLSYM_CONST lt_dlsymlist
2673
3434
lt_${my_prefix}_LTX_preloaded_symbols[] =
2674
3435
{\
2675
3436
  { \"$my_originator\", (void *) 0 },"
2725
3486
        for arg in $LTCFLAGS; do
2726
3487
          case $arg in
2727
3488
          -pie | -fpie | -fPIE) ;;
2728
 
          *) symtab_cflags="$symtab_cflags $arg" ;;
 
3489
          *) func_append symtab_cflags " $arg" ;;
2729
3490
          esac
2730
3491
        done
2731
3492
 
2788
3549
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2789
3550
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2790
3551
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
2791
 
      win32_nmres=`eval $NM -f posix -A $1 |
 
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\" |
2792
3554
        $SED -n -e '
2793
3555
            1,100{
2794
3556
                / I /{
2817
3579
  $ECHO "$win32_libid_type"
2818
3580
}
2819
3581
 
 
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
}
2820
3707
 
2821
3708
 
2822
3709
# func_extract_an_archive dir oldlib
3195
4082
 
3196
4083
  if test -f \"\$progdir/\$program\"; then"
3197
4084
 
 
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
 
3198
4097
        # Export our shlibpath_var if we have one.
3199
4098
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3200
4099
          $ECHO "\
3209
4108
"
3210
4109
        fi
3211
4110
 
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
 
 
3220
4111
        $ECHO "\
3221
4112
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3222
4113
      # Run the actual program with our arguments.
3234
4125
}
3235
4126
 
3236
4127
 
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
 
 
3397
4128
# func_emit_cwrapperexe_src
3398
4129
# emit the source code for a wrapper executable on stdout
3399
4130
# Must ONLY be called from within func_mode_link because
3563
4294
EOF
3564
4295
 
3565
4296
            cat <<EOF
3566
 
const char * MAGIC_EXE = "$magic_exe";
 
4297
volatile const char * MAGIC_EXE = "$magic_exe";
3567
4298
const char * LIB_PATH_VARNAME = "$shlibpath_var";
3568
4299
EOF
3569
4300
 
3570
4301
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3571
 
              func_to_host_pathlist "$temp_rpath"
 
4302
              func_to_host_path "$temp_rpath"
3572
4303
              cat <<EOF
3573
 
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4304
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
3574
4305
EOF
3575
4306
            else
3576
4307
              cat <<"EOF"
3579
4310
            fi
3580
4311
 
3581
4312
            if test -n "$dllsearchpath"; then
3582
 
              func_to_host_pathlist "$dllsearchpath:"
 
4313
              func_to_host_path "$dllsearchpath:"
3583
4314
              cat <<EOF
3584
4315
const char * EXE_PATH_VARNAME = "PATH";
3585
 
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4316
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
3586
4317
EOF
3587
4318
            else
3588
4319
              cat <<"EOF"
3765
4496
 
3766
4497
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3767
4498
  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. */
 
4503
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3768
4504
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3769
 
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3770
4505
 
3771
4506
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3772
4507
                  nonnull (lt_argv_zero));
4515
5250
            ;;
4516
5251
          *)
4517
5252
            if test "$prev" = dlfiles; then
4518
 
              dlfiles="$dlfiles $arg"
 
5253
              func_append dlfiles " $arg"
4519
5254
            else
4520
 
              dlprefiles="$dlprefiles $arg"
 
5255
              func_append dlprefiles " $arg"
4521
5256
            fi
4522
5257
            prev=
4523
5258
            continue
4541
5276
            *-*-darwin*)
4542
5277
              case "$deplibs " in
4543
5278
                *" $qarg.ltframework "*) ;;
4544
 
                *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
 
5279
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
4545
5280
                   ;;
4546
5281
              esac
4547
5282
              ;;
4560
5295
            moreargs=
4561
5296
            for fil in `cat "$save_arg"`
4562
5297
            do
4563
 
#             moreargs="$moreargs $fil"
 
5298
#             func_append moreargs " $fil"
4564
5299
              arg=$fil
4565
5300
              # A libtool-controlled object.
4566
5301
 
4589
5324
 
4590
5325
                  if test "$prev" = dlfiles; then
4591
5326
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4592
 
                      dlfiles="$dlfiles $pic_object"
 
5327
                      func_append dlfiles " $pic_object"
4593
5328
                      prev=
4594
5329
                      continue
4595
5330
                    else
4601
5336
                  # CHECK ME:  I think I busted this.  -Ossama
4602
5337
                  if test "$prev" = dlprefiles; then
4603
5338
                    # Preload the old-style object.
4604
 
                    dlprefiles="$dlprefiles $pic_object"
 
5339
                    func_append dlprefiles " $pic_object"
4605
5340
                    prev=
4606
5341
                  fi
4607
5342
 
4671
5406
          if test "$prev" = rpath; then
4672
5407
            case "$rpath " in
4673
5408
            *" $arg "*) ;;
4674
 
            *) rpath="$rpath $arg" ;;
 
5409
            *) func_append rpath " $arg" ;;
4675
5410
            esac
4676
5411
          else
4677
5412
            case "$xrpath " in
4678
5413
            *" $arg "*) ;;
4679
 
            *) xrpath="$xrpath $arg" ;;
 
5414
            *) func_append xrpath " $arg" ;;
4680
5415
            esac
4681
5416
          fi
4682
5417
          prev=
4688
5423
          continue
4689
5424
          ;;
4690
5425
        weak)
4691
 
          weak_libs="$weak_libs $arg"
 
5426
          func_append weak_libs " $arg"
4692
5427
          prev=
4693
5428
          continue
4694
5429
          ;;
4695
5430
        xcclinker)
4696
 
          linker_flags="$linker_flags $qarg"
4697
 
          compiler_flags="$compiler_flags $qarg"
 
5431
          func_append linker_flags " $qarg"
 
5432
          func_append compiler_flags " $qarg"
4698
5433
          prev=
4699
5434
          func_append compile_command " $qarg"
4700
5435
          func_append finalize_command " $qarg"
4701
5436
          continue
4702
5437
          ;;
4703
5438
        xcompiler)
4704
 
          compiler_flags="$compiler_flags $qarg"
 
5439
          func_append compiler_flags " $qarg"
4705
5440
          prev=
4706
5441
          func_append compile_command " $qarg"
4707
5442
          func_append finalize_command " $qarg"
4708
5443
          continue
4709
5444
          ;;
4710
5445
        xlinker)
4711
 
          linker_flags="$linker_flags $qarg"
4712
 
          compiler_flags="$compiler_flags $wl$qarg"
 
5446
          func_append linker_flags " $qarg"
 
5447
          func_append compiler_flags " $wl$qarg"
4713
5448
          prev=
4714
5449
          func_append compile_command " $wl$qarg"
4715
5450
          func_append finalize_command " $wl$qarg"
4800
5535
        ;;
4801
5536
 
4802
5537
      -L*)
4803
 
        func_stripname '-L' '' "$arg"
4804
 
        dir=$func_stripname_result
4805
 
        if test -z "$dir"; then
 
5538
        func_stripname "-L" '' "$arg"
 
5539
        if test -z "$func_stripname_result"; then
4806
5540
          if test "$#" -gt 0; then
4807
5541
            func_fatal_error "require no space between \`-L' and \`$1'"
4808
5542
          else
4809
5543
            func_fatal_error "need path for \`-L' option"
4810
5544
          fi
4811
5545
        fi
 
5546
        func_resolve_sysroot "$func_stripname_result"
 
5547
        dir=$func_resolve_sysroot_result
4812
5548
        # We need an absolute path.
4813
5549
        case $dir in
4814
5550
        [\\/]* | [A-Za-z]:[\\/]*) ;;
4820
5556
          ;;
4821
5557
        esac
4822
5558
        case "$deplibs " in
4823
 
        *" -L$dir "*) ;;
 
5559
        *" -L$dir "* | *" $arg "*)
 
5560
          # Will only happen for absolute or sysroot arguments
 
5561
          ;;
4824
5562
        *)
4825
 
          deplibs="$deplibs -L$dir"
4826
 
          lib_search_path="$lib_search_path $dir"
 
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"
4827
5569
          ;;
4828
5570
        esac
4829
5571
        case $host in
4832
5574
          case :$dllsearchpath: in
4833
5575
          *":$dir:"*) ;;
4834
5576
          ::) dllsearchpath=$dir;;
4835
 
          *) dllsearchpath="$dllsearchpath:$dir";;
 
5577
          *) func_append dllsearchpath ":$dir";;
4836
5578
          esac
4837
5579
          case :$dllsearchpath: in
4838
5580
          *":$testbindir:"*) ;;
4839
5581
          ::) dllsearchpath=$testbindir;;
4840
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
5582
          *) func_append dllsearchpath ":$testbindir";;
4841
5583
          esac
4842
5584
          ;;
4843
5585
        esac
4861
5603
            ;;
4862
5604
          *-*-rhapsody* | *-*-darwin1.[012])
4863
5605
            # Rhapsody C and math libraries are in the System framework
4864
 
            deplibs="$deplibs System.ltframework"
 
5606
            func_append deplibs " System.ltframework"
4865
5607
            continue
4866
5608
            ;;
4867
5609
          *-*-sco3.2v5* | *-*-sco5v6*)
4881
5623
           ;;
4882
5624
         esac
4883
5625
        fi
4884
 
        deplibs="$deplibs $arg"
 
5626
        func_append deplibs " $arg"
4885
5627
        continue
4886
5628
        ;;
4887
5629
 
4893
5635
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
4894
5636
      # classes, name mangling, and exception handling.
4895
5637
      # Darwin uses the -arch flag to determine output architecture.
4896
 
      -model|-arch|-isysroot)
4897
 
        compiler_flags="$compiler_flags $arg"
 
5638
      -model|-arch|-isysroot|--sysroot)
 
5639
        func_append compiler_flags " $arg"
4898
5640
        func_append compile_command " $arg"
4899
5641
        func_append finalize_command " $arg"
4900
5642
        prev=xcompiler
4902
5644
        ;;
4903
5645
 
4904
5646
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4905
 
        compiler_flags="$compiler_flags $arg"
 
5647
        func_append compiler_flags " $arg"
4906
5648
        func_append compile_command " $arg"
4907
5649
        func_append finalize_command " $arg"
4908
5650
        case "$new_inherited_linker_flags " in
4909
5651
            *" $arg "*) ;;
4910
 
            * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
 
5652
            * ) func_append new_inherited_linker_flags " $arg" ;;
4911
5653
        esac
4912
5654
        continue
4913
5655
        ;;
4974
5716
        # We need an absolute path.
4975
5717
        case $dir in
4976
5718
        [\\/]* | [A-Za-z]:[\\/]*) ;;
 
5719
        =*)
 
5720
          func_stripname '=' '' "$dir"
 
5721
          dir=$lt_sysroot$func_stripname_result
 
5722
          ;;
4977
5723
        *)
4978
5724
          func_fatal_error "only absolute run-paths are allowed"
4979
5725
          ;;
4980
5726
        esac
4981
5727
        case "$xrpath " in
4982
5728
        *" $dir "*) ;;
4983
 
        *) xrpath="$xrpath $dir" ;;
 
5729
        *) func_append xrpath " $dir" ;;
4984
5730
        esac
4985
5731
        continue
4986
5732
        ;;
5033
5779
        for flag in $args; do
5034
5780
          IFS="$save_ifs"
5035
5781
          func_quote_for_eval "$flag"
5036
 
          arg="$arg $func_quote_for_eval_result"
5037
 
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
 
5782
          func_append arg " $func_quote_for_eval_result"
 
5783
          func_append compiler_flags " $func_quote_for_eval_result"
5038
5784
        done
5039
5785
        IFS="$save_ifs"
5040
5786
        func_stripname ' ' '' "$arg"
5049
5795
        for flag in $args; do
5050
5796
          IFS="$save_ifs"
5051
5797
          func_quote_for_eval "$flag"
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"
 
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"
5055
5801
        done
5056
5802
        IFS="$save_ifs"
5057
5803
        func_stripname ' ' '' "$arg"
5090
5836
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
5091
5837
      # @file                GCC response files
5092
5838
      # -tp=*                Portland pgcc target processor selection
 
5839
      # --sysroot=*          for sysroot support
 
5840
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5093
5841
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5094
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
 
5842
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
 
5843
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5095
5844
        func_quote_for_eval "$arg"
5096
5845
        arg="$func_quote_for_eval_result"
5097
5846
        func_append compile_command " $arg"
5098
5847
        func_append finalize_command " $arg"
5099
 
        compiler_flags="$compiler_flags $arg"
 
5848
        func_append compiler_flags " $arg"
5100
5849
        continue
5101
5850
        ;;
5102
5851
 
5108
5857
 
5109
5858
      *.$objext)
5110
5859
        # A standard object.
5111
 
        objs="$objs $arg"
 
5860
        func_append objs " $arg"
5112
5861
        ;;
5113
5862
 
5114
5863
      *.lo)
5139
5888
 
5140
5889
            if test "$prev" = dlfiles; then
5141
5890
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5142
 
                dlfiles="$dlfiles $pic_object"
 
5891
                func_append dlfiles " $pic_object"
5143
5892
                prev=
5144
5893
                continue
5145
5894
              else
5151
5900
            # CHECK ME:  I think I busted this.  -Ossama
5152
5901
            if test "$prev" = dlprefiles; then
5153
5902
              # Preload the old-style object.
5154
 
              dlprefiles="$dlprefiles $pic_object"
 
5903
              func_append dlprefiles " $pic_object"
5155
5904
              prev=
5156
5905
            fi
5157
5906
 
5196
5945
 
5197
5946
      *.$libext)
5198
5947
        # An archive.
5199
 
        deplibs="$deplibs $arg"
5200
 
        old_deplibs="$old_deplibs $arg"
 
5948
        func_append deplibs " $arg"
 
5949
        func_append old_deplibs " $arg"
5201
5950
        continue
5202
5951
        ;;
5203
5952
 
5204
5953
      *.la)
5205
5954
        # A libtool-controlled library.
5206
5955
 
 
5956
        func_resolve_sysroot "$arg"
5207
5957
        if test "$prev" = dlfiles; then
5208
5958
          # This library was specified with -dlopen.
5209
 
          dlfiles="$dlfiles $arg"
 
5959
          func_append dlfiles " $func_resolve_sysroot_result"
5210
5960
          prev=
5211
5961
        elif test "$prev" = dlprefiles; then
5212
5962
          # The library was specified with -dlpreopen.
5213
 
          dlprefiles="$dlprefiles $arg"
 
5963
          func_append dlprefiles " $func_resolve_sysroot_result"
5214
5964
          prev=
5215
5965
        else
5216
 
          deplibs="$deplibs $arg"
 
5966
          func_append deplibs " $func_resolve_sysroot_result"
5217
5967
        fi
5218
5968
        continue
5219
5969
        ;;
5260
6010
 
5261
6011
    func_dirname "$output" "/" ""
5262
6012
    output_objdir="$func_dirname_result$objdir"
 
6013
    func_to_tool_file "$output_objdir/"
 
6014
    tool_output_objdir=$func_to_tool_file_result
5263
6015
    # Create the object directory.
5264
6016
    func_mkdir_p "$output_objdir"
5265
6017
 
5280
6032
    # Find all interdependent deplibs by searching for libraries
5281
6033
    # that are linked more than once (e.g. -la -lb -la)
5282
6034
    for deplib in $deplibs; do
5283
 
      if $opt_duplicate_deps ; then
 
6035
      if $opt_preserve_dup_deps ; then
5284
6036
        case "$libs " in
5285
 
        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6037
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5286
6038
        esac
5287
6039
      fi
5288
 
      libs="$libs $deplib"
 
6040
      func_append libs " $deplib"
5289
6041
    done
5290
6042
 
5291
6043
    if test "$linkmode" = lib; then
5298
6050
      if $opt_duplicate_compiler_generated_deps; then
5299
6051
        for pre_post_dep in $predeps $postdeps; do
5300
6052
          case "$pre_post_deps " in
5301
 
          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
 
6053
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
5302
6054
          esac
5303
 
          pre_post_deps="$pre_post_deps $pre_post_dep"
 
6055
          func_append pre_post_deps " $pre_post_dep"
5304
6056
        done
5305
6057
      fi
5306
6058
      pre_post_deps=
5367
6119
        for lib in $dlprefiles; do
5368
6120
          # Ignore non-libtool-libs
5369
6121
          dependency_libs=
 
6122
          func_resolve_sysroot "$lib"
5370
6123
          case $lib in
5371
 
          *.la) func_source "$lib" ;;
 
6124
          *.la) func_source "$func_resolve_sysroot_result" ;;
5372
6125
          esac
5373
6126
 
5374
6127
          # Collect preopened libtool deplibs, except any this library
5378
6131
            deplib_base=$func_basename_result
5379
6132
            case " $weak_libs " in
5380
6133
            *" $deplib_base "*) ;;
5381
 
            *) deplibs="$deplibs $deplib" ;;
 
6134
            *) func_append deplibs " $deplib" ;;
5382
6135
            esac
5383
6136
          done
5384
6137
        done
5399
6152
            compile_deplibs="$deplib $compile_deplibs"
5400
6153
            finalize_deplibs="$deplib $finalize_deplibs"
5401
6154
          else
5402
 
            compiler_flags="$compiler_flags $deplib"
 
6155
            func_append compiler_flags " $deplib"
5403
6156
            if test "$linkmode" = lib ; then
5404
6157
                case "$new_inherited_linker_flags " in
5405
6158
                    *" $deplib "*) ;;
5406
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6159
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5407
6160
                esac
5408
6161
            fi
5409
6162
          fi
5488
6241
            if test "$linkmode" = lib ; then
5489
6242
                case "$new_inherited_linker_flags " in
5490
6243
                    *" $deplib "*) ;;
5491
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6244
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5492
6245
                esac
5493
6246
            fi
5494
6247
          fi
5501
6254
            test "$pass" = conv && continue
5502
6255
            newdependency_libs="$deplib $newdependency_libs"
5503
6256
            func_stripname '-L' '' "$deplib"
5504
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6257
            func_resolve_sysroot "$func_stripname_result"
 
6258
            func_append newlib_search_path " $func_resolve_sysroot_result"
5505
6259
            ;;
5506
6260
          prog)
5507
6261
            if test "$pass" = conv; then
5515
6269
              finalize_deplibs="$deplib $finalize_deplibs"
5516
6270
            fi
5517
6271
            func_stripname '-L' '' "$deplib"
5518
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6272
            func_resolve_sysroot "$func_stripname_result"
 
6273
            func_append newlib_search_path " $func_resolve_sysroot_result"
5519
6274
            ;;
5520
6275
          *)
5521
6276
            func_warning "\`-L' is ignored for archives/objects"
5526
6281
        -R*)
5527
6282
          if test "$pass" = link; then
5528
6283
            func_stripname '-R' '' "$deplib"
5529
 
            dir=$func_stripname_result
 
6284
            func_resolve_sysroot "$func_stripname_result"
 
6285
            dir=$func_resolve_sysroot_result
5530
6286
            # Make sure the xrpath contains only unique directories.
5531
6287
            case "$xrpath " in
5532
6288
            *" $dir "*) ;;
5533
 
            *) xrpath="$xrpath $dir" ;;
 
6289
            *) func_append xrpath " $dir" ;;
5534
6290
            esac
5535
6291
          fi
5536
6292
          deplibs="$deplib $deplibs"
5537
6293
          continue
5538
6294
          ;;
5539
 
        *.la) lib="$deplib" ;;
 
6295
        *.la)
 
6296
          func_resolve_sysroot "$deplib"
 
6297
          lib=$func_resolve_sysroot_result
 
6298
          ;;
5540
6299
        *.$libext)
5541
6300
          if test "$pass" = conv; then
5542
6301
            deplibs="$deplib $deplibs"
5599
6358
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5600
6359
              # If there is no dlopen support or we're linking statically,
5601
6360
              # we need to preload.
5602
 
              newdlprefiles="$newdlprefiles $deplib"
 
6361
              func_append newdlprefiles " $deplib"
5603
6362
              compile_deplibs="$deplib $compile_deplibs"
5604
6363
              finalize_deplibs="$deplib $finalize_deplibs"
5605
6364
            else
5606
 
              newdlfiles="$newdlfiles $deplib"
 
6365
              func_append newdlfiles " $deplib"
5607
6366
            fi
5608
6367
          fi
5609
6368
          continue
5649
6408
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5650
6409
            case " $new_inherited_linker_flags " in
5651
6410
              *" $tmp_inherited_linker_flag "*) ;;
5652
 
              *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
 
6411
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
5653
6412
            esac
5654
6413
          done
5655
6414
        fi
5657
6416
        if test "$linkmode,$pass" = "lib,link" ||
5658
6417
           test "$linkmode,$pass" = "prog,scan" ||
5659
6418
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5660
 
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5661
 
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
 
6419
          test -n "$dlopen" && func_append dlfiles " $dlopen"
 
6420
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
5662
6421
        fi
5663
6422
 
5664
6423
        if test "$pass" = conv; then
5669
6428
              func_fatal_error "cannot find name of link library for \`$lib'"
5670
6429
            fi
5671
6430
            # It is a libtool convenience library, so add in its objects.
5672
 
            convenience="$convenience $ladir/$objdir/$old_library"
5673
 
            old_convenience="$old_convenience $ladir/$objdir/$old_library"
 
6431
            func_append convenience " $ladir/$objdir/$old_library"
 
6432
            func_append old_convenience " $ladir/$objdir/$old_library"
5674
6433
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
5675
6434
            func_fatal_error "\`$lib' is not a convenience library"
5676
6435
          fi
5677
6436
          tmp_libs=
5678
6437
          for deplib in $dependency_libs; do
5679
6438
            deplibs="$deplib $deplibs"
5680
 
            if $opt_duplicate_deps ; then
 
6439
            if $opt_preserve_dup_deps ; then
5681
6440
              case "$tmp_libs " in
5682
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6441
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5683
6442
              esac
5684
6443
            fi
5685
 
            tmp_libs="$tmp_libs $deplib"
 
6444
            func_append tmp_libs " $deplib"
5686
6445
          done
5687
6446
          continue
5688
6447
        fi # $pass = conv
5690
6449
 
5691
6450
        # Get the name of the library we link against.
5692
6451
        linklib=
5693
 
        for l in $old_library $library_names; do
5694
 
          linklib="$l"
5695
 
        done
 
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
5696
6461
        if test -z "$linklib"; then
5697
6462
          func_fatal_error "cannot find name of link library for \`$lib'"
5698
6463
        fi
5709
6474
            # statically, we need to preload.  We also need to preload any
5710
6475
            # dependent libraries so libltdl's deplib preloader doesn't
5711
6476
            # bomb out in the load deplibs phase.
5712
 
            dlprefiles="$dlprefiles $lib $dependency_libs"
 
6477
            func_append dlprefiles " $lib $dependency_libs"
5713
6478
          else
5714
 
            newdlfiles="$newdlfiles $lib"
 
6479
            func_append newdlfiles " $lib"
5715
6480
          fi
5716
6481
          continue
5717
6482
        fi # $pass = dlopen
5733
6498
 
5734
6499
        # Find the relevant object directory and library name.
5735
6500
        if test "X$installed" = Xyes; then
5736
 
          if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
6501
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5737
6502
            func_warning "library \`$lib' was moved."
5738
6503
            dir="$ladir"
5739
6504
            absdir="$abs_ladir"
5740
6505
            libdir="$abs_ladir"
5741
6506
          else
5742
 
            dir="$libdir"
5743
 
            absdir="$libdir"
 
6507
            dir="$lt_sysroot$libdir"
 
6508
            absdir="$lt_sysroot$libdir"
5744
6509
          fi
5745
6510
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5746
6511
        else
5748
6513
            dir="$ladir"
5749
6514
            absdir="$abs_ladir"
5750
6515
            # Remove this search path later
5751
 
            notinst_path="$notinst_path $abs_ladir"
 
6516
            func_append notinst_path " $abs_ladir"
5752
6517
          else
5753
6518
            dir="$ladir/$objdir"
5754
6519
            absdir="$abs_ladir/$objdir"
5755
6520
            # Remove this search path later
5756
 
            notinst_path="$notinst_path $abs_ladir"
 
6521
            func_append notinst_path " $abs_ladir"
5757
6522
          fi
5758
6523
        fi # $installed = yes
5759
6524
        func_stripname 'lib' '.la' "$laname"
5764
6529
          if test -z "$libdir" && test "$linkmode" = prog; then
5765
6530
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5766
6531
          fi
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
 
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
5781
6572
        fi # $pass = dlpreopen
5782
6573
 
5783
6574
        if test -z "$libdir"; then
5795
6586
 
5796
6587
 
5797
6588
        if test "$linkmode" = prog && test "$pass" != link; then
5798
 
          newlib_search_path="$newlib_search_path $ladir"
 
6589
          func_append newlib_search_path " $ladir"
5799
6590
          deplibs="$lib $deplibs"
5800
6591
 
5801
6592
          linkalldeplibs=no
5808
6599
          for deplib in $dependency_libs; do
5809
6600
            case $deplib in
5810
6601
            -L*) func_stripname '-L' '' "$deplib"
5811
 
                 newlib_search_path="$newlib_search_path $func_stripname_result"
 
6602
                 func_resolve_sysroot "$func_stripname_result"
 
6603
                 func_append newlib_search_path " $func_resolve_sysroot_result"
5812
6604
                 ;;
5813
6605
            esac
5814
6606
            # Need to link against all dependency_libs?
5819
6611
              # or/and link against static libraries
5820
6612
              newdependency_libs="$deplib $newdependency_libs"
5821
6613
            fi
5822
 
            if $opt_duplicate_deps ; then
 
6614
            if $opt_preserve_dup_deps ; then
5823
6615
              case "$tmp_libs " in
5824
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6616
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5825
6617
              esac
5826
6618
            fi
5827
 
            tmp_libs="$tmp_libs $deplib"
 
6619
            func_append tmp_libs " $deplib"
5828
6620
          done # for deplib
5829
6621
          continue
5830
6622
        fi # $linkmode = prog...
5839
6631
              # Make sure the rpath contains only unique directories.
5840
6632
              case "$temp_rpath:" in
5841
6633
              *"$absdir:"*) ;;
5842
 
              *) temp_rpath="$temp_rpath$absdir:" ;;
 
6634
              *) func_append temp_rpath "$absdir:" ;;
5843
6635
              esac
5844
6636
            fi
5845
6637
 
5851
6643
            *)
5852
6644
              case "$compile_rpath " in
5853
6645
              *" $absdir "*) ;;
5854
 
              *) compile_rpath="$compile_rpath $absdir"
 
6646
              *) func_append compile_rpath " $absdir" ;;
5855
6647
              esac
5856
6648
              ;;
5857
6649
            esac
5860
6652
            *)
5861
6653
              case "$finalize_rpath " in
5862
6654
              *" $libdir "*) ;;
5863
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6655
              *) func_append finalize_rpath " $libdir" ;;
5864
6656
              esac
5865
6657
              ;;
5866
6658
            esac
5885
6677
          case $host in
5886
6678
          *cygwin* | *mingw* | *cegcc*)
5887
6679
              # No point in relinking DLLs because paths are not encoded
5888
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6680
              func_append notinst_deplibs " $lib"
5889
6681
              need_relink=no
5890
6682
            ;;
5891
6683
          *)
5892
6684
            if test "$installed" = no; then
5893
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6685
              func_append notinst_deplibs " $lib"
5894
6686
              need_relink=yes
5895
6687
            fi
5896
6688
            ;;
5925
6717
            *)
5926
6718
              case "$compile_rpath " in
5927
6719
              *" $absdir "*) ;;
5928
 
              *) compile_rpath="$compile_rpath $absdir"
 
6720
              *) func_append compile_rpath " $absdir" ;;
5929
6721
              esac
5930
6722
              ;;
5931
6723
            esac
5934
6726
            *)
5935
6727
              case "$finalize_rpath " in
5936
6728
              *" $libdir "*) ;;
5937
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6729
              *) func_append finalize_rpath " $libdir" ;;
5938
6730
              esac
5939
6731
              ;;
5940
6732
            esac
5988
6780
            linklib=$newlib
5989
6781
          fi # test -n "$old_archive_from_expsyms_cmds"
5990
6782
 
5991
 
          if test "$linkmode" = prog || test "$mode" != relink; then
 
6783
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
5992
6784
            add_shlibpath=
5993
6785
            add_dir=
5994
6786
            add=
6044
6836
                if test -n "$inst_prefix_dir"; then
6045
6837
                  case $libdir in
6046
6838
                    [\\/]*)
6047
 
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6839
                      func_append add_dir " -L$inst_prefix_dir$libdir"
6048
6840
                      ;;
6049
6841
                  esac
6050
6842
                fi
6066
6858
            if test -n "$add_shlibpath"; then
6067
6859
              case :$compile_shlibpath: in
6068
6860
              *":$add_shlibpath:"*) ;;
6069
 
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
 
6861
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
6070
6862
              esac
6071
6863
            fi
6072
6864
            if test "$linkmode" = prog; then
6080
6872
                 test "$hardcode_shlibpath_var" = yes; then
6081
6873
                case :$finalize_shlibpath: in
6082
6874
                *":$libdir:"*) ;;
6083
 
                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6875
                *) func_append finalize_shlibpath "$libdir:" ;;
6084
6876
                esac
6085
6877
              fi
6086
6878
            fi
6087
6879
          fi
6088
6880
 
6089
 
          if test "$linkmode" = prog || test "$mode" = relink; then
 
6881
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
6090
6882
            add_shlibpath=
6091
6883
            add_dir=
6092
6884
            add=
6100
6892
            elif test "$hardcode_shlibpath_var" = yes; then
6101
6893
              case :$finalize_shlibpath: in
6102
6894
              *":$libdir:"*) ;;
6103
 
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6895
              *) func_append finalize_shlibpath "$libdir:" ;;
6104
6896
              esac
6105
6897
              add="-l$name"
6106
6898
            elif test "$hardcode_automatic" = yes; then
6117
6909
              if test -n "$inst_prefix_dir"; then
6118
6910
                case $libdir in
6119
6911
                  [\\/]*)
6120
 
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6912
                    func_append add_dir " -L$inst_prefix_dir$libdir"
6121
6913
                    ;;
6122
6914
                esac
6123
6915
              fi
6194
6986
                   temp_xrpath=$func_stripname_result
6195
6987
                   case " $xrpath " in
6196
6988
                   *" $temp_xrpath "*) ;;
6197
 
                   *) xrpath="$xrpath $temp_xrpath";;
 
6989
                   *) func_append xrpath " $temp_xrpath";;
6198
6990
                   esac;;
6199
 
              *) temp_deplibs="$temp_deplibs $libdir";;
 
6991
              *) func_append temp_deplibs " $libdir";;
6200
6992
              esac
6201
6993
            done
6202
6994
            dependency_libs="$temp_deplibs"
6203
6995
          fi
6204
6996
 
6205
 
          newlib_search_path="$newlib_search_path $absdir"
 
6997
          func_append newlib_search_path " $absdir"
6206
6998
          # Link against this library
6207
6999
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6208
7000
          # ... and its dependency_libs
6209
7001
          tmp_libs=
6210
7002
          for deplib in $dependency_libs; do
6211
7003
            newdependency_libs="$deplib $newdependency_libs"
6212
 
            if $opt_duplicate_deps ; then
 
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
6213
7010
              case "$tmp_libs " in
6214
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
7011
              *" $func_resolve_sysroot_result "*)
 
7012
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
6215
7013
              esac
6216
7014
            fi
6217
 
            tmp_libs="$tmp_libs $deplib"
 
7015
            func_append tmp_libs " $func_resolve_sysroot_result"
6218
7016
          done
6219
7017
 
6220
7018
          if test "$link_all_deplibs" != no; then
6224
7022
              case $deplib in
6225
7023
              -L*) path="$deplib" ;;
6226
7024
              *.la)
 
7025
                func_resolve_sysroot "$deplib"
 
7026
                deplib=$func_resolve_sysroot_result
6227
7027
                func_dirname "$deplib" "" "."
6228
 
                dir="$func_dirname_result"
 
7028
                dir=$func_dirname_result
6229
7029
                # We need an absolute path.
6230
7030
                case $dir in
6231
7031
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6252
7052
                      if test -z "$darwin_install_name"; then
6253
7053
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
6254
7054
                      fi
6255
 
                      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
6256
 
                      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
 
7055
                      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
 
7056
                      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
6257
7057
                      path=
6258
7058
                    fi
6259
7059
                  fi
6303
7103
          for dir in $newlib_search_path; do
6304
7104
            case "$lib_search_path " in
6305
7105
            *" $dir "*) ;;
6306
 
            *) lib_search_path="$lib_search_path $dir" ;;
 
7106
            *) func_append lib_search_path " $dir" ;;
6307
7107
            esac
6308
7108
          done
6309
7109
          newlib_search_path=
6361
7161
            -L*)
6362
7162
              case " $tmp_libs " in
6363
7163
              *" $deplib "*) ;;
6364
 
              *) tmp_libs="$tmp_libs $deplib" ;;
 
7164
              *) func_append tmp_libs " $deplib" ;;
6365
7165
              esac
6366
7166
              ;;
6367
 
            *) tmp_libs="$tmp_libs $deplib" ;;
 
7167
            *) func_append tmp_libs " $deplib" ;;
6368
7168
            esac
6369
7169
          done
6370
7170
          eval $var=\"$tmp_libs\"
6380
7180
          ;;
6381
7181
        esac
6382
7182
        if test -n "$i" ; then
6383
 
          tmp_libs="$tmp_libs $i"
 
7183
          func_append tmp_libs " $i"
6384
7184
        fi
6385
7185
      done
6386
7186
      dependency_libs=$tmp_libs
6421
7221
      # Now set the variables for building old libraries.
6422
7222
      build_libtool_libs=no
6423
7223
      oldlibs="$output"
6424
 
      objs="$objs$old_deplibs"
 
7224
      func_append objs "$old_deplibs"
6425
7225
      ;;
6426
7226
 
6427
7227
    lib)
6457
7257
          echo
6458
7258
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6459
7259
          $ECHO "*** objects $objs is not portable!"
6460
 
          libobjs="$libobjs $objs"
 
7260
          func_append libobjs " $objs"
6461
7261
        fi
6462
7262
      fi
6463
7263
 
6655
7455
          done
6656
7456
 
6657
7457
          # Make executables depend on our current version.
6658
 
          verstring="$verstring:${current}.0"
 
7458
          func_append verstring ":${current}.0"
6659
7459
          ;;
6660
7460
 
6661
7461
        qnx)
6723
7523
      fi
6724
7524
 
6725
7525
      func_generate_dlsyms "$libname" "$libname" "yes"
6726
 
      libobjs="$libobjs $symfileobj"
 
7526
      func_append libobjs " $symfileobj"
6727
7527
      test "X$libobjs" = "X " && libobjs=
6728
7528
 
6729
 
      if test "$mode" != relink; then
 
7529
      if test "$opt_mode" != relink; then
6730
7530
        # Remove our outputs, but don't remove object files since they
6731
7531
        # may have been created when compiling PIC objects.
6732
7532
        removelist=
6742
7542
                   continue
6743
7543
                 fi
6744
7544
               fi
6745
 
               removelist="$removelist $p"
 
7545
               func_append removelist " $p"
6746
7546
               ;;
6747
7547
            *) ;;
6748
7548
          esac
6753
7553
 
6754
7554
      # Now set the variables for building old libraries.
6755
7555
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6756
 
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
7556
        func_append oldlibs " $output_objdir/$libname.$libext"
6757
7557
 
6758
7558
        # Transform .lo files to .o files.
6759
7559
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6770
7570
        # If the user specified any rpath flags, then add them.
6771
7571
        temp_xrpath=
6772
7572
        for libdir in $xrpath; do
6773
 
          temp_xrpath="$temp_xrpath -R$libdir"
 
7573
          func_replace_sysroot "$libdir"
 
7574
          func_append temp_xrpath " -R$func_replace_sysroot_result"
6774
7575
          case "$finalize_rpath " in
6775
7576
          *" $libdir "*) ;;
6776
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
7577
          *) func_append finalize_rpath " $libdir" ;;
6777
7578
          esac
6778
7579
        done
6779
7580
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6787
7588
      for lib in $old_dlfiles; do
6788
7589
        case " $dlprefiles $dlfiles " in
6789
7590
        *" $lib "*) ;;
6790
 
        *) dlfiles="$dlfiles $lib" ;;
 
7591
        *) func_append dlfiles " $lib" ;;
6791
7592
        esac
6792
7593
      done
6793
7594
 
6797
7598
      for lib in $old_dlprefiles; do
6798
7599
        case "$dlprefiles " in
6799
7600
        *" $lib "*) ;;
6800
 
        *) dlprefiles="$dlprefiles $lib" ;;
 
7601
        *) func_append dlprefiles " $lib" ;;
6801
7602
        esac
6802
7603
      done
6803
7604
 
6809
7610
            ;;
6810
7611
          *-*-rhapsody* | *-*-darwin1.[012])
6811
7612
            # Rhapsody C library is in the System framework
6812
 
            deplibs="$deplibs System.ltframework"
 
7613
            func_append deplibs " System.ltframework"
6813
7614
            ;;
6814
7615
          *-*-netbsd*)
6815
7616
            # Don't link with libc until the a.out ld.so is fixed.
6826
7627
          *)
6827
7628
            # Add libc to deplibs on all other systems if necessary.
6828
7629
            if test "$build_libtool_need_lc" = "yes"; then
6829
 
              deplibs="$deplibs -lc"
 
7630
              func_append deplibs " -lc"
6830
7631
            fi
6831
7632
            ;;
6832
7633
          esac
6875
7676
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6876
7677
                  case " $predeps $postdeps " in
6877
7678
                  *" $i "*)
6878
 
                    newdeplibs="$newdeplibs $i"
 
7679
                    func_append newdeplibs " $i"
6879
7680
                    i=""
6880
7681
                    ;;
6881
7682
                  esac
6886
7687
                  set dummy $deplib_matches; shift
6887
7688
                  deplib_match=$1
6888
7689
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6889
 
                    newdeplibs="$newdeplibs $i"
 
7690
                    func_append newdeplibs " $i"
6890
7691
                  else
6891
7692
                    droppeddeps=yes
6892
7693
                    echo
6900
7701
                fi
6901
7702
                ;;
6902
7703
              *)
6903
 
                newdeplibs="$newdeplibs $i"
 
7704
                func_append newdeplibs " $i"
6904
7705
                ;;
6905
7706
              esac
6906
7707
            done
6918
7719
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6919
7720
                    case " $predeps $postdeps " in
6920
7721
                    *" $i "*)
6921
 
                      newdeplibs="$newdeplibs $i"
 
7722
                      func_append newdeplibs " $i"
6922
7723
                      i=""
6923
7724
                      ;;
6924
7725
                    esac
6929
7730
                    set dummy $deplib_matches; shift
6930
7731
                    deplib_match=$1
6931
7732
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6932
 
                      newdeplibs="$newdeplibs $i"
 
7733
                      func_append newdeplibs " $i"
6933
7734
                    else
6934
7735
                      droppeddeps=yes
6935
7736
                      echo
6951
7752
                fi
6952
7753
                ;;
6953
7754
              *)
6954
 
                newdeplibs="$newdeplibs $i"
 
7755
                func_append newdeplibs " $i"
6955
7756
                ;;
6956
7757
              esac
6957
7758
            done
6968
7769
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6969
7770
                case " $predeps $postdeps " in
6970
7771
                *" $a_deplib "*)
6971
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7772
                  func_append newdeplibs " $a_deplib"
6972
7773
                  a_deplib=""
6973
7774
                  ;;
6974
7775
                esac
6975
7776
              fi
6976
7777
              if test -n "$a_deplib" ; then
6977
7778
                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`
6978
7785
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6979
 
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 
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
6980
7793
                  for potent_lib in $potential_libs; do
6981
7794
                      # Follow soft links.
6982
7795
                      if ls -lLd "$potent_lib" 2>/dev/null |
6999
7812
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7000
7813
                         $SED -e 10q |
7001
7814
                         $EGREP "$file_magic_regex" > /dev/null; then
7002
 
                        newdeplibs="$newdeplibs $a_deplib"
 
7815
                        func_append newdeplibs " $a_deplib"
7003
7816
                        a_deplib=""
7004
7817
                        break 2
7005
7818
                      fi
7024
7837
              ;;
7025
7838
            *)
7026
7839
              # Add a -L argument.
7027
 
              newdeplibs="$newdeplibs $a_deplib"
 
7840
              func_append newdeplibs " $a_deplib"
7028
7841
              ;;
7029
7842
            esac
7030
7843
          done # Gone through all deplibs.
7040
7853
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7041
7854
                case " $predeps $postdeps " in
7042
7855
                *" $a_deplib "*)
7043
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7856
                  func_append newdeplibs " $a_deplib"
7044
7857
                  a_deplib=""
7045
7858
                  ;;
7046
7859
                esac
7053
7866
                    potlib="$potent_lib" # see symlink-check above in file_magic test
7054
7867
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7055
7868
                       $EGREP "$match_pattern_regex" > /dev/null; then
7056
 
                      newdeplibs="$newdeplibs $a_deplib"
 
7869
                      func_append newdeplibs " $a_deplib"
7057
7870
                      a_deplib=""
7058
7871
                      break 2
7059
7872
                    fi
7078
7891
              ;;
7079
7892
            *)
7080
7893
              # Add a -L argument.
7081
 
              newdeplibs="$newdeplibs $a_deplib"
 
7894
              func_append newdeplibs " $a_deplib"
7082
7895
              ;;
7083
7896
            esac
7084
7897
          done # Gone through all deplibs.
7182
7995
        *)
7183
7996
          case " $deplibs " in
7184
7997
          *" -L$path/$objdir "*)
7185
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
7998
            func_append new_libs " -L$path/$objdir" ;;
7186
7999
          esac
7187
8000
          ;;
7188
8001
        esac
7192
8005
        -L*)
7193
8006
          case " $new_libs " in
7194
8007
          *" $deplib "*) ;;
7195
 
          *) new_libs="$new_libs $deplib" ;;
 
8008
          *) func_append new_libs " $deplib" ;;
7196
8009
          esac
7197
8010
          ;;
7198
 
        *) new_libs="$new_libs $deplib" ;;
 
8011
        *) func_append new_libs " $deplib" ;;
7199
8012
        esac
7200
8013
      done
7201
8014
      deplibs="$new_libs"
7212
8025
          hardcode_libdirs=
7213
8026
          dep_rpath=
7214
8027
          rpath="$finalize_rpath"
7215
 
          test "$mode" != relink && rpath="$compile_rpath$rpath"
 
8028
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
7216
8029
          for libdir in $rpath; do
7217
8030
            if test -n "$hardcode_libdir_flag_spec"; then
7218
8031
              if test -n "$hardcode_libdir_separator"; then
 
8032
                func_replace_sysroot "$libdir"
 
8033
                libdir=$func_replace_sysroot_result
7219
8034
                if test -z "$hardcode_libdirs"; then
7220
8035
                  hardcode_libdirs="$libdir"
7221
8036
                else
7224
8039
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7225
8040
                    ;;
7226
8041
                  *)
7227
 
                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8042
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7228
8043
                    ;;
7229
8044
                  esac
7230
8045
                fi
7231
8046
              else
7232
8047
                eval flag=\"$hardcode_libdir_flag_spec\"
7233
 
                dep_rpath="$dep_rpath $flag"
 
8048
                func_append dep_rpath " $flag"
7234
8049
              fi
7235
8050
            elif test -n "$runpath_var"; then
7236
8051
              case "$perm_rpath " in
7237
8052
              *" $libdir "*) ;;
7238
 
              *) perm_rpath="$perm_rpath $libdir" ;;
 
8053
              *) func_apped perm_rpath " $libdir" ;;
7239
8054
              esac
7240
8055
            fi
7241
8056
          done
7253
8068
            # We should set the runpath_var.
7254
8069
            rpath=
7255
8070
            for dir in $perm_rpath; do
7256
 
              rpath="$rpath$dir:"
 
8071
              func_append rpath "$dir:"
7257
8072
            done
7258
8073
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7259
8074
          fi
7261
8076
        fi
7262
8077
 
7263
8078
        shlibpath="$finalize_shlibpath"
7264
 
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 
8079
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7265
8080
        if test -n "$shlibpath"; then
7266
8081
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7267
8082
        fi
7287
8102
        linknames=
7288
8103
        for link
7289
8104
        do
7290
 
          linknames="$linknames $link"
 
8105
          func_append linknames " $link"
7291
8106
        done
7292
8107
 
7293
8108
        # Use standard objects if they are pic
7298
8113
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7299
8114
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7300
8115
          export_symbols="$output_objdir/$libname.uexp"
7301
 
          delfiles="$delfiles $export_symbols"
 
8116
          func_append delfiles " $export_symbols"
7302
8117
        fi
7303
8118
 
7304
8119
        orig_export_symbols=
7329
8144
            $opt_dry_run || $RM $export_symbols
7330
8145
            cmds=$export_symbols_cmds
7331
8146
            save_ifs="$IFS"; IFS='~'
7332
 
            for cmd in $cmds; do
 
8147
            for cmd1 in $cmds; do
7333
8148
              IFS="$save_ifs"
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 $?'
 
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
7339
8186
                skipped_export=false
7340
8187
              else
7341
8188
                # The command line is too long to execute in one step.
7369
8216
          # global variables. join(1) would be nice here, but unfortunately
7370
8217
          # isn't a blessed tool.
7371
8218
          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7372
 
          delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
 
8219
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7373
8220
          export_symbols=$output_objdir/$libname.def
7374
8221
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7375
8222
        fi
7379
8226
          case " $convenience " in
7380
8227
          *" $test_deplib "*) ;;
7381
8228
          *)
7382
 
            tmp_deplibs="$tmp_deplibs $test_deplib"
 
8229
            func_append tmp_deplibs " $test_deplib"
7383
8230
            ;;
7384
8231
          esac
7385
8232
        done
7399
8246
            test "X$libobjs" = "X " && libobjs=
7400
8247
          else
7401
8248
            gentop="$output_objdir/${outputname}x"
7402
 
            generated="$generated $gentop"
 
8249
            func_append generated " $gentop"
7403
8250
 
7404
8251
            func_extract_archives $gentop $convenience
7405
 
            libobjs="$libobjs $func_extract_archives_result"
 
8252
            func_append libobjs " $func_extract_archives_result"
7406
8253
            test "X$libobjs" = "X " && libobjs=
7407
8254
          fi
7408
8255
        fi
7409
8256
 
7410
8257
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7411
8258
          eval flag=\"$thread_safe_flag_spec\"
7412
 
          linker_flags="$linker_flags $flag"
 
8259
          func_append linker_flags " $flag"
7413
8260
        fi
7414
8261
 
7415
8262
        # Make a backup of the uninstalled library when relinking
7416
 
        if test "$mode" = relink; then
 
8263
        if test "$opt_mode" = relink; then
7417
8264
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7418
8265
        fi
7419
8266
 
7475
8322
            echo 'INPUT (' > $output
7476
8323
            for obj in $save_libobjs
7477
8324
            do
7478
 
              $ECHO "$obj" >> $output
 
8325
              func_to_tool_file "$obj"
 
8326
              $ECHO "$func_to_tool_file_result" >> $output
7479
8327
            done
7480
8328
            echo ')' >> $output
7481
 
            delfiles="$delfiles $output"
 
8329
            func_append delfiles " $output"
 
8330
            func_to_tool_file "$output"
 
8331
            output=$func_to_tool_file_result
7482
8332
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7483
8333
            output=${output_objdir}/${output_la}.lnk
7484
8334
            func_verbose "creating linker input file list: $output"
7492
8342
            fi
7493
8343
            for obj
7494
8344
            do
7495
 
              $ECHO "$obj" >> $output
 
8345
              func_to_tool_file "$obj"
 
8346
              $ECHO "$func_to_tool_file_result" >> $output
7496
8347
            done
7497
 
            delfiles="$delfiles $output"
7498
 
            output=$firstobj\"$file_list_spec$output\"
 
8348
            func_append delfiles " $output"
 
8349
            func_to_tool_file "$output"
 
8350
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
7499
8351
          else
7500
8352
            if test -n "$save_libobjs"; then
7501
8353
              func_verbose "creating reloadable object files..."
7546
8398
              if test -n "$last_robj"; then
7547
8399
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7548
8400
              fi
7549
 
              delfiles="$delfiles $output"
 
8401
              func_append delfiles " $output"
7550
8402
 
7551
8403
            else
7552
8404
              output=
7580
8432
                lt_exit=$?
7581
8433
 
7582
8434
                # Restore the uninstalled library and exit
7583
 
                if test "$mode" = relink; then
 
8435
                if test "$opt_mode" = relink; then
7584
8436
                  ( cd "$output_objdir" && \
7585
8437
                    $RM "${realname}T" && \
7586
8438
                    $MV "${realname}U" "$realname" )
7613
8465
              # global variables. join(1) would be nice here, but unfortunately
7614
8466
              # isn't a blessed tool.
7615
8467
              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7616
 
              delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
 
8468
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7617
8469
              export_symbols=$output_objdir/$libname.def
7618
8470
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7619
8471
            fi
7654
8506
        # Add any objects from preloaded convenience libraries
7655
8507
        if test -n "$dlprefiles"; then
7656
8508
          gentop="$output_objdir/${outputname}x"
7657
 
          generated="$generated $gentop"
 
8509
          func_append generated " $gentop"
7658
8510
 
7659
8511
          func_extract_archives $gentop $dlprefiles
7660
 
          libobjs="$libobjs $func_extract_archives_result"
 
8512
          func_append libobjs " $func_extract_archives_result"
7661
8513
          test "X$libobjs" = "X " && libobjs=
7662
8514
        fi
7663
8515
 
7673
8525
            lt_exit=$?
7674
8526
 
7675
8527
            # Restore the uninstalled library and exit
7676
 
            if test "$mode" = relink; then
 
8528
            if test "$opt_mode" = relink; then
7677
8529
              ( cd "$output_objdir" && \
7678
8530
                $RM "${realname}T" && \
7679
8531
                $MV "${realname}U" "$realname" )
7685
8537
        IFS="$save_ifs"
7686
8538
 
7687
8539
        # Restore the uninstalled library and exit
7688
 
        if test "$mode" = relink; then
 
8540
        if test "$opt_mode" = relink; then
7689
8541
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7690
8542
 
7691
8543
          if test -n "$convenience"; then
7769
8621
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7770
8622
        else
7771
8623
          gentop="$output_objdir/${obj}x"
7772
 
          generated="$generated $gentop"
 
8624
          func_append generated " $gentop"
7773
8625
 
7774
8626
          func_extract_archives $gentop $convenience
7775
8627
          reload_conv_objs="$reload_objs $func_extract_archives_result"
7776
8628
        fi
7777
8629
      fi
7778
8630
 
 
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
 
7779
8634
      # Create the old-style object.
7780
8635
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7781
8636
 
7849
8704
        if test "$tagname" = CXX ; then
7850
8705
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7851
8706
            10.[0123])
7852
 
              compile_command="$compile_command ${wl}-bind_at_load"
7853
 
              finalize_command="$finalize_command ${wl}-bind_at_load"
 
8707
              func_append compile_command " ${wl}-bind_at_load"
 
8708
              func_append finalize_command " ${wl}-bind_at_load"
7854
8709
            ;;
7855
8710
          esac
7856
8711
        fi
7870
8725
        *)
7871
8726
          case " $compile_deplibs " in
7872
8727
          *" -L$path/$objdir "*)
7873
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
8728
            func_append new_libs " -L$path/$objdir" ;;
7874
8729
          esac
7875
8730
          ;;
7876
8731
        esac
7880
8735
        -L*)
7881
8736
          case " $new_libs " in
7882
8737
          *" $deplib "*) ;;
7883
 
          *) new_libs="$new_libs $deplib" ;;
 
8738
          *) func_append new_libs " $deplib" ;;
7884
8739
          esac
7885
8740
          ;;
7886
 
        *) new_libs="$new_libs $deplib" ;;
 
8741
        *) func_append new_libs " $deplib" ;;
7887
8742
        esac
7888
8743
      done
7889
8744
      compile_deplibs="$new_libs"
7890
8745
 
7891
8746
 
7892
 
      compile_command="$compile_command $compile_deplibs"
7893
 
      finalize_command="$finalize_command $finalize_deplibs"
 
8747
      func_append compile_command " $compile_deplibs"
 
8748
      func_append finalize_command " $finalize_deplibs"
7894
8749
 
7895
8750
      if test -n "$rpath$xrpath"; then
7896
8751
        # If the user specified any rpath flags, then add them.
7898
8753
          # This is the magic to use -rpath.
7899
8754
          case "$finalize_rpath " in
7900
8755
          *" $libdir "*) ;;
7901
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
8756
          *) func_append finalize_rpath " $libdir" ;;
7902
8757
          esac
7903
8758
        done
7904
8759
      fi
7917
8772
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7918
8773
                ;;
7919
8774
              *)
7920
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8775
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7921
8776
                ;;
7922
8777
              esac
7923
8778
            fi
7924
8779
          else
7925
8780
            eval flag=\"$hardcode_libdir_flag_spec\"
7926
 
            rpath="$rpath $flag"
 
8781
            func_append rpath " $flag"
7927
8782
          fi
7928
8783
        elif test -n "$runpath_var"; then
7929
8784
          case "$perm_rpath " in
7930
8785
          *" $libdir "*) ;;
7931
 
          *) perm_rpath="$perm_rpath $libdir" ;;
 
8786
          *) func_append perm_rpath " $libdir" ;;
7932
8787
          esac
7933
8788
        fi
7934
8789
        case $host in
7937
8792
          case :$dllsearchpath: in
7938
8793
          *":$libdir:"*) ;;
7939
8794
          ::) dllsearchpath=$libdir;;
7940
 
          *) dllsearchpath="$dllsearchpath:$libdir";;
 
8795
          *) func_append dllsearchpath ":$libdir";;
7941
8796
          esac
7942
8797
          case :$dllsearchpath: in
7943
8798
          *":$testbindir:"*) ;;
7944
8799
          ::) dllsearchpath=$testbindir;;
7945
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
8800
          *) func_append dllsearchpath ":$testbindir";;
7946
8801
          esac
7947
8802
          ;;
7948
8803
        esac
7968
8823
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7969
8824
                ;;
7970
8825
              *)
7971
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8826
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7972
8827
                ;;
7973
8828
              esac
7974
8829
            fi
7975
8830
          else
7976
8831
            eval flag=\"$hardcode_libdir_flag_spec\"
7977
 
            rpath="$rpath $flag"
 
8832
            func_append rpath " $flag"
7978
8833
          fi
7979
8834
        elif test -n "$runpath_var"; then
7980
8835
          case "$finalize_perm_rpath " in
7981
8836
          *" $libdir "*) ;;
7982
 
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
 
8837
          *) func_append finalize_perm_rpath " $libdir" ;;
7983
8838
          esac
7984
8839
        fi
7985
8840
      done
8030
8885
        exit_status=0
8031
8886
        func_show_eval "$link_command" 'exit_status=$?'
8032
8887
 
 
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
 
8033
8894
        # Delete the generated files.
8034
8895
        if test -f "$output_objdir/${outputname}S.${objext}"; then
8035
8896
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8052
8913
          # We should set the runpath_var.
8053
8914
          rpath=
8054
8915
          for dir in $perm_rpath; do
8055
 
            rpath="$rpath$dir:"
 
8916
            func_append rpath "$dir:"
8056
8917
          done
8057
8918
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8058
8919
        fi
8060
8921
          # We should set the runpath_var.
8061
8922
          rpath=
8062
8923
          for dir in $finalize_perm_rpath; do
8063
 
            rpath="$rpath$dir:"
 
8924
            func_append rpath "$dir:"
8064
8925
          done
8065
8926
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8066
8927
        fi
8075
8936
        $opt_dry_run || $RM $output
8076
8937
        # Link the executable and exit
8077
8938
        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
 
8078
8946
        exit $EXIT_SUCCESS
8079
8947
      fi
8080
8948
 
8108
8976
 
8109
8977
      func_show_eval "$link_command" 'exit $?'
8110
8978
 
 
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
 
8111
8985
      # Now create the wrapper script.
8112
8986
      func_verbose "creating $output"
8113
8987
 
8205
9079
        else
8206
9080
          oldobjs="$old_deplibs $non_pic_objects"
8207
9081
          if test "$preload" = yes && test -f "$symfileobj"; then
8208
 
            oldobjs="$oldobjs $symfileobj"
 
9082
            func_append oldobjs " $symfileobj"
8209
9083
          fi
8210
9084
        fi
8211
9085
        addlibs="$old_convenience"
8213
9087
 
8214
9088
      if test -n "$addlibs"; then
8215
9089
        gentop="$output_objdir/${outputname}x"
8216
 
        generated="$generated $gentop"
 
9090
        func_append generated " $gentop"
8217
9091
 
8218
9092
        func_extract_archives $gentop $addlibs
8219
 
        oldobjs="$oldobjs $func_extract_archives_result"
 
9093
        func_append oldobjs " $func_extract_archives_result"
8220
9094
      fi
8221
9095
 
8222
9096
      # Do each command in the archive commands.
8227
9101
        # Add any objects from preloaded convenience libraries
8228
9102
        if test -n "$dlprefiles"; then
8229
9103
          gentop="$output_objdir/${outputname}x"
8230
 
          generated="$generated $gentop"
 
9104
          func_append generated " $gentop"
8231
9105
 
8232
9106
          func_extract_archives $gentop $dlprefiles
8233
 
          oldobjs="$oldobjs $func_extract_archives_result"
 
9107
          func_append oldobjs " $func_extract_archives_result"
8234
9108
        fi
8235
9109
 
8236
9110
        # POSIX demands no paths to be encoded in archives.  We have
8248
9122
        else
8249
9123
          echo "copying selected object files to avoid basename conflicts..."
8250
9124
          gentop="$output_objdir/${outputname}x"
8251
 
          generated="$generated $gentop"
 
9125
          func_append generated " $gentop"
8252
9126
          func_mkdir_p "$gentop"
8253
9127
          save_oldobjs=$oldobjs
8254
9128
          oldobjs=
8272
9146
                esac
8273
9147
              done
8274
9148
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8275
 
              oldobjs="$oldobjs $gentop/$newobj"
 
9149
              func_append oldobjs " $gentop/$newobj"
8276
9150
              ;;
8277
 
            *) oldobjs="$oldobjs $obj" ;;
 
9151
            *) func_append oldobjs " $obj" ;;
8278
9152
            esac
8279
9153
          done
8280
9154
        fi
8284
9158
        len=$func_len_result
8285
9159
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8286
9160
          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
8287
9171
        else
8288
9172
          # the command line is too long to link in one step, link in parts
8289
9173
          func_verbose "using piecewise archive linking..."
8380
9264
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8381
9265
                test -z "$libdir" && \
8382
9266
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
8383
 
                newdependency_libs="$newdependency_libs $libdir/$name"
8384
 
                ;;
8385
 
              *) newdependency_libs="$newdependency_libs $deplib" ;;
 
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" ;;
8386
9280
              esac
8387
9281
            done
8388
9282
            dependency_libs="$newdependency_libs"
8396
9290
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8397
9291
                test -z "$libdir" && \
8398
9292
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8399
 
                newdlfiles="$newdlfiles $libdir/$name"
 
9293
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
8400
9294
                ;;
8401
 
              *) newdlfiles="$newdlfiles $lib" ;;
 
9295
              *) func_append newdlfiles " $lib" ;;
8402
9296
              esac
8403
9297
            done
8404
9298
            dlfiles="$newdlfiles"
8415
9309
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8416
9310
                test -z "$libdir" && \
8417
9311
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8418
 
                newdlprefiles="$newdlprefiles $libdir/$name"
 
9312
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
8419
9313
                ;;
8420
9314
              esac
8421
9315
            done
8427
9321
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8428
9322
                *) abs=`pwd`"/$lib" ;;
8429
9323
              esac
8430
 
              newdlfiles="$newdlfiles $abs"
 
9324
              func_append newdlfiles " $abs"
8431
9325
            done
8432
9326
            dlfiles="$newdlfiles"
8433
9327
            newdlprefiles=
8436
9330
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8437
9331
                *) abs=`pwd`"/$lib" ;;
8438
9332
              esac
8439
 
              newdlprefiles="$newdlprefiles $abs"
 
9333
              func_append newdlprefiles " $abs"
8440
9334
            done
8441
9335
            dlprefiles="$newdlprefiles"
8442
9336
          fi
8521
9415
    exit $EXIT_SUCCESS
8522
9416
}
8523
9417
 
8524
 
{ test "$mode" = link || test "$mode" = relink; } &&
 
9418
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
8525
9419
    func_mode_link ${1+"$@"}
8526
9420
 
8527
9421
 
8541
9435
    for arg
8542
9436
    do
8543
9437
      case $arg in
8544
 
      -f) RM="$RM $arg"; rmforce=yes ;;
8545
 
      -*) RM="$RM $arg" ;;
8546
 
      *) files="$files $arg" ;;
 
9438
      -f) func_append RM " $arg"; rmforce=yes ;;
 
9439
      -*) func_append RM " $arg" ;;
 
9440
      *) func_append files " $arg" ;;
8547
9441
      esac
8548
9442
    done
8549
9443
 
8552
9446
 
8553
9447
    rmdirs=
8554
9448
 
8555
 
    origobjdir="$objdir"
8556
9449
    for file in $files; do
8557
9450
      func_dirname "$file" "" "."
8558
9451
      dir="$func_dirname_result"
8559
9452
      if test "X$dir" = X.; then
8560
 
        objdir="$origobjdir"
 
9453
        odir="$objdir"
8561
9454
      else
8562
 
        objdir="$dir/$origobjdir"
 
9455
        odir="$dir/$objdir"
8563
9456
      fi
8564
9457
      func_basename "$file"
8565
9458
      name="$func_basename_result"
8566
 
      test "$mode" = uninstall && objdir="$dir"
 
9459
      test "$opt_mode" = uninstall && odir="$dir"
8567
9460
 
8568
 
      # Remember objdir for removal later, being careful to avoid duplicates
8569
 
      if test "$mode" = clean; then
 
9461
      # Remember odir for removal later, being careful to avoid duplicates
 
9462
      if test "$opt_mode" = clean; then
8570
9463
        case " $rmdirs " in
8571
 
          *" $objdir "*) ;;
8572
 
          *) rmdirs="$rmdirs $objdir" ;;
 
9464
          *" $odir "*) ;;
 
9465
          *) func_append rmdirs " $odir" ;;
8573
9466
        esac
8574
9467
      fi
8575
9468
 
8595
9488
 
8596
9489
          # Delete the libtool libraries and symlinks.
8597
9490
          for n in $library_names; do
8598
 
            rmfiles="$rmfiles $objdir/$n"
 
9491
            func_append rmfiles " $odir/$n"
8599
9492
          done
8600
 
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
 
9493
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
8601
9494
 
8602
 
          case "$mode" in
 
9495
          case "$opt_mode" in
8603
9496
          clean)
8604
 
            case "  $library_names " in
8605
 
            # "  " in the beginning catches empty $dlname
 
9497
            case " $library_names " in
8606
9498
            *" $dlname "*) ;;
8607
 
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
 
9499
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
8608
9500
            esac
8609
 
            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
9501
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
8610
9502
            ;;
8611
9503
          uninstall)
8612
9504
            if test -n "$library_names"; then
8634
9526
          # Add PIC object to the list of files to remove.
8635
9527
          if test -n "$pic_object" &&
8636
9528
             test "$pic_object" != none; then
8637
 
            rmfiles="$rmfiles $dir/$pic_object"
 
9529
            func_append rmfiles " $dir/$pic_object"
8638
9530
          fi
8639
9531
 
8640
9532
          # Add non-PIC object to the list of files to remove.
8641
9533
          if test -n "$non_pic_object" &&
8642
9534
             test "$non_pic_object" != none; then
8643
 
            rmfiles="$rmfiles $dir/$non_pic_object"
 
9535
            func_append rmfiles " $dir/$non_pic_object"
8644
9536
          fi
8645
9537
        fi
8646
9538
        ;;
8647
9539
 
8648
9540
      *)
8649
 
        if test "$mode" = clean ; then
 
9541
        if test "$opt_mode" = clean ; then
8650
9542
          noexename=$name
8651
9543
          case $file in
8652
9544
          *.exe)
8656
9548
            noexename=$func_stripname_result
8657
9549
            # $file with .exe has already been added to rmfiles,
8658
9550
            # add $file without .exe
8659
 
            rmfiles="$rmfiles $file"
 
9551
            func_append rmfiles " $file"
8660
9552
            ;;
8661
9553
          esac
8662
9554
          # Do a test to see if this is a libtool program.
8665
9557
              func_ltwrapper_scriptname "$file"
8666
9558
              relink_command=
8667
9559
              func_source $func_ltwrapper_scriptname_result
8668
 
              rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
 
9560
              func_append rmfiles " $func_ltwrapper_scriptname_result"
8669
9561
            else
8670
9562
              relink_command=
8671
9563
              func_source $dir/$noexename
8673
9565
 
8674
9566
            # note $name still contains .exe if it was in $file originally
8675
9567
            # as does the version of $file that was added into $rmfiles
8676
 
            rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
 
9568
            func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
8677
9569
            if test "$fast_install" = yes && test -n "$relink_command"; then
8678
 
              rmfiles="$rmfiles $objdir/lt-$name"
 
9570
              func_append rmfiles " $odir/lt-$name"
8679
9571
            fi
8680
9572
            if test "X$noexename" != "X$name" ; then
8681
 
              rmfiles="$rmfiles $objdir/lt-${noexename}.c"
 
9573
              func_append rmfiles " $odir/lt-${noexename}.c"
8682
9574
            fi
8683
9575
          fi
8684
9576
        fi
8686
9578
      esac
8687
9579
      func_show_eval "$RM $rmfiles" 'exit_status=1'
8688
9580
    done
8689
 
    objdir="$origobjdir"
8690
9581
 
8691
9582
    # Try to remove the ${objdir}s in the directories where we deleted files
8692
9583
    for dir in $rmdirs; do
8698
9589
    exit $exit_status
8699
9590
}
8700
9591
 
8701
 
{ test "$mode" = uninstall || test "$mode" = clean; } &&
 
9592
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
8702
9593
    func_mode_uninstall ${1+"$@"}
8703
9594
 
8704
 
test -z "$mode" && {
 
9595
test -z "$opt_mode" && {
8705
9596
  help="$generic_help"
8706
9597
  func_fatal_help "you must specify a MODE"
8707
9598
}
8708
9599
 
8709
9600
test -z "$exec_cmd" && \
8710
 
  func_fatal_help "invalid operation mode \`$mode'"
 
9601
  func_fatal_help "invalid operation mode \`$opt_mode'"
8711
9602
 
8712
9603
if test -n "$exec_cmd"; then
8713
9604
  eval exec "$exec_cmd"