~ubuntu-branches/ubuntu/saucy/lcmaps-plugins-jobrep/saucy

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Package Import Robot
  • Author(s): Dennis van Dok
  • Date: 2013-05-23 11:38:59 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130523113859-j3aprq5imdokjunw
Tags: 1.5.3-1
New upstream release ; this includes recording the GATEKEEPER_JM_ID
so jobs can be linked to credentials

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.2
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,
7
 
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
6
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
8
7
# This is free software; see the source for copying conditions.  There is NO
9
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
9
 
42
41
#       --quiet, --silent    don't print informational messages
43
42
#       --no-quiet, --no-silent
44
43
#                            print informational messages (default)
 
44
#       --no-warn            don't display warning messages
45
45
#       --tag=TAG            use configuration variables from tag TAG
46
46
#   -v, --verbose            print more informational messages than default
47
47
#       --no-verbose         don't print the extra informational messages
70
70
#         compiler:             $LTCC
71
71
#         compiler flags:               $LTCFLAGS
72
72
#         linker:               $LD (gnu? $with_gnu_ld)
73
 
#         $progname:    (GNU libtool) 2.2.10
 
73
#         $progname:    (GNU libtool) 2.4.2
74
74
#         automake:     $automake_version
75
75
#         autoconf:     $autoconf_version
76
76
#
77
77
# Report bugs to <bug-libtool@gnu.org>.
 
78
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
 
79
# General help using GNU software: <http://www.gnu.org/gethelp/>.
78
80
 
79
81
PROGRAM=libtool
80
82
PACKAGE=libtool
81
 
VERSION=2.2.10
 
83
VERSION=2.4.2
82
84
TIMESTAMP=""
83
 
package_revision=1.3175
 
85
package_revision=1.3337
84
86
 
85
87
# Be Bourne compatible
86
88
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
135
137
 
136
138
: ${CP="cp -f"}
137
139
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
138
 
: ${EGREP="/bin/grep -E"}
139
 
: ${FGREP="/bin/grep -F"}
140
 
: ${GREP="/bin/grep"}
141
 
: ${LN_S="ln -s"}
142
140
: ${MAKE="make"}
143
141
: ${MKDIR="mkdir"}
144
142
: ${MV="mv -f"}
145
143
: ${RM="rm -f"}
146
 
: ${SED="/bin/sed"}
147
144
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
148
145
: ${Xsed="$SED -e 1s/^X//"}
149
146
 
163
160
dirname="s,/[^/]*$,,"
164
161
basename="s,^.*/,,"
165
162
 
 
163
# func_dirname file append nondir_replacement
 
164
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 
165
# otherwise set result to NONDIR_REPLACEMENT.
 
166
func_dirname ()
 
167
{
 
168
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
 
169
    if test "X$func_dirname_result" = "X${1}"; then
 
170
      func_dirname_result="${3}"
 
171
    else
 
172
      func_dirname_result="$func_dirname_result${2}"
 
173
    fi
 
174
} # func_dirname may be replaced by extended shell implementation
 
175
 
 
176
 
 
177
# func_basename file
 
178
func_basename ()
 
179
{
 
180
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
 
181
} # func_basename may be replaced by extended shell implementation
 
182
 
 
183
 
166
184
# func_dirname_and_basename file append nondir_replacement
167
185
# perform func_basename and func_dirname in a single function
168
186
# call:
177
195
# those functions but instead duplicate the functionality here.
178
196
func_dirname_and_basename ()
179
197
{
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.
 
198
    # Extract subdirectory from the argument.
 
199
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
 
200
    if test "X$func_dirname_result" = "X${1}"; then
 
201
      func_dirname_result="${3}"
 
202
    else
 
203
      func_dirname_result="$func_dirname_result${2}"
 
204
    fi
 
205
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
 
206
} # func_dirname_and_basename may be replaced by extended shell implementation
 
207
 
 
208
 
 
209
# func_stripname prefix suffix name
 
210
# strip PREFIX and SUFFIX off of NAME.
 
211
# PREFIX and SUFFIX must not contain globbing or regex special
 
212
# characters, hashes, percent signs, but SUFFIX may contain a leading
 
213
# dot (in which case that matches only a dot).
 
214
# func_strip_suffix prefix name
 
215
func_stripname ()
 
216
{
 
217
    case ${2} in
 
218
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
 
219
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
 
220
    esac
 
221
} # func_stripname may be replaced by extended shell implementation
 
222
 
191
223
 
192
224
# These SED scripts presuppose an absolute path with a trailing slash.
193
225
pathcar='s,^/\([^/]*\).*$,\1,'
351
383
     ;;
352
384
  *)
353
385
     save_IFS="$IFS"
354
 
     IFS=:
 
386
     IFS=${PATH_SEPARATOR-:}
355
387
     for progdir in $PATH; do
356
388
       IFS="$save_IFS"
357
389
       test -x "$progdir/$progname" && break
370
402
# Same as above, but do not quote variable references.
371
403
double_quote_subst='s/\(["`\\]\)/\\\1/g'
372
404
 
 
405
# Sed substitution that turns a string into a regex matching for the
 
406
# string literally.
 
407
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
 
408
 
 
409
# Sed substitution that converts a w32 file name or path
 
410
# which contains forward slashes, into one that contains
 
411
# (escaped) backslashes.  A very naive implementation.
 
412
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
 
413
 
373
414
# Re-`\' parameter expansions in output of double_quote_subst that were
374
415
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
375
416
# in input to double_quote_subst, that '$' was protected from expansion.
398
439
# name if it has been set yet.
399
440
func_echo ()
400
441
{
401
 
    $ECHO "$progname${mode+: }$mode: $*"
 
442
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
402
443
}
403
444
 
404
445
# func_verbose arg...
424
465
# Echo program name prefixed message to standard error.
425
466
func_error ()
426
467
{
427
 
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
 
468
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
428
469
}
429
470
 
430
471
# func_warning arg...
431
472
# Echo program name prefixed warning message to standard error.
432
473
func_warning ()
433
474
{
434
 
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
 
475
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
435
476
 
436
477
    # bash bug again:
437
478
    :
650
691
    fi
651
692
}
652
693
 
 
694
# func_tr_sh
 
695
# Turn $1 into a string suitable for a shell variable name.
 
696
# Result is stored in $func_tr_sh_result.  All characters
 
697
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
 
698
# if $1 begins with a digit, a '_' is prepended as well.
 
699
func_tr_sh ()
 
700
{
 
701
  case $1 in
 
702
  [0-9]* | *[!a-zA-Z0-9_]*)
 
703
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
 
704
    ;;
 
705
  * )
 
706
    func_tr_sh_result=$1
 
707
    ;;
 
708
  esac
 
709
}
 
710
 
653
711
 
654
712
# func_version
655
713
# Echo version message to standard output and exit.
656
714
func_version ()
657
715
{
 
716
    $opt_debug
 
717
 
658
718
    $SED -n '/(C)/!b go
659
719
        :more
660
720
        /\./!{
676
736
# Echo short help message to standard output and exit.
677
737
func_usage ()
678
738
{
 
739
    $opt_debug
 
740
 
679
741
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
680
742
        s/^# //
681
743
        s/^# *$//
692
754
# unless 'noexit' is passed as argument.
693
755
func_help ()
694
756
{
 
757
    $opt_debug
 
758
 
695
759
    $SED -n '/^# Usage:/,/# Report bugs to/ {
 
760
        :print
696
761
        s/^# //
697
762
        s/^# *$//
698
763
        s*\$progname*'$progname'*
702
767
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
703
768
        s*\$LD*'"$LD"'*
704
769
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
705
 
        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
706
 
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
 
770
        s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
 
771
        s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
707
772
        p
708
 
     }' < "$progpath"
 
773
        d
 
774
     }
 
775
     /^# .* home page:/b print
 
776
     /^# General help using/b print
 
777
     ' < "$progpath"
709
778
    ret=$?
710
779
    if test -z "$1"; then
711
780
      exit $ret
717
786
# exit_cmd.
718
787
func_missing_arg ()
719
788
{
 
789
    $opt_debug
 
790
 
720
791
    func_error "missing argument for $1."
721
792
    exit_cmd=exit
722
793
}
723
794
 
 
795
 
 
796
# func_split_short_opt shortopt
 
797
# Set func_split_short_opt_name and func_split_short_opt_arg shell
 
798
# variables after splitting SHORTOPT after the 2nd character.
 
799
func_split_short_opt ()
 
800
{
 
801
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
 
802
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
803
 
 
804
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
 
805
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
 
806
} # func_split_short_opt may be replaced by extended shell implementation
 
807
 
 
808
 
 
809
# func_split_long_opt longopt
 
810
# Set func_split_long_opt_name and func_split_long_opt_arg shell
 
811
# variables after splitting LONGOPT at the `=' sign.
 
812
func_split_long_opt ()
 
813
{
 
814
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
 
815
    my_sed_long_arg='1s/^--[^=]*=//'
 
816
 
 
817
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
 
818
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
 
819
} # func_split_long_opt may be replaced by extended shell implementation
 
820
 
724
821
exit_cmd=:
725
822
 
726
823
 
727
824
 
728
825
 
729
826
 
730
 
 
731
827
magic="%%%MAGIC variable%%%"
732
828
magic_exe="%%%MAGIC EXE variable%%%"
733
829
 
734
830
# Global variables.
735
 
# $mode is unset
736
831
nonopt=
737
 
execute_dlfiles=
738
832
preserve_args=
739
833
lo2o="s/\\.lo\$/.${objext}/"
740
834
o2lo="s/\\.${objext}\$/.lo/"
741
835
extracted_archives=
742
836
extracted_serial=0
743
837
 
744
 
opt_dry_run=false
745
 
opt_duplicate_deps=false
746
 
opt_silent=false
747
 
opt_debug=:
748
 
 
749
838
# If this variable is set in any of the actions, the command in it
750
839
# will be execed at the end.  This prevents here-documents from being
751
840
# left over by shells.
752
841
exec_cmd=
753
842
 
 
843
# func_append var value
 
844
# Append VALUE to the end of shell variable VAR.
 
845
func_append ()
 
846
{
 
847
    eval "${1}=\$${1}\${2}"
 
848
} # func_append may be replaced by extended shell implementation
 
849
 
 
850
# func_append_quoted var value
 
851
# Quote VALUE and append to the end of shell variable VAR, separated
 
852
# by a space.
 
853
func_append_quoted ()
 
854
{
 
855
    func_quote_for_eval "${2}"
 
856
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
 
857
} # func_append_quoted may be replaced by extended shell implementation
 
858
 
 
859
 
 
860
# func_arith arithmetic-term...
 
861
func_arith ()
 
862
{
 
863
    func_arith_result=`expr "${@}"`
 
864
} # func_arith may be replaced by extended shell implementation
 
865
 
 
866
 
 
867
# func_len string
 
868
# STRING may not start with a hyphen.
 
869
func_len ()
 
870
{
 
871
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
 
872
} # func_len may be replaced by extended shell implementation
 
873
 
 
874
 
 
875
# func_lo2o object
 
876
func_lo2o ()
 
877
{
 
878
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
 
879
} # func_lo2o may be replaced by extended shell implementation
 
880
 
 
881
 
 
882
# func_xform libobj-or-source
 
883
func_xform ()
 
884
{
 
885
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
 
886
} # func_xform may be replaced by extended shell implementation
 
887
 
 
888
 
754
889
# func_fatal_configuration arg...
755
890
# Echo program name prefixed message to standard error, followed by
756
891
# a configuration failure hint, and exit.
840
975
  esac
841
976
}
842
977
 
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
978
# func_check_version_match
983
979
# Ensure that we are using m4 macros, and libtool script from the same
984
980
# release of libtool.
1015
1011
}
1016
1012
 
1017
1013
 
 
1014
# Shorthand for --mode=foo, only valid as the first argument
 
1015
case $1 in
 
1016
clean|clea|cle|cl)
 
1017
  shift; set dummy --mode clean ${1+"$@"}; shift
 
1018
  ;;
 
1019
compile|compil|compi|comp|com|co|c)
 
1020
  shift; set dummy --mode compile ${1+"$@"}; shift
 
1021
  ;;
 
1022
execute|execut|execu|exec|exe|ex|e)
 
1023
  shift; set dummy --mode execute ${1+"$@"}; shift
 
1024
  ;;
 
1025
finish|finis|fini|fin|fi|f)
 
1026
  shift; set dummy --mode finish ${1+"$@"}; shift
 
1027
  ;;
 
1028
install|instal|insta|inst|ins|in|i)
 
1029
  shift; set dummy --mode install ${1+"$@"}; shift
 
1030
  ;;
 
1031
link|lin|li|l)
 
1032
  shift; set dummy --mode link ${1+"$@"}; shift
 
1033
  ;;
 
1034
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
 
1035
  shift; set dummy --mode uninstall ${1+"$@"}; shift
 
1036
  ;;
 
1037
esac
 
1038
 
 
1039
 
 
1040
 
 
1041
# Option defaults:
 
1042
opt_debug=:
 
1043
opt_dry_run=false
 
1044
opt_config=false
 
1045
opt_preserve_dup_deps=false
 
1046
opt_features=false
 
1047
opt_finish=false
 
1048
opt_help=false
 
1049
opt_help_all=false
 
1050
opt_silent=:
 
1051
opt_warning=:
 
1052
opt_verbose=:
 
1053
opt_silent=false
 
1054
opt_verbose=false
 
1055
 
 
1056
 
 
1057
# Parse options once, thoroughly.  This comes as soon as possible in the
 
1058
# script to make things like `--version' happen as quickly as we can.
 
1059
{
 
1060
  # this just eases exit handling
 
1061
  while test $# -gt 0; do
 
1062
    opt="$1"
 
1063
    shift
 
1064
    case $opt in
 
1065
      --debug|-x)       opt_debug='set -x'
 
1066
                        func_echo "enabling shell trace mode"
 
1067
                        $opt_debug
 
1068
                        ;;
 
1069
      --dry-run|--dryrun|-n)
 
1070
                        opt_dry_run=:
 
1071
                        ;;
 
1072
      --config)
 
1073
                        opt_config=:
 
1074
func_config
 
1075
                        ;;
 
1076
      --dlopen|-dlopen)
 
1077
                        optarg="$1"
 
1078
                        opt_dlopen="${opt_dlopen+$opt_dlopen
 
1079
}$optarg"
 
1080
                        shift
 
1081
                        ;;
 
1082
      --preserve-dup-deps)
 
1083
                        opt_preserve_dup_deps=:
 
1084
                        ;;
 
1085
      --features)
 
1086
                        opt_features=:
 
1087
func_features
 
1088
                        ;;
 
1089
      --finish)
 
1090
                        opt_finish=:
 
1091
set dummy --mode finish ${1+"$@"}; shift
 
1092
                        ;;
 
1093
      --help)
 
1094
                        opt_help=:
 
1095
                        ;;
 
1096
      --help-all)
 
1097
                        opt_help_all=:
 
1098
opt_help=': help-all'
 
1099
                        ;;
 
1100
      --mode)
 
1101
                        test $# = 0 && func_missing_arg $opt && break
 
1102
                        optarg="$1"
 
1103
                        opt_mode="$optarg"
 
1104
case $optarg in
 
1105
  # Valid mode arguments:
 
1106
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
 
1107
 
 
1108
  # Catch anything else as an error
 
1109
  *) func_error "invalid argument for $opt"
 
1110
     exit_cmd=exit
 
1111
     break
 
1112
     ;;
 
1113
esac
 
1114
                        shift
 
1115
                        ;;
 
1116
      --no-silent|--no-quiet)
 
1117
                        opt_silent=false
 
1118
func_append preserve_args " $opt"
 
1119
                        ;;
 
1120
      --no-warning|--no-warn)
 
1121
                        opt_warning=false
 
1122
func_append preserve_args " $opt"
 
1123
                        ;;
 
1124
      --no-verbose)
 
1125
                        opt_verbose=false
 
1126
func_append preserve_args " $opt"
 
1127
                        ;;
 
1128
      --silent|--quiet)
 
1129
                        opt_silent=:
 
1130
func_append preserve_args " $opt"
 
1131
        opt_verbose=false
 
1132
                        ;;
 
1133
      --verbose|-v)
 
1134
                        opt_verbose=:
 
1135
func_append preserve_args " $opt"
 
1136
opt_silent=false
 
1137
                        ;;
 
1138
      --tag)
 
1139
                        test $# = 0 && func_missing_arg $opt && break
 
1140
                        optarg="$1"
 
1141
                        opt_tag="$optarg"
 
1142
func_append preserve_args " $opt $optarg"
 
1143
func_enable_tag "$optarg"
 
1144
                        shift
 
1145
                        ;;
 
1146
 
 
1147
      -\?|-h)           func_usage                              ;;
 
1148
      --help)           func_help                               ;;
 
1149
      --version)        func_version                            ;;
 
1150
 
 
1151
      # Separate optargs to long options:
 
1152
      --*=*)
 
1153
                        func_split_long_opt "$opt"
 
1154
                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
 
1155
                        shift
 
1156
                        ;;
 
1157
 
 
1158
      # Separate non-argument short options:
 
1159
      -\?*|-h*|-n*|-v*)
 
1160
                        func_split_short_opt "$opt"
 
1161
                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
 
1162
                        shift
 
1163
                        ;;
 
1164
 
 
1165
      --)               break                                   ;;
 
1166
      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
 
1167
      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
 
1168
    esac
 
1169
  done
 
1170
 
 
1171
  # Validate options:
 
1172
 
 
1173
  # save first non-option argument
 
1174
  if test "$#" -gt 0; then
 
1175
    nonopt="$opt"
 
1176
    shift
 
1177
  fi
 
1178
 
 
1179
  # preserve --debug
 
1180
  test "$opt_debug" = : || func_append preserve_args " --debug"
 
1181
 
 
1182
  case $host in
 
1183
    *cygwin* | *mingw* | *pw32* | *cegcc*)
 
1184
      # don't eliminate duplications in $postdeps and $predeps
 
1185
      opt_duplicate_compiler_generated_deps=:
 
1186
      ;;
 
1187
    *)
 
1188
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
 
1189
      ;;
 
1190
  esac
 
1191
 
 
1192
  $opt_help || {
 
1193
    # Sanity checks first:
 
1194
    func_check_version_match
 
1195
 
 
1196
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
 
1197
      func_fatal_configuration "not configured to build any kind of library"
 
1198
    fi
 
1199
 
 
1200
    # Darwin sucks
 
1201
    eval std_shrext=\"$shrext_cmds\"
 
1202
 
 
1203
    # Only execute mode is allowed to have -dlopen flags.
 
1204
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
 
1205
      func_error "unrecognized option \`-dlopen'"
 
1206
      $ECHO "$help" 1>&2
 
1207
      exit $EXIT_FAILURE
 
1208
    fi
 
1209
 
 
1210
    # Change the help message to a mode-specific one.
 
1211
    generic_help="$help"
 
1212
    help="Try \`$progname --help --mode=$opt_mode' for more information."
 
1213
  }
 
1214
 
 
1215
 
 
1216
  # Bail if the options were screwed
 
1217
  $exit_cmd $EXIT_FAILURE
 
1218
}
 
1219
 
 
1220
 
 
1221
 
 
1222
 
1018
1223
## ----------- ##
1019
1224
##    Main.    ##
1020
1225
## ----------- ##
1021
1226
 
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
1227
# func_lalib_p file
1051
1228
# True iff FILE is a libtool `.la' library or `.lo' object file.
1052
1229
# This function is only a basic sanity check; it will hardly flush out
1110
1287
# temporary ltwrapper_script.
1111
1288
func_ltwrapper_scriptname ()
1112
1289
{
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
 
1290
    func_dirname_and_basename "$1" "" "."
 
1291
    func_stripname '' '.exe' "$func_basename_result"
 
1292
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1119
1293
}
1120
1294
 
1121
1295
# func_ltwrapper_p file
1161
1335
}
1162
1336
 
1163
1337
 
 
1338
# func_resolve_sysroot PATH
 
1339
# Replace a leading = in PATH with a sysroot.  Store the result into
 
1340
# func_resolve_sysroot_result
 
1341
func_resolve_sysroot ()
 
1342
{
 
1343
  func_resolve_sysroot_result=$1
 
1344
  case $func_resolve_sysroot_result in
 
1345
  =*)
 
1346
    func_stripname '=' '' "$func_resolve_sysroot_result"
 
1347
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
 
1348
    ;;
 
1349
  esac
 
1350
}
 
1351
 
 
1352
# func_replace_sysroot PATH
 
1353
# If PATH begins with the sysroot, replace it with = and
 
1354
# store the result into func_replace_sysroot_result.
 
1355
func_replace_sysroot ()
 
1356
{
 
1357
  case "$lt_sysroot:$1" in
 
1358
  ?*:"$lt_sysroot"*)
 
1359
    func_stripname "$lt_sysroot" '' "$1"
 
1360
    func_replace_sysroot_result="=$func_stripname_result"
 
1361
    ;;
 
1362
  *)
 
1363
    # Including no sysroot.
 
1364
    func_replace_sysroot_result=$1
 
1365
    ;;
 
1366
  esac
 
1367
}
 
1368
 
1164
1369
# func_infer_tag arg
1165
1370
# Infer tagged configuration to use if any are available and
1166
1371
# if one wasn't chosen via the "--tag" command line option.
1173
1378
    if test -n "$available_tags" && test -z "$tagname"; then
1174
1379
      CC_quoted=
1175
1380
      for arg in $CC; do
1176
 
        func_quote_for_eval "$arg"
1177
 
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1381
        func_append_quoted CC_quoted "$arg"
1178
1382
      done
1179
1383
      CC_expanded=`func_echo_all $CC`
1180
1384
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1193
1397
            CC_quoted=
1194
1398
            for arg in $CC; do
1195
1399
              # Double-quote args containing other shell metacharacters.
1196
 
              func_quote_for_eval "$arg"
1197
 
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1400
              func_append_quoted CC_quoted "$arg"
1198
1401
            done
1199
1402
            CC_expanded=`func_echo_all $CC`
1200
1403
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1263
1466
    }
1264
1467
}
1265
1468
 
 
1469
 
 
1470
##################################################
 
1471
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
 
1472
##################################################
 
1473
 
 
1474
# func_convert_core_file_wine_to_w32 ARG
 
1475
# Helper function used by file name conversion functions when $build is *nix,
 
1476
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
 
1477
# correctly configured wine environment available, with the winepath program
 
1478
# in $build's $PATH.
 
1479
#
 
1480
# ARG is the $build file name to be converted to w32 format.
 
1481
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
 
1482
# be empty on error (or when ARG is empty)
 
1483
func_convert_core_file_wine_to_w32 ()
 
1484
{
 
1485
  $opt_debug
 
1486
  func_convert_core_file_wine_to_w32_result="$1"
 
1487
  if test -n "$1"; then
 
1488
    # Unfortunately, winepath does not exit with a non-zero error code, so we
 
1489
    # are forced to check the contents of stdout. On the other hand, if the
 
1490
    # command is not found, the shell will set an exit code of 127 and print
 
1491
    # *an error message* to stdout. So we must check for both error code of
 
1492
    # zero AND non-empty stdout, which explains the odd construction:
 
1493
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
 
1494
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
 
1495
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
 
1496
        $SED -e "$lt_sed_naive_backslashify"`
 
1497
    else
 
1498
      func_convert_core_file_wine_to_w32_result=
 
1499
    fi
 
1500
  fi
 
1501
}
 
1502
# end: func_convert_core_file_wine_to_w32
 
1503
 
 
1504
 
 
1505
# func_convert_core_path_wine_to_w32 ARG
 
1506
# Helper function used by path conversion functions when $build is *nix, and
 
1507
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
 
1508
# configured wine environment available, with the winepath program in $build's
 
1509
# $PATH. Assumes ARG has no leading or trailing path separator characters.
 
1510
#
 
1511
# ARG is path to be converted from $build format to win32.
 
1512
# Result is available in $func_convert_core_path_wine_to_w32_result.
 
1513
# Unconvertible file (directory) names in ARG are skipped; if no directory names
 
1514
# are convertible, then the result may be empty.
 
1515
func_convert_core_path_wine_to_w32 ()
 
1516
{
 
1517
  $opt_debug
 
1518
  # unfortunately, winepath doesn't convert paths, only file names
 
1519
  func_convert_core_path_wine_to_w32_result=""
 
1520
  if test -n "$1"; then
 
1521
    oldIFS=$IFS
 
1522
    IFS=:
 
1523
    for func_convert_core_path_wine_to_w32_f in $1; do
 
1524
      IFS=$oldIFS
 
1525
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
 
1526
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
 
1527
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
 
1528
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
 
1529
        else
 
1530
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
 
1531
        fi
 
1532
      fi
 
1533
    done
 
1534
    IFS=$oldIFS
 
1535
  fi
 
1536
}
 
1537
# end: func_convert_core_path_wine_to_w32
 
1538
 
 
1539
 
 
1540
# func_cygpath ARGS...
 
1541
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
 
1542
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
 
1543
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
 
1544
# (2), returns the Cygwin file name or path in func_cygpath_result (input
 
1545
# file name or path is assumed to be in w32 format, as previously converted
 
1546
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
 
1547
# or path in func_cygpath_result (input file name or path is assumed to be in
 
1548
# Cygwin format). Returns an empty string on error.
 
1549
#
 
1550
# ARGS are passed to cygpath, with the last one being the file name or path to
 
1551
# be converted.
 
1552
#
 
1553
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
 
1554
# environment variable; do not put it in $PATH.
 
1555
func_cygpath ()
 
1556
{
 
1557
  $opt_debug
 
1558
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
 
1559
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
 
1560
    if test "$?" -ne 0; then
 
1561
      # on failure, ensure result is empty
 
1562
      func_cygpath_result=
 
1563
    fi
 
1564
  else
 
1565
    func_cygpath_result=
 
1566
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
 
1567
  fi
 
1568
}
 
1569
#end: func_cygpath
 
1570
 
 
1571
 
 
1572
# func_convert_core_msys_to_w32 ARG
 
1573
# Convert file name or path ARG from MSYS format to w32 format.  Return
 
1574
# result in func_convert_core_msys_to_w32_result.
 
1575
func_convert_core_msys_to_w32 ()
 
1576
{
 
1577
  $opt_debug
 
1578
  # awkward: cmd appends spaces to result
 
1579
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
 
1580
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
1581
}
 
1582
#end: func_convert_core_msys_to_w32
 
1583
 
 
1584
 
 
1585
# func_convert_file_check ARG1 ARG2
 
1586
# Verify that ARG1 (a file name in $build format) was converted to $host
 
1587
# format in ARG2. Otherwise, emit an error message, but continue (resetting
 
1588
# func_to_host_file_result to ARG1).
 
1589
func_convert_file_check ()
 
1590
{
 
1591
  $opt_debug
 
1592
  if test -z "$2" && test -n "$1" ; then
 
1593
    func_error "Could not determine host file name corresponding to"
 
1594
    func_error "  \`$1'"
 
1595
    func_error "Continuing, but uninstalled executables may not work."
 
1596
    # Fallback:
 
1597
    func_to_host_file_result="$1"
 
1598
  fi
 
1599
}
 
1600
# end func_convert_file_check
 
1601
 
 
1602
 
 
1603
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
 
1604
# Verify that FROM_PATH (a path in $build format) was converted to $host
 
1605
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
 
1606
# func_to_host_file_result to a simplistic fallback value (see below).
 
1607
func_convert_path_check ()
 
1608
{
 
1609
  $opt_debug
 
1610
  if test -z "$4" && test -n "$3"; then
 
1611
    func_error "Could not determine the host path corresponding to"
 
1612
    func_error "  \`$3'"
 
1613
    func_error "Continuing, but uninstalled executables may not work."
 
1614
    # Fallback.  This is a deliberately simplistic "conversion" and
 
1615
    # should not be "improved".  See libtool.info.
 
1616
    if test "x$1" != "x$2"; then
 
1617
      lt_replace_pathsep_chars="s|$1|$2|g"
 
1618
      func_to_host_path_result=`echo "$3" |
 
1619
        $SED -e "$lt_replace_pathsep_chars"`
 
1620
    else
 
1621
      func_to_host_path_result="$3"
 
1622
    fi
 
1623
  fi
 
1624
}
 
1625
# end func_convert_path_check
 
1626
 
 
1627
 
 
1628
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
 
1629
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
 
1630
# and appending REPL if ORIG matches BACKPAT.
 
1631
func_convert_path_front_back_pathsep ()
 
1632
{
 
1633
  $opt_debug
 
1634
  case $4 in
 
1635
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
 
1636
    ;;
 
1637
  esac
 
1638
  case $4 in
 
1639
  $2 ) func_append func_to_host_path_result "$3"
 
1640
    ;;
 
1641
  esac
 
1642
}
 
1643
# end func_convert_path_front_back_pathsep
 
1644
 
 
1645
 
 
1646
##################################################
 
1647
# $build to $host FILE NAME CONVERSION FUNCTIONS #
 
1648
##################################################
 
1649
# invoked via `$to_host_file_cmd ARG'
 
1650
#
 
1651
# In each case, ARG is the path to be converted from $build to $host format.
 
1652
# Result will be available in $func_to_host_file_result.
 
1653
 
 
1654
 
 
1655
# func_to_host_file ARG
 
1656
# Converts the file name ARG from $build format to $host format. Return result
 
1657
# in func_to_host_file_result.
 
1658
func_to_host_file ()
 
1659
{
 
1660
  $opt_debug
 
1661
  $to_host_file_cmd "$1"
 
1662
}
 
1663
# end func_to_host_file
 
1664
 
 
1665
 
 
1666
# func_to_tool_file ARG LAZY
 
1667
# converts the file name ARG from $build format to toolchain format. Return
 
1668
# result in func_to_tool_file_result.  If the conversion in use is listed
 
1669
# in (the comma separated) LAZY, no conversion takes place.
 
1670
func_to_tool_file ()
 
1671
{
 
1672
  $opt_debug
 
1673
  case ,$2, in
 
1674
    *,"$to_tool_file_cmd",*)
 
1675
      func_to_tool_file_result=$1
 
1676
      ;;
 
1677
    *)
 
1678
      $to_tool_file_cmd "$1"
 
1679
      func_to_tool_file_result=$func_to_host_file_result
 
1680
      ;;
 
1681
  esac
 
1682
}
 
1683
# end func_to_tool_file
 
1684
 
 
1685
 
 
1686
# func_convert_file_noop ARG
 
1687
# Copy ARG to func_to_host_file_result.
 
1688
func_convert_file_noop ()
 
1689
{
 
1690
  func_to_host_file_result="$1"
 
1691
}
 
1692
# end func_convert_file_noop
 
1693
 
 
1694
 
 
1695
# func_convert_file_msys_to_w32 ARG
 
1696
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
 
1697
# conversion to w32 is not available inside the cwrapper.  Returns result in
 
1698
# func_to_host_file_result.
 
1699
func_convert_file_msys_to_w32 ()
 
1700
{
 
1701
  $opt_debug
 
1702
  func_to_host_file_result="$1"
 
1703
  if test -n "$1"; then
 
1704
    func_convert_core_msys_to_w32 "$1"
 
1705
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
 
1706
  fi
 
1707
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1708
}
 
1709
# end func_convert_file_msys_to_w32
 
1710
 
 
1711
 
 
1712
# func_convert_file_cygwin_to_w32 ARG
 
1713
# Convert file name ARG from Cygwin to w32 format.  Returns result in
 
1714
# func_to_host_file_result.
 
1715
func_convert_file_cygwin_to_w32 ()
 
1716
{
 
1717
  $opt_debug
 
1718
  func_to_host_file_result="$1"
 
1719
  if test -n "$1"; then
 
1720
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
 
1721
    # LT_CYGPATH in this case.
 
1722
    func_to_host_file_result=`cygpath -m "$1"`
 
1723
  fi
 
1724
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1725
}
 
1726
# end func_convert_file_cygwin_to_w32
 
1727
 
 
1728
 
 
1729
# func_convert_file_nix_to_w32 ARG
 
1730
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
 
1731
# and a working winepath. Returns result in func_to_host_file_result.
 
1732
func_convert_file_nix_to_w32 ()
 
1733
{
 
1734
  $opt_debug
 
1735
  func_to_host_file_result="$1"
 
1736
  if test -n "$1"; then
 
1737
    func_convert_core_file_wine_to_w32 "$1"
 
1738
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
 
1739
  fi
 
1740
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1741
}
 
1742
# end func_convert_file_nix_to_w32
 
1743
 
 
1744
 
 
1745
# func_convert_file_msys_to_cygwin ARG
 
1746
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
 
1747
# Returns result in func_to_host_file_result.
 
1748
func_convert_file_msys_to_cygwin ()
 
1749
{
 
1750
  $opt_debug
 
1751
  func_to_host_file_result="$1"
 
1752
  if test -n "$1"; then
 
1753
    func_convert_core_msys_to_w32 "$1"
 
1754
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
 
1755
    func_to_host_file_result="$func_cygpath_result"
 
1756
  fi
 
1757
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1758
}
 
1759
# end func_convert_file_msys_to_cygwin
 
1760
 
 
1761
 
 
1762
# func_convert_file_nix_to_cygwin ARG
 
1763
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
 
1764
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
 
1765
# in func_to_host_file_result.
 
1766
func_convert_file_nix_to_cygwin ()
 
1767
{
 
1768
  $opt_debug
 
1769
  func_to_host_file_result="$1"
 
1770
  if test -n "$1"; then
 
1771
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
 
1772
    func_convert_core_file_wine_to_w32 "$1"
 
1773
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
 
1774
    func_to_host_file_result="$func_cygpath_result"
 
1775
  fi
 
1776
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1777
}
 
1778
# end func_convert_file_nix_to_cygwin
 
1779
 
 
1780
 
 
1781
#############################################
 
1782
# $build to $host PATH CONVERSION FUNCTIONS #
 
1783
#############################################
 
1784
# invoked via `$to_host_path_cmd ARG'
 
1785
#
 
1786
# In each case, ARG is the path to be converted from $build to $host format.
 
1787
# The result will be available in $func_to_host_path_result.
 
1788
#
 
1789
# Path separators are also converted from $build format to $host format.  If
 
1790
# ARG begins or ends with a path separator character, it is preserved (but
 
1791
# converted to $host format) on output.
 
1792
#
 
1793
# All path conversion functions are named using the following convention:
 
1794
#   file name conversion function    : func_convert_file_X_to_Y ()
 
1795
#   path conversion function         : func_convert_path_X_to_Y ()
 
1796
# where, for any given $build/$host combination the 'X_to_Y' value is the
 
1797
# same.  If conversion functions are added for new $build/$host combinations,
 
1798
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
 
1799
# will break.
 
1800
 
 
1801
 
 
1802
# func_init_to_host_path_cmd
 
1803
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
 
1804
# appropriate value, based on the value of $to_host_file_cmd.
 
1805
to_host_path_cmd=
 
1806
func_init_to_host_path_cmd ()
 
1807
{
 
1808
  $opt_debug
 
1809
  if test -z "$to_host_path_cmd"; then
 
1810
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
 
1811
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
 
1812
  fi
 
1813
}
 
1814
 
 
1815
 
 
1816
# func_to_host_path ARG
 
1817
# Converts the path ARG from $build format to $host format. Return result
 
1818
# in func_to_host_path_result.
 
1819
func_to_host_path ()
 
1820
{
 
1821
  $opt_debug
 
1822
  func_init_to_host_path_cmd
 
1823
  $to_host_path_cmd "$1"
 
1824
}
 
1825
# end func_to_host_path
 
1826
 
 
1827
 
 
1828
# func_convert_path_noop ARG
 
1829
# Copy ARG to func_to_host_path_result.
 
1830
func_convert_path_noop ()
 
1831
{
 
1832
  func_to_host_path_result="$1"
 
1833
}
 
1834
# end func_convert_path_noop
 
1835
 
 
1836
 
 
1837
# func_convert_path_msys_to_w32 ARG
 
1838
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
 
1839
# conversion to w32 is not available inside the cwrapper.  Returns result in
 
1840
# func_to_host_path_result.
 
1841
func_convert_path_msys_to_w32 ()
 
1842
{
 
1843
  $opt_debug
 
1844
  func_to_host_path_result="$1"
 
1845
  if test -n "$1"; then
 
1846
    # Remove leading and trailing path separator characters from ARG.  MSYS
 
1847
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
 
1848
    # and winepath ignores them completely.
 
1849
    func_stripname : : "$1"
 
1850
    func_to_host_path_tmp1=$func_stripname_result
 
1851
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
 
1852
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
 
1853
    func_convert_path_check : ";" \
 
1854
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1855
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1856
  fi
 
1857
}
 
1858
# end func_convert_path_msys_to_w32
 
1859
 
 
1860
 
 
1861
# func_convert_path_cygwin_to_w32 ARG
 
1862
# Convert path ARG from Cygwin to w32 format.  Returns result in
 
1863
# func_to_host_file_result.
 
1864
func_convert_path_cygwin_to_w32 ()
 
1865
{
 
1866
  $opt_debug
 
1867
  func_to_host_path_result="$1"
 
1868
  if test -n "$1"; then
 
1869
    # See func_convert_path_msys_to_w32:
 
1870
    func_stripname : : "$1"
 
1871
    func_to_host_path_tmp1=$func_stripname_result
 
1872
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
 
1873
    func_convert_path_check : ";" \
 
1874
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1875
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1876
  fi
 
1877
}
 
1878
# end func_convert_path_cygwin_to_w32
 
1879
 
 
1880
 
 
1881
# func_convert_path_nix_to_w32 ARG
 
1882
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
 
1883
# a working winepath.  Returns result in func_to_host_file_result.
 
1884
func_convert_path_nix_to_w32 ()
 
1885
{
 
1886
  $opt_debug
 
1887
  func_to_host_path_result="$1"
 
1888
  if test -n "$1"; then
 
1889
    # See func_convert_path_msys_to_w32:
 
1890
    func_stripname : : "$1"
 
1891
    func_to_host_path_tmp1=$func_stripname_result
 
1892
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
 
1893
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
 
1894
    func_convert_path_check : ";" \
 
1895
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1896
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1897
  fi
 
1898
}
 
1899
# end func_convert_path_nix_to_w32
 
1900
 
 
1901
 
 
1902
# func_convert_path_msys_to_cygwin ARG
 
1903
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
 
1904
# Returns result in func_to_host_file_result.
 
1905
func_convert_path_msys_to_cygwin ()
 
1906
{
 
1907
  $opt_debug
 
1908
  func_to_host_path_result="$1"
 
1909
  if test -n "$1"; then
 
1910
    # See func_convert_path_msys_to_w32:
 
1911
    func_stripname : : "$1"
 
1912
    func_to_host_path_tmp1=$func_stripname_result
 
1913
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
 
1914
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
 
1915
    func_to_host_path_result="$func_cygpath_result"
 
1916
    func_convert_path_check : : \
 
1917
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1918
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
 
1919
  fi
 
1920
}
 
1921
# end func_convert_path_msys_to_cygwin
 
1922
 
 
1923
 
 
1924
# func_convert_path_nix_to_cygwin ARG
 
1925
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
 
1926
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
 
1927
# func_to_host_file_result.
 
1928
func_convert_path_nix_to_cygwin ()
 
1929
{
 
1930
  $opt_debug
 
1931
  func_to_host_path_result="$1"
 
1932
  if test -n "$1"; then
 
1933
    # Remove leading and trailing path separator characters from
 
1934
    # ARG. msys behavior is inconsistent here, cygpath turns them
 
1935
    # into '.;' and ';.', and winepath ignores them completely.
 
1936
    func_stripname : : "$1"
 
1937
    func_to_host_path_tmp1=$func_stripname_result
 
1938
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
 
1939
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
 
1940
    func_to_host_path_result="$func_cygpath_result"
 
1941
    func_convert_path_check : : \
 
1942
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1943
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
 
1944
  fi
 
1945
}
 
1946
# end func_convert_path_nix_to_cygwin
 
1947
 
 
1948
 
1266
1949
# func_mode_compile arg...
1267
1950
func_mode_compile ()
1268
1951
{
1303
1986
          ;;
1304
1987
 
1305
1988
        -pie | -fpie | -fPIE)
1306
 
          pie_flag="$pie_flag $arg"
 
1989
          func_append pie_flag " $arg"
1307
1990
          continue
1308
1991
          ;;
1309
1992
 
1310
1993
        -shared | -static | -prefer-pic | -prefer-non-pic)
1311
 
          later="$later $arg"
 
1994
          func_append later " $arg"
1312
1995
          continue
1313
1996
          ;;
1314
1997
 
1329
2012
          save_ifs="$IFS"; IFS=','
1330
2013
          for arg in $args; do
1331
2014
            IFS="$save_ifs"
1332
 
            func_quote_for_eval "$arg"
1333
 
            lastarg="$lastarg $func_quote_for_eval_result"
 
2015
            func_append_quoted lastarg "$arg"
1334
2016
          done
1335
2017
          IFS="$save_ifs"
1336
2018
          func_stripname ' ' '' "$lastarg"
1337
2019
          lastarg=$func_stripname_result
1338
2020
 
1339
2021
          # Add the arguments to base_compile.
1340
 
          base_compile="$base_compile $lastarg"
 
2022
          func_append base_compile " $lastarg"
1341
2023
          continue
1342
2024
          ;;
1343
2025
 
1353
2035
      esac    #  case $arg_mode
1354
2036
 
1355
2037
      # Aesthetically quote the previous argument.
1356
 
      func_quote_for_eval "$lastarg"
1357
 
      base_compile="$base_compile $func_quote_for_eval_result"
 
2038
      func_append_quoted base_compile "$lastarg"
1358
2039
    done # for arg
1359
2040
 
1360
2041
    case $arg_mode in
1379
2060
    *.[cCFSifmso] | \
1380
2061
    *.ada | *.adb | *.ads | *.asm | \
1381
2062
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1382
 
    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
 
2063
    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
1383
2064
      func_xform "$libobj"
1384
2065
      libobj=$func_xform_result
1385
2066
      ;;
1485
2166
        $opt_dry_run || $RM $removelist
1486
2167
        exit $EXIT_FAILURE
1487
2168
      fi
1488
 
      removelist="$removelist $output_obj"
 
2169
      func_append removelist " $output_obj"
1489
2170
      $ECHO "$srcfile" > "$lockfile"
1490
2171
    fi
1491
2172
 
1492
2173
    $opt_dry_run || $RM $removelist
1493
 
    removelist="$removelist $lockfile"
 
2174
    func_append removelist " $lockfile"
1494
2175
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1495
2176
 
1496
 
    if test -n "$fix_srcfile_path"; then
1497
 
      eval srcfile=\"$fix_srcfile_path\"
1498
 
    fi
 
2177
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
 
2178
    srcfile=$func_to_tool_file_result
1499
2179
    func_quote_for_eval "$srcfile"
1500
2180
    qsrcfile=$func_quote_for_eval_result
1501
2181
 
1515
2195
 
1516
2196
      if test -z "$output_obj"; then
1517
2197
        # Place PIC objects in $objdir
1518
 
        command="$command -o $lobj"
 
2198
        func_append command " -o $lobj"
1519
2199
      fi
1520
2200
 
1521
2201
      func_show_eval_locale "$command"  \
1562
2242
        command="$base_compile $qsrcfile $pic_flag"
1563
2243
      fi
1564
2244
      if test "$compiler_c_o" = yes; then
1565
 
        command="$command -o $obj"
 
2245
        func_append command " -o $obj"
1566
2246
      fi
1567
2247
 
1568
2248
      # Suppress compiler output if we already did a PIC compilation.
1569
 
      command="$command$suppress_output"
 
2249
      func_append command "$suppress_output"
1570
2250
      func_show_eval_locale "$command" \
1571
2251
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1572
2252
 
1611
2291
}
1612
2292
 
1613
2293
$opt_help || {
1614
 
  test "$mode" = compile && func_mode_compile ${1+"$@"}
 
2294
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
1615
2295
}
1616
2296
 
1617
2297
func_mode_help ()
1618
2298
{
1619
2299
    # We need to display help for each of the modes.
1620
 
    case $mode in
 
2300
    case $opt_mode in
1621
2301
      "")
1622
2302
        # Generic help is extracted from the usage comments
1623
2303
        # at the start of this file.
1793
2473
        ;;
1794
2474
 
1795
2475
      *)
1796
 
        func_fatal_help "invalid operation mode \`$mode'"
 
2476
        func_fatal_help "invalid operation mode \`$opt_mode'"
1797
2477
        ;;
1798
2478
    esac
1799
2479
 
1808
2488
  else
1809
2489
    {
1810
2490
      func_help noexit
1811
 
      for mode in compile link execute install finish uninstall clean; do
 
2491
      for opt_mode in compile link execute install finish uninstall clean; do
1812
2492
        func_mode_help
1813
2493
      done
1814
2494
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
1815
2495
    {
1816
2496
      func_help noexit
1817
 
      for mode in compile link execute install finish uninstall clean; do
 
2497
      for opt_mode in compile link execute install finish uninstall clean; do
1818
2498
        echo
1819
2499
        func_mode_help
1820
2500
      done
1843
2523
      func_fatal_help "you must specify a COMMAND"
1844
2524
 
1845
2525
    # Handle -dlopen flags immediately.
1846
 
    for file in $execute_dlfiles; do
 
2526
    for file in $opt_dlopen; do
1847
2527
      test -f "$file" \
1848
2528
        || func_fatal_help "\`$file' is not a file"
1849
2529
 
1850
2530
      dir=
1851
2531
      case $file in
1852
2532
      *.la)
 
2533
        func_resolve_sysroot "$file"
 
2534
        file=$func_resolve_sysroot_result
 
2535
 
1853
2536
        # Check to see that this really is a libtool archive.
1854
2537
        func_lalib_unsafe_p "$file" \
1855
2538
          || func_fatal_help "\`$lib' is not a valid libtool archive"
1871
2554
        dir="$func_dirname_result"
1872
2555
 
1873
2556
        if test -f "$dir/$objdir/$dlname"; then
1874
 
          dir="$dir/$objdir"
 
2557
          func_append dir "/$objdir"
1875
2558
        else
1876
2559
          if test ! -f "$dir/$dlname"; then
1877
2560
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1928
2611
        ;;
1929
2612
      esac
1930
2613
      # Quote arguments (to preserve shell metacharacters).
1931
 
      func_quote_for_eval "$file"
1932
 
      args="$args $func_quote_for_eval_result"
 
2614
      func_append_quoted args "$file"
1933
2615
    done
1934
2616
 
1935
2617
    if test "X$opt_dry_run" = Xfalse; then
1961
2643
    fi
1962
2644
}
1963
2645
 
1964
 
test "$mode" = execute && func_mode_execute ${1+"$@"}
 
2646
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
1965
2647
 
1966
2648
 
1967
2649
# func_mode_finish arg...
1968
2650
func_mode_finish ()
1969
2651
{
1970
2652
    $opt_debug
1971
 
    libdirs="$nonopt"
 
2653
    libs=
 
2654
    libdirs=
1972
2655
    admincmds=
1973
2656
 
 
2657
    for opt in "$nonopt" ${1+"$@"}
 
2658
    do
 
2659
      if test -d "$opt"; then
 
2660
        func_append libdirs " $opt"
 
2661
 
 
2662
      elif test -f "$opt"; then
 
2663
        if func_lalib_unsafe_p "$opt"; then
 
2664
          func_append libs " $opt"
 
2665
        else
 
2666
          func_warning "\`$opt' is not a valid libtool archive"
 
2667
        fi
 
2668
 
 
2669
      else
 
2670
        func_fatal_error "invalid argument \`$opt'"
 
2671
      fi
 
2672
    done
 
2673
 
 
2674
    if test -n "$libs"; then
 
2675
      if test -n "$lt_sysroot"; then
 
2676
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
 
2677
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
 
2678
      else
 
2679
        sysroot_cmd=
 
2680
      fi
 
2681
 
 
2682
      # Remove sysroot references
 
2683
      if $opt_dry_run; then
 
2684
        for lib in $libs; do
 
2685
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
 
2686
        done
 
2687
      else
 
2688
        tmpdir=`func_mktempdir`
 
2689
        for lib in $libs; do
 
2690
          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 
2691
            > $tmpdir/tmp-la
 
2692
          mv -f $tmpdir/tmp-la $lib
 
2693
        done
 
2694
        ${RM}r "$tmpdir"
 
2695
      fi
 
2696
    fi
 
2697
 
1974
2698
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1975
 
      for dir
1976
 
      do
1977
 
        libdirs="$libdirs $dir"
1978
 
      done
1979
 
 
1980
2699
      for libdir in $libdirs; do
1981
2700
        if test -n "$finish_cmds"; then
1982
2701
          # Do each command in the finish commands.
1986
2705
        if test -n "$finish_eval"; then
1987
2706
          # Do the single finish_eval.
1988
2707
          eval cmds=\"$finish_eval\"
1989
 
          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
 
2708
          $opt_dry_run || eval "$cmds" || func_append admincmds "
1990
2709
       $cmds"
1991
2710
        fi
1992
2711
      done
1995
2714
    # Exit here if they wanted silent mode.
1996
2715
    $opt_silent && exit $EXIT_SUCCESS
1997
2716
 
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 "----------------------------------------------------------------------"
 
2717
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
 
2718
      echo "----------------------------------------------------------------------"
 
2719
      echo "Libraries have been installed in:"
 
2720
      for libdir in $libdirs; do
 
2721
        $ECHO "   $libdir"
 
2722
      done
 
2723
      echo
 
2724
      echo "If you ever happen to want to link against installed libraries"
 
2725
      echo "in a given directory, LIBDIR, you must either use libtool, and"
 
2726
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
2727
      echo "flag during linking and do at least one of the following:"
 
2728
      if test -n "$shlibpath_var"; then
 
2729
        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
2730
        echo "     during execution"
 
2731
      fi
 
2732
      if test -n "$runpath_var"; then
 
2733
        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
2734
        echo "     during linking"
 
2735
      fi
 
2736
      if test -n "$hardcode_libdir_flag_spec"; then
 
2737
        libdir=LIBDIR
 
2738
        eval flag=\"$hardcode_libdir_flag_spec\"
 
2739
 
 
2740
        $ECHO "   - use the \`$flag' linker flag"
 
2741
      fi
 
2742
      if test -n "$admincmds"; then
 
2743
        $ECHO "   - have your system administrator run these commands:$admincmds"
 
2744
      fi
 
2745
      if test -f /etc/ld.so.conf; then
 
2746
        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
2747
      fi
 
2748
      echo
 
2749
 
 
2750
      echo "See any operating system documentation about shared libraries for"
 
2751
      case $host in
 
2752
        solaris2.[6789]|solaris2.1[0-9])
 
2753
          echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
2754
          echo "pages."
 
2755
          ;;
 
2756
        *)
 
2757
          echo "more information, such as the ld(1) and ld.so(8) manual pages."
 
2758
          ;;
 
2759
      esac
 
2760
      echo "----------------------------------------------------------------------"
 
2761
    fi
2041
2762
    exit $EXIT_SUCCESS
2042
2763
}
2043
2764
 
2044
 
test "$mode" = finish && func_mode_finish ${1+"$@"}
 
2765
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2045
2766
 
2046
2767
 
2047
2768
# func_mode_install arg...
2066
2787
    # The real first argument should be the name of the installation program.
2067
2788
    # Aesthetically quote it.
2068
2789
    func_quote_for_eval "$arg"
2069
 
    install_prog="$install_prog$func_quote_for_eval_result"
 
2790
    func_append install_prog "$func_quote_for_eval_result"
2070
2791
    install_shared_prog=$install_prog
2071
2792
    case " $install_prog " in
2072
2793
      *[\\\ /]cp\ *) install_cp=: ;;
2086
2807
    do
2087
2808
      arg2=
2088
2809
      if test -n "$dest"; then
2089
 
        files="$files $dest"
 
2810
        func_append files " $dest"
2090
2811
        dest=$arg
2091
2812
        continue
2092
2813
      fi
2124
2845
 
2125
2846
      # Aesthetically quote the argument.
2126
2847
      func_quote_for_eval "$arg"
2127
 
      install_prog="$install_prog $func_quote_for_eval_result"
 
2848
      func_append install_prog " $func_quote_for_eval_result"
2128
2849
      if test -n "$arg2"; then
2129
2850
        func_quote_for_eval "$arg2"
2130
2851
      fi
2131
 
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
 
2852
      func_append install_shared_prog " $func_quote_for_eval_result"
2132
2853
    done
2133
2854
 
2134
2855
    test -z "$install_prog" && \
2140
2861
    if test -n "$install_override_mode" && $no_mode; then
2141
2862
      if $install_cp; then :; else
2142
2863
        func_quote_for_eval "$install_override_mode"
2143
 
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
 
2864
        func_append install_shared_prog " -m $func_quote_for_eval_result"
2144
2865
      fi
2145
2866
    fi
2146
2867
 
2198
2919
      case $file in
2199
2920
      *.$libext)
2200
2921
        # Do the static libraries later.
2201
 
        staticlibs="$staticlibs $file"
 
2922
        func_append staticlibs " $file"
2202
2923
        ;;
2203
2924
 
2204
2925
      *.la)
 
2926
        func_resolve_sysroot "$file"
 
2927
        file=$func_resolve_sysroot_result
 
2928
 
2205
2929
        # Check to see that this really is a libtool archive.
2206
2930
        func_lalib_unsafe_p "$file" \
2207
2931
          || func_fatal_help "\`$file' is not a valid libtool archive"
2215
2939
        if test "X$destdir" = "X$libdir"; then
2216
2940
          case "$current_libdirs " in
2217
2941
          *" $libdir "*) ;;
2218
 
          *) current_libdirs="$current_libdirs $libdir" ;;
 
2942
          *) func_append current_libdirs " $libdir" ;;
2219
2943
          esac
2220
2944
        else
2221
2945
          # Note the libdir as a future libdir.
2222
2946
          case "$future_libdirs " in
2223
2947
          *" $libdir "*) ;;
2224
 
          *) future_libdirs="$future_libdirs $libdir" ;;
 
2948
          *) func_append future_libdirs " $libdir" ;;
2225
2949
          esac
2226
2950
        fi
2227
2951
 
2228
2952
        func_dirname "$file" "/" ""
2229
2953
        dir="$func_dirname_result"
2230
 
        dir="$dir$objdir"
 
2954
        func_append dir "$objdir"
2231
2955
 
2232
2956
        if test -n "$relink_command"; then
2233
2957
          # Determine the prefix the user has applied to our future dir.
2304
3028
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2305
3029
 
2306
3030
        # Maybe install the static library, too.
2307
 
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
 
3031
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
2308
3032
        ;;
2309
3033
 
2310
3034
      *.lo)
2478
3202
 
2479
3203
      # Set up the ranlib parameters.
2480
3204
      oldlib="$destdir/$name"
 
3205
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
 
3206
      tool_oldlib=$func_to_tool_file_result
2481
3207
 
2482
3208
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2483
3209
 
2484
3210
      if test -n "$stripme" && test -n "$old_striplib"; then
2485
 
        func_show_eval "$old_striplib $oldlib" 'exit $?'
 
3211
        func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
2486
3212
      fi
2487
3213
 
2488
3214
      # Do each command in the postinstall commands.
2501
3227
    fi
2502
3228
}
2503
3229
 
2504
 
test "$mode" = install && func_mode_install ${1+"$@"}
 
3230
test "$opt_mode" = install && func_mode_install ${1+"$@"}
2505
3231
 
2506
3232
 
2507
3233
# func_generate_dlsyms outputname originator pic_p
2548
3274
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
2549
3275
#endif
2550
3276
 
 
3277
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
 
3278
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 
3279
/* DATA imports from DLLs on WIN32 con't be const, because runtime
 
3280
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
 
3281
# define LT_DLSYM_CONST
 
3282
#elif defined(__osf__)
 
3283
/* This system does not cope well with relocations in const data.  */
 
3284
# define LT_DLSYM_CONST
 
3285
#else
 
3286
# define LT_DLSYM_CONST const
 
3287
#endif
 
3288
 
2551
3289
/* External symbol declarations for the compiler. */\
2552
3290
"
2553
3291
 
2559
3297
          # Add our own program objects to the symbol list.
2560
3298
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2561
3299
          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'"
 
3300
            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
 
3301
            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
 
3302
            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
2564
3303
          done
2565
3304
 
2566
3305
          if test -n "$exclude_expsyms"; then
2609
3348
          func_verbose "extracting global C symbols from \`$dlprefile'"
2610
3349
          func_basename "$dlprefile"
2611
3350
          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
 
          }
 
3351
          case $host in
 
3352
            *cygwin* | *mingw* | *cegcc* )
 
3353
              # if an import library, we need to obtain dlname
 
3354
              if func_win32_import_lib_p "$dlprefile"; then
 
3355
                func_tr_sh "$dlprefile"
 
3356
                eval "curr_lafile=\$libfile_$func_tr_sh_result"
 
3357
                dlprefile_dlbasename=""
 
3358
                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 
3359
                  # Use subshell, to avoid clobbering current variable values
 
3360
                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
 
3361
                  if test -n "$dlprefile_dlname" ; then
 
3362
                    func_basename "$dlprefile_dlname"
 
3363
                    dlprefile_dlbasename="$func_basename_result"
 
3364
                  else
 
3365
                    # no lafile. user explicitly requested -dlpreopen <import library>.
 
3366
                    $sharedlib_from_linklib_cmd "$dlprefile"
 
3367
                    dlprefile_dlbasename=$sharedlib_from_linklib_result
 
3368
                  fi
 
3369
                fi
 
3370
                $opt_dry_run || {
 
3371
                  if test -n "$dlprefile_dlbasename" ; then
 
3372
                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 
3373
                  else
 
3374
                    func_warning "Could not compute DLL name from $name"
 
3375
                    eval '$ECHO ": $name " >> "$nlist"'
 
3376
                  fi
 
3377
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3378
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
 
3379
                    $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
 
3380
                }
 
3381
              else # not an import lib
 
3382
                $opt_dry_run || {
 
3383
                  eval '$ECHO ": $name " >> "$nlist"'
 
3384
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3385
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
 
3386
                }
 
3387
              fi
 
3388
            ;;
 
3389
            *)
 
3390
              $opt_dry_run || {
 
3391
                eval '$ECHO ": $name " >> "$nlist"'
 
3392
                func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3393
                eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
 
3394
              }
 
3395
            ;;
 
3396
          esac
2616
3397
        done
2617
3398
 
2618
3399
        $opt_dry_run || {
2650
3431
  const char *name;
2651
3432
  void *address;
2652
3433
} 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
 
3434
extern LT_DLSYM_CONST lt_dlsymlist
2671
3435
lt_${my_prefix}_LTX_preloaded_symbols[];
2672
 
$lt_dlsym_const lt_dlsymlist
 
3436
LT_DLSYM_CONST lt_dlsymlist
2673
3437
lt_${my_prefix}_LTX_preloaded_symbols[] =
2674
3438
{\
2675
3439
  { \"$my_originator\", (void *) 0 },"
2709
3473
          # linked before any other PIC object.  But we must not use
2710
3474
          # pic_flag when linking with -static.  The problem exists in
2711
3475
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2712
 
          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 
3476
          *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2713
3477
            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2714
3478
          *-*-hpux*)
2715
3479
            pic_flag_for_symtable=" $pic_flag"  ;;
2725
3489
        for arg in $LTCFLAGS; do
2726
3490
          case $arg in
2727
3491
          -pie | -fpie | -fPIE) ;;
2728
 
          *) symtab_cflags="$symtab_cflags $arg" ;;
 
3492
          *) func_append symtab_cflags " $arg" ;;
2729
3493
          esac
2730
3494
        done
2731
3495
 
2788
3552
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2789
3553
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2790
3554
       $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 |
 
3555
      func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3556
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
2792
3557
        $SED -n -e '
2793
3558
            1,100{
2794
3559
                / I /{
2817
3582
  $ECHO "$win32_libid_type"
2818
3583
}
2819
3584
 
 
3585
# func_cygming_dll_for_implib ARG
 
3586
#
 
3587
# Platform-specific function to extract the
 
3588
# name of the DLL associated with the specified
 
3589
# import library ARG.
 
3590
# Invoked by eval'ing the libtool variable
 
3591
#    $sharedlib_from_linklib_cmd
 
3592
# Result is available in the variable
 
3593
#    $sharedlib_from_linklib_result
 
3594
func_cygming_dll_for_implib ()
 
3595
{
 
3596
  $opt_debug
 
3597
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 
3598
}
 
3599
 
 
3600
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
 
3601
#
 
3602
# The is the core of a fallback implementation of a
 
3603
# platform-specific function to extract the name of the
 
3604
# DLL associated with the specified import library LIBNAME.
 
3605
#
 
3606
# SECTION_NAME is either .idata$6 or .idata$7, depending
 
3607
# on the platform and compiler that created the implib.
 
3608
#
 
3609
# Echos the name of the DLL associated with the
 
3610
# specified import library.
 
3611
func_cygming_dll_for_implib_fallback_core ()
 
3612
{
 
3613
  $opt_debug
 
3614
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
 
3615
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
 
3616
    $SED '/^Contents of section '"$match_literal"':/{
 
3617
      # Place marker at beginning of archive member dllname section
 
3618
      s/.*/====MARK====/
 
3619
      p
 
3620
      d
 
3621
    }
 
3622
    # These lines can sometimes be longer than 43 characters, but
 
3623
    # are always uninteresting
 
3624
    /:[  ]*file format pe[i]\{,1\}-/d
 
3625
    /^In archive [^:]*:/d
 
3626
    # Ensure marker is printed
 
3627
    /^====MARK====/p
 
3628
    # Remove all lines with less than 43 characters
 
3629
    /^.\{43\}/!d
 
3630
    # From remaining lines, remove first 43 characters
 
3631
    s/^.\{43\}//' |
 
3632
    $SED -n '
 
3633
      # Join marker and all lines until next marker into a single line
 
3634
      /^====MARK====/ b para
 
3635
      H
 
3636
      $ b para
 
3637
      b
 
3638
      :para
 
3639
      x
 
3640
      s/\n//g
 
3641
      # Remove the marker
 
3642
      s/^====MARK====//
 
3643
      # Remove trailing dots and whitespace
 
3644
      s/[\. \t]*$//
 
3645
      # Print
 
3646
      /./p' |
 
3647
    # we now have a list, one entry per line, of the stringified
 
3648
    # contents of the appropriate section of all members of the
 
3649
    # archive which possess that section. Heuristic: eliminate
 
3650
    # all those which have a first or second character that is
 
3651
    # a '.' (that is, objdump's representation of an unprintable
 
3652
    # character.) This should work for all archives with less than
 
3653
    # 0x302f exports -- but will fail for DLLs whose name actually
 
3654
    # begins with a literal '.' or a single character followed by
 
3655
    # a '.'.
 
3656
    #
 
3657
    # Of those that remain, print the first one.
 
3658
    $SED -e '/^\./d;/^.\./d;q'
 
3659
}
 
3660
 
 
3661
# func_cygming_gnu_implib_p ARG
 
3662
# This predicate returns with zero status (TRUE) if
 
3663
# ARG is a GNU/binutils-style import library. Returns
 
3664
# with nonzero status (FALSE) otherwise.
 
3665
func_cygming_gnu_implib_p ()
 
3666
{
 
3667
  $opt_debug
 
3668
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3669
  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)$'`
 
3670
  test -n "$func_cygming_gnu_implib_tmp"
 
3671
}
 
3672
 
 
3673
# func_cygming_ms_implib_p ARG
 
3674
# This predicate returns with zero status (TRUE) if
 
3675
# ARG is an MS-style import library. Returns
 
3676
# with nonzero status (FALSE) otherwise.
 
3677
func_cygming_ms_implib_p ()
 
3678
{
 
3679
  $opt_debug
 
3680
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3681
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
 
3682
  test -n "$func_cygming_ms_implib_tmp"
 
3683
}
 
3684
 
 
3685
# func_cygming_dll_for_implib_fallback ARG
 
3686
# Platform-specific function to extract the
 
3687
# name of the DLL associated with the specified
 
3688
# import library ARG.
 
3689
#
 
3690
# This fallback implementation is for use when $DLLTOOL
 
3691
# does not support the --identify-strict option.
 
3692
# Invoked by eval'ing the libtool variable
 
3693
#    $sharedlib_from_linklib_cmd
 
3694
# Result is available in the variable
 
3695
#    $sharedlib_from_linklib_result
 
3696
func_cygming_dll_for_implib_fallback ()
 
3697
{
 
3698
  $opt_debug
 
3699
  if func_cygming_gnu_implib_p "$1" ; then
 
3700
    # binutils import library
 
3701
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
 
3702
  elif func_cygming_ms_implib_p "$1" ; then
 
3703
    # ms-generated import library
 
3704
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
 
3705
  else
 
3706
    # unknown
 
3707
    sharedlib_from_linklib_result=""
 
3708
  fi
 
3709
}
2820
3710
 
2821
3711
 
2822
3712
# func_extract_an_archive dir oldlib
3095
3985
# launches target application with the remaining arguments.
3096
3986
func_exec_program ()
3097
3987
{
3098
 
  for lt_wr_arg
3099
 
  do
3100
 
    case \$lt_wr_arg in
3101
 
    --lt-*) ;;
3102
 
    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3103
 
    esac
3104
 
    shift
3105
 
  done
 
3988
  case \" \$* \" in
 
3989
  *\\ --lt-*)
 
3990
    for lt_wr_arg
 
3991
    do
 
3992
      case \$lt_wr_arg in
 
3993
      --lt-*) ;;
 
3994
      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
 
3995
      esac
 
3996
      shift
 
3997
    done ;;
 
3998
  esac
3106
3999
  func_exec_program_core \${1+\"\$@\"}
3107
4000
}
3108
4001
 
3195
4088
 
3196
4089
  if test -f \"\$progdir/\$program\"; then"
3197
4090
 
 
4091
        # fixup the dll searchpath if we need to.
 
4092
        #
 
4093
        # Fix the DLL searchpath if we need to.  Do this before prepending
 
4094
        # to shlibpath, because on Windows, both are PATH and uninstalled
 
4095
        # libraries must come first.
 
4096
        if test -n "$dllsearchpath"; then
 
4097
          $ECHO "\
 
4098
    # Add the dll search path components to the executable PATH
 
4099
    PATH=$dllsearchpath:\$PATH
 
4100
"
 
4101
        fi
 
4102
 
3198
4103
        # Export our shlibpath_var if we have one.
3199
4104
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3200
4105
          $ECHO "\
3209
4114
"
3210
4115
        fi
3211
4116
 
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
4117
        $ECHO "\
3221
4118
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3222
4119
      # Run the actual program with our arguments.
3234
4131
}
3235
4132
 
3236
4133
 
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
4134
# func_emit_cwrapperexe_src
3398
4135
# emit the source code for a wrapper executable on stdout
3399
4136
# Must ONLY be called from within func_mode_link because
3563
4300
EOF
3564
4301
 
3565
4302
            cat <<EOF
3566
 
const char * MAGIC_EXE = "$magic_exe";
 
4303
volatile const char * MAGIC_EXE = "$magic_exe";
3567
4304
const char * LIB_PATH_VARNAME = "$shlibpath_var";
3568
4305
EOF
3569
4306
 
3570
4307
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3571
 
              func_to_host_pathlist "$temp_rpath"
 
4308
              func_to_host_path "$temp_rpath"
3572
4309
              cat <<EOF
3573
 
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4310
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
3574
4311
EOF
3575
4312
            else
3576
4313
              cat <<"EOF"
3579
4316
            fi
3580
4317
 
3581
4318
            if test -n "$dllsearchpath"; then
3582
 
              func_to_host_pathlist "$dllsearchpath:"
 
4319
              func_to_host_path "$dllsearchpath:"
3583
4320
              cat <<EOF
3584
4321
const char * EXE_PATH_VARNAME = "PATH";
3585
 
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4322
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
3586
4323
EOF
3587
4324
            else
3588
4325
              cat <<"EOF"
3765
4502
 
3766
4503
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3767
4504
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
 
4505
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
 
4506
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
 
4507
     because on Windows, both *_VARNAMEs are PATH but uninstalled
 
4508
     libraries must come first. */
 
4509
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3768
4510
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3769
 
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3770
4511
 
3771
4512
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3772
4513
                  nonnull (lt_argv_zero));
4322
5063
{
4323
5064
EOF
4324
5065
            func_emit_wrapper yes |
4325
 
              $SED -e 's/\([\\"]\)/\\\1/g' \
4326
 
                   -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
4327
 
 
 
5066
              $SED -n -e '
 
5067
s/^\(.\{79\}\)\(..*\)/\1\
 
5068
\2/
 
5069
h
 
5070
s/\([\\"]\)/\\\1/g
 
5071
s/$/\\n/
 
5072
s/\([^\n]*\).*/  fputs ("\1", f);/p
 
5073
g
 
5074
D'
4328
5075
            cat <<"EOF"
4329
5076
}
4330
5077
EOF
4515
5262
            ;;
4516
5263
          *)
4517
5264
            if test "$prev" = dlfiles; then
4518
 
              dlfiles="$dlfiles $arg"
 
5265
              func_append dlfiles " $arg"
4519
5266
            else
4520
 
              dlprefiles="$dlprefiles $arg"
 
5267
              func_append dlprefiles " $arg"
4521
5268
            fi
4522
5269
            prev=
4523
5270
            continue
4541
5288
            *-*-darwin*)
4542
5289
              case "$deplibs " in
4543
5290
                *" $qarg.ltframework "*) ;;
4544
 
                *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
 
5291
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
4545
5292
                   ;;
4546
5293
              esac
4547
5294
              ;;
4560
5307
            moreargs=
4561
5308
            for fil in `cat "$save_arg"`
4562
5309
            do
4563
 
#             moreargs="$moreargs $fil"
 
5310
#             func_append moreargs " $fil"
4564
5311
              arg=$fil
4565
5312
              # A libtool-controlled object.
4566
5313
 
4589
5336
 
4590
5337
                  if test "$prev" = dlfiles; then
4591
5338
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4592
 
                      dlfiles="$dlfiles $pic_object"
 
5339
                      func_append dlfiles " $pic_object"
4593
5340
                      prev=
4594
5341
                      continue
4595
5342
                    else
4601
5348
                  # CHECK ME:  I think I busted this.  -Ossama
4602
5349
                  if test "$prev" = dlprefiles; then
4603
5350
                    # Preload the old-style object.
4604
 
                    dlprefiles="$dlprefiles $pic_object"
 
5351
                    func_append dlprefiles " $pic_object"
4605
5352
                    prev=
4606
5353
                  fi
4607
5354
 
4671
5418
          if test "$prev" = rpath; then
4672
5419
            case "$rpath " in
4673
5420
            *" $arg "*) ;;
4674
 
            *) rpath="$rpath $arg" ;;
 
5421
            *) func_append rpath " $arg" ;;
4675
5422
            esac
4676
5423
          else
4677
5424
            case "$xrpath " in
4678
5425
            *" $arg "*) ;;
4679
 
            *) xrpath="$xrpath $arg" ;;
 
5426
            *) func_append xrpath " $arg" ;;
4680
5427
            esac
4681
5428
          fi
4682
5429
          prev=
4688
5435
          continue
4689
5436
          ;;
4690
5437
        weak)
4691
 
          weak_libs="$weak_libs $arg"
 
5438
          func_append weak_libs " $arg"
4692
5439
          prev=
4693
5440
          continue
4694
5441
          ;;
4695
5442
        xcclinker)
4696
 
          linker_flags="$linker_flags $qarg"
4697
 
          compiler_flags="$compiler_flags $qarg"
 
5443
          func_append linker_flags " $qarg"
 
5444
          func_append compiler_flags " $qarg"
4698
5445
          prev=
4699
5446
          func_append compile_command " $qarg"
4700
5447
          func_append finalize_command " $qarg"
4701
5448
          continue
4702
5449
          ;;
4703
5450
        xcompiler)
4704
 
          compiler_flags="$compiler_flags $qarg"
 
5451
          func_append compiler_flags " $qarg"
4705
5452
          prev=
4706
5453
          func_append compile_command " $qarg"
4707
5454
          func_append finalize_command " $qarg"
4708
5455
          continue
4709
5456
          ;;
4710
5457
        xlinker)
4711
 
          linker_flags="$linker_flags $qarg"
4712
 
          compiler_flags="$compiler_flags $wl$qarg"
 
5458
          func_append linker_flags " $qarg"
 
5459
          func_append compiler_flags " $wl$qarg"
4713
5460
          prev=
4714
5461
          func_append compile_command " $wl$qarg"
4715
5462
          func_append finalize_command " $wl$qarg"
4800
5547
        ;;
4801
5548
 
4802
5549
      -L*)
4803
 
        func_stripname '-L' '' "$arg"
4804
 
        dir=$func_stripname_result
4805
 
        if test -z "$dir"; then
 
5550
        func_stripname "-L" '' "$arg"
 
5551
        if test -z "$func_stripname_result"; then
4806
5552
          if test "$#" -gt 0; then
4807
5553
            func_fatal_error "require no space between \`-L' and \`$1'"
4808
5554
          else
4809
5555
            func_fatal_error "need path for \`-L' option"
4810
5556
          fi
4811
5557
        fi
 
5558
        func_resolve_sysroot "$func_stripname_result"
 
5559
        dir=$func_resolve_sysroot_result
4812
5560
        # We need an absolute path.
4813
5561
        case $dir in
4814
5562
        [\\/]* | [A-Za-z]:[\\/]*) ;;
4820
5568
          ;;
4821
5569
        esac
4822
5570
        case "$deplibs " in
4823
 
        *" -L$dir "*) ;;
 
5571
        *" -L$dir "* | *" $arg "*)
 
5572
          # Will only happen for absolute or sysroot arguments
 
5573
          ;;
4824
5574
        *)
4825
 
          deplibs="$deplibs -L$dir"
4826
 
          lib_search_path="$lib_search_path $dir"
 
5575
          # Preserve sysroot, but never include relative directories
 
5576
          case $dir in
 
5577
            [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
 
5578
            *) func_append deplibs " -L$dir" ;;
 
5579
          esac
 
5580
          func_append lib_search_path " $dir"
4827
5581
          ;;
4828
5582
        esac
4829
5583
        case $host in
4832
5586
          case :$dllsearchpath: in
4833
5587
          *":$dir:"*) ;;
4834
5588
          ::) dllsearchpath=$dir;;
4835
 
          *) dllsearchpath="$dllsearchpath:$dir";;
 
5589
          *) func_append dllsearchpath ":$dir";;
4836
5590
          esac
4837
5591
          case :$dllsearchpath: in
4838
5592
          *":$testbindir:"*) ;;
4839
5593
          ::) dllsearchpath=$testbindir;;
4840
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
5594
          *) func_append dllsearchpath ":$testbindir";;
4841
5595
          esac
4842
5596
          ;;
4843
5597
        esac
4861
5615
            ;;
4862
5616
          *-*-rhapsody* | *-*-darwin1.[012])
4863
5617
            # Rhapsody C and math libraries are in the System framework
4864
 
            deplibs="$deplibs System.ltframework"
 
5618
            func_append deplibs " System.ltframework"
4865
5619
            continue
4866
5620
            ;;
4867
5621
          *-*-sco3.2v5* | *-*-sco5v6*)
4881
5635
           ;;
4882
5636
         esac
4883
5637
        fi
4884
 
        deplibs="$deplibs $arg"
 
5638
        func_append deplibs " $arg"
4885
5639
        continue
4886
5640
        ;;
4887
5641
 
4893
5647
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
4894
5648
      # classes, name mangling, and exception handling.
4895
5649
      # Darwin uses the -arch flag to determine output architecture.
4896
 
      -model|-arch|-isysroot)
4897
 
        compiler_flags="$compiler_flags $arg"
 
5650
      -model|-arch|-isysroot|--sysroot)
 
5651
        func_append compiler_flags " $arg"
4898
5652
        func_append compile_command " $arg"
4899
5653
        func_append finalize_command " $arg"
4900
5654
        prev=xcompiler
4901
5655
        continue
4902
5656
        ;;
4903
5657
 
4904
 
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4905
 
        compiler_flags="$compiler_flags $arg"
 
5658
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
 
5659
      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 
5660
        func_append compiler_flags " $arg"
4906
5661
        func_append compile_command " $arg"
4907
5662
        func_append finalize_command " $arg"
4908
5663
        case "$new_inherited_linker_flags " in
4909
5664
            *" $arg "*) ;;
4910
 
            * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
 
5665
            * ) func_append new_inherited_linker_flags " $arg" ;;
4911
5666
        esac
4912
5667
        continue
4913
5668
        ;;
4974
5729
        # We need an absolute path.
4975
5730
        case $dir in
4976
5731
        [\\/]* | [A-Za-z]:[\\/]*) ;;
 
5732
        =*)
 
5733
          func_stripname '=' '' "$dir"
 
5734
          dir=$lt_sysroot$func_stripname_result
 
5735
          ;;
4977
5736
        *)
4978
5737
          func_fatal_error "only absolute run-paths are allowed"
4979
5738
          ;;
4980
5739
        esac
4981
5740
        case "$xrpath " in
4982
5741
        *" $dir "*) ;;
4983
 
        *) xrpath="$xrpath $dir" ;;
 
5742
        *) func_append xrpath " $dir" ;;
4984
5743
        esac
4985
5744
        continue
4986
5745
        ;;
5033
5792
        for flag in $args; do
5034
5793
          IFS="$save_ifs"
5035
5794
          func_quote_for_eval "$flag"
5036
 
          arg="$arg $func_quote_for_eval_result"
5037
 
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
 
5795
          func_append arg " $func_quote_for_eval_result"
 
5796
          func_append compiler_flags " $func_quote_for_eval_result"
5038
5797
        done
5039
5798
        IFS="$save_ifs"
5040
5799
        func_stripname ' ' '' "$arg"
5049
5808
        for flag in $args; do
5050
5809
          IFS="$save_ifs"
5051
5810
          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"
 
5811
          func_append arg " $wl$func_quote_for_eval_result"
 
5812
          func_append compiler_flags " $wl$func_quote_for_eval_result"
 
5813
          func_append linker_flags " $func_quote_for_eval_result"
5055
5814
        done
5056
5815
        IFS="$save_ifs"
5057
5816
        func_stripname ' ' '' "$arg"
5090
5849
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
5091
5850
      # @file                GCC response files
5092
5851
      # -tp=*                Portland pgcc target processor selection
 
5852
      # --sysroot=*          for sysroot support
 
5853
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5093
5854
      -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=*)
 
5855
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
 
5856
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5095
5857
        func_quote_for_eval "$arg"
5096
5858
        arg="$func_quote_for_eval_result"
5097
5859
        func_append compile_command " $arg"
5098
5860
        func_append finalize_command " $arg"
5099
 
        compiler_flags="$compiler_flags $arg"
 
5861
        func_append compiler_flags " $arg"
5100
5862
        continue
5101
5863
        ;;
5102
5864
 
5108
5870
 
5109
5871
      *.$objext)
5110
5872
        # A standard object.
5111
 
        objs="$objs $arg"
 
5873
        func_append objs " $arg"
5112
5874
        ;;
5113
5875
 
5114
5876
      *.lo)
5139
5901
 
5140
5902
            if test "$prev" = dlfiles; then
5141
5903
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5142
 
                dlfiles="$dlfiles $pic_object"
 
5904
                func_append dlfiles " $pic_object"
5143
5905
                prev=
5144
5906
                continue
5145
5907
              else
5151
5913
            # CHECK ME:  I think I busted this.  -Ossama
5152
5914
            if test "$prev" = dlprefiles; then
5153
5915
              # Preload the old-style object.
5154
 
              dlprefiles="$dlprefiles $pic_object"
 
5916
              func_append dlprefiles " $pic_object"
5155
5917
              prev=
5156
5918
            fi
5157
5919
 
5196
5958
 
5197
5959
      *.$libext)
5198
5960
        # An archive.
5199
 
        deplibs="$deplibs $arg"
5200
 
        old_deplibs="$old_deplibs $arg"
 
5961
        func_append deplibs " $arg"
 
5962
        func_append old_deplibs " $arg"
5201
5963
        continue
5202
5964
        ;;
5203
5965
 
5204
5966
      *.la)
5205
5967
        # A libtool-controlled library.
5206
5968
 
 
5969
        func_resolve_sysroot "$arg"
5207
5970
        if test "$prev" = dlfiles; then
5208
5971
          # This library was specified with -dlopen.
5209
 
          dlfiles="$dlfiles $arg"
 
5972
          func_append dlfiles " $func_resolve_sysroot_result"
5210
5973
          prev=
5211
5974
        elif test "$prev" = dlprefiles; then
5212
5975
          # The library was specified with -dlpreopen.
5213
 
          dlprefiles="$dlprefiles $arg"
 
5976
          func_append dlprefiles " $func_resolve_sysroot_result"
5214
5977
          prev=
5215
5978
        else
5216
 
          deplibs="$deplibs $arg"
 
5979
          func_append deplibs " $func_resolve_sysroot_result"
5217
5980
        fi
5218
5981
        continue
5219
5982
        ;;
5260
6023
 
5261
6024
    func_dirname "$output" "/" ""
5262
6025
    output_objdir="$func_dirname_result$objdir"
 
6026
    func_to_tool_file "$output_objdir/"
 
6027
    tool_output_objdir=$func_to_tool_file_result
5263
6028
    # Create the object directory.
5264
6029
    func_mkdir_p "$output_objdir"
5265
6030
 
5280
6045
    # Find all interdependent deplibs by searching for libraries
5281
6046
    # that are linked more than once (e.g. -la -lb -la)
5282
6047
    for deplib in $deplibs; do
5283
 
      if $opt_duplicate_deps ; then
 
6048
      if $opt_preserve_dup_deps ; then
5284
6049
        case "$libs " in
5285
 
        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6050
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5286
6051
        esac
5287
6052
      fi
5288
 
      libs="$libs $deplib"
 
6053
      func_append libs " $deplib"
5289
6054
    done
5290
6055
 
5291
6056
    if test "$linkmode" = lib; then
5298
6063
      if $opt_duplicate_compiler_generated_deps; then
5299
6064
        for pre_post_dep in $predeps $postdeps; do
5300
6065
          case "$pre_post_deps " in
5301
 
          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
 
6066
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
5302
6067
          esac
5303
 
          pre_post_deps="$pre_post_deps $pre_post_dep"
 
6068
          func_append pre_post_deps " $pre_post_dep"
5304
6069
        done
5305
6070
      fi
5306
6071
      pre_post_deps=
5367
6132
        for lib in $dlprefiles; do
5368
6133
          # Ignore non-libtool-libs
5369
6134
          dependency_libs=
 
6135
          func_resolve_sysroot "$lib"
5370
6136
          case $lib in
5371
 
          *.la) func_source "$lib" ;;
 
6137
          *.la) func_source "$func_resolve_sysroot_result" ;;
5372
6138
          esac
5373
6139
 
5374
6140
          # Collect preopened libtool deplibs, except any this library
5378
6144
            deplib_base=$func_basename_result
5379
6145
            case " $weak_libs " in
5380
6146
            *" $deplib_base "*) ;;
5381
 
            *) deplibs="$deplibs $deplib" ;;
 
6147
            *) func_append deplibs " $deplib" ;;
5382
6148
            esac
5383
6149
          done
5384
6150
        done
5394
6160
        lib=
5395
6161
        found=no
5396
6162
        case $deplib in
5397
 
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 
6163
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
 
6164
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5398
6165
          if test "$linkmode,$pass" = "prog,link"; then
5399
6166
            compile_deplibs="$deplib $compile_deplibs"
5400
6167
            finalize_deplibs="$deplib $finalize_deplibs"
5401
6168
          else
5402
 
            compiler_flags="$compiler_flags $deplib"
 
6169
            func_append compiler_flags " $deplib"
5403
6170
            if test "$linkmode" = lib ; then
5404
6171
                case "$new_inherited_linker_flags " in
5405
6172
                    *" $deplib "*) ;;
5406
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6173
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5407
6174
                esac
5408
6175
            fi
5409
6176
          fi
5488
6255
            if test "$linkmode" = lib ; then
5489
6256
                case "$new_inherited_linker_flags " in
5490
6257
                    *" $deplib "*) ;;
5491
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6258
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5492
6259
                esac
5493
6260
            fi
5494
6261
          fi
5501
6268
            test "$pass" = conv && continue
5502
6269
            newdependency_libs="$deplib $newdependency_libs"
5503
6270
            func_stripname '-L' '' "$deplib"
5504
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6271
            func_resolve_sysroot "$func_stripname_result"
 
6272
            func_append newlib_search_path " $func_resolve_sysroot_result"
5505
6273
            ;;
5506
6274
          prog)
5507
6275
            if test "$pass" = conv; then
5515
6283
              finalize_deplibs="$deplib $finalize_deplibs"
5516
6284
            fi
5517
6285
            func_stripname '-L' '' "$deplib"
5518
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6286
            func_resolve_sysroot "$func_stripname_result"
 
6287
            func_append newlib_search_path " $func_resolve_sysroot_result"
5519
6288
            ;;
5520
6289
          *)
5521
6290
            func_warning "\`-L' is ignored for archives/objects"
5526
6295
        -R*)
5527
6296
          if test "$pass" = link; then
5528
6297
            func_stripname '-R' '' "$deplib"
5529
 
            dir=$func_stripname_result
 
6298
            func_resolve_sysroot "$func_stripname_result"
 
6299
            dir=$func_resolve_sysroot_result
5530
6300
            # Make sure the xrpath contains only unique directories.
5531
6301
            case "$xrpath " in
5532
6302
            *" $dir "*) ;;
5533
 
            *) xrpath="$xrpath $dir" ;;
 
6303
            *) func_append xrpath " $dir" ;;
5534
6304
            esac
5535
6305
          fi
5536
6306
          deplibs="$deplib $deplibs"
5537
6307
          continue
5538
6308
          ;;
5539
 
        *.la) lib="$deplib" ;;
 
6309
        *.la)
 
6310
          func_resolve_sysroot "$deplib"
 
6311
          lib=$func_resolve_sysroot_result
 
6312
          ;;
5540
6313
        *.$libext)
5541
6314
          if test "$pass" = conv; then
5542
6315
            deplibs="$deplib $deplibs"
5599
6372
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5600
6373
              # If there is no dlopen support or we're linking statically,
5601
6374
              # we need to preload.
5602
 
              newdlprefiles="$newdlprefiles $deplib"
 
6375
              func_append newdlprefiles " $deplib"
5603
6376
              compile_deplibs="$deplib $compile_deplibs"
5604
6377
              finalize_deplibs="$deplib $finalize_deplibs"
5605
6378
            else
5606
 
              newdlfiles="$newdlfiles $deplib"
 
6379
              func_append newdlfiles " $deplib"
5607
6380
            fi
5608
6381
          fi
5609
6382
          continue
5649
6422
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5650
6423
            case " $new_inherited_linker_flags " in
5651
6424
              *" $tmp_inherited_linker_flag "*) ;;
5652
 
              *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
 
6425
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
5653
6426
            esac
5654
6427
          done
5655
6428
        fi
5657
6430
        if test "$linkmode,$pass" = "lib,link" ||
5658
6431
           test "$linkmode,$pass" = "prog,scan" ||
5659
6432
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5660
 
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5661
 
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
 
6433
          test -n "$dlopen" && func_append dlfiles " $dlopen"
 
6434
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
5662
6435
        fi
5663
6436
 
5664
6437
        if test "$pass" = conv; then
5669
6442
              func_fatal_error "cannot find name of link library for \`$lib'"
5670
6443
            fi
5671
6444
            # 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"
 
6445
            func_append convenience " $ladir/$objdir/$old_library"
 
6446
            func_append old_convenience " $ladir/$objdir/$old_library"
5674
6447
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
5675
6448
            func_fatal_error "\`$lib' is not a convenience library"
5676
6449
          fi
5677
6450
          tmp_libs=
5678
6451
          for deplib in $dependency_libs; do
5679
6452
            deplibs="$deplib $deplibs"
5680
 
            if $opt_duplicate_deps ; then
 
6453
            if $opt_preserve_dup_deps ; then
5681
6454
              case "$tmp_libs " in
5682
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6455
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5683
6456
              esac
5684
6457
            fi
5685
 
            tmp_libs="$tmp_libs $deplib"
 
6458
            func_append tmp_libs " $deplib"
5686
6459
          done
5687
6460
          continue
5688
6461
        fi # $pass = conv
5690
6463
 
5691
6464
        # Get the name of the library we link against.
5692
6465
        linklib=
5693
 
        for l in $old_library $library_names; do
5694
 
          linklib="$l"
5695
 
        done
 
6466
        if test -n "$old_library" &&
 
6467
           { test "$prefer_static_libs" = yes ||
 
6468
             test "$prefer_static_libs,$installed" = "built,no"; }; then
 
6469
          linklib=$old_library
 
6470
        else
 
6471
          for l in $old_library $library_names; do
 
6472
            linklib="$l"
 
6473
          done
 
6474
        fi
5696
6475
        if test -z "$linklib"; then
5697
6476
          func_fatal_error "cannot find name of link library for \`$lib'"
5698
6477
        fi
5709
6488
            # statically, we need to preload.  We also need to preload any
5710
6489
            # dependent libraries so libltdl's deplib preloader doesn't
5711
6490
            # bomb out in the load deplibs phase.
5712
 
            dlprefiles="$dlprefiles $lib $dependency_libs"
 
6491
            func_append dlprefiles " $lib $dependency_libs"
5713
6492
          else
5714
 
            newdlfiles="$newdlfiles $lib"
 
6493
            func_append newdlfiles " $lib"
5715
6494
          fi
5716
6495
          continue
5717
6496
        fi # $pass = dlopen
5733
6512
 
5734
6513
        # Find the relevant object directory and library name.
5735
6514
        if test "X$installed" = Xyes; then
5736
 
          if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
6515
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5737
6516
            func_warning "library \`$lib' was moved."
5738
6517
            dir="$ladir"
5739
6518
            absdir="$abs_ladir"
5740
6519
            libdir="$abs_ladir"
5741
6520
          else
5742
 
            dir="$libdir"
5743
 
            absdir="$libdir"
 
6521
            dir="$lt_sysroot$libdir"
 
6522
            absdir="$lt_sysroot$libdir"
5744
6523
          fi
5745
6524
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5746
6525
        else
5748
6527
            dir="$ladir"
5749
6528
            absdir="$abs_ladir"
5750
6529
            # Remove this search path later
5751
 
            notinst_path="$notinst_path $abs_ladir"
 
6530
            func_append notinst_path " $abs_ladir"
5752
6531
          else
5753
6532
            dir="$ladir/$objdir"
5754
6533
            absdir="$abs_ladir/$objdir"
5755
6534
            # Remove this search path later
5756
 
            notinst_path="$notinst_path $abs_ladir"
 
6535
            func_append notinst_path " $abs_ladir"
5757
6536
          fi
5758
6537
        fi # $installed = yes
5759
6538
        func_stripname 'lib' '.la' "$laname"
5764
6543
          if test -z "$libdir" && test "$linkmode" = prog; then
5765
6544
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5766
6545
          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
 
6546
          case "$host" in
 
6547
            # special handling for platforms with PE-DLLs.
 
6548
            *cygwin* | *mingw* | *cegcc* )
 
6549
              # Linker will automatically link against shared library if both
 
6550
              # static and shared are present.  Therefore, ensure we extract
 
6551
              # symbols from the import library if a shared library is present
 
6552
              # (otherwise, the dlopen module name will be incorrect).  We do
 
6553
              # this by putting the import library name into $newdlprefiles.
 
6554
              # We recover the dlopen module name by 'saving' the la file
 
6555
              # name in a special purpose variable, and (later) extracting the
 
6556
              # dlname from the la file.
 
6557
              if test -n "$dlname"; then
 
6558
                func_tr_sh "$dir/$linklib"
 
6559
                eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
 
6560
                func_append newdlprefiles " $dir/$linklib"
 
6561
              else
 
6562
                func_append newdlprefiles " $dir/$old_library"
 
6563
                # Keep a list of preopened convenience libraries to check
 
6564
                # that they are being used correctly in the link pass.
 
6565
                test -z "$libdir" && \
 
6566
                  func_append dlpreconveniencelibs " $dir/$old_library"
 
6567
              fi
 
6568
            ;;
 
6569
            * )
 
6570
              # Prefer using a static library (so that no silly _DYNAMIC symbols
 
6571
              # are required to link).
 
6572
              if test -n "$old_library"; then
 
6573
                func_append newdlprefiles " $dir/$old_library"
 
6574
                # Keep a list of preopened convenience libraries to check
 
6575
                # that they are being used correctly in the link pass.
 
6576
                test -z "$libdir" && \
 
6577
                  func_append dlpreconveniencelibs " $dir/$old_library"
 
6578
              # Otherwise, use the dlname, so that lt_dlopen finds it.
 
6579
              elif test -n "$dlname"; then
 
6580
                func_append newdlprefiles " $dir/$dlname"
 
6581
              else
 
6582
                func_append newdlprefiles " $dir/$linklib"
 
6583
              fi
 
6584
            ;;
 
6585
          esac
5781
6586
        fi # $pass = dlpreopen
5782
6587
 
5783
6588
        if test -z "$libdir"; then
5795
6600
 
5796
6601
 
5797
6602
        if test "$linkmode" = prog && test "$pass" != link; then
5798
 
          newlib_search_path="$newlib_search_path $ladir"
 
6603
          func_append newlib_search_path " $ladir"
5799
6604
          deplibs="$lib $deplibs"
5800
6605
 
5801
6606
          linkalldeplibs=no
5808
6613
          for deplib in $dependency_libs; do
5809
6614
            case $deplib in
5810
6615
            -L*) func_stripname '-L' '' "$deplib"
5811
 
                 newlib_search_path="$newlib_search_path $func_stripname_result"
 
6616
                 func_resolve_sysroot "$func_stripname_result"
 
6617
                 func_append newlib_search_path " $func_resolve_sysroot_result"
5812
6618
                 ;;
5813
6619
            esac
5814
6620
            # Need to link against all dependency_libs?
5819
6625
              # or/and link against static libraries
5820
6626
              newdependency_libs="$deplib $newdependency_libs"
5821
6627
            fi
5822
 
            if $opt_duplicate_deps ; then
 
6628
            if $opt_preserve_dup_deps ; then
5823
6629
              case "$tmp_libs " in
5824
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6630
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5825
6631
              esac
5826
6632
            fi
5827
 
            tmp_libs="$tmp_libs $deplib"
 
6633
            func_append tmp_libs " $deplib"
5828
6634
          done # for deplib
5829
6635
          continue
5830
6636
        fi # $linkmode = prog...
5839
6645
              # Make sure the rpath contains only unique directories.
5840
6646
              case "$temp_rpath:" in
5841
6647
              *"$absdir:"*) ;;
5842
 
              *) temp_rpath="$temp_rpath$absdir:" ;;
 
6648
              *) func_append temp_rpath "$absdir:" ;;
5843
6649
              esac
5844
6650
            fi
5845
6651
 
5851
6657
            *)
5852
6658
              case "$compile_rpath " in
5853
6659
              *" $absdir "*) ;;
5854
 
              *) compile_rpath="$compile_rpath $absdir"
 
6660
              *) func_append compile_rpath " $absdir" ;;
5855
6661
              esac
5856
6662
              ;;
5857
6663
            esac
5860
6666
            *)
5861
6667
              case "$finalize_rpath " in
5862
6668
              *" $libdir "*) ;;
5863
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6669
              *) func_append finalize_rpath " $libdir" ;;
5864
6670
              esac
5865
6671
              ;;
5866
6672
            esac
5885
6691
          case $host in
5886
6692
          *cygwin* | *mingw* | *cegcc*)
5887
6693
              # No point in relinking DLLs because paths are not encoded
5888
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6694
              func_append notinst_deplibs " $lib"
5889
6695
              need_relink=no
5890
6696
            ;;
5891
6697
          *)
5892
6698
            if test "$installed" = no; then
5893
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6699
              func_append notinst_deplibs " $lib"
5894
6700
              need_relink=yes
5895
6701
            fi
5896
6702
            ;;
5925
6731
            *)
5926
6732
              case "$compile_rpath " in
5927
6733
              *" $absdir "*) ;;
5928
 
              *) compile_rpath="$compile_rpath $absdir"
 
6734
              *) func_append compile_rpath " $absdir" ;;
5929
6735
              esac
5930
6736
              ;;
5931
6737
            esac
5934
6740
            *)
5935
6741
              case "$finalize_rpath " in
5936
6742
              *" $libdir "*) ;;
5937
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6743
              *) func_append finalize_rpath " $libdir" ;;
5938
6744
              esac
5939
6745
              ;;
5940
6746
            esac
5988
6794
            linklib=$newlib
5989
6795
          fi # test -n "$old_archive_from_expsyms_cmds"
5990
6796
 
5991
 
          if test "$linkmode" = prog || test "$mode" != relink; then
 
6797
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
5992
6798
            add_shlibpath=
5993
6799
            add_dir=
5994
6800
            add=
6039
6845
                 test "$hardcode_direct_absolute" = no; then
6040
6846
                add="$dir/$linklib"
6041
6847
              elif test "$hardcode_minus_L" = yes; then
6042
 
                add_dir="-L$dir"
 
6848
                add_dir="-L$absdir"
6043
6849
                # Try looking first in the location we're being installed to.
6044
6850
                if test -n "$inst_prefix_dir"; then
6045
6851
                  case $libdir in
6046
6852
                    [\\/]*)
6047
 
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6853
                      func_append add_dir " -L$inst_prefix_dir$libdir"
6048
6854
                      ;;
6049
6855
                  esac
6050
6856
                fi
6066
6872
            if test -n "$add_shlibpath"; then
6067
6873
              case :$compile_shlibpath: in
6068
6874
              *":$add_shlibpath:"*) ;;
6069
 
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
 
6875
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
6070
6876
              esac
6071
6877
            fi
6072
6878
            if test "$linkmode" = prog; then
6080
6886
                 test "$hardcode_shlibpath_var" = yes; then
6081
6887
                case :$finalize_shlibpath: in
6082
6888
                *":$libdir:"*) ;;
6083
 
                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6889
                *) func_append finalize_shlibpath "$libdir:" ;;
6084
6890
                esac
6085
6891
              fi
6086
6892
            fi
6087
6893
          fi
6088
6894
 
6089
 
          if test "$linkmode" = prog || test "$mode" = relink; then
 
6895
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
6090
6896
            add_shlibpath=
6091
6897
            add_dir=
6092
6898
            add=
6100
6906
            elif test "$hardcode_shlibpath_var" = yes; then
6101
6907
              case :$finalize_shlibpath: in
6102
6908
              *":$libdir:"*) ;;
6103
 
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6909
              *) func_append finalize_shlibpath "$libdir:" ;;
6104
6910
              esac
6105
6911
              add="-l$name"
6106
6912
            elif test "$hardcode_automatic" = yes; then
6117
6923
              if test -n "$inst_prefix_dir"; then
6118
6924
                case $libdir in
6119
6925
                  [\\/]*)
6120
 
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6926
                    func_append add_dir " -L$inst_prefix_dir$libdir"
6121
6927
                    ;;
6122
6928
                esac
6123
6929
              fi
6194
7000
                   temp_xrpath=$func_stripname_result
6195
7001
                   case " $xrpath " in
6196
7002
                   *" $temp_xrpath "*) ;;
6197
 
                   *) xrpath="$xrpath $temp_xrpath";;
 
7003
                   *) func_append xrpath " $temp_xrpath";;
6198
7004
                   esac;;
6199
 
              *) temp_deplibs="$temp_deplibs $libdir";;
 
7005
              *) func_append temp_deplibs " $libdir";;
6200
7006
              esac
6201
7007
            done
6202
7008
            dependency_libs="$temp_deplibs"
6203
7009
          fi
6204
7010
 
6205
 
          newlib_search_path="$newlib_search_path $absdir"
 
7011
          func_append newlib_search_path " $absdir"
6206
7012
          # Link against this library
6207
7013
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6208
7014
          # ... and its dependency_libs
6209
7015
          tmp_libs=
6210
7016
          for deplib in $dependency_libs; do
6211
7017
            newdependency_libs="$deplib $newdependency_libs"
6212
 
            if $opt_duplicate_deps ; then
 
7018
            case $deplib in
 
7019
              -L*) func_stripname '-L' '' "$deplib"
 
7020
                   func_resolve_sysroot "$func_stripname_result";;
 
7021
              *) func_resolve_sysroot "$deplib" ;;
 
7022
            esac
 
7023
            if $opt_preserve_dup_deps ; then
6213
7024
              case "$tmp_libs " in
6214
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
7025
              *" $func_resolve_sysroot_result "*)
 
7026
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
6215
7027
              esac
6216
7028
            fi
6217
 
            tmp_libs="$tmp_libs $deplib"
 
7029
            func_append tmp_libs " $func_resolve_sysroot_result"
6218
7030
          done
6219
7031
 
6220
7032
          if test "$link_all_deplibs" != no; then
6224
7036
              case $deplib in
6225
7037
              -L*) path="$deplib" ;;
6226
7038
              *.la)
 
7039
                func_resolve_sysroot "$deplib"
 
7040
                deplib=$func_resolve_sysroot_result
6227
7041
                func_dirname "$deplib" "" "."
6228
 
                dir="$func_dirname_result"
 
7042
                dir=$func_dirname_result
6229
7043
                # We need an absolute path.
6230
7044
                case $dir in
6231
7045
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6252
7066
                      if test -z "$darwin_install_name"; then
6253
7067
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
6254
7068
                      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}"
 
7069
                      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
 
7070
                      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
6257
7071
                      path=
6258
7072
                    fi
6259
7073
                  fi
6303
7117
          for dir in $newlib_search_path; do
6304
7118
            case "$lib_search_path " in
6305
7119
            *" $dir "*) ;;
6306
 
            *) lib_search_path="$lib_search_path $dir" ;;
 
7120
            *) func_append lib_search_path " $dir" ;;
6307
7121
            esac
6308
7122
          done
6309
7123
          newlib_search_path=
6361
7175
            -L*)
6362
7176
              case " $tmp_libs " in
6363
7177
              *" $deplib "*) ;;
6364
 
              *) tmp_libs="$tmp_libs $deplib" ;;
 
7178
              *) func_append tmp_libs " $deplib" ;;
6365
7179
              esac
6366
7180
              ;;
6367
 
            *) tmp_libs="$tmp_libs $deplib" ;;
 
7181
            *) func_append tmp_libs " $deplib" ;;
6368
7182
            esac
6369
7183
          done
6370
7184
          eval $var=\"$tmp_libs\"
6380
7194
          ;;
6381
7195
        esac
6382
7196
        if test -n "$i" ; then
6383
 
          tmp_libs="$tmp_libs $i"
 
7197
          func_append tmp_libs " $i"
6384
7198
        fi
6385
7199
      done
6386
7200
      dependency_libs=$tmp_libs
6421
7235
      # Now set the variables for building old libraries.
6422
7236
      build_libtool_libs=no
6423
7237
      oldlibs="$output"
6424
 
      objs="$objs$old_deplibs"
 
7238
      func_append objs "$old_deplibs"
6425
7239
      ;;
6426
7240
 
6427
7241
    lib)
6457
7271
          echo
6458
7272
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6459
7273
          $ECHO "*** objects $objs is not portable!"
6460
 
          libobjs="$libobjs $objs"
 
7274
          func_append libobjs " $objs"
6461
7275
        fi
6462
7276
      fi
6463
7277
 
6516
7330
          # which has an extra 1 added just for fun
6517
7331
          #
6518
7332
          case $version_type in
 
7333
          # correct linux to gnu/linux during the next big refactor
6519
7334
          darwin|linux|osf|windows|none)
6520
7335
            func_arith $number_major + $number_minor
6521
7336
            current=$func_arith_result
6632
7447
          versuffix="$major.$revision"
6633
7448
          ;;
6634
7449
 
6635
 
        linux)
 
7450
        linux) # correct to gnu/linux during the next big refactor
6636
7451
          func_arith $current - $age
6637
7452
          major=.$func_arith_result
6638
7453
          versuffix="$major.$age.$revision"
6655
7470
          done
6656
7471
 
6657
7472
          # Make executables depend on our current version.
6658
 
          verstring="$verstring:${current}.0"
 
7473
          func_append verstring ":${current}.0"
6659
7474
          ;;
6660
7475
 
6661
7476
        qnx)
6723
7538
      fi
6724
7539
 
6725
7540
      func_generate_dlsyms "$libname" "$libname" "yes"
6726
 
      libobjs="$libobjs $symfileobj"
 
7541
      func_append libobjs " $symfileobj"
6727
7542
      test "X$libobjs" = "X " && libobjs=
6728
7543
 
6729
 
      if test "$mode" != relink; then
 
7544
      if test "$opt_mode" != relink; then
6730
7545
        # Remove our outputs, but don't remove object files since they
6731
7546
        # may have been created when compiling PIC objects.
6732
7547
        removelist=
6742
7557
                   continue
6743
7558
                 fi
6744
7559
               fi
6745
 
               removelist="$removelist $p"
 
7560
               func_append removelist " $p"
6746
7561
               ;;
6747
7562
            *) ;;
6748
7563
          esac
6753
7568
 
6754
7569
      # Now set the variables for building old libraries.
6755
7570
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6756
 
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
7571
        func_append oldlibs " $output_objdir/$libname.$libext"
6757
7572
 
6758
7573
        # Transform .lo files to .o files.
6759
7574
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6770
7585
        # If the user specified any rpath flags, then add them.
6771
7586
        temp_xrpath=
6772
7587
        for libdir in $xrpath; do
6773
 
          temp_xrpath="$temp_xrpath -R$libdir"
 
7588
          func_replace_sysroot "$libdir"
 
7589
          func_append temp_xrpath " -R$func_replace_sysroot_result"
6774
7590
          case "$finalize_rpath " in
6775
7591
          *" $libdir "*) ;;
6776
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
7592
          *) func_append finalize_rpath " $libdir" ;;
6777
7593
          esac
6778
7594
        done
6779
7595
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6787
7603
      for lib in $old_dlfiles; do
6788
7604
        case " $dlprefiles $dlfiles " in
6789
7605
        *" $lib "*) ;;
6790
 
        *) dlfiles="$dlfiles $lib" ;;
 
7606
        *) func_append dlfiles " $lib" ;;
6791
7607
        esac
6792
7608
      done
6793
7609
 
6797
7613
      for lib in $old_dlprefiles; do
6798
7614
        case "$dlprefiles " in
6799
7615
        *" $lib "*) ;;
6800
 
        *) dlprefiles="$dlprefiles $lib" ;;
 
7616
        *) func_append dlprefiles " $lib" ;;
6801
7617
        esac
6802
7618
      done
6803
7619
 
6809
7625
            ;;
6810
7626
          *-*-rhapsody* | *-*-darwin1.[012])
6811
7627
            # Rhapsody C library is in the System framework
6812
 
            deplibs="$deplibs System.ltframework"
 
7628
            func_append deplibs " System.ltframework"
6813
7629
            ;;
6814
7630
          *-*-netbsd*)
6815
7631
            # Don't link with libc until the a.out ld.so is fixed.
6826
7642
          *)
6827
7643
            # Add libc to deplibs on all other systems if necessary.
6828
7644
            if test "$build_libtool_need_lc" = "yes"; then
6829
 
              deplibs="$deplibs -lc"
 
7645
              func_append deplibs " -lc"
6830
7646
            fi
6831
7647
            ;;
6832
7648
          esac
6875
7691
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6876
7692
                  case " $predeps $postdeps " in
6877
7693
                  *" $i "*)
6878
 
                    newdeplibs="$newdeplibs $i"
 
7694
                    func_append newdeplibs " $i"
6879
7695
                    i=""
6880
7696
                    ;;
6881
7697
                  esac
6886
7702
                  set dummy $deplib_matches; shift
6887
7703
                  deplib_match=$1
6888
7704
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6889
 
                    newdeplibs="$newdeplibs $i"
 
7705
                    func_append newdeplibs " $i"
6890
7706
                  else
6891
7707
                    droppeddeps=yes
6892
7708
                    echo
6900
7716
                fi
6901
7717
                ;;
6902
7718
              *)
6903
 
                newdeplibs="$newdeplibs $i"
 
7719
                func_append newdeplibs " $i"
6904
7720
                ;;
6905
7721
              esac
6906
7722
            done
6918
7734
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6919
7735
                    case " $predeps $postdeps " in
6920
7736
                    *" $i "*)
6921
 
                      newdeplibs="$newdeplibs $i"
 
7737
                      func_append newdeplibs " $i"
6922
7738
                      i=""
6923
7739
                      ;;
6924
7740
                    esac
6929
7745
                    set dummy $deplib_matches; shift
6930
7746
                    deplib_match=$1
6931
7747
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6932
 
                      newdeplibs="$newdeplibs $i"
 
7748
                      func_append newdeplibs " $i"
6933
7749
                    else
6934
7750
                      droppeddeps=yes
6935
7751
                      echo
6951
7767
                fi
6952
7768
                ;;
6953
7769
              *)
6954
 
                newdeplibs="$newdeplibs $i"
 
7770
                func_append newdeplibs " $i"
6955
7771
                ;;
6956
7772
              esac
6957
7773
            done
6968
7784
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6969
7785
                case " $predeps $postdeps " in
6970
7786
                *" $a_deplib "*)
6971
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7787
                  func_append newdeplibs " $a_deplib"
6972
7788
                  a_deplib=""
6973
7789
                  ;;
6974
7790
                esac
6975
7791
              fi
6976
7792
              if test -n "$a_deplib" ; then
6977
7793
                libname=`eval "\\$ECHO \"$libname_spec\""`
 
7794
                if test -n "$file_magic_glob"; then
 
7795
                  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 
7796
                else
 
7797
                  libnameglob=$libname
 
7798
                fi
 
7799
                test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
6978
7800
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6979
 
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 
7801
                  if test "$want_nocaseglob" = yes; then
 
7802
                    shopt -s nocaseglob
 
7803
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 
7804
                    $nocaseglob
 
7805
                  else
 
7806
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 
7807
                  fi
6980
7808
                  for potent_lib in $potential_libs; do
6981
7809
                      # Follow soft links.
6982
7810
                      if ls -lLd "$potent_lib" 2>/dev/null |
6999
7827
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7000
7828
                         $SED -e 10q |
7001
7829
                         $EGREP "$file_magic_regex" > /dev/null; then
7002
 
                        newdeplibs="$newdeplibs $a_deplib"
 
7830
                        func_append newdeplibs " $a_deplib"
7003
7831
                        a_deplib=""
7004
7832
                        break 2
7005
7833
                      fi
7024
7852
              ;;
7025
7853
            *)
7026
7854
              # Add a -L argument.
7027
 
              newdeplibs="$newdeplibs $a_deplib"
 
7855
              func_append newdeplibs " $a_deplib"
7028
7856
              ;;
7029
7857
            esac
7030
7858
          done # Gone through all deplibs.
7040
7868
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7041
7869
                case " $predeps $postdeps " in
7042
7870
                *" $a_deplib "*)
7043
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7871
                  func_append newdeplibs " $a_deplib"
7044
7872
                  a_deplib=""
7045
7873
                  ;;
7046
7874
                esac
7053
7881
                    potlib="$potent_lib" # see symlink-check above in file_magic test
7054
7882
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7055
7883
                       $EGREP "$match_pattern_regex" > /dev/null; then
7056
 
                      newdeplibs="$newdeplibs $a_deplib"
 
7884
                      func_append newdeplibs " $a_deplib"
7057
7885
                      a_deplib=""
7058
7886
                      break 2
7059
7887
                    fi
7078
7906
              ;;
7079
7907
            *)
7080
7908
              # Add a -L argument.
7081
 
              newdeplibs="$newdeplibs $a_deplib"
 
7909
              func_append newdeplibs " $a_deplib"
7082
7910
              ;;
7083
7911
            esac
7084
7912
          done # Gone through all deplibs.
7182
8010
        *)
7183
8011
          case " $deplibs " in
7184
8012
          *" -L$path/$objdir "*)
7185
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
8013
            func_append new_libs " -L$path/$objdir" ;;
7186
8014
          esac
7187
8015
          ;;
7188
8016
        esac
7192
8020
        -L*)
7193
8021
          case " $new_libs " in
7194
8022
          *" $deplib "*) ;;
7195
 
          *) new_libs="$new_libs $deplib" ;;
 
8023
          *) func_append new_libs " $deplib" ;;
7196
8024
          esac
7197
8025
          ;;
7198
 
        *) new_libs="$new_libs $deplib" ;;
 
8026
        *) func_append new_libs " $deplib" ;;
7199
8027
        esac
7200
8028
      done
7201
8029
      deplibs="$new_libs"
7207
8035
 
7208
8036
      # Test again, we may have decided not to build it any more
7209
8037
      if test "$build_libtool_libs" = yes; then
 
8038
        # Remove ${wl} instances when linking with ld.
 
8039
        # FIXME: should test the right _cmds variable.
 
8040
        case $archive_cmds in
 
8041
          *\$LD\ *) wl= ;;
 
8042
        esac
7210
8043
        if test "$hardcode_into_libs" = yes; then
7211
8044
          # Hardcode the library paths
7212
8045
          hardcode_libdirs=
7213
8046
          dep_rpath=
7214
8047
          rpath="$finalize_rpath"
7215
 
          test "$mode" != relink && rpath="$compile_rpath$rpath"
 
8048
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
7216
8049
          for libdir in $rpath; do
7217
8050
            if test -n "$hardcode_libdir_flag_spec"; then
7218
8051
              if test -n "$hardcode_libdir_separator"; then
 
8052
                func_replace_sysroot "$libdir"
 
8053
                libdir=$func_replace_sysroot_result
7219
8054
                if test -z "$hardcode_libdirs"; then
7220
8055
                  hardcode_libdirs="$libdir"
7221
8056
                else
7224
8059
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7225
8060
                    ;;
7226
8061
                  *)
7227
 
                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8062
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7228
8063
                    ;;
7229
8064
                  esac
7230
8065
                fi
7231
8066
              else
7232
8067
                eval flag=\"$hardcode_libdir_flag_spec\"
7233
 
                dep_rpath="$dep_rpath $flag"
 
8068
                func_append dep_rpath " $flag"
7234
8069
              fi
7235
8070
            elif test -n "$runpath_var"; then
7236
8071
              case "$perm_rpath " in
7237
8072
              *" $libdir "*) ;;
7238
 
              *) perm_rpath="$perm_rpath $libdir" ;;
 
8073
              *) func_append perm_rpath " $libdir" ;;
7239
8074
              esac
7240
8075
            fi
7241
8076
          done
7243
8078
          if test -n "$hardcode_libdir_separator" &&
7244
8079
             test -n "$hardcode_libdirs"; then
7245
8080
            libdir="$hardcode_libdirs"
7246
 
            if test -n "$hardcode_libdir_flag_spec_ld"; then
7247
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
7248
 
            else
7249
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
7250
 
            fi
 
8081
            eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
7251
8082
          fi
7252
8083
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
7253
8084
            # We should set the runpath_var.
7254
8085
            rpath=
7255
8086
            for dir in $perm_rpath; do
7256
 
              rpath="$rpath$dir:"
 
8087
              func_append rpath "$dir:"
7257
8088
            done
7258
8089
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7259
8090
          fi
7261
8092
        fi
7262
8093
 
7263
8094
        shlibpath="$finalize_shlibpath"
7264
 
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 
8095
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7265
8096
        if test -n "$shlibpath"; then
7266
8097
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7267
8098
        fi
7287
8118
        linknames=
7288
8119
        for link
7289
8120
        do
7290
 
          linknames="$linknames $link"
 
8121
          func_append linknames " $link"
7291
8122
        done
7292
8123
 
7293
8124
        # Use standard objects if they are pic
7298
8129
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7299
8130
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7300
8131
          export_symbols="$output_objdir/$libname.uexp"
7301
 
          delfiles="$delfiles $export_symbols"
 
8132
          func_append delfiles " $export_symbols"
7302
8133
        fi
7303
8134
 
7304
8135
        orig_export_symbols=
7329
8160
            $opt_dry_run || $RM $export_symbols
7330
8161
            cmds=$export_symbols_cmds
7331
8162
            save_ifs="$IFS"; IFS='~'
7332
 
            for cmd in $cmds; do
 
8163
            for cmd1 in $cmds; do
7333
8164
              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 $?'
 
8165
              # Take the normal branch if the nm_file_list_spec branch
 
8166
              # doesn't work or if tool conversion is not needed.
 
8167
              case $nm_file_list_spec~$to_tool_file_cmd in
 
8168
                *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
 
8169
                  try_normal_branch=yes
 
8170
                  eval cmd=\"$cmd1\"
 
8171
                  func_len " $cmd"
 
8172
                  len=$func_len_result
 
8173
                  ;;
 
8174
                *)
 
8175
                  try_normal_branch=no
 
8176
                  ;;
 
8177
              esac
 
8178
              if test "$try_normal_branch" = yes \
 
8179
                 && { test "$len" -lt "$max_cmd_len" \
 
8180
                      || test "$max_cmd_len" -le -1; }
 
8181
              then
 
8182
                func_show_eval "$cmd" 'exit $?'
 
8183
                skipped_export=false
 
8184
              elif test -n "$nm_file_list_spec"; then
 
8185
                func_basename "$output"
 
8186
                output_la=$func_basename_result
 
8187
                save_libobjs=$libobjs
 
8188
                save_output=$output
 
8189
                output=${output_objdir}/${output_la}.nm
 
8190
                func_to_tool_file "$output"
 
8191
                libobjs=$nm_file_list_spec$func_to_tool_file_result
 
8192
                func_append delfiles " $output"
 
8193
                func_verbose "creating $NM input file list: $output"
 
8194
                for obj in $save_libobjs; do
 
8195
                  func_to_tool_file "$obj"
 
8196
                  $ECHO "$func_to_tool_file_result"
 
8197
                done > "$output"
 
8198
                eval cmd=\"$cmd1\"
 
8199
                func_show_eval "$cmd" 'exit $?'
 
8200
                output=$save_output
 
8201
                libobjs=$save_libobjs
7339
8202
                skipped_export=false
7340
8203
              else
7341
8204
                # The command line is too long to execute in one step.
7369
8232
          # global variables. join(1) would be nice here, but unfortunately
7370
8233
          # isn't a blessed tool.
7371
8234
          $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"
 
8235
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7373
8236
          export_symbols=$output_objdir/$libname.def
7374
8237
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7375
8238
        fi
7379
8242
          case " $convenience " in
7380
8243
          *" $test_deplib "*) ;;
7381
8244
          *)
7382
 
            tmp_deplibs="$tmp_deplibs $test_deplib"
 
8245
            func_append tmp_deplibs " $test_deplib"
7383
8246
            ;;
7384
8247
          esac
7385
8248
        done
7399
8262
            test "X$libobjs" = "X " && libobjs=
7400
8263
          else
7401
8264
            gentop="$output_objdir/${outputname}x"
7402
 
            generated="$generated $gentop"
 
8265
            func_append generated " $gentop"
7403
8266
 
7404
8267
            func_extract_archives $gentop $convenience
7405
 
            libobjs="$libobjs $func_extract_archives_result"
 
8268
            func_append libobjs " $func_extract_archives_result"
7406
8269
            test "X$libobjs" = "X " && libobjs=
7407
8270
          fi
7408
8271
        fi
7409
8272
 
7410
8273
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7411
8274
          eval flag=\"$thread_safe_flag_spec\"
7412
 
          linker_flags="$linker_flags $flag"
 
8275
          func_append linker_flags " $flag"
7413
8276
        fi
7414
8277
 
7415
8278
        # Make a backup of the uninstalled library when relinking
7416
 
        if test "$mode" = relink; then
 
8279
        if test "$opt_mode" = relink; then
7417
8280
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7418
8281
        fi
7419
8282
 
7475
8338
            echo 'INPUT (' > $output
7476
8339
            for obj in $save_libobjs
7477
8340
            do
7478
 
              $ECHO "$obj" >> $output
 
8341
              func_to_tool_file "$obj"
 
8342
              $ECHO "$func_to_tool_file_result" >> $output
7479
8343
            done
7480
8344
            echo ')' >> $output
7481
 
            delfiles="$delfiles $output"
 
8345
            func_append delfiles " $output"
 
8346
            func_to_tool_file "$output"
 
8347
            output=$func_to_tool_file_result
7482
8348
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7483
8349
            output=${output_objdir}/${output_la}.lnk
7484
8350
            func_verbose "creating linker input file list: $output"
7492
8358
            fi
7493
8359
            for obj
7494
8360
            do
7495
 
              $ECHO "$obj" >> $output
 
8361
              func_to_tool_file "$obj"
 
8362
              $ECHO "$func_to_tool_file_result" >> $output
7496
8363
            done
7497
 
            delfiles="$delfiles $output"
7498
 
            output=$firstobj\"$file_list_spec$output\"
 
8364
            func_append delfiles " $output"
 
8365
            func_to_tool_file "$output"
 
8366
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
7499
8367
          else
7500
8368
            if test -n "$save_libobjs"; then
7501
8369
              func_verbose "creating reloadable object files..."
7546
8414
              if test -n "$last_robj"; then
7547
8415
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7548
8416
              fi
7549
 
              delfiles="$delfiles $output"
 
8417
              func_append delfiles " $output"
7550
8418
 
7551
8419
            else
7552
8420
              output=
7580
8448
                lt_exit=$?
7581
8449
 
7582
8450
                # Restore the uninstalled library and exit
7583
 
                if test "$mode" = relink; then
 
8451
                if test "$opt_mode" = relink; then
7584
8452
                  ( cd "$output_objdir" && \
7585
8453
                    $RM "${realname}T" && \
7586
8454
                    $MV "${realname}U" "$realname" )
7613
8481
              # global variables. join(1) would be nice here, but unfortunately
7614
8482
              # isn't a blessed tool.
7615
8483
              $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"
 
8484
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7617
8485
              export_symbols=$output_objdir/$libname.def
7618
8486
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7619
8487
            fi
7654
8522
        # Add any objects from preloaded convenience libraries
7655
8523
        if test -n "$dlprefiles"; then
7656
8524
          gentop="$output_objdir/${outputname}x"
7657
 
          generated="$generated $gentop"
 
8525
          func_append generated " $gentop"
7658
8526
 
7659
8527
          func_extract_archives $gentop $dlprefiles
7660
 
          libobjs="$libobjs $func_extract_archives_result"
 
8528
          func_append libobjs " $func_extract_archives_result"
7661
8529
          test "X$libobjs" = "X " && libobjs=
7662
8530
        fi
7663
8531
 
7673
8541
            lt_exit=$?
7674
8542
 
7675
8543
            # Restore the uninstalled library and exit
7676
 
            if test "$mode" = relink; then
 
8544
            if test "$opt_mode" = relink; then
7677
8545
              ( cd "$output_objdir" && \
7678
8546
                $RM "${realname}T" && \
7679
8547
                $MV "${realname}U" "$realname" )
7685
8553
        IFS="$save_ifs"
7686
8554
 
7687
8555
        # Restore the uninstalled library and exit
7688
 
        if test "$mode" = relink; then
 
8556
        if test "$opt_mode" = relink; then
7689
8557
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7690
8558
 
7691
8559
          if test -n "$convenience"; then
7769
8637
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7770
8638
        else
7771
8639
          gentop="$output_objdir/${obj}x"
7772
 
          generated="$generated $gentop"
 
8640
          func_append generated " $gentop"
7773
8641
 
7774
8642
          func_extract_archives $gentop $convenience
7775
8643
          reload_conv_objs="$reload_objs $func_extract_archives_result"
7776
8644
        fi
7777
8645
      fi
7778
8646
 
 
8647
      # If we're not building shared, we need to use non_pic_objs
 
8648
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
 
8649
 
7779
8650
      # Create the old-style object.
7780
8651
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7781
8652
 
7849
8720
        if test "$tagname" = CXX ; then
7850
8721
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7851
8722
            10.[0123])
7852
 
              compile_command="$compile_command ${wl}-bind_at_load"
7853
 
              finalize_command="$finalize_command ${wl}-bind_at_load"
 
8723
              func_append compile_command " ${wl}-bind_at_load"
 
8724
              func_append finalize_command " ${wl}-bind_at_load"
7854
8725
            ;;
7855
8726
          esac
7856
8727
        fi
7870
8741
        *)
7871
8742
          case " $compile_deplibs " in
7872
8743
          *" -L$path/$objdir "*)
7873
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
8744
            func_append new_libs " -L$path/$objdir" ;;
7874
8745
          esac
7875
8746
          ;;
7876
8747
        esac
7880
8751
        -L*)
7881
8752
          case " $new_libs " in
7882
8753
          *" $deplib "*) ;;
7883
 
          *) new_libs="$new_libs $deplib" ;;
 
8754
          *) func_append new_libs " $deplib" ;;
7884
8755
          esac
7885
8756
          ;;
7886
 
        *) new_libs="$new_libs $deplib" ;;
 
8757
        *) func_append new_libs " $deplib" ;;
7887
8758
        esac
7888
8759
      done
7889
8760
      compile_deplibs="$new_libs"
7890
8761
 
7891
8762
 
7892
 
      compile_command="$compile_command $compile_deplibs"
7893
 
      finalize_command="$finalize_command $finalize_deplibs"
 
8763
      func_append compile_command " $compile_deplibs"
 
8764
      func_append finalize_command " $finalize_deplibs"
7894
8765
 
7895
8766
      if test -n "$rpath$xrpath"; then
7896
8767
        # If the user specified any rpath flags, then add them.
7898
8769
          # This is the magic to use -rpath.
7899
8770
          case "$finalize_rpath " in
7900
8771
          *" $libdir "*) ;;
7901
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
8772
          *) func_append finalize_rpath " $libdir" ;;
7902
8773
          esac
7903
8774
        done
7904
8775
      fi
7917
8788
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7918
8789
                ;;
7919
8790
              *)
7920
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8791
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7921
8792
                ;;
7922
8793
              esac
7923
8794
            fi
7924
8795
          else
7925
8796
            eval flag=\"$hardcode_libdir_flag_spec\"
7926
 
            rpath="$rpath $flag"
 
8797
            func_append rpath " $flag"
7927
8798
          fi
7928
8799
        elif test -n "$runpath_var"; then
7929
8800
          case "$perm_rpath " in
7930
8801
          *" $libdir "*) ;;
7931
 
          *) perm_rpath="$perm_rpath $libdir" ;;
 
8802
          *) func_append perm_rpath " $libdir" ;;
7932
8803
          esac
7933
8804
        fi
7934
8805
        case $host in
7937
8808
          case :$dllsearchpath: in
7938
8809
          *":$libdir:"*) ;;
7939
8810
          ::) dllsearchpath=$libdir;;
7940
 
          *) dllsearchpath="$dllsearchpath:$libdir";;
 
8811
          *) func_append dllsearchpath ":$libdir";;
7941
8812
          esac
7942
8813
          case :$dllsearchpath: in
7943
8814
          *":$testbindir:"*) ;;
7944
8815
          ::) dllsearchpath=$testbindir;;
7945
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
8816
          *) func_append dllsearchpath ":$testbindir";;
7946
8817
          esac
7947
8818
          ;;
7948
8819
        esac
7968
8839
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7969
8840
                ;;
7970
8841
              *)
7971
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8842
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7972
8843
                ;;
7973
8844
              esac
7974
8845
            fi
7975
8846
          else
7976
8847
            eval flag=\"$hardcode_libdir_flag_spec\"
7977
 
            rpath="$rpath $flag"
 
8848
            func_append rpath " $flag"
7978
8849
          fi
7979
8850
        elif test -n "$runpath_var"; then
7980
8851
          case "$finalize_perm_rpath " in
7981
8852
          *" $libdir "*) ;;
7982
 
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
 
8853
          *) func_append finalize_perm_rpath " $libdir" ;;
7983
8854
          esac
7984
8855
        fi
7985
8856
      done
8030
8901
        exit_status=0
8031
8902
        func_show_eval "$link_command" 'exit_status=$?'
8032
8903
 
 
8904
        if test -n "$postlink_cmds"; then
 
8905
          func_to_tool_file "$output"
 
8906
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 
8907
          func_execute_cmds "$postlink_cmds" 'exit $?'
 
8908
        fi
 
8909
 
8033
8910
        # Delete the generated files.
8034
8911
        if test -f "$output_objdir/${outputname}S.${objext}"; then
8035
8912
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8052
8929
          # We should set the runpath_var.
8053
8930
          rpath=
8054
8931
          for dir in $perm_rpath; do
8055
 
            rpath="$rpath$dir:"
 
8932
            func_append rpath "$dir:"
8056
8933
          done
8057
8934
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8058
8935
        fi
8060
8937
          # We should set the runpath_var.
8061
8938
          rpath=
8062
8939
          for dir in $finalize_perm_rpath; do
8063
 
            rpath="$rpath$dir:"
 
8940
            func_append rpath "$dir:"
8064
8941
          done
8065
8942
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8066
8943
        fi
8075
8952
        $opt_dry_run || $RM $output
8076
8953
        # Link the executable and exit
8077
8954
        func_show_eval "$link_command" 'exit $?'
 
8955
 
 
8956
        if test -n "$postlink_cmds"; then
 
8957
          func_to_tool_file "$output"
 
8958
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 
8959
          func_execute_cmds "$postlink_cmds" 'exit $?'
 
8960
        fi
 
8961
 
8078
8962
        exit $EXIT_SUCCESS
8079
8963
      fi
8080
8964
 
8108
8992
 
8109
8993
      func_show_eval "$link_command" 'exit $?'
8110
8994
 
 
8995
      if test -n "$postlink_cmds"; then
 
8996
        func_to_tool_file "$output_objdir/$outputname"
 
8997
        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'`
 
8998
        func_execute_cmds "$postlink_cmds" 'exit $?'
 
8999
      fi
 
9000
 
8111
9001
      # Now create the wrapper script.
8112
9002
      func_verbose "creating $output"
8113
9003
 
8205
9095
        else
8206
9096
          oldobjs="$old_deplibs $non_pic_objects"
8207
9097
          if test "$preload" = yes && test -f "$symfileobj"; then
8208
 
            oldobjs="$oldobjs $symfileobj"
 
9098
            func_append oldobjs " $symfileobj"
8209
9099
          fi
8210
9100
        fi
8211
9101
        addlibs="$old_convenience"
8213
9103
 
8214
9104
      if test -n "$addlibs"; then
8215
9105
        gentop="$output_objdir/${outputname}x"
8216
 
        generated="$generated $gentop"
 
9106
        func_append generated " $gentop"
8217
9107
 
8218
9108
        func_extract_archives $gentop $addlibs
8219
 
        oldobjs="$oldobjs $func_extract_archives_result"
 
9109
        func_append oldobjs " $func_extract_archives_result"
8220
9110
      fi
8221
9111
 
8222
9112
      # Do each command in the archive commands.
8227
9117
        # Add any objects from preloaded convenience libraries
8228
9118
        if test -n "$dlprefiles"; then
8229
9119
          gentop="$output_objdir/${outputname}x"
8230
 
          generated="$generated $gentop"
 
9120
          func_append generated " $gentop"
8231
9121
 
8232
9122
          func_extract_archives $gentop $dlprefiles
8233
 
          oldobjs="$oldobjs $func_extract_archives_result"
 
9123
          func_append oldobjs " $func_extract_archives_result"
8234
9124
        fi
8235
9125
 
8236
9126
        # POSIX demands no paths to be encoded in archives.  We have
8248
9138
        else
8249
9139
          echo "copying selected object files to avoid basename conflicts..."
8250
9140
          gentop="$output_objdir/${outputname}x"
8251
 
          generated="$generated $gentop"
 
9141
          func_append generated " $gentop"
8252
9142
          func_mkdir_p "$gentop"
8253
9143
          save_oldobjs=$oldobjs
8254
9144
          oldobjs=
8272
9162
                esac
8273
9163
              done
8274
9164
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8275
 
              oldobjs="$oldobjs $gentop/$newobj"
 
9165
              func_append oldobjs " $gentop/$newobj"
8276
9166
              ;;
8277
 
            *) oldobjs="$oldobjs $obj" ;;
 
9167
            *) func_append oldobjs " $obj" ;;
8278
9168
            esac
8279
9169
          done
8280
9170
        fi
 
9171
        func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
 
9172
        tool_oldlib=$func_to_tool_file_result
8281
9173
        eval cmds=\"$old_archive_cmds\"
8282
9174
 
8283
9175
        func_len " $cmds"
8284
9176
        len=$func_len_result
8285
9177
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8286
9178
          cmds=$old_archive_cmds
 
9179
        elif test -n "$archiver_list_spec"; then
 
9180
          func_verbose "using command file archive linking..."
 
9181
          for obj in $oldobjs
 
9182
          do
 
9183
            func_to_tool_file "$obj"
 
9184
            $ECHO "$func_to_tool_file_result"
 
9185
          done > $output_objdir/$libname.libcmd
 
9186
          func_to_tool_file "$output_objdir/$libname.libcmd"
 
9187
          oldobjs=" $archiver_list_spec$func_to_tool_file_result"
 
9188
          cmds=$old_archive_cmds
8287
9189
        else
8288
9190
          # the command line is too long to link in one step, link in parts
8289
9191
          func_verbose "using piecewise archive linking..."
8377
9279
              *.la)
8378
9280
                func_basename "$deplib"
8379
9281
                name="$func_basename_result"
8380
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 
9282
                func_resolve_sysroot "$deplib"
 
9283
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
8381
9284
                test -z "$libdir" && \
8382
9285
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
8383
 
                newdependency_libs="$newdependency_libs $libdir/$name"
8384
 
                ;;
8385
 
              *) newdependency_libs="$newdependency_libs $deplib" ;;
 
9286
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 
9287
                ;;
 
9288
              -L*)
 
9289
                func_stripname -L '' "$deplib"
 
9290
                func_replace_sysroot "$func_stripname_result"
 
9291
                func_append newdependency_libs " -L$func_replace_sysroot_result"
 
9292
                ;;
 
9293
              -R*)
 
9294
                func_stripname -R '' "$deplib"
 
9295
                func_replace_sysroot "$func_stripname_result"
 
9296
                func_append newdependency_libs " -R$func_replace_sysroot_result"
 
9297
                ;;
 
9298
              *) func_append newdependency_libs " $deplib" ;;
8386
9299
              esac
8387
9300
            done
8388
9301
            dependency_libs="$newdependency_libs"
8396
9309
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8397
9310
                test -z "$libdir" && \
8398
9311
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8399
 
                newdlfiles="$newdlfiles $libdir/$name"
 
9312
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
8400
9313
                ;;
8401
 
              *) newdlfiles="$newdlfiles $lib" ;;
 
9314
              *) func_append newdlfiles " $lib" ;;
8402
9315
              esac
8403
9316
            done
8404
9317
            dlfiles="$newdlfiles"
8415
9328
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8416
9329
                test -z "$libdir" && \
8417
9330
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8418
 
                newdlprefiles="$newdlprefiles $libdir/$name"
 
9331
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
8419
9332
                ;;
8420
9333
              esac
8421
9334
            done
8427
9340
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8428
9341
                *) abs=`pwd`"/$lib" ;;
8429
9342
              esac
8430
 
              newdlfiles="$newdlfiles $abs"
 
9343
              func_append newdlfiles " $abs"
8431
9344
            done
8432
9345
            dlfiles="$newdlfiles"
8433
9346
            newdlprefiles=
8436
9349
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8437
9350
                *) abs=`pwd`"/$lib" ;;
8438
9351
              esac
8439
 
              newdlprefiles="$newdlprefiles $abs"
 
9352
              func_append newdlprefiles " $abs"
8440
9353
            done
8441
9354
            dlprefiles="$newdlprefiles"
8442
9355
          fi
8521
9434
    exit $EXIT_SUCCESS
8522
9435
}
8523
9436
 
8524
 
{ test "$mode" = link || test "$mode" = relink; } &&
 
9437
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
8525
9438
    func_mode_link ${1+"$@"}
8526
9439
 
8527
9440
 
8541
9454
    for arg
8542
9455
    do
8543
9456
      case $arg in
8544
 
      -f) RM="$RM $arg"; rmforce=yes ;;
8545
 
      -*) RM="$RM $arg" ;;
8546
 
      *) files="$files $arg" ;;
 
9457
      -f) func_append RM " $arg"; rmforce=yes ;;
 
9458
      -*) func_append RM " $arg" ;;
 
9459
      *) func_append files " $arg" ;;
8547
9460
      esac
8548
9461
    done
8549
9462
 
8552
9465
 
8553
9466
    rmdirs=
8554
9467
 
8555
 
    origobjdir="$objdir"
8556
9468
    for file in $files; do
8557
9469
      func_dirname "$file" "" "."
8558
9470
      dir="$func_dirname_result"
8559
9471
      if test "X$dir" = X.; then
8560
 
        objdir="$origobjdir"
 
9472
        odir="$objdir"
8561
9473
      else
8562
 
        objdir="$dir/$origobjdir"
 
9474
        odir="$dir/$objdir"
8563
9475
      fi
8564
9476
      func_basename "$file"
8565
9477
      name="$func_basename_result"
8566
 
      test "$mode" = uninstall && objdir="$dir"
 
9478
      test "$opt_mode" = uninstall && odir="$dir"
8567
9479
 
8568
 
      # Remember objdir for removal later, being careful to avoid duplicates
8569
 
      if test "$mode" = clean; then
 
9480
      # Remember odir for removal later, being careful to avoid duplicates
 
9481
      if test "$opt_mode" = clean; then
8570
9482
        case " $rmdirs " in
8571
 
          *" $objdir "*) ;;
8572
 
          *) rmdirs="$rmdirs $objdir" ;;
 
9483
          *" $odir "*) ;;
 
9484
          *) func_append rmdirs " $odir" ;;
8573
9485
        esac
8574
9486
      fi
8575
9487
 
8595
9507
 
8596
9508
          # Delete the libtool libraries and symlinks.
8597
9509
          for n in $library_names; do
8598
 
            rmfiles="$rmfiles $objdir/$n"
 
9510
            func_append rmfiles " $odir/$n"
8599
9511
          done
8600
 
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
 
9512
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
8601
9513
 
8602
 
          case "$mode" in
 
9514
          case "$opt_mode" in
8603
9515
          clean)
8604
 
            case "  $library_names " in
8605
 
            # "  " in the beginning catches empty $dlname
 
9516
            case " $library_names " in
8606
9517
            *" $dlname "*) ;;
8607
 
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
 
9518
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
8608
9519
            esac
8609
 
            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
9520
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
8610
9521
            ;;
8611
9522
          uninstall)
8612
9523
            if test -n "$library_names"; then
8634
9545
          # Add PIC object to the list of files to remove.
8635
9546
          if test -n "$pic_object" &&
8636
9547
             test "$pic_object" != none; then
8637
 
            rmfiles="$rmfiles $dir/$pic_object"
 
9548
            func_append rmfiles " $dir/$pic_object"
8638
9549
          fi
8639
9550
 
8640
9551
          # Add non-PIC object to the list of files to remove.
8641
9552
          if test -n "$non_pic_object" &&
8642
9553
             test "$non_pic_object" != none; then
8643
 
            rmfiles="$rmfiles $dir/$non_pic_object"
 
9554
            func_append rmfiles " $dir/$non_pic_object"
8644
9555
          fi
8645
9556
        fi
8646
9557
        ;;
8647
9558
 
8648
9559
      *)
8649
 
        if test "$mode" = clean ; then
 
9560
        if test "$opt_mode" = clean ; then
8650
9561
          noexename=$name
8651
9562
          case $file in
8652
9563
          *.exe)
8656
9567
            noexename=$func_stripname_result
8657
9568
            # $file with .exe has already been added to rmfiles,
8658
9569
            # add $file without .exe
8659
 
            rmfiles="$rmfiles $file"
 
9570
            func_append rmfiles " $file"
8660
9571
            ;;
8661
9572
          esac
8662
9573
          # Do a test to see if this is a libtool program.
8665
9576
              func_ltwrapper_scriptname "$file"
8666
9577
              relink_command=
8667
9578
              func_source $func_ltwrapper_scriptname_result
8668
 
              rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
 
9579
              func_append rmfiles " $func_ltwrapper_scriptname_result"
8669
9580
            else
8670
9581
              relink_command=
8671
9582
              func_source $dir/$noexename
8673
9584
 
8674
9585
            # note $name still contains .exe if it was in $file originally
8675
9586
            # as does the version of $file that was added into $rmfiles
8676
 
            rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
 
9587
            func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
8677
9588
            if test "$fast_install" = yes && test -n "$relink_command"; then
8678
 
              rmfiles="$rmfiles $objdir/lt-$name"
 
9589
              func_append rmfiles " $odir/lt-$name"
8679
9590
            fi
8680
9591
            if test "X$noexename" != "X$name" ; then
8681
 
              rmfiles="$rmfiles $objdir/lt-${noexename}.c"
 
9592
              func_append rmfiles " $odir/lt-${noexename}.c"
8682
9593
            fi
8683
9594
          fi
8684
9595
        fi
8686
9597
      esac
8687
9598
      func_show_eval "$RM $rmfiles" 'exit_status=1'
8688
9599
    done
8689
 
    objdir="$origobjdir"
8690
9600
 
8691
9601
    # Try to remove the ${objdir}s in the directories where we deleted files
8692
9602
    for dir in $rmdirs; do
8698
9608
    exit $exit_status
8699
9609
}
8700
9610
 
8701
 
{ test "$mode" = uninstall || test "$mode" = clean; } &&
 
9611
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
8702
9612
    func_mode_uninstall ${1+"$@"}
8703
9613
 
8704
 
test -z "$mode" && {
 
9614
test -z "$opt_mode" && {
8705
9615
  help="$generic_help"
8706
9616
  func_fatal_help "you must specify a MODE"
8707
9617
}
8708
9618
 
8709
9619
test -z "$exec_cmd" && \
8710
 
  func_fatal_help "invalid operation mode \`$mode'"
 
9620
  func_fatal_help "invalid operation mode \`$opt_mode'"
8711
9621
 
8712
9622
if test -n "$exec_cmd"; then
8713
9623
  eval exec "$exec_cmd"