The R Project SVN R

Rev

Rev 44852 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 44852 Rev 48718
Line 1... Line 1...
1
# Generated from ltmain.m4sh.
1
# Generated from ltmain.m4sh.
2
 
2
 
3
# ltmain.sh (GNU libtool) 2.2
3
# ltmain.sh (GNU libtool) 2.2.6
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
 
5
 
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
7
# This is free software; see the source for copying conditions.  There is NO
7
# This is free software; see the source for copying conditions.  There is NO
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Line 63... Line 63...
63
#       host-triplet:	$host
63
#       host-triplet:	$host
64
#       shell:		$SHELL
64
#       shell:		$SHELL
65
#       compiler:		$LTCC
65
#       compiler:		$LTCC
66
#       compiler flags:		$LTCFLAGS
66
#       compiler flags:		$LTCFLAGS
67
#       linker:		$LD (gnu? $with_gnu_ld)
67
#       linker:		$LD (gnu? $with_gnu_ld)
68
#       $progname:		(GNU libtool) 2.2
68
#       $progname:		(GNU libtool) 2.2.6
69
#       automake:		$automake_version
69
#       automake:		$automake_version
70
#       autoconf:		$autoconf_version
70
#       autoconf:		$autoconf_version
71
#
71
#
72
# Report bugs to <bug-libtool@gnu.org>.
72
# Report bugs to <bug-libtool@gnu.org>.
73
 
73
 
74
PROGRAM=ltmain.sh
74
PROGRAM=ltmain.sh
75
PACKAGE=libtool
75
PACKAGE=libtool
76
VERSION=2.2
76
VERSION=2.2.6
77
TIMESTAMP=""
77
TIMESTAMP=""
78
package_revision=1.2599
78
package_revision=1.3012
79
 
79
 
80
# Be Bourne compatible
80
# Be Bourne compatible
81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
82
  emulate sh
82
  emulate sh
83
  NULLCMD=:
83
  NULLCMD=:
Line 93... Line 93...
93
 
93
 
94
# NLS nuisances: We save the old values to restore during execute mode.
94
# NLS nuisances: We save the old values to restore during execute mode.
95
# Only set LANG and LC_ALL to C if already set.
95
# Only set LANG and LC_ALL to C if already set.
96
# These must not be set unconditionally because not all systems understand
96
# These must not be set unconditionally because not all systems understand
97
# e.g. LANG=C (notably SCO).
97
# e.g. LANG=C (notably SCO).
-
 
98
lt_user_locale=
-
 
99
lt_safe_locale=
98
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
100
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
99
do
101
do
100
  eval "if test \"\${$lt_var+set}\" = set; then
102
  eval "if test \"\${$lt_var+set}\" = set; then
101
          save_$lt_var=\$$lt_var
103
          save_$lt_var=\$$lt_var
102
          $lt_var=C
104
          $lt_var=C
103
	  export $lt_var
105
	  export $lt_var
-
 
106
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-
 
107
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
104
	fi"
108
	fi"
105
done
109
done
106
 
110
 
107
$lt_unset CDPATH
111
$lt_unset CDPATH
108
 
112
 
Line 118... Line 122...
118
: ${LN_S="ln -s"}
122
: ${LN_S="ln -s"}
119
: ${MAKE="make"}
123
: ${MAKE="make"}
120
: ${MKDIR="mkdir"}
124
: ${MKDIR="mkdir"}
121
: ${MV="mv -f"}
125
: ${MV="mv -f"}
122
: ${RM="rm -f"}
126
: ${RM="rm -f"}
123
: ${SED="/usr/bin/sed"}
127
: ${SED="/opt/local/bin/gsed"}
124
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
128
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
125
: ${Xsed="$SED -e 1s/^X//"}
129
: ${Xsed="$SED -e 1s/^X//"}
126
 
130
 
127
# Global variables:
131
# Global variables:
128
EXIT_SUCCESS=0
132
EXIT_SUCCESS=0
Line 138... Line 142...
138
IFS=" 	$lt_nl"
142
IFS=" 	$lt_nl"
139
 
143
 
140
dirname="s,/[^/]*$,,"
144
dirname="s,/[^/]*$,,"
141
basename="s,^.*/,,"
145
basename="s,^.*/,,"
142
 
146
 
-
 
147
# func_dirname_and_basename file append nondir_replacement
-
 
148
# perform func_basename and func_dirname in a single function
-
 
149
# call:
-
 
150
#   dirname:  Compute the dirname of FILE.  If nonempty,
-
 
151
#             add APPEND to the result, otherwise set result
-
 
152
#             to NONDIR_REPLACEMENT.
-
 
153
#             value returned in "$func_dirname_result"
-
 
154
#   basename: Compute filename of FILE.
-
 
155
#             value retuned in "$func_basename_result"
-
 
156
# Implementation must be kept synchronized with func_dirname
-
 
157
# and func_basename. For efficiency, we do not delegate to
-
 
158
# those functions but instead duplicate the functionality here.
-
 
159
func_dirname_and_basename ()
-
 
160
{
-
 
161
  # Extract subdirectory from the argument.
-
 
162
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-
 
163
  if test "X$func_dirname_result" = "X${1}"; then
-
 
164
    func_dirname_result="${3}"
-
 
165
  else
-
 
166
    func_dirname_result="$func_dirname_result${2}"
-
 
167
  fi
-
 
168
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-
 
169
}
-
 
170
 
-
 
171
# Generated shell functions inserted here.
-
 
172
 
143
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
173
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
144
# is ksh but when the shell is invoked as "sh" and the current value of
174
# is ksh but when the shell is invoked as "sh" and the current value of
145
# the _XPG environment variable is not equal to 1 (one), the special
175
# the _XPG environment variable is not equal to 1 (one), the special
146
# positional parameter $0, within a function call, is the name of the
176
# positional parameter $0, within a function call, is the name of the
147
# function.
177
# function.
148
progpath="$0"
178
progpath="$0"
149
 
179
 
150
# The name of this program:
180
# The name of this program:
151
# In the unlikely event $progname began with a '-', it would play havoc with
181
# In the unlikely event $progname began with a '-', it would play havoc with
152
# func_echo (imagine progname=-n), so we prepend ./ in that case:
182
# func_echo (imagine progname=-n), so we prepend ./ in that case:
-
 
183
func_dirname_and_basename "$progpath"
153
progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'`
184
progname=$func_basename_result
-
 
185
case $progname in
-
 
186
  -*) progname=./$progname ;;
-
 
187
esac
154
 
188
 
155
# Make sure we have an absolute path for reexecution:
189
# Make sure we have an absolute path for reexecution:
156
case $progpath in
190
case $progpath in
157
  [\\/]*|[A-Za-z]:\\*) ;;
191
  [\\/]*|[A-Za-z]:\\*) ;;
158
  *[\\/]*)
192
  *[\\/]*)
159
     progdir=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
193
     progdir=$func_dirname_result
160
     progdir=`cd "$progdir" && pwd`
194
     progdir=`cd "$progdir" && pwd`
161
     progpath="$progdir/$progname"
195
     progpath="$progdir/$progname"
162
     ;;
196
     ;;
163
  *)
197
  *)
164
     save_IFS="$IFS"
198
     save_IFS="$IFS"
Line 200... Line 234...
200
# Standard options:
234
# Standard options:
201
opt_dry_run=false
235
opt_dry_run=false
202
opt_help=false
236
opt_help=false
203
opt_quiet=false
237
opt_quiet=false
204
opt_verbose=false
238
opt_verbose=false
-
 
239
opt_warning=:
205
 
240
 
206
# func_echo arg...
241
# func_echo arg...
207
# Echo program name prefixed message, along with the current mode
242
# Echo program name prefixed message, along with the current mode
208
# name if it has been set yet.
243
# name if it has been set yet.
209
func_echo ()
244
func_echo ()
Line 232... Line 267...
232
 
267
 
233
# func_warning arg...
268
# func_warning arg...
234
# Echo program name prefixed warning message to standard error.
269
# Echo program name prefixed warning message to standard error.
235
func_warning ()
270
func_warning ()
236
{
271
{
237
    $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
272
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
-
 
273
 
-
 
274
    # bash bug again:
-
 
275
    :
238
}
276
}
239
 
277
 
240
# func_fatal_error arg...
278
# func_fatal_error arg...
241
# Echo program name prefixed message to standard error, and exit.
279
# Echo program name prefixed message to standard error, and exit.
242
func_fatal_error ()
280
func_fatal_error ()
Line 423... Line 461...
423
      fi
461
      fi
424
    fi
462
    fi
425
}
463
}
426
 
464
 
427
 
465
 
-
 
466
# func_show_eval_locale cmd [fail_exp]
-
 
467
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-
 
468
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-
 
469
# is given, then evaluate it.  Use the saved locale for evaluation.
-
 
470
func_show_eval_locale ()
-
 
471
{
-
 
472
    my_cmd="$1"
-
 
473
    my_fail_exp="${2-:}"
-
 
474
 
-
 
475
    ${opt_silent-false} || {
-
 
476
      func_quote_for_expand "$my_cmd"
-
 
477
      eval "func_echo $func_quote_for_expand_result"
-
 
478
    }
-
 
479
 
-
 
480
    if ${opt_dry_run-false}; then :; else
-
 
481
      eval "$lt_user_locale
-
 
482
	    $my_cmd"
-
 
483
      my_status=$?
-
 
484
      eval "$lt_safe_locale"
-
 
485
      if test "$my_status" -eq 0; then :; else
-
 
486
	eval "(exit $my_status); $my_fail_exp"
-
 
487
      fi
-
 
488
    fi
-
 
489
}
-
 
490
 
-
 
491
 
428
 
492
 
429
 
493
 
430
 
494
 
431
# func_version
495
# func_version
432
# Echo version message to standard output and exit.
496
# Echo version message to standard output and exit.
Line 626... Line 690...
626
      fi
690
      fi
627
      ;;
691
      ;;
628
  esac
692
  esac
629
}
693
}
630
 
694
 
631
 
-
 
632
func_mode_help ()
-
 
633
{
-
 
634
    # We need to display help for each of the modes.
-
 
635
    case $mode in
-
 
636
      "")
-
 
637
        # Generic help is extracted from the usage comments
-
 
638
        # at the start of this file.
-
 
639
        func_help
-
 
640
        ;;
-
 
641
 
-
 
642
      clean)
-
 
643
        $ECHO \
-
 
644
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
 
645
 
-
 
646
Remove files from the build directory.
-
 
647
 
-
 
648
RM is the name of the program to use to delete files associated with each FILE
-
 
649
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-
 
650
to RM.
-
 
651
 
-
 
652
If FILE is a libtool library, object or program, all the files associated
-
 
653
with it are deleted. Otherwise, only FILE itself is deleted using RM."
-
 
654
        ;;
-
 
655
 
-
 
656
      compile)
-
 
657
      $ECHO \
-
 
658
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
 
659
 
-
 
660
Compile a source file into a libtool library object.
-
 
661
 
-
 
662
This mode accepts the following additional options:
-
 
663
 
-
 
664
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-
 
665
  -no-suppress      do not suppress compiler output for multiple passes
-
 
666
  -prefer-pic       try to building PIC objects only
-
 
667
  -prefer-non-pic   try to building non-PIC objects only
-
 
668
  -shared           do not build a \`.o' file suitable for static linking
-
 
669
  -static           only build a \`.o' file suitable for static linking
-
 
670
 
-
 
671
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-
 
672
from the given SOURCEFILE.
-
 
673
 
-
 
674
The output file name is determined by removing the directory component from
-
 
675
SOURCEFILE, then substituting the C source code suffix \`.c' with the
-
 
676
library object suffix, \`.lo'."
-
 
677
        ;;
-
 
678
 
-
 
679
      execute)
-
 
680
        $ECHO \
-
 
681
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
 
682
 
-
 
683
Automatically set library path, then run a program.
-
 
684
 
-
 
685
This mode accepts the following additional options:
-
 
686
 
-
 
687
  -dlopen FILE      add the directory containing FILE to the library path
-
 
688
 
-
 
689
This mode sets the library path environment variable according to \`-dlopen'
-
 
690
flags.
-
 
691
 
-
 
692
If any of the ARGS are libtool executable wrappers, then they are translated
-
 
693
into their corresponding uninstalled binary, and any of their required library
-
 
694
directories are added to the library path.
-
 
695
 
-
 
696
Then, COMMAND is executed, with ARGS as arguments."
-
 
697
        ;;
-
 
698
 
-
 
699
      finish)
-
 
700
        $ECHO \
-
 
701
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
 
702
 
-
 
703
Complete the installation of libtool libraries.
-
 
704
 
-
 
705
Each LIBDIR is a directory that contains libtool libraries.
-
 
706
 
-
 
707
The commands that this mode executes may require superuser privileges.  Use
-
 
708
the \`--dry-run' option if you just want to see what would be executed."
-
 
709
        ;;
-
 
710
 
-
 
711
      install)
-
 
712
        $ECHO \
-
 
713
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
 
714
 
-
 
715
Install executables or libraries.
-
 
716
 
-
 
717
INSTALL-COMMAND is the installation command.  The first component should be
-
 
718
either the \`install' or \`cp' program.
-
 
719
 
-
 
720
The following components of INSTALL-COMMAND are treated specially:
-
 
721
 
-
 
722
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
 
723
 
-
 
724
The rest of the components are interpreted as arguments to that command (only
-
 
725
BSD-compatible install options are recognized)."
-
 
726
        ;;
-
 
727
 
-
 
728
      link)
-
 
729
        $ECHO \
-
 
730
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
 
731
 
-
 
732
Link object files or libraries together to form another library, or to
-
 
733
create an executable program.
-
 
734
 
-
 
735
LINK-COMMAND is a command using the C compiler that you would use to create
-
 
736
a program from several object files.
-
 
737
 
-
 
738
The following components of LINK-COMMAND are treated specially:
-
 
739
 
-
 
740
  -all-static       do not do any dynamic linking at all
-
 
741
  -avoid-version    do not add a version suffix if possible
-
 
742
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-
 
743
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-
 
744
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-
 
745
  -export-symbols SYMFILE
-
 
746
                    try to export only the symbols listed in SYMFILE
-
 
747
  -export-symbols-regex REGEX
-
 
748
                    try to export only the symbols matching REGEX
-
 
749
  -LLIBDIR          search LIBDIR for required installed libraries
-
 
750
  -lNAME            OUTPUT-FILE requires the installed library libNAME
-
 
751
  -module           build a library that can dlopened
-
 
752
  -no-fast-install  disable the fast-install mode
-
 
753
  -no-install       link a not-installable executable
-
 
754
  -no-undefined     declare that a library does not refer to external symbols
-
 
755
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-
 
756
  -objectlist FILE  Use a list of object files found in FILE to specify objects
-
 
757
  -precious-files-regex REGEX
-
 
758
                    don't remove output files matching REGEX
-
 
759
  -release RELEASE  specify package release information
-
 
760
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-
 
761
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-
 
762
  -shared           only do dynamic linking of libtool libraries
-
 
763
  -shrext SUFFIX    override the standard shared library file extension
-
 
764
  -static           do not do any dynamic linking of uninstalled libtool libraries
-
 
765
  -static-libtool-libs
-
 
766
                    do not do any dynamic linking of libtool libraries
-
 
767
  -version-info CURRENT[:REVISION[:AGE]]
-
 
768
                    specify library version info [each variable defaults to 0]
-
 
769
  -weak LIBNAME     declare that the target provides the LIBNAME interface
-
 
770
 
-
 
771
All other options (arguments beginning with \`-') are ignored.
-
 
772
 
-
 
773
Every other argument is treated as a filename.  Files ending in \`.la' are
-
 
774
treated as uninstalled libtool libraries, other files are standard or library
-
 
775
object files.
-
 
776
 
-
 
777
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-
 
778
only library objects (\`.lo' files) may be specified, and \`-rpath' is
-
 
779
required, except when creating a convenience library.
-
 
780
 
-
 
781
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-
 
782
using \`ar' and \`ranlib', or on Windows using \`lib'.
-
 
783
 
-
 
784
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-
 
785
is created, otherwise an executable program is created."
-
 
786
        ;;
-
 
787
 
-
 
788
      uninstall)
-
 
789
        $ECHO \
-
 
790
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
 
791
 
-
 
792
Remove libraries from an installation directory.
-
 
793
 
-
 
794
RM is the name of the program to use to delete files associated with each FILE
-
 
795
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-
 
796
to RM.
-
 
797
 
-
 
798
If FILE is a libtool library, all the files associated with it are deleted.
-
 
799
Otherwise, only FILE itself is deleted using RM."
-
 
800
        ;;
-
 
801
 
-
 
802
      *)
-
 
803
        func_fatal_help "invalid operation mode \`$mode'"
-
 
804
        ;;
-
 
805
    esac
-
 
806
 
-
 
807
    $ECHO
-
 
808
    $ECHO "Try \`$progname --help' for more information about other modes."
-
 
809
 
-
 
810
    exit $?
-
 
811
}
-
 
812
 
-
 
813
# Generated shell functions inserted here.
-
 
814
 
-
 
815
 
-
 
816
# Parse options once, thoroughly.  This comes as soon as possible in
695
# Parse options once, thoroughly.  This comes as soon as possible in
817
# the script to make things like `libtool --version' happen quickly.
696
# the script to make things like `libtool --version' happen quickly.
818
{
697
{
819
 
698
 
820
  # Shorthand for --mode=foo, only valid as the first argument
699
  # Shorthand for --mode=foo, only valid as the first argument
Line 922... Line 801...
922
			break
801
			break
923
			;;
802
			;;
924
    esac
803
    esac
925
  done
804
  done
926
 
805
 
927
  # Now that we've collected a possible --mode arg, show help if necessary
-
 
928
  $opt_help && func_mode_help
-
 
929
 
806
 
930
  case $host in
807
  case $host in
931
    *cygwin* | *mingw* | *pw32*)
808
    *cygwin* | *mingw* | *pw32* | *cegcc*)
932
      # don't eliminate duplications in $postdeps and $predeps
809
      # don't eliminate duplications in $postdeps and $predeps
933
      opt_duplicate_compiler_generated_deps=:
810
      opt_duplicate_compiler_generated_deps=:
934
      ;;
811
      ;;
935
    *)
812
    *)
936
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
813
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
Line 980... Line 857...
980
 
857
 
981
## ----------- ##
858
## ----------- ##
982
##    Main.    ##
859
##    Main.    ##
983
## ----------- ##
860
## ----------- ##
984
 
861
 
985
{
862
$opt_help || {
986
  # Sanity checks first:
863
  # Sanity checks first:
987
  func_check_version_match
864
  func_check_version_match
988
 
865
 
989
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
866
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
990
    func_fatal_configuration "not configured to build any kind of library"
867
    func_fatal_configuration "not configured to build any kind of library"
Line 1014... Line 891...
1014
# True iff FILE is a libtool `.la' library or `.lo' object file.
891
# True iff FILE is a libtool `.la' library or `.lo' object file.
1015
# This function is only a basic sanity check; it will hardly flush out
892
# This function is only a basic sanity check; it will hardly flush out
1016
# determined imposters.
893
# determined imposters.
1017
func_lalib_p ()
894
func_lalib_p ()
1018
{
895
{
-
 
896
    test -f "$1" &&
1019
    $SED -e 4q "$1" 2>/dev/null \
897
      $SED -e 4q "$1" 2>/dev/null \
1020
      | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
898
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1021
}
899
}
1022
 
900
 
1023
# func_lalib_unsafe_p file
901
# func_lalib_unsafe_p file
1024
# True iff FILE is a libtool `.la' library or `.lo' object file.
902
# True iff FILE is a libtool `.la' library or `.lo' object file.
1025
# This function implements the same check as func_lalib_p without
903
# This function implements the same check as func_lalib_p without
Line 1028... Line 906...
1028
# As a safety measure, use it only where a negative result would be
906
# As a safety measure, use it only where a negative result would be
1029
# fatal anyway.  Works if `file' does not exist.
907
# fatal anyway.  Works if `file' does not exist.
1030
func_lalib_unsafe_p ()
908
func_lalib_unsafe_p ()
1031
{
909
{
1032
    lalib_p=no
910
    lalib_p=no
1033
    if test -r "$1" && exec 5<&1 <"$1"; then
911
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1034
	for lalib_p_l in 1 2 3 4
912
	for lalib_p_l in 1 2 3 4
1035
	do
913
	do
1036
	    read lalib_p_line
914
	    read lalib_p_line
1037
	    case "$lalib_p_line" in
915
	    case "$lalib_p_line" in
1038
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
916
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1039
	    esac
917
	    esac
1040
	done
918
	done
1041
	exec 1<&5 5<&-
919
	exec 0<&5 5<&-
1042
    fi
920
    fi
1043
    test "$lalib_p" = yes
921
    test "$lalib_p" = yes
1044
}
922
}
1045
 
923
 
1046
# func_ltwrapper_script_p file
924
# func_ltwrapper_script_p file
Line 1121... Line 999...
1121
    *)		. "./$1" ;;
999
    *)		. "./$1" ;;
1122
    esac
1000
    esac
1123
}
1001
}
1124
 
1002
 
1125
 
1003
 
1126
# func_win32_libid arg
-
 
1127
# return the library type of file 'arg'
-
 
1128
#
-
 
1129
# Need a lot of goo to handle *both* DLLs and import libs
-
 
1130
# Has to be a shell function in order to 'eat' the argument
-
 
1131
# that is supplied when $file_magic_command is called.
-
 
1132
func_win32_libid ()
-
 
1133
{
-
 
1134
  $opt_debug
-
 
1135
  win32_libid_type="unknown"
-
 
1136
  win32_fileres=`file -L $1 2>/dev/null`
-
 
1137
  case $win32_fileres in
-
 
1138
  *ar\ archive\ import\ library*) # definitely import
-
 
1139
    win32_libid_type="x86 archive import"
-
 
1140
    ;;
-
 
1141
  *ar\ archive*) # could be an import, or static
-
 
1142
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-
 
1143
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-
 
1144
      win32_nmres=`eval $NM -f posix -A $1 |
-
 
1145
	$SED -n -e '
-
 
1146
	    1,100{
-
 
1147
		/ I /{
-
 
1148
		    s,.*,import,
-
 
1149
		    p
-
 
1150
		    q
-
 
1151
		}
-
 
1152
	    }'`
-
 
1153
      case $win32_nmres in
-
 
1154
      import*)  win32_libid_type="x86 archive import";;
-
 
1155
      *)        win32_libid_type="x86 archive static";;
-
 
1156
      esac
-
 
1157
    fi
-
 
1158
    ;;
-
 
1159
  *DLL*)
-
 
1160
    win32_libid_type="x86 DLL"
-
 
1161
    ;;
-
 
1162
  *executable*) # but shell scripts are "executable" too...
-
 
1163
    case $win32_fileres in
-
 
1164
    *MS\ Windows\ PE\ Intel*)
-
 
1165
      win32_libid_type="x86 DLL"
-
 
1166
      ;;
-
 
1167
    esac
-
 
1168
    ;;
-
 
1169
  esac
-
 
1170
  $ECHO "$win32_libid_type"
-
 
1171
}
-
 
1172
 
-
 
1173
 
-
 
1174
 
-
 
1175
# func_infer_tag arg
1004
# func_infer_tag arg
1176
# Infer tagged configuration to use if any are available and
1005
# Infer tagged configuration to use if any are available and
1177
# if one wasn't chosen via the "--tag" command line option.
1006
# if one wasn't chosen via the "--tag" command line option.
1178
# Only attempt this if the compiler in the base compile
1007
# Only attempt this if the compiler in the base compile
1179
# command doesn't match the default compiler.
1008
# command doesn't match the default compiler.
Line 1229... Line 1058...
1229
    fi
1058
    fi
1230
}
1059
}
1231
 
1060
 
1232
 
1061
 
1233
 
1062
 
1234
# func_generate_dlsyms outputname originator pic_p
-
 
1235
# Extract symbols from dlprefiles and create ${outputname}S.o with
-
 
1236
# a dlpreopen symbol table.
-
 
1237
func_generate_dlsyms ()
-
 
1238
{
-
 
1239
    $opt_debug
-
 
1240
    my_outputname="$1"
-
 
1241
    my_originator="$2"
-
 
1242
    my_pic_p="${3-no}"
-
 
1243
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
-
 
1244
    my_dlsyms=
-
 
1245
 
-
 
1246
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-
 
1247
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-
 
1248
	my_dlsyms="${my_outputname}S.c"
-
 
1249
      else
-
 
1250
	func_error "not configured to extract global symbols from dlpreopened files"
-
 
1251
      fi
-
 
1252
    fi
-
 
1253
 
-
 
1254
    if test -n "$my_dlsyms"; then
-
 
1255
      case $my_dlsyms in
-
 
1256
      "") ;;
-
 
1257
      *.c)
-
 
1258
	# Discover the nlist of each of the dlfiles.
-
 
1259
	nlist="$output_objdir/${my_outputname}.nm"
-
 
1260
 
-
 
1261
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
 
1262
 
-
 
1263
	# Parse the name list into a source file.
-
 
1264
	func_verbose "creating $output_objdir/$my_dlsyms"
-
 
1265
 
-
 
1266
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-
 
1267
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-
 
1268
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
 
1269
 
-
 
1270
#ifdef __cplusplus
-
 
1271
extern \"C\" {
-
 
1272
#endif
-
 
1273
 
-
 
1274
/* External symbol declarations for the compiler. */\
-
 
1275
"
-
 
1276
 
-
 
1277
	if test "$dlself" = yes; then
-
 
1278
	  func_verbose "generating symbol list for \`$output'"
-
 
1279
 
-
 
1280
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
 
1281
 
-
 
1282
	  # Add our own program objects to the symbol list.
-
 
1283
	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
 
1284
	  for progfile in $progfiles; do
-
 
1285
	    func_verbose "extracting global C symbols from \`$progfile'"
-
 
1286
	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
-
 
1287
	  done
-
 
1288
 
-
 
1289
	  if test -n "$exclude_expsyms"; then
-
 
1290
	    $opt_dry_run || {
-
 
1291
	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-
 
1292
	      eval '$MV "$nlist"T "$nlist"'
-
 
1293
	    }
-
 
1294
	  fi
-
 
1295
 
-
 
1296
	  if test -n "$export_symbols_regex"; then
-
 
1297
	    $opt_dry_run || {
-
 
1298
	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-
 
1299
	      eval '$MV "$nlist"T "$nlist"'
-
 
1300
	    }
-
 
1301
	  fi
-
 
1302
 
-
 
1303
	  # Prepare the list of exported symbols
-
 
1304
	  if test -z "$export_symbols"; then
-
 
1305
	    export_symbols="$output_objdir/$outputname.exp"
-
 
1306
	    $opt_dry_run || {
-
 
1307
	      $RM $export_symbols
-
 
1308
	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-
 
1309
	      case $host in
-
 
1310
	      *cygwin* | *mingw* )
-
 
1311
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-
 
1312
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-
 
1313
	        ;;
-
 
1314
	      esac
-
 
1315
	    }
-
 
1316
	  else
-
 
1317
	    $opt_dry_run || {
-
 
1318
	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-
 
1319
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-
 
1320
	      eval '$MV "$nlist"T "$nlist"'
-
 
1321
	      case $host in
-
 
1322
	        *cygwin | *mingw* )
-
 
1323
	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-
 
1324
	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-
 
1325
	          ;;
-
 
1326
	      esac
-
 
1327
	    }
-
 
1328
	  fi
-
 
1329
	fi
-
 
1330
 
-
 
1331
	for dlprefile in $dlprefiles; do
-
 
1332
	  func_verbose "extracting global C symbols from \`$dlprefile'"
-
 
1333
	  func_basename "$dlprefile"
-
 
1334
	  name="$func_basename_result"
-
 
1335
	  $opt_dry_run || {
-
 
1336
	    eval '$ECHO ": $name " >> "$nlist"'
-
 
1337
	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-
 
1338
	  }
-
 
1339
	done
-
 
1340
 
-
 
1341
	$opt_dry_run || {
-
 
1342
	  # Make sure we have at least an empty file.
-
 
1343
	  test -f "$nlist" || : > "$nlist"
-
 
1344
 
-
 
1345
	  if test -n "$exclude_expsyms"; then
-
 
1346
	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-
 
1347
	    $MV "$nlist"T "$nlist"
-
 
1348
	  fi
-
 
1349
 
-
 
1350
	  # Try sorting and uniquifying the output.
-
 
1351
	  if $GREP -v "^: " < "$nlist" |
-
 
1352
	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-
 
1353
		sort -k 3
-
 
1354
	      else
-
 
1355
		sort +2
-
 
1356
	      fi |
-
 
1357
	      uniq > "$nlist"S; then
-
 
1358
	    :
-
 
1359
	  else
-
 
1360
	    $GREP -v "^: " < "$nlist" > "$nlist"S
-
 
1361
	  fi
-
 
1362
 
-
 
1363
	  if test -f "$nlist"S; then
-
 
1364
	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-
 
1365
	  else
-
 
1366
	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
-
 
1367
	  fi
-
 
1368
 
-
 
1369
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
1370
 
-
 
1371
/* The mapping between symbol names and symbols.  */
-
 
1372
typedef struct {
-
 
1373
  const char *name;
-
 
1374
  void *address;
-
 
1375
} lt_dlsymlist;
-
 
1376
"
-
 
1377
	  case $host in
-
 
1378
	  *cygwin* | *mingw* )
-
 
1379
	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
1380
/* DATA imports from DLLs on WIN32 con't be const, because
-
 
1381
   runtime relocations are performed -- see ld's documentation
-
 
1382
   on pseudo-relocs.  */"
-
 
1383
	    lt_dlsym_const= ;;
-
 
1384
	  *osf5*)
-
 
1385
	    echo >> "$output_objdir/$my_dlsyms" "\
-
 
1386
/* This system does not cope well with relocations in const data */"
-
 
1387
	    lt_dlsym_const= ;;
-
 
1388
	  *)
-
 
1389
	    lt_dlsym_const=const ;;
-
 
1390
	  esac
-
 
1391
 
-
 
1392
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
1393
extern $lt_dlsym_const lt_dlsymlist
-
 
1394
lt_${my_prefix}_LTX_preloaded_symbols[];
-
 
1395
$lt_dlsym_const lt_dlsymlist
-
 
1396
lt_${my_prefix}_LTX_preloaded_symbols[] =
-
 
1397
{\
-
 
1398
  { \"$my_originator\", (void *) 0 },"
-
 
1399
 
-
 
1400
	  case $need_lib_prefix in
-
 
1401
	  no)
-
 
1402
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-
 
1403
	    ;;
-
 
1404
	  *)
-
 
1405
	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-
 
1406
	    ;;
-
 
1407
	  esac
-
 
1408
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
1409
  {0, (void *) 0}
-
 
1410
};
-
 
1411
 
-
 
1412
/* This works around a problem in FreeBSD linker */
-
 
1413
#ifdef FREEBSD_WORKAROUND
-
 
1414
static const void *lt_preloaded_setup() {
-
 
1415
  return lt_${my_prefix}_LTX_preloaded_symbols;
-
 
1416
}
-
 
1417
#endif
-
 
1418
 
-
 
1419
#ifdef __cplusplus
-
 
1420
}
-
 
1421
#endif\
-
 
1422
"
-
 
1423
	} # !$opt_dry_run
-
 
1424
 
-
 
1425
	pic_flag_for_symtable=
-
 
1426
	case "$compile_command " in
-
 
1427
	*" -static "*) ;;
-
 
1428
	*)
-
 
1429
	  case $host in
-
 
1430
	  # compiling the symbol table file with pic_flag works around
-
 
1431
	  # a FreeBSD bug that causes programs to crash when -lm is
-
 
1432
	  # linked before any other PIC object.  But we must not use
-
 
1433
	  # pic_flag when linking with -static.  The problem exists in
-
 
1434
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-
 
1435
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-
 
1436
	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-
 
1437
	  *-*-hpux*)
-
 
1438
	    pic_flag_for_symtable=" $pic_flag"  ;;
-
 
1439
	  *)
-
 
1440
	    if test "X$my_pic_p" != Xno; then
-
 
1441
	      pic_flag_for_symtable=" $pic_flag"
-
 
1442
	    fi
-
 
1443
	    ;;
-
 
1444
	  esac
-
 
1445
	  ;;
-
 
1446
	esac
-
 
1447
	symtab_cflags=
-
 
1448
	for arg in $LTCFLAGS; do
-
 
1449
	  case $arg in
-
 
1450
	  -pie | -fpie | -fPIE) ;;
-
 
1451
	  *) symtab_cflags="$symtab_cflags $arg" ;;
-
 
1452
	  esac
-
 
1453
	done
-
 
1454
 
-
 
1455
	# Now compile the dynamic symbol file.
-
 
1456
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
 
1457
 
-
 
1458
	# Clean up the generated files.
-
 
1459
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
 
1460
 
-
 
1461
	# Transform the symbol file into the correct name.
-
 
1462
	symfileobj="$output_objdir/${my_outputname}S.$objext"
-
 
1463
	case $host in
-
 
1464
	*cygwin* | *mingw* )
-
 
1465
	  if test -f "$output_objdir/$my_outputname.def"; then
-
 
1466
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-
 
1467
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-
 
1468
	  else
-
 
1469
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
1470
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
1471
	  fi
-
 
1472
	  ;;
-
 
1473
	*)
-
 
1474
	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
1475
	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
1476
	  ;;
-
 
1477
	esac
-
 
1478
	;;
-
 
1479
      *)
-
 
1480
	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-
 
1481
	;;
-
 
1482
      esac
-
 
1483
    else
-
 
1484
      # We keep going just in case the user didn't refer to
-
 
1485
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-
 
1486
      # really was required.
-
 
1487
 
-
 
1488
      # Nullify the symbol file.
-
 
1489
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-
 
1490
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-
 
1491
    fi
-
 
1492
}
-
 
1493
 
-
 
1494
# func_extract_an_archive dir oldlib
-
 
1495
func_extract_an_archive ()
-
 
1496
{
-
 
1497
    $opt_debug
-
 
1498
    f_ex_an_ar_dir="$1"; shift
-
 
1499
    f_ex_an_ar_oldlib="$1"
-
 
1500
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
-
 
1501
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-
 
1502
     :
-
 
1503
    else
-
 
1504
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-
 
1505
    fi
-
 
1506
}
-
 
1507
 
-
 
1508
 
-
 
1509
# func_extract_archives gentop oldlib ...
-
 
1510
func_extract_archives ()
-
 
1511
{
-
 
1512
    $opt_debug
-
 
1513
    my_gentop="$1"; shift
-
 
1514
    my_oldlibs=${1+"$@"}
-
 
1515
    my_oldobjs=""
-
 
1516
    my_xlib=""
-
 
1517
    my_xabs=""
-
 
1518
    my_xdir=""
-
 
1519
 
-
 
1520
    for my_xlib in $my_oldlibs; do
-
 
1521
      # Extract the objects.
-
 
1522
      case $my_xlib in
-
 
1523
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-
 
1524
	*) my_xabs=`pwd`"/$my_xlib" ;;
-
 
1525
      esac
-
 
1526
      func_basename "$my_xlib"
-
 
1527
      my_xlib="$func_basename_result"
-
 
1528
      my_xlib_u=$my_xlib
-
 
1529
      while :; do
-
 
1530
        case " $extracted_archives " in
-
 
1531
	*" $my_xlib_u "*)
-
 
1532
	  extracted_serial=`expr $extracted_serial + 1`
-
 
1533
	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-
 
1534
	*) break ;;
-
 
1535
	esac
-
 
1536
      done
-
 
1537
      extracted_archives="$extracted_archives $my_xlib_u"
-
 
1538
      my_xdir="$my_gentop/$my_xlib_u"
-
 
1539
 
-
 
1540
      func_mkdir_p "$my_xdir"
-
 
1541
 
-
 
1542
      case $host in
-
 
1543
      *-darwin*)
-
 
1544
	func_verbose "Extracting $my_xabs"
-
 
1545
	# Do not bother doing anything if just a dry run
-
 
1546
	$opt_dry_run || {
-
 
1547
	  darwin_orig_dir=`pwd`
-
 
1548
	  cd $my_xdir || exit $?
-
 
1549
	  darwin_archive=$my_xabs
-
 
1550
	  darwin_curdir=`pwd`
-
 
1551
	  darwin_base_archive=`basename "$darwin_archive"`
-
 
1552
	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-
 
1553
	  if test -n "$darwin_arches"; then
-
 
1554
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-
 
1555
	    darwin_arch=
-
 
1556
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-
 
1557
	    for darwin_arch in  $darwin_arches ; do
-
 
1558
	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-
 
1559
	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-
 
1560
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-
 
1561
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-
 
1562
	      cd "$darwin_curdir"
-
 
1563
	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-
 
1564
	    done # $darwin_arches
-
 
1565
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-
 
1566
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
-
 
1567
	    darwin_file=
-
 
1568
	    darwin_files=
-
 
1569
	    for darwin_file in $darwin_filelist; do
-
 
1570
	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-
 
1571
	      lipo -create -output "$darwin_file" $darwin_files
-
 
1572
	    done # $darwin_filelist
-
 
1573
	    $RM -rf unfat-$$
-
 
1574
	    cd "$darwin_orig_dir"
-
 
1575
	  else
-
 
1576
	    cd $darwin_orig_dir
-
 
1577
	    func_extract_an_archive "$my_xdir" "$my_xabs"
-
 
1578
	  fi # $darwin_arches
-
 
1579
	} # !$opt_dry_run
-
 
1580
	;;
-
 
1581
      *)
-
 
1582
        func_extract_an_archive "$my_xdir" "$my_xabs"
-
 
1583
	;;
-
 
1584
      esac
-
 
1585
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-
 
1586
    done
-
 
1587
 
-
 
1588
    func_extract_archives_result="$my_oldobjs"
-
 
1589
}
-
 
1590
 
-
 
1591
 
-
 
1592
 
-
 
1593
# func_write_libtool_object output_name pic_name nonpic_name
1063
# func_write_libtool_object output_name pic_name nonpic_name
1594
# Create a libtool object file (analogous to a ".la" file),
1064
# Create a libtool object file (analogous to a ".la" file),
1595
# but don't create it if we're doing a dry run.
1065
# but don't create it if we're doing a dry run.
1596
func_write_libtool_object ()
1066
func_write_libtool_object ()
1597
{
1067
{
Line 1621... Line 1091...
1621
 
1091
 
1622
# Name of the non-PIC object
1092
# Name of the non-PIC object
1623
non_pic_object=$write_oldobj
1093
non_pic_object=$write_oldobj
1624
 
1094
 
1625
EOF
1095
EOF
1626
      mv -f "${write_libobj}T" "${write_libobj}"
1096
      $MV "${write_libobj}T" "${write_libobj}"
1627
    }
1097
    }
1628
}
1098
}
1629
 
1099
 
1630
# func_mode_compile arg...
1100
# func_mode_compile arg...
1631
func_mode_compile ()
1101
func_mode_compile ()
Line 1737... Line 1207...
1737
      ;;
1207
      ;;
1738
    esac
1208
    esac
1739
 
1209
 
1740
    # Recognize several different file suffixes.
1210
    # Recognize several different file suffixes.
1741
    # If the user specifies -o file.o, it is replaced with file.lo
1211
    # If the user specifies -o file.o, it is replaced with file.lo
1742
    xform='[cCFSifmso]'
-
 
1743
    case $libobj in
1212
    case $libobj in
1744
    *.ada) xform=ada ;;
-
 
1745
    *.adb) xform=adb ;;
1213
    *.[cCFSifmso] | \
1746
    *.ads) xform=ads ;;
1214
    *.ada | *.adb | *.ads | *.asm | \
1747
    *.asm) xform=asm ;;
-
 
1748
    *.c++) xform=c++ ;;
-
 
1749
    *.cc) xform=cc ;;
-
 
1750
    *.ii) xform=ii ;;
-
 
1751
    *.class) xform=class ;;
1215
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1752
    *.cpp) xform=cpp ;;
-
 
1753
    *.cxx) xform=cxx ;;
-
 
1754
    *.[fF][09]?) xform='[fF][09].' ;;
1216
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1755
    *.for) xform=for ;;
1217
      func_xform "$libobj"
1756
    *.java) xform=java ;;
-
 
1757
    *.obj) xform=obj ;;
1218
      libobj=$func_xform_result
1758
    *.sx) xform=sx ;;
1219
      ;;
1759
    esac
1220
    esac
1760
 
1221
 
1761
    libobj=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
 
1762
 
-
 
1763
    case $libobj in
1222
    case $libobj in
1764
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1223
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1765
    *)
1224
    *)
1766
      func_fatal_error "cannot determine name of library object from \`$libobj'"
1225
      func_fatal_error "cannot determine name of library object from \`$libobj'"
1767
      ;;
1226
      ;;
Line 1813... Line 1272...
1813
      removelist="$obj $lobj $libobj ${libobj}T"
1272
      removelist="$obj $lobj $libobj ${libobj}T"
1814
    else
1273
    else
1815
      removelist="$lobj $libobj ${libobj}T"
1274
      removelist="$lobj $libobj ${libobj}T"
1816
    fi
1275
    fi
1817
 
1276
 
1818
    $opt_dry_run || $RM $removelist
-
 
1819
    trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
-
 
1820
 
-
 
1821
    # On Cygwin there's no "real" PIC flag so we must build both object types
1277
    # On Cygwin there's no "real" PIC flag so we must build both object types
1822
    case $host_os in
1278
    case $host_os in
1823
    cygwin* | mingw* | pw32* | os2*)
1279
    cygwin* | mingw* | pw32* | os2* | cegcc*)
1824
      pic_mode=default
1280
      pic_mode=default
1825
      ;;
1281
      ;;
1826
    esac
1282
    esac
1827
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1283
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1828
      # non-PIC code in shared libraries is not supported
1284
      # non-PIC code in shared libraries is not supported
Line 1832... Line 1288...
1832
    # Calculate the filename of the output object if compiler does
1288
    # Calculate the filename of the output object if compiler does
1833
    # not support -o with -c
1289
    # not support -o with -c
1834
    if test "$compiler_c_o" = no; then
1290
    if test "$compiler_c_o" = no; then
1835
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1291
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1836
      lockfile="$output_obj.lock"
1292
      lockfile="$output_obj.lock"
1837
      removelist="$removelist $output_obj $lockfile"
-
 
1838
      trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
-
 
1839
    else
1293
    else
1840
      output_obj=
1294
      output_obj=
1841
      need_locks=no
1295
      need_locks=no
1842
      lockfile=
1296
      lockfile=
1843
    fi
1297
    fi
Line 1863... Line 1317...
1863
compiler."
1317
compiler."
1864
 
1318
 
1865
	$opt_dry_run || $RM $removelist
1319
	$opt_dry_run || $RM $removelist
1866
	exit $EXIT_FAILURE
1320
	exit $EXIT_FAILURE
1867
      fi
1321
      fi
-
 
1322
      removelist="$removelist $output_obj"
1868
      $ECHO "$srcfile" > "$lockfile"
1323
      $ECHO "$srcfile" > "$lockfile"
1869
    fi
1324
    fi
1870
 
1325
 
-
 
1326
    $opt_dry_run || $RM $removelist
-
 
1327
    removelist="$removelist $lockfile"
-
 
1328
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
 
1329
 
1871
    if test -n "$fix_srcfile_path"; then
1330
    if test -n "$fix_srcfile_path"; then
1872
      eval srcfile=\"$fix_srcfile_path\"
1331
      eval srcfile=\"$fix_srcfile_path\"
1873
    fi
1332
    fi
1874
    func_quote_for_eval "$srcfile"
1333
    func_quote_for_eval "$srcfile"
1875
    qsrcfile=$func_quote_for_eval_result
1334
    qsrcfile=$func_quote_for_eval_result
1876
 
1335
 
1877
    $opt_dry_run || $RM "$libobj" "${libobj}T"
-
 
1878
 
-
 
1879
    # Only build a PIC object if we are building libtool libraries.
1336
    # Only build a PIC object if we are building libtool libraries.
1880
    if test "$build_libtool_libs" = yes; then
1337
    if test "$build_libtool_libs" = yes; then
1881
      # Without this assignment, base_compile gets emptied.
1338
      # Without this assignment, base_compile gets emptied.
1882
      fbsd_hideous_sh_bug=$base_compile
1339
      fbsd_hideous_sh_bug=$base_compile
1883
 
1340
 
Line 1893... Line 1350...
1893
      if test -z "$output_obj"; then
1350
      if test -z "$output_obj"; then
1894
	# Place PIC objects in $objdir
1351
	# Place PIC objects in $objdir
1895
	command="$command -o $lobj"
1352
	command="$command -o $lobj"
1896
      fi
1353
      fi
1897
 
1354
 
1898
      $opt_dry_run || $RM "$lobj" "$output_obj"
-
 
1899
 
-
 
1900
      func_show_eval "$command"	\
1355
      func_show_eval_locale "$command"	\
1901
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1356
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1902
 
1357
 
1903
      if test "$need_locks" = warn &&
1358
      if test "$need_locks" = warn &&
1904
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1359
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1905
	$ECHO "\
1360
	$ECHO "\
Line 1944... Line 1399...
1944
	command="$command -o $obj"
1399
	command="$command -o $obj"
1945
      fi
1400
      fi
1946
 
1401
 
1947
      # Suppress compiler output if we already did a PIC compilation.
1402
      # Suppress compiler output if we already did a PIC compilation.
1948
      command="$command$suppress_output"
1403
      command="$command$suppress_output"
1949
      $opt_dry_run || $RM "$obj" "$output_obj"
-
 
1950
      func_show_eval "$command" \
1404
      func_show_eval_locale "$command" \
1951
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1405
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1952
 
1406
 
1953
      if test "$need_locks" = warn &&
1407
      if test "$need_locks" = warn &&
1954
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1408
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1955
	$ECHO "\
1409
	$ECHO "\
Line 1980... Line 1434...
1980
    $opt_dry_run || {
1434
    $opt_dry_run || {
1981
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1435
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1982
 
1436
 
1983
      # Unlock the critical section if it was locked
1437
      # Unlock the critical section if it was locked
1984
      if test "$need_locks" != no; then
1438
      if test "$need_locks" != no; then
-
 
1439
	removelist=$lockfile
1985
        $RM "$lockfile"
1440
        $RM "$lockfile"
1986
      fi
1441
      fi
1987
    }
1442
    }
1988
 
1443
 
1989
    exit $EXIT_SUCCESS
1444
    exit $EXIT_SUCCESS
1990
}
1445
}
1991
 
1446
 
-
 
1447
$opt_help || {
1992
test "$mode" = compile && func_mode_compile ${1+"$@"}
1448
test "$mode" = compile && func_mode_compile ${1+"$@"}
-
 
1449
}
-
 
1450
 
-
 
1451
func_mode_help ()
-
 
1452
{
-
 
1453
    # We need to display help for each of the modes.
-
 
1454
    case $mode in
-
 
1455
      "")
-
 
1456
        # Generic help is extracted from the usage comments
-
 
1457
        # at the start of this file.
-
 
1458
        func_help
-
 
1459
        ;;
-
 
1460
 
-
 
1461
      clean)
-
 
1462
        $ECHO \
-
 
1463
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
 
1464
 
-
 
1465
Remove files from the build directory.
-
 
1466
 
-
 
1467
RM is the name of the program to use to delete files associated with each FILE
-
 
1468
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-
 
1469
to RM.
-
 
1470
 
-
 
1471
If FILE is a libtool library, object or program, all the files associated
-
 
1472
with it are deleted. Otherwise, only FILE itself is deleted using RM."
-
 
1473
        ;;
-
 
1474
 
-
 
1475
      compile)
-
 
1476
      $ECHO \
-
 
1477
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
 
1478
 
-
 
1479
Compile a source file into a libtool library object.
-
 
1480
 
-
 
1481
This mode accepts the following additional options:
-
 
1482
 
-
 
1483
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-
 
1484
  -no-suppress      do not suppress compiler output for multiple passes
-
 
1485
  -prefer-pic       try to building PIC objects only
-
 
1486
  -prefer-non-pic   try to building non-PIC objects only
-
 
1487
  -shared           do not build a \`.o' file suitable for static linking
-
 
1488
  -static           only build a \`.o' file suitable for static linking
-
 
1489
 
-
 
1490
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-
 
1491
from the given SOURCEFILE.
-
 
1492
 
-
 
1493
The output file name is determined by removing the directory component from
-
 
1494
SOURCEFILE, then substituting the C source code suffix \`.c' with the
-
 
1495
library object suffix, \`.lo'."
-
 
1496
        ;;
-
 
1497
 
-
 
1498
      execute)
-
 
1499
        $ECHO \
-
 
1500
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
 
1501
 
-
 
1502
Automatically set library path, then run a program.
-
 
1503
 
-
 
1504
This mode accepts the following additional options:
-
 
1505
 
-
 
1506
  -dlopen FILE      add the directory containing FILE to the library path
-
 
1507
 
-
 
1508
This mode sets the library path environment variable according to \`-dlopen'
-
 
1509
flags.
-
 
1510
 
-
 
1511
If any of the ARGS are libtool executable wrappers, then they are translated
-
 
1512
into their corresponding uninstalled binary, and any of their required library
-
 
1513
directories are added to the library path.
-
 
1514
 
-
 
1515
Then, COMMAND is executed, with ARGS as arguments."
-
 
1516
        ;;
-
 
1517
 
-
 
1518
      finish)
-
 
1519
        $ECHO \
-
 
1520
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
 
1521
 
-
 
1522
Complete the installation of libtool libraries.
-
 
1523
 
-
 
1524
Each LIBDIR is a directory that contains libtool libraries.
-
 
1525
 
-
 
1526
The commands that this mode executes may require superuser privileges.  Use
-
 
1527
the \`--dry-run' option if you just want to see what would be executed."
-
 
1528
        ;;
-
 
1529
 
-
 
1530
      install)
-
 
1531
        $ECHO \
-
 
1532
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
 
1533
 
-
 
1534
Install executables or libraries.
-
 
1535
 
-
 
1536
INSTALL-COMMAND is the installation command.  The first component should be
-
 
1537
either the \`install' or \`cp' program.
-
 
1538
 
-
 
1539
The following components of INSTALL-COMMAND are treated specially:
-
 
1540
 
-
 
1541
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
 
1542
 
-
 
1543
The rest of the components are interpreted as arguments to that command (only
-
 
1544
BSD-compatible install options are recognized)."
-
 
1545
        ;;
-
 
1546
 
-
 
1547
      link)
-
 
1548
        $ECHO \
-
 
1549
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
 
1550
 
-
 
1551
Link object files or libraries together to form another library, or to
-
 
1552
create an executable program.
-
 
1553
 
-
 
1554
LINK-COMMAND is a command using the C compiler that you would use to create
-
 
1555
a program from several object files.
-
 
1556
 
-
 
1557
The following components of LINK-COMMAND are treated specially:
-
 
1558
 
-
 
1559
  -all-static       do not do any dynamic linking at all
-
 
1560
  -avoid-version    do not add a version suffix if possible
-
 
1561
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-
 
1562
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-
 
1563
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-
 
1564
  -export-symbols SYMFILE
-
 
1565
                    try to export only the symbols listed in SYMFILE
-
 
1566
  -export-symbols-regex REGEX
-
 
1567
                    try to export only the symbols matching REGEX
-
 
1568
  -LLIBDIR          search LIBDIR for required installed libraries
-
 
1569
  -lNAME            OUTPUT-FILE requires the installed library libNAME
-
 
1570
  -module           build a library that can dlopened
-
 
1571
  -no-fast-install  disable the fast-install mode
-
 
1572
  -no-install       link a not-installable executable
-
 
1573
  -no-undefined     declare that a library does not refer to external symbols
-
 
1574
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-
 
1575
  -objectlist FILE  Use a list of object files found in FILE to specify objects
-
 
1576
  -precious-files-regex REGEX
-
 
1577
                    don't remove output files matching REGEX
-
 
1578
  -release RELEASE  specify package release information
-
 
1579
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-
 
1580
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-
 
1581
  -shared           only do dynamic linking of libtool libraries
-
 
1582
  -shrext SUFFIX    override the standard shared library file extension
-
 
1583
  -static           do not do any dynamic linking of uninstalled libtool libraries
-
 
1584
  -static-libtool-libs
-
 
1585
                    do not do any dynamic linking of libtool libraries
-
 
1586
  -version-info CURRENT[:REVISION[:AGE]]
-
 
1587
                    specify library version info [each variable defaults to 0]
-
 
1588
  -weak LIBNAME     declare that the target provides the LIBNAME interface
-
 
1589
 
-
 
1590
All other options (arguments beginning with \`-') are ignored.
-
 
1591
 
-
 
1592
Every other argument is treated as a filename.  Files ending in \`.la' are
-
 
1593
treated as uninstalled libtool libraries, other files are standard or library
-
 
1594
object files.
-
 
1595
 
-
 
1596
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-
 
1597
only library objects (\`.lo' files) may be specified, and \`-rpath' is
-
 
1598
required, except when creating a convenience library.
-
 
1599
 
-
 
1600
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-
 
1601
using \`ar' and \`ranlib', or on Windows using \`lib'.
-
 
1602
 
-
 
1603
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-
 
1604
is created, otherwise an executable program is created."
-
 
1605
        ;;
-
 
1606
 
-
 
1607
      uninstall)
-
 
1608
        $ECHO \
-
 
1609
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
 
1610
 
-
 
1611
Remove libraries from an installation directory.
-
 
1612
 
-
 
1613
RM is the name of the program to use to delete files associated with each FILE
-
 
1614
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-
 
1615
to RM.
-
 
1616
 
-
 
1617
If FILE is a libtool library, all the files associated with it are deleted.
-
 
1618
Otherwise, only FILE itself is deleted using RM."
-
 
1619
        ;;
-
 
1620
 
-
 
1621
      *)
-
 
1622
        func_fatal_help "invalid operation mode \`$mode'"
-
 
1623
        ;;
-
 
1624
    esac
-
 
1625
 
-
 
1626
    $ECHO
-
 
1627
    $ECHO "Try \`$progname --help' for more information about other modes."
-
 
1628
 
-
 
1629
    exit $?
-
 
1630
}
-
 
1631
 
-
 
1632
  # Now that we've collected a possible --mode arg, show help if necessary
-
 
1633
  $opt_help && func_mode_help
1993
 
1634
 
1994
 
1635
 
1995
# func_mode_execute arg...
1636
# func_mode_execute arg...
1996
func_mode_execute ()
1637
func_mode_execute ()
1997
{
1638
{
Line 2074... Line 1715...
2074
      -*) ;;
1715
      -*) ;;
2075
      *)
1716
      *)
2076
	# Do a test to see if this is really a libtool program.
1717
	# Do a test to see if this is really a libtool program.
2077
	if func_ltwrapper_script_p "$file"; then
1718
	if func_ltwrapper_script_p "$file"; then
2078
	  func_source "$file"
1719
	  func_source "$file"
-
 
1720
	  # Transform arg to wrapped name.
-
 
1721
	  file="$progdir/$program"
2079
	elif func_ltwrapper_executable_p "$file"; then
1722
	elif func_ltwrapper_executable_p "$file"; then
2080
	  func_ltwrapper_scriptname "$file"
1723
	  func_ltwrapper_scriptname "$file"
2081
	  func_source "$func_ltwrapper_scriptname_result"
1724
	  func_source "$func_ltwrapper_scriptname_result"
-
 
1725
	  # Transform arg to wrapped name.
-
 
1726
	  file="$progdir/$program"
2082
	fi
1727
	fi
2083
	# Transform arg to wrapped name.
-
 
2084
	file="$progdir/$program"
-
 
2085
	;;
1728
	;;
2086
      esac
1729
      esac
2087
      # Quote arguments (to preserve shell metacharacters).
1730
      # Quote arguments (to preserve shell metacharacters).
2088
      func_quote_for_eval "$file"
1731
      func_quote_for_eval "$file"
2089
      args="$args $func_quote_for_eval_result"
1732
      args="$args $func_quote_for_eval_result"
Line 2402... Line 2045...
2402
	  # Install the shared library and build the symlinks.
2045
	  # Install the shared library and build the symlinks.
2403
	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2046
	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2404
	      'exit $?'
2047
	      'exit $?'
2405
	  tstripme="$stripme"
2048
	  tstripme="$stripme"
2406
	  case $host_os in
2049
	  case $host_os in
2407
	  cygwin* | mingw* | pw32*)
2050
	  cygwin* | mingw* | pw32* | cegcc*)
2408
	    case $realname in
2051
	    case $realname in
2409
	    *.dll.a)
2052
	    *.dll.a)
2410
	      tstripme=""
2053
	      tstripme=""
2411
	      ;;
2054
	      ;;
2412
	    esac
2055
	    esac
Line 2508... Line 2151...
2508
	    ;;
2151
	    ;;
2509
	esac
2152
	esac
2510
 
2153
 
2511
	# Do a test to see if this is really a libtool program.
2154
	# Do a test to see if this is really a libtool program.
2512
	case $host in
2155
	case $host in
2513
	*cygwin*|*mingw*)
2156
	*cygwin* | *mingw*)
2514
	    if func_ltwrapper_executable_p "$file"; then
2157
	    if func_ltwrapper_executable_p "$file"; then
2515
	      func_ltwrapper_scriptname "$file"
2158
	      func_ltwrapper_scriptname "$file"
2516
	      wrapper=$func_ltwrapper_scriptname_result
2159
	      wrapper=$func_ltwrapper_scriptname_result
2517
	    else
2160
	    else
2518
	      func_stripname '' '.exe' "$file"
2161
	      func_stripname '' '.exe' "$file"
Line 2638... Line 2281...
2638
}
2281
}
2639
 
2282
 
2640
test "$mode" = install && func_mode_install ${1+"$@"}
2283
test "$mode" = install && func_mode_install ${1+"$@"}
2641
 
2284
 
2642
 
2285
 
-
 
2286
# func_generate_dlsyms outputname originator pic_p
-
 
2287
# Extract symbols from dlprefiles and create ${outputname}S.o with
-
 
2288
# a dlpreopen symbol table.
-
 
2289
func_generate_dlsyms ()
-
 
2290
{
-
 
2291
    $opt_debug
-
 
2292
    my_outputname="$1"
-
 
2293
    my_originator="$2"
-
 
2294
    my_pic_p="${3-no}"
-
 
2295
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
-
 
2296
    my_dlsyms=
-
 
2297
 
-
 
2298
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-
 
2299
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-
 
2300
	my_dlsyms="${my_outputname}S.c"
-
 
2301
      else
-
 
2302
	func_error "not configured to extract global symbols from dlpreopened files"
-
 
2303
      fi
-
 
2304
    fi
-
 
2305
 
-
 
2306
    if test -n "$my_dlsyms"; then
-
 
2307
      case $my_dlsyms in
-
 
2308
      "") ;;
-
 
2309
      *.c)
-
 
2310
	# Discover the nlist of each of the dlfiles.
-
 
2311
	nlist="$output_objdir/${my_outputname}.nm"
-
 
2312
 
-
 
2313
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
 
2314
 
-
 
2315
	# Parse the name list into a source file.
-
 
2316
	func_verbose "creating $output_objdir/$my_dlsyms"
-
 
2317
 
-
 
2318
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-
 
2319
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-
 
2320
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
 
2321
 
-
 
2322
#ifdef __cplusplus
-
 
2323
extern \"C\" {
-
 
2324
#endif
-
 
2325
 
-
 
2326
/* External symbol declarations for the compiler. */\
-
 
2327
"
-
 
2328
 
-
 
2329
	if test "$dlself" = yes; then
-
 
2330
	  func_verbose "generating symbol list for \`$output'"
-
 
2331
 
-
 
2332
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
 
2333
 
-
 
2334
	  # Add our own program objects to the symbol list.
-
 
2335
	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
 
2336
	  for progfile in $progfiles; do
-
 
2337
	    func_verbose "extracting global C symbols from \`$progfile'"
-
 
2338
	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
-
 
2339
	  done
-
 
2340
 
-
 
2341
	  if test -n "$exclude_expsyms"; then
-
 
2342
	    $opt_dry_run || {
-
 
2343
	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-
 
2344
	      eval '$MV "$nlist"T "$nlist"'
-
 
2345
	    }
-
 
2346
	  fi
-
 
2347
 
-
 
2348
	  if test -n "$export_symbols_regex"; then
-
 
2349
	    $opt_dry_run || {
-
 
2350
	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-
 
2351
	      eval '$MV "$nlist"T "$nlist"'
-
 
2352
	    }
-
 
2353
	  fi
-
 
2354
 
-
 
2355
	  # Prepare the list of exported symbols
-
 
2356
	  if test -z "$export_symbols"; then
-
 
2357
	    export_symbols="$output_objdir/$outputname.exp"
-
 
2358
	    $opt_dry_run || {
-
 
2359
	      $RM $export_symbols
-
 
2360
	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-
 
2361
	      case $host in
-
 
2362
	      *cygwin* | *mingw* | *cegcc* )
-
 
2363
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-
 
2364
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-
 
2365
	        ;;
-
 
2366
	      esac
-
 
2367
	    }
-
 
2368
	  else
-
 
2369
	    $opt_dry_run || {
-
 
2370
	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-
 
2371
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-
 
2372
	      eval '$MV "$nlist"T "$nlist"'
-
 
2373
	      case $host in
-
 
2374
	        *cygwin | *mingw* | *cegcc* )
-
 
2375
	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-
 
2376
	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-
 
2377
	          ;;
-
 
2378
	      esac
-
 
2379
	    }
-
 
2380
	  fi
-
 
2381
	fi
-
 
2382
 
-
 
2383
	for dlprefile in $dlprefiles; do
-
 
2384
	  func_verbose "extracting global C symbols from \`$dlprefile'"
-
 
2385
	  func_basename "$dlprefile"
-
 
2386
	  name="$func_basename_result"
-
 
2387
	  $opt_dry_run || {
-
 
2388
	    eval '$ECHO ": $name " >> "$nlist"'
-
 
2389
	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-
 
2390
	  }
-
 
2391
	done
-
 
2392
 
-
 
2393
	$opt_dry_run || {
-
 
2394
	  # Make sure we have at least an empty file.
-
 
2395
	  test -f "$nlist" || : > "$nlist"
-
 
2396
 
-
 
2397
	  if test -n "$exclude_expsyms"; then
-
 
2398
	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-
 
2399
	    $MV "$nlist"T "$nlist"
-
 
2400
	  fi
-
 
2401
 
-
 
2402
	  # Try sorting and uniquifying the output.
-
 
2403
	  if $GREP -v "^: " < "$nlist" |
-
 
2404
	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-
 
2405
		sort -k 3
-
 
2406
	      else
-
 
2407
		sort +2
-
 
2408
	      fi |
-
 
2409
	      uniq > "$nlist"S; then
-
 
2410
	    :
-
 
2411
	  else
-
 
2412
	    $GREP -v "^: " < "$nlist" > "$nlist"S
-
 
2413
	  fi
-
 
2414
 
-
 
2415
	  if test -f "$nlist"S; then
-
 
2416
	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-
 
2417
	  else
-
 
2418
	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
-
 
2419
	  fi
-
 
2420
 
-
 
2421
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
2422
 
-
 
2423
/* The mapping between symbol names and symbols.  */
-
 
2424
typedef struct {
-
 
2425
  const char *name;
-
 
2426
  void *address;
-
 
2427
} lt_dlsymlist;
-
 
2428
"
-
 
2429
	  case $host in
-
 
2430
	  *cygwin* | *mingw* | *cegcc* )
-
 
2431
	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
2432
/* DATA imports from DLLs on WIN32 con't be const, because
-
 
2433
   runtime relocations are performed -- see ld's documentation
-
 
2434
   on pseudo-relocs.  */"
-
 
2435
	    lt_dlsym_const= ;;
-
 
2436
	  *osf5*)
-
 
2437
	    echo >> "$output_objdir/$my_dlsyms" "\
-
 
2438
/* This system does not cope well with relocations in const data */"
-
 
2439
	    lt_dlsym_const= ;;
-
 
2440
	  *)
-
 
2441
	    lt_dlsym_const=const ;;
-
 
2442
	  esac
-
 
2443
 
-
 
2444
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
2445
extern $lt_dlsym_const lt_dlsymlist
-
 
2446
lt_${my_prefix}_LTX_preloaded_symbols[];
-
 
2447
$lt_dlsym_const lt_dlsymlist
-
 
2448
lt_${my_prefix}_LTX_preloaded_symbols[] =
-
 
2449
{\
-
 
2450
  { \"$my_originator\", (void *) 0 },"
-
 
2451
 
-
 
2452
	  case $need_lib_prefix in
-
 
2453
	  no)
-
 
2454
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-
 
2455
	    ;;
-
 
2456
	  *)
-
 
2457
	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-
 
2458
	    ;;
-
 
2459
	  esac
-
 
2460
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
2461
  {0, (void *) 0}
-
 
2462
};
-
 
2463
 
-
 
2464
/* This works around a problem in FreeBSD linker */
-
 
2465
#ifdef FREEBSD_WORKAROUND
-
 
2466
static const void *lt_preloaded_setup() {
-
 
2467
  return lt_${my_prefix}_LTX_preloaded_symbols;
-
 
2468
}
-
 
2469
#endif
-
 
2470
 
-
 
2471
#ifdef __cplusplus
-
 
2472
}
-
 
2473
#endif\
-
 
2474
"
-
 
2475
	} # !$opt_dry_run
-
 
2476
 
-
 
2477
	pic_flag_for_symtable=
-
 
2478
	case "$compile_command " in
-
 
2479
	*" -static "*) ;;
-
 
2480
	*)
-
 
2481
	  case $host in
-
 
2482
	  # compiling the symbol table file with pic_flag works around
-
 
2483
	  # a FreeBSD bug that causes programs to crash when -lm is
-
 
2484
	  # linked before any other PIC object.  But we must not use
-
 
2485
	  # pic_flag when linking with -static.  The problem exists in
-
 
2486
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-
 
2487
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-
 
2488
	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-
 
2489
	  *-*-hpux*)
-
 
2490
	    pic_flag_for_symtable=" $pic_flag"  ;;
-
 
2491
	  *)
-
 
2492
	    if test "X$my_pic_p" != Xno; then
-
 
2493
	      pic_flag_for_symtable=" $pic_flag"
-
 
2494
	    fi
-
 
2495
	    ;;
-
 
2496
	  esac
-
 
2497
	  ;;
-
 
2498
	esac
-
 
2499
	symtab_cflags=
-
 
2500
	for arg in $LTCFLAGS; do
-
 
2501
	  case $arg in
-
 
2502
	  -pie | -fpie | -fPIE) ;;
-
 
2503
	  *) symtab_cflags="$symtab_cflags $arg" ;;
-
 
2504
	  esac
-
 
2505
	done
-
 
2506
 
-
 
2507
	# Now compile the dynamic symbol file.
-
 
2508
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
 
2509
 
-
 
2510
	# Clean up the generated files.
-
 
2511
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
 
2512
 
-
 
2513
	# Transform the symbol file into the correct name.
-
 
2514
	symfileobj="$output_objdir/${my_outputname}S.$objext"
-
 
2515
	case $host in
-
 
2516
	*cygwin* | *mingw* | *cegcc* )
-
 
2517
	  if test -f "$output_objdir/$my_outputname.def"; then
-
 
2518
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-
 
2519
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-
 
2520
	  else
-
 
2521
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
2522
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
2523
	  fi
-
 
2524
	  ;;
-
 
2525
	*)
-
 
2526
	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
2527
	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-
 
2528
	  ;;
-
 
2529
	esac
-
 
2530
	;;
-
 
2531
      *)
-
 
2532
	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-
 
2533
	;;
-
 
2534
      esac
-
 
2535
    else
-
 
2536
      # We keep going just in case the user didn't refer to
-
 
2537
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-
 
2538
      # really was required.
-
 
2539
 
-
 
2540
      # Nullify the symbol file.
-
 
2541
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-
 
2542
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-
 
2543
    fi
-
 
2544
}
-
 
2545
 
2643
# func_emit_wrapper arg
2546
# func_win32_libid arg
-
 
2547
# return the library type of file 'arg'
2644
#
2548
#
2645
# emit a libtool wrapper script on stdout
2549
# Need a lot of goo to handle *both* DLLs and import libs
-
 
2550
# Has to be a shell function in order to 'eat' the argument
2646
# don't directly open a file because we may want to
2551
# that is supplied when $file_magic_command is called.
-
 
2552
func_win32_libid ()
-
 
2553
{
-
 
2554
  $opt_debug
-
 
2555
  win32_libid_type="unknown"
-
 
2556
  win32_fileres=`file -L $1 2>/dev/null`
-
 
2557
  case $win32_fileres in
2647
# incorporate the script contents within a cygwin/mingw
2558
  *ar\ archive\ import\ library*) # definitely import
-
 
2559
    win32_libid_type="x86 archive import"
-
 
2560
    ;;
-
 
2561
  *ar\ archive*) # could be an import, or static
-
 
2562
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-
 
2563
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-
 
2564
      win32_nmres=`eval $NM -f posix -A $1 |
-
 
2565
	$SED -n -e '
-
 
2566
	    1,100{
-
 
2567
		/ I /{
-
 
2568
		    s,.*,import,
-
 
2569
		    p
-
 
2570
		    q
-
 
2571
		}
-
 
2572
	    }'`
-
 
2573
      case $win32_nmres in
-
 
2574
      import*)  win32_libid_type="x86 archive import";;
-
 
2575
      *)        win32_libid_type="x86 archive static";;
-
 
2576
      esac
-
 
2577
    fi
-
 
2578
    ;;
-
 
2579
  *DLL*)
-
 
2580
    win32_libid_type="x86 DLL"
-
 
2581
    ;;
2648
# wrapper executable.  Must ONLY be called from within
2582
  *executable*) # but shell scripts are "executable" too...
-
 
2583
    case $win32_fileres in
-
 
2584
    *MS\ Windows\ PE\ Intel*)
-
 
2585
      win32_libid_type="x86 DLL"
-
 
2586
      ;;
-
 
2587
    esac
-
 
2588
    ;;
-
 
2589
  esac
-
 
2590
  $ECHO "$win32_libid_type"
-
 
2591
}
-
 
2592
 
-
 
2593
 
-
 
2594
 
-
 
2595
# func_extract_an_archive dir oldlib
-
 
2596
func_extract_an_archive ()
-
 
2597
{
-
 
2598
    $opt_debug
-
 
2599
    f_ex_an_ar_dir="$1"; shift
-
 
2600
    f_ex_an_ar_oldlib="$1"
-
 
2601
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
-
 
2602
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-
 
2603
     :
-
 
2604
    else
-
 
2605
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-
 
2606
    fi
-
 
2607
}
-
 
2608
 
-
 
2609
 
2649
# func_mode_link because it depends on a number of variable
2610
# func_extract_archives gentop oldlib ...
-
 
2611
func_extract_archives ()
-
 
2612
{
-
 
2613
    $opt_debug
-
 
2614
    my_gentop="$1"; shift
-
 
2615
    my_oldlibs=${1+"$@"}
-
 
2616
    my_oldobjs=""
-
 
2617
    my_xlib=""
-
 
2618
    my_xabs=""
-
 
2619
    my_xdir=""
-
 
2620
 
-
 
2621
    for my_xlib in $my_oldlibs; do
-
 
2622
      # Extract the objects.
-
 
2623
      case $my_xlib in
-
 
2624
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-
 
2625
	*) my_xabs=`pwd`"/$my_xlib" ;;
-
 
2626
      esac
-
 
2627
      func_basename "$my_xlib"
-
 
2628
      my_xlib="$func_basename_result"
-
 
2629
      my_xlib_u=$my_xlib
-
 
2630
      while :; do
-
 
2631
        case " $extracted_archives " in
-
 
2632
	*" $my_xlib_u "*)
-
 
2633
	  func_arith $extracted_serial + 1
-
 
2634
	  extracted_serial=$func_arith_result
-
 
2635
	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-
 
2636
	*) break ;;
-
 
2637
	esac
-
 
2638
      done
-
 
2639
      extracted_archives="$extracted_archives $my_xlib_u"
-
 
2640
      my_xdir="$my_gentop/$my_xlib_u"
-
 
2641
 
-
 
2642
      func_mkdir_p "$my_xdir"
-
 
2643
 
-
 
2644
      case $host in
2650
# set therein.
2645
      *-darwin*)
-
 
2646
	func_verbose "Extracting $my_xabs"
-
 
2647
	# Do not bother doing anything if just a dry run
-
 
2648
	$opt_dry_run || {
-
 
2649
	  darwin_orig_dir=`pwd`
-
 
2650
	  cd $my_xdir || exit $?
-
 
2651
	  darwin_archive=$my_xabs
-
 
2652
	  darwin_curdir=`pwd`
-
 
2653
	  darwin_base_archive=`basename "$darwin_archive"`
-
 
2654
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-
 
2655
	  if test -n "$darwin_arches"; then
-
 
2656
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-
 
2657
	    darwin_arch=
-
 
2658
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-
 
2659
	    for darwin_arch in  $darwin_arches ; do
-
 
2660
	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-
 
2661
	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-
 
2662
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-
 
2663
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-
 
2664
	      cd "$darwin_curdir"
-
 
2665
	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-
 
2666
	    done # $darwin_arches
-
 
2667
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-
 
2668
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
-
 
2669
	    darwin_file=
-
 
2670
	    darwin_files=
-
 
2671
	    for darwin_file in $darwin_filelist; do
-
 
2672
	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-
 
2673
	      $LIPO -create -output "$darwin_file" $darwin_files
-
 
2674
	    done # $darwin_filelist
-
 
2675
	    $RM -rf unfat-$$
-
 
2676
	    cd "$darwin_orig_dir"
-
 
2677
	  else
-
 
2678
	    cd $darwin_orig_dir
-
 
2679
	    func_extract_an_archive "$my_xdir" "$my_xabs"
-
 
2680
	  fi # $darwin_arches
-
 
2681
	} # !$opt_dry_run
-
 
2682
	;;
-
 
2683
      *)
-
 
2684
        func_extract_an_archive "$my_xdir" "$my_xabs"
-
 
2685
	;;
-
 
2686
      esac
-
 
2687
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-
 
2688
    done
-
 
2689
 
-
 
2690
    func_extract_archives_result="$my_oldobjs"
-
 
2691
}
-
 
2692
 
-
 
2693
 
-
 
2694
 
-
 
2695
# func_emit_wrapper_part1 [arg=no]
2651
#
2696
#
2652
# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-
 
2653
# variable will take.  If 'yes', then the emitted script
2697
# Emit the first part of a libtool wrapper script on stdout.
2654
# will assume that the directory in which it is stored is
2698
# For more information, see the description associated with
2655
# the '.lib' directory.  This is a cygwin/mingw-specific
-
 
2656
# behavior.
2699
# func_emit_wrapper(), below.
2657
func_emit_wrapper ()
2700
func_emit_wrapper_part1 ()
2658
{
2701
{
2659
	func_emit_wrapper_arg1=no
2702
	func_emit_wrapper_part1_arg1=no
2660
	if test -n "$1" ; then
2703
	if test -n "$1" ; then
2661
	  func_emit_wrapper_arg1=$1
2704
	  func_emit_wrapper_part1_arg1=$1
2662
	fi
2705
	fi
2663
 
2706
 
2664
	$ECHO "\
2707
	$ECHO "\
2665
#! $SHELL
2708
#! $SHELL
2666
 
2709
 
Line 2741... Line 2784...
2741
    fi
2784
    fi
2742
 
2785
 
2743
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2786
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2744
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2787
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2745
  done
2788
  done
-
 
2789
"
-
 
2790
}
-
 
2791
# end: func_emit_wrapper_part1
-
 
2792
 
-
 
2793
# func_emit_wrapper_part2 [arg=no]
-
 
2794
#
-
 
2795
# Emit the second part of a libtool wrapper script on stdout.
-
 
2796
# For more information, see the description associated with
-
 
2797
# func_emit_wrapper(), below.
-
 
2798
func_emit_wrapper_part2 ()
-
 
2799
{
-
 
2800
	func_emit_wrapper_part2_arg1=no
-
 
2801
	if test -n "$1" ; then
-
 
2802
	  func_emit_wrapper_part2_arg1=$1
-
 
2803
	fi
-
 
2804
 
-
 
2805
	$ECHO "\
2746
 
2806
 
2747
  # Usually 'no', except on cygwin/mingw when embedded into
2807
  # Usually 'no', except on cygwin/mingw when embedded into
2748
  # the cwrapper.
2808
  # the cwrapper.
2749
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2809
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2750
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2810
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2751
    # special case for '.'
2811
    # special case for '.'
2752
    if test \"\$thisdir\" = \".\"; then
2812
    if test \"\$thisdir\" = \".\"; then
2753
      thisdir=\`pwd\`
2813
      thisdir=\`pwd\`
2754
    fi
2814
    fi
Line 2835... Line 2895...
2835
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
2895
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
2836
      # Run the actual program with our arguments.
2896
      # Run the actual program with our arguments.
2837
"
2897
"
2838
	case $host in
2898
	case $host in
2839
	# Backslashes separate directories on plain windows
2899
	# Backslashes separate directories on plain windows
2840
	*-*-mingw | *-*-os2*)
2900
	*-*-mingw | *-*-os2* | *-cegcc*)
2841
	  $ECHO "\
2901
	  $ECHO "\
2842
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2902
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2843
"
2903
"
2844
	  ;;
2904
	  ;;
2845
 
2905
 
Line 2848... Line 2908...
2848
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
2908
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
2849
"
2909
"
2850
	  ;;
2910
	  ;;
2851
	esac
2911
	esac
2852
	$ECHO "\
2912
	$ECHO "\
2853
      \$ECHO \"\$0: cannot exec \$program \$*\"
2913
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2854
      exit 1
2914
      exit 1
2855
    fi
2915
    fi
2856
  else
2916
  else
2857
    # The program doesn't exist.
2917
    # The program doesn't exist.
2858
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2918
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
Line 2861... Line 2921...
2861
    exit 1
2921
    exit 1
2862
  fi
2922
  fi
2863
fi\
2923
fi\
2864
"
2924
"
2865
}
2925
}
2866
# end: func_emit_wrapper
2926
# end: func_emit_wrapper_part2
-
 
2927
 
-
 
2928
 
-
 
2929
# func_emit_wrapper [arg=no]
-
 
2930
#
-
 
2931
# Emit a libtool wrapper script on stdout.
-
 
2932
# Don't directly open a file because we may want to
-
 
2933
# incorporate the script contents within a cygwin/mingw
-
 
2934
# wrapper executable.  Must ONLY be called from within
-
 
2935
# func_mode_link because it depends on a number of variables
-
 
2936
# set therein.
-
 
2937
#
-
 
2938
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-
 
2939
# variable will take.  If 'yes', then the emitted script
-
 
2940
# will assume that the directory in which it is stored is
-
 
2941
# the $objdir directory.  This is a cygwin/mingw-specific
-
 
2942
# behavior.
-
 
2943
func_emit_wrapper ()
-
 
2944
{
-
 
2945
	func_emit_wrapper_arg1=no
-
 
2946
	if test -n "$1" ; then
-
 
2947
	  func_emit_wrapper_arg1=$1
-
 
2948
	fi
-
 
2949
 
-
 
2950
	# split this up so that func_emit_cwrapperexe_src
-
 
2951
	# can call each part independently.
-
 
2952
	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
-
 
2953
	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-
 
2954
}
-
 
2955
 
-
 
2956
 
-
 
2957
# func_to_host_path arg
-
 
2958
#
-
 
2959
# Convert paths to host format when used with build tools.
-
 
2960
# Intended for use with "native" mingw (where libtool itself
-
 
2961
# is running under the msys shell), or in the following cross-
-
 
2962
# build environments:
-
 
2963
#    $build          $host
-
 
2964
#    mingw (msys)    mingw  [e.g. native]
-
 
2965
#    cygwin          mingw
-
 
2966
#    *nix + wine     mingw
-
 
2967
# where wine is equipped with the `winepath' executable.
-
 
2968
# In the native mingw case, the (msys) shell automatically
-
 
2969
# converts paths for any non-msys applications it launches,
-
 
2970
# but that facility isn't available from inside the cwrapper.
-
 
2971
# Similar accommodations are necessary for $host mingw and
-
 
2972
# $build cygwin.  Calling this function does no harm for other
-
 
2973
# $host/$build combinations not listed above.
-
 
2974
#
-
 
2975
# ARG is the path (on $build) that should be converted to
-
 
2976
# the proper representation for $host. The result is stored
-
 
2977
# in $func_to_host_path_result.
-
 
2978
func_to_host_path ()
-
 
2979
{
-
 
2980
  func_to_host_path_result="$1"
-
 
2981
  if test -n "$1" ; then
-
 
2982
    case $host in
-
 
2983
      *mingw* )
-
 
2984
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
 
2985
        case $build in
-
 
2986
          *mingw* ) # actually, msys
-
 
2987
            # awkward: cmd appends spaces to result
-
 
2988
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-
 
2989
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
-
 
2990
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-
 
2991
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
2992
              $SED -e "$lt_sed_naive_backslashify"`
-
 
2993
            ;;
-
 
2994
          *cygwin* )
-
 
2995
            func_to_host_path_tmp1=`cygpath -w "$1"`
-
 
2996
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
2997
              $SED -e "$lt_sed_naive_backslashify"`
-
 
2998
            ;;
-
 
2999
          * )
-
 
3000
            # Unfortunately, winepath does not exit with a non-zero
-
 
3001
            # error code, so we are forced to check the contents of
-
 
3002
            # stdout. On the other hand, if the command is not
-
 
3003
            # found, the shell will set an exit code of 127 and print
-
 
3004
            # *an error message* to stdout. So we must check for both
-
 
3005
            # error code of zero AND non-empty stdout, which explains
-
 
3006
            # the odd construction:
-
 
3007
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
-
 
3008
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
-
 
3009
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
3010
                $SED -e "$lt_sed_naive_backslashify"`
-
 
3011
            else
-
 
3012
              # Allow warning below.
-
 
3013
              func_to_host_path_result=""
-
 
3014
            fi
-
 
3015
            ;;
-
 
3016
        esac
-
 
3017
        if test -z "$func_to_host_path_result" ; then
-
 
3018
          func_error "Could not determine host path corresponding to"
-
 
3019
          func_error "  '$1'"
-
 
3020
          func_error "Continuing, but uninstalled executables may not work."
-
 
3021
          # Fallback:
-
 
3022
          func_to_host_path_result="$1"
-
 
3023
        fi
-
 
3024
        ;;
-
 
3025
    esac
-
 
3026
  fi
-
 
3027
}
-
 
3028
# end: func_to_host_path
-
 
3029
 
-
 
3030
# func_to_host_pathlist arg
-
 
3031
#
-
 
3032
# Convert pathlists to host format when used with build tools.
-
 
3033
# See func_to_host_path(), above. This function supports the
-
 
3034
# following $build/$host combinations (but does no harm for
-
 
3035
# combinations not listed here):
-
 
3036
#    $build          $host
-
 
3037
#    mingw (msys)    mingw  [e.g. native]
-
 
3038
#    cygwin          mingw
-
 
3039
#    *nix + wine     mingw
-
 
3040
#
-
 
3041
# Path separators are also converted from $build format to
-
 
3042
# $host format. If ARG begins or ends with a path separator
-
 
3043
# character, it is preserved (but converted to $host format)
-
 
3044
# on output.
-
 
3045
#
-
 
3046
# ARG is a pathlist (on $build) that should be converted to
-
 
3047
# the proper representation on $host. The result is stored
-
 
3048
# in $func_to_host_pathlist_result.
-
 
3049
func_to_host_pathlist ()
-
 
3050
{
-
 
3051
  func_to_host_pathlist_result="$1"
-
 
3052
  if test -n "$1" ; then
-
 
3053
    case $host in
-
 
3054
      *mingw* )
-
 
3055
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
 
3056
        # Remove leading and trailing path separator characters from
-
 
3057
        # ARG. msys behavior is inconsistent here, cygpath turns them
-
 
3058
        # into '.;' and ';.', and winepath ignores them completely.
-
 
3059
        func_to_host_pathlist_tmp2="$1"
-
 
3060
        # Once set for this call, this variable should not be
-
 
3061
        # reassigned. It is used in tha fallback case.
-
 
3062
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3063
          $SED -e 's|^:*||' -e 's|:*$||'`
-
 
3064
        case $build in
-
 
3065
          *mingw* ) # Actually, msys.
-
 
3066
            # Awkward: cmd appends spaces to result.
-
 
3067
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-
 
3068
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
-
 
3069
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-
 
3070
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3071
              $SED -e "$lt_sed_naive_backslashify"`
-
 
3072
            ;;
-
 
3073
          *cygwin* )
-
 
3074
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
-
 
3075
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3076
              $SED -e "$lt_sed_naive_backslashify"`
-
 
3077
            ;;
-
 
3078
          * )
-
 
3079
            # unfortunately, winepath doesn't convert pathlists
-
 
3080
            func_to_host_pathlist_result=""
-
 
3081
            func_to_host_pathlist_oldIFS=$IFS
-
 
3082
            IFS=:
-
 
3083
            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
-
 
3084
              IFS=$func_to_host_pathlist_oldIFS
-
 
3085
              if test -n "$func_to_host_pathlist_f" ; then
-
 
3086
                func_to_host_path "$func_to_host_pathlist_f"
-
 
3087
                if test -n "$func_to_host_path_result" ; then
-
 
3088
                  if test -z "$func_to_host_pathlist_result" ; then
-
 
3089
                    func_to_host_pathlist_result="$func_to_host_path_result"
-
 
3090
                  else
-
 
3091
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
-
 
3092
                  fi
-
 
3093
                fi
-
 
3094
              fi
-
 
3095
              IFS=:
-
 
3096
            done
-
 
3097
            IFS=$func_to_host_pathlist_oldIFS
-
 
3098
            ;;
-
 
3099
        esac
-
 
3100
        if test -z "$func_to_host_pathlist_result" ; then
-
 
3101
          func_error "Could not determine the host path(s) corresponding to"
-
 
3102
          func_error "  '$1'"
-
 
3103
          func_error "Continuing, but uninstalled executables may not work."
-
 
3104
          # Fallback. This may break if $1 contains DOS-style drive
-
 
3105
          # specifications. The fix is not to complicate the expression
-
 
3106
          # below, but for the user to provide a working wine installation
-
 
3107
          # with winepath so that path translation in the cross-to-mingw
-
 
3108
          # case works properly.
-
 
3109
          lt_replace_pathsep_nix_to_dos="s|:|;|g"
-
 
3110
          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
-
 
3111
            $SED -e "$lt_replace_pathsep_nix_to_dos"`
-
 
3112
        fi
-
 
3113
        # Now, add the leading and trailing path separators back
-
 
3114
        case "$1" in
-
 
3115
          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
-
 
3116
            ;;
-
 
3117
        esac
-
 
3118
        case "$1" in
-
 
3119
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
-
 
3120
            ;;
-
 
3121
        esac
-
 
3122
        ;;
-
 
3123
    esac
-
 
3124
  fi
-
 
3125
}
-
 
3126
# end: func_to_host_pathlist
2867
 
3127
 
2868
# func_emit_cwrapperexe_src
3128
# func_emit_cwrapperexe_src
2869
# emit the source code for a wrapper executable on stdout
3129
# emit the source code for a wrapper executable on stdout
2870
# Must ONLY be called from within func_mode_link because
3130
# Must ONLY be called from within func_mode_link because
2871
# it depends on a number of variable set therein.
3131
# it depends on a number of variable set therein.
Line 2891... Line 3151...
2891
#include <stdio.h>
3151
#include <stdio.h>
2892
#include <stdlib.h>
3152
#include <stdlib.h>
2893
#ifdef _MSC_VER
3153
#ifdef _MSC_VER
2894
# include <direct.h>
3154
# include <direct.h>
2895
# include <process.h>
3155
# include <process.h>
-
 
3156
# include <io.h>
-
 
3157
# define setmode _setmode
2896
#else
3158
#else
2897
# include <unistd.h>
3159
# include <unistd.h>
2898
# include <stdint.h>
3160
# include <stdint.h>
-
 
3161
# ifdef __CYGWIN__
-
 
3162
#  include <io.h>
-
 
3163
#  define HAVE_SETENV
-
 
3164
#  ifdef __STRICT_ANSI__
-
 
3165
char *realpath (const char *, char *);
-
 
3166
int putenv (char *);
-
 
3167
int setenv (const char *, const char *, int);
-
 
3168
#  endif
-
 
3169
# endif
2899
#endif
3170
#endif
2900
#include <malloc.h>
3171
#include <malloc.h>
2901
#include <stdarg.h>
3172
#include <stdarg.h>
2902
#include <assert.h>
3173
#include <assert.h>
2903
#include <string.h>
3174
#include <string.h>
2904
#include <ctype.h>
3175
#include <ctype.h>
2905
#include <errno.h>
3176
#include <errno.h>
-
 
3177
#include <fcntl.h>
2906
#include <sys/stat.h>
3178
#include <sys/stat.h>
2907
 
3179
 
2908
#if defined(PATH_MAX)
3180
#if defined(PATH_MAX)
2909
# define LT_PATHMAX PATH_MAX
3181
# define LT_PATHMAX PATH_MAX
2910
#elif defined(MAXPATHLEN)
3182
#elif defined(MAXPATHLEN)
Line 2934... Line 3206...
2934
#endif
3206
#endif
2935
 
3207
 
2936
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3208
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
2937
  defined (__OS2__)
3209
  defined (__OS2__)
2938
# define HAVE_DOS_BASED_FILE_SYSTEM
3210
# define HAVE_DOS_BASED_FILE_SYSTEM
-
 
3211
# define FOPEN_WB "wb"
2939
# ifndef DIR_SEPARATOR_2
3212
# ifndef DIR_SEPARATOR_2
2940
#  define DIR_SEPARATOR_2 '\\'
3213
#  define DIR_SEPARATOR_2 '\\'
2941
# endif
3214
# endif
2942
# ifndef PATH_SEPARATOR_2
3215
# ifndef PATH_SEPARATOR_2
2943
#  define PATH_SEPARATOR_2 ';'
3216
#  define PATH_SEPARATOR_2 ';'
Line 2955... Line 3228...
2955
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3228
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
2956
#else /* PATH_SEPARATOR_2 */
3229
#else /* PATH_SEPARATOR_2 */
2957
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3230
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
2958
#endif /* PATH_SEPARATOR_2 */
3231
#endif /* PATH_SEPARATOR_2 */
2959
 
3232
 
-
 
3233
#ifdef __CYGWIN__
-
 
3234
# define FOPEN_WB "wb"
-
 
3235
#endif
-
 
3236
 
-
 
3237
#ifndef FOPEN_WB
-
 
3238
# define FOPEN_WB "w"
-
 
3239
#endif
-
 
3240
#ifndef _O_BINARY
-
 
3241
# define _O_BINARY 0
-
 
3242
#endif
-
 
3243
 
2960
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
3244
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
2961
#define XFREE(stale) do { \
3245
#define XFREE(stale) do { \
2962
  if (stale) { free ((void *) stale); stale = 0; } \
3246
  if (stale) { free ((void *) stale); stale = 0; } \
2963
} while (0)
3247
} while (0)
2964
 
3248
 
Line 2986... Line 3270...
2986
char *chase_symlinks (const char *pathspec);
3270
char *chase_symlinks (const char *pathspec);
2987
int make_executable (const char *path);
3271
int make_executable (const char *path);
2988
int check_executable (const char *path);
3272
int check_executable (const char *path);
2989
char *strendzap (char *str, const char *pat);
3273
char *strendzap (char *str, const char *pat);
2990
void lt_fatal (const char *message, ...);
3274
void lt_fatal (const char *message, ...);
-
 
3275
void lt_setenv (const char *name, const char *value);
-
 
3276
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-
 
3277
void lt_opt_process_env_set (const char *arg);
-
 
3278
void lt_opt_process_env_prepend (const char *arg);
-
 
3279
void lt_opt_process_env_append (const char *arg);
-
 
3280
int lt_split_name_value (const char *arg, char** name, char** value);
-
 
3281
void lt_update_exe_path (const char *name, const char *value);
-
 
3282
void lt_update_lib_path (const char *name, const char *value);
2991
 
3283
 
2992
static const char *script_text =
3284
static const char *script_text_part1 =
2993
EOF
3285
EOF
2994
 
3286
 
2995
	    func_emit_wrapper yes |
3287
	    func_emit_wrapper_part1 yes |
-
 
3288
	        $SED -e 's/\([\\"]\)/\\\1/g' \
-
 
3289
	             -e 's/^/  "/' -e 's/$/\\n"/'
-
 
3290
	    echo ";"
-
 
3291
	    cat <<EOF
-
 
3292
 
-
 
3293
static const char *script_text_part2 =
-
 
3294
EOF
-
 
3295
	    func_emit_wrapper_part2 yes |
2996
	        $SED -e 's/\([\\"]\)/\\\1/g' \
3296
	        $SED -e 's/\([\\"]\)/\\\1/g' \
2997
	             -e 's/^/  "/' -e 's/$/\\n"/'
3297
	             -e 's/^/  "/' -e 's/$/\\n"/'
2998
	    echo ";"
3298
	    echo ";"
2999
 
3299
 
3000
	    cat <<EOF
3300
	    cat <<EOF
3001
const char * MAGIC_EXE = "$magic_exe";
3301
const char * MAGIC_EXE = "$magic_exe";
-
 
3302
const char * LIB_PATH_VARNAME = "$shlibpath_var";
-
 
3303
EOF
-
 
3304
 
-
 
3305
	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-
 
3306
              func_to_host_pathlist "$temp_rpath"
-
 
3307
	      cat <<EOF
-
 
3308
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
-
 
3309
EOF
-
 
3310
	    else
-
 
3311
	      cat <<"EOF"
-
 
3312
const char * LIB_PATH_VALUE   = "";
-
 
3313
EOF
-
 
3314
	    fi
-
 
3315
 
-
 
3316
	    if test -n "$dllsearchpath"; then
-
 
3317
              func_to_host_pathlist "$dllsearchpath:"
-
 
3318
	      cat <<EOF
-
 
3319
const char * EXE_PATH_VARNAME = "PATH";
-
 
3320
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
-
 
3321
EOF
-
 
3322
	    else
-
 
3323
	      cat <<"EOF"
-
 
3324
const char * EXE_PATH_VARNAME = "";
-
 
3325
const char * EXE_PATH_VALUE   = "";
-
 
3326
EOF
-
 
3327
	    fi
-
 
3328
 
-
 
3329
	    if test "$fast_install" = yes; then
-
 
3330
	      cat <<EOF
-
 
3331
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-
 
3332
EOF
-
 
3333
	    else
-
 
3334
	      cat <<EOF
-
 
3335
const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-
 
3336
EOF
-
 
3337
	    fi
-
 
3338
 
-
 
3339
 
-
 
3340
	    cat <<"EOF"
-
 
3341
 
-
 
3342
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
 
3343
#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
-
 
3344
 
-
 
3345
static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
-
 
3346
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
 
3347
 
-
 
3348
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-
 
3349
 
-
 
3350
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-
 
3351
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
-
 
3352
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
 
3353
 
-
 
3354
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-
 
3355
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
-
 
3356
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
 
3357
 
-
 
3358
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-
 
3359
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
-
 
3360
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3002
 
3361
 
3003
int
3362
int
3004
main (int argc, char *argv[])
3363
main (int argc, char *argv[])
3005
{
3364
{
3006
  char **newargz;
3365
  char **newargz;
-
 
3366
  int  newargc;
3007
  char *tmp_pathspec;
3367
  char *tmp_pathspec;
3008
  char *actual_cwrapper_path;
3368
  char *actual_cwrapper_path;
3009
  char *shwrapper_name;
3369
  char *actual_cwrapper_name;
-
 
3370
  char *target_name;
-
 
3371
  char *lt_argv_zero;
3010
  intptr_t rval = 127;
3372
  intptr_t rval = 127;
3011
  FILE *shwrapper;
-
 
3012
 
3373
 
3013
  const char *dumpscript_opt = "--lt-dump-script";
-
 
3014
  int i;
3374
  int i;
3015
 
3375
 
3016
  program_name = (char *) xstrdup (base_name (argv[0]));
3376
  program_name = (char *) xstrdup (base_name (argv[0]));
3017
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
3377
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
3018
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3378
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
Line 3020... Line 3380...
3020
  /* very simple arg parsing; don't want to rely on getopt */
3380
  /* very simple arg parsing; don't want to rely on getopt */
3021
  for (i = 1; i < argc; i++)
3381
  for (i = 1; i < argc; i++)
3022
    {
3382
    {
3023
      if (strcmp (argv[i], dumpscript_opt) == 0)
3383
      if (strcmp (argv[i], dumpscript_opt) == 0)
3024
	{
3384
	{
3025
	  printf ("%s", script_text);
-
 
3026
	  return 0;
-
 
3027
	}
-
 
3028
    }
-
 
3029
 
-
 
3030
  newargz = XMALLOC (char *, argc + 2);
-
 
3031
EOF
3385
EOF
3032
 
-
 
3033
	    if test -n "$TARGETSHELL" ; then
-
 
3034
	      # no path translation at all
-
 
3035
	      lt_newargv0=$TARGETSHELL
-
 
3036
	    else
-
 
3037
	      case "$host" in
3386
	    case "$host" in
3038
		*mingw* )
3387
	      *mingw* | *cygwin* )
3039
		  # awkward: cmd appends spaces to result
3388
		# make stdout use "unix" line endings
3040
		  lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-
 
3041
		  lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`
-
 
3042
		  case $lt_newargv0 in
-
 
3043
		    *.exe | *.EXE) ;;
-
 
3044
		    *) lt_newargv0=$lt_newargv0.exe ;;
3389
		echo "          setmode(1,_O_BINARY);"
3045
		  esac
-
 
3046
		  ;;
3390
		;;
3047
		* ) lt_newargv0=$SHELL ;;
-
 
3048
	      esac
3391
	      esac
3049
	    fi
-
 
3050
 
-
 
3051
		cat <<EOF
-
 
3052
  newargz[0] = (char *) xstrdup ("$lt_newargv0");
-
 
3053
EOF
-
 
3054
 
3392
 
3055
	    cat <<"EOF"
3393
	    cat <<"EOF"
-
 
3394
	  printf ("%s", script_text_part1);
-
 
3395
	  printf ("%s", script_text_part2);
-
 
3396
	  return 0;
-
 
3397
	}
-
 
3398
    }
-
 
3399
 
-
 
3400
  newargz = XMALLOC (char *, argc + 1);
3056
  tmp_pathspec = find_executable (argv[0]);
3401
  tmp_pathspec = find_executable (argv[0]);
3057
  if (tmp_pathspec == NULL)
3402
  if (tmp_pathspec == NULL)
3058
    lt_fatal ("Couldn't find %s", argv[0]);
3403
    lt_fatal ("Couldn't find %s", argv[0]);
3059
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3404
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3060
			  tmp_pathspec));
3405
			  tmp_pathspec));
Line 3062... Line 3407...
3062
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3407
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3063
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3408
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3064
			  actual_cwrapper_path));
3409
			  actual_cwrapper_path));
3065
  XFREE (tmp_pathspec);
3410
  XFREE (tmp_pathspec);
3066
 
3411
 
3067
  shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path));
3412
  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3068
  strendzap (actual_cwrapper_path, shwrapper_name);
3413
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
3069
 
3414
 
3070
  /* shwrapper_name transforms */
3415
  /* wrapper name transforms */
3071
  strendzap (shwrapper_name, ".exe");
3416
  strendzap (actual_cwrapper_name, ".exe");
3072
  tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) +
3417
  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3073
				 strlen ("_ltshwrapperTMP") + 1));
-
 
3074
  strcpy (tmp_pathspec, shwrapper_name);
-
 
3075
  strcat (tmp_pathspec, "_ltshwrapperTMP");
-
 
3076
  XFREE (shwrapper_name);
3418
  XFREE (actual_cwrapper_name);
3077
  shwrapper_name = tmp_pathspec;
3419
  actual_cwrapper_name = tmp_pathspec;
3078
  tmp_pathspec = 0;
3420
  tmp_pathspec = 0;
-
 
3421
 
-
 
3422
  /* target_name transforms -- use actual target program name; might have lt- prefix */
-
 
3423
  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-
 
3424
  strendzap (target_name, ".exe");
-
 
3425
  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-
 
3426
  XFREE (target_name);
-
 
3427
  target_name = tmp_pathspec;
-
 
3428
  tmp_pathspec = 0;
-
 
3429
 
3079
  LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",
3430
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3080
			  shwrapper_name));
3431
			  target_name));
3081
EOF
3432
EOF
3082
 
3433
 
3083
	    cat <<EOF
3434
	    cat <<EOF
3084
  newargz[1] =
3435
  newargz[0] =
3085
    XMALLOC (char, (strlen (actual_cwrapper_path) +
3436
    XMALLOC (char, (strlen (actual_cwrapper_path) +
3086
		    strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));
3437
		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3087
  strcpy (newargz[1], actual_cwrapper_path);
3438
  strcpy (newargz[0], actual_cwrapper_path);
3088
  strcat (newargz[1], "$objdir");
3439
  strcat (newargz[0], "$objdir");
3089
  strcat (newargz[1], "/");
3440
  strcat (newargz[0], "/");
3090
  strcat (newargz[1], shwrapper_name);
-
 
3091
EOF
3441
EOF
3092
 
3442
 
-
 
3443
	    cat <<"EOF"
-
 
3444
  /* stop here, and copy so we don't have to do this twice */
-
 
3445
  tmp_pathspec = xstrdup (newargz[0]);
-
 
3446
 
-
 
3447
  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-
 
3448
  strcat (newargz[0], actual_cwrapper_name);
-
 
3449
 
-
 
3450
  /* DO want the lt- prefix here if it exists, so use target_name */
-
 
3451
  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-
 
3452
  XFREE (tmp_pathspec);
-
 
3453
  tmp_pathspec = NULL;
-
 
3454
EOF
3093
 
3455
 
3094
	    case $host_os in
3456
	    case $host_os in
3095
	      mingw*)
3457
	      mingw*)
3096
	    cat <<"EOF"
3458
	    cat <<"EOF"
3097
  {
3459
  {
3098
    char* p;
3460
    char* p;
3099
    while ((p = strchr (newargz[1], '\\')) != NULL)
3461
    while ((p = strchr (newargz[0], '\\')) != NULL)
-
 
3462
      {
-
 
3463
	*p = '/';
-
 
3464
      }
-
 
3465
    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3100
      {
3466
      {
3101
	*p = '/';
3467
	*p = '/';
3102
      }
3468
      }
3103
  }
3469
  }
3104
EOF
3470
EOF
3105
	    ;;
3471
	    ;;
3106
	    esac
3472
	    esac
3107
 
3473
 
3108
	    cat <<"EOF"
3474
	    cat <<"EOF"
3109
  XFREE (shwrapper_name);
3475
  XFREE (target_name);
3110
  XFREE (actual_cwrapper_path);
3476
  XFREE (actual_cwrapper_path);
-
 
3477
  XFREE (actual_cwrapper_name);
3111
 
3478
 
3112
  /* note: do NOT use "wt" here! -- defer to underlying
3479
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3113
   * mount type on cygwin
-
 
3114
   */
-
 
3115
  if ((shwrapper = fopen (newargz[1], "w")) == 0)
3480
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
3116
    {
-
 
3117
      lt_fatal ("Could not open %s for writing", newargz[1]);
3481
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3118
    }
-
 
3119
  fprintf (shwrapper, "%s", script_text);
3482
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3120
  fclose (shwrapper);
-
 
3121
 
-
 
3122
  make_executable (newargz[1]);
-
 
3123
 
3483
 
-
 
3484
  newargc=0;
3124
  for (i = 1; i < argc; i++)
3485
  for (i = 1; i < argc; i++)
-
 
3486
    {
-
 
3487
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
-
 
3488
        {
-
 
3489
          if (argv[i][env_set_opt_len] == '=')
-
 
3490
            {
-
 
3491
              const char *p = argv[i] + env_set_opt_len + 1;
-
 
3492
              lt_opt_process_env_set (p);
-
 
3493
            }
-
 
3494
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
-
 
3495
            {
-
 
3496
              lt_opt_process_env_set (argv[++i]); /* don't copy */
-
 
3497
            }
-
 
3498
          else
-
 
3499
            lt_fatal ("%s missing required argument", env_set_opt);
-
 
3500
          continue;
-
 
3501
        }
-
 
3502
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
-
 
3503
        {
-
 
3504
          if (argv[i][env_prepend_opt_len] == '=')
-
 
3505
            {
-
 
3506
              const char *p = argv[i] + env_prepend_opt_len + 1;
-
 
3507
              lt_opt_process_env_prepend (p);
-
 
3508
            }
-
 
3509
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
-
 
3510
            {
-
 
3511
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
-
 
3512
            }
-
 
3513
          else
-
 
3514
            lt_fatal ("%s missing required argument", env_prepend_opt);
-
 
3515
          continue;
-
 
3516
        }
-
 
3517
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
-
 
3518
        {
-
 
3519
          if (argv[i][env_append_opt_len] == '=')
-
 
3520
            {
-
 
3521
              const char *p = argv[i] + env_append_opt_len + 1;
-
 
3522
              lt_opt_process_env_append (p);
-
 
3523
            }
-
 
3524
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
-
 
3525
            {
-
 
3526
              lt_opt_process_env_append (argv[++i]); /* don't copy */
-
 
3527
            }
-
 
3528
          else
-
 
3529
            lt_fatal ("%s missing required argument", env_append_opt);
-
 
3530
          continue;
-
 
3531
        }
-
 
3532
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-
 
3533
        {
-
 
3534
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-
 
3535
             namespace, but it is not one of the ones we know about and
-
 
3536
             have already dealt with, above (inluding dump-script), then
-
 
3537
             report an error. Otherwise, targets might begin to believe
-
 
3538
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-
 
3539
             namespace. The first time any user complains about this, we'll
-
 
3540
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-
 
3541
             or a configure.ac-settable value.
-
 
3542
           */
-
 
3543
          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-
 
3544
                    ltwrapper_option_prefix, argv[i]);
-
 
3545
        }
-
 
3546
      /* otherwise ... */
3125
    newargz[i + 1] = xstrdup (argv[i]);
3547
      newargz[++newargc] = xstrdup (argv[i]);
-
 
3548
    }
3126
  newargz[argc + 1] = NULL;
3549
  newargz[++newargc] = NULL;
3127
 
3550
 
-
 
3551
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3128
  for (i = 0; i < argc + 1; i++)
3552
  for (i = 0; i < newargc; i++)
3129
    {
3553
    {
3130
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, newargz[i]));
3554
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3131
    }
3555
    }
3132
 
3556
 
3133
EOF
3557
EOF
3134
 
3558
 
3135
	    case $host_os in
3559
	    case $host_os in
3136
	      mingw*)
3560
	      mingw*)
3137
		cat <<EOF
3561
		cat <<"EOF"
3138
  /* execv doesn't actually work on mingw as expected on unix */
3562
  /* execv doesn't actually work on mingw as expected on unix */
3139
  rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);
3563
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3140
  if (rval == -1)
3564
  if (rval == -1)
3141
    {
3565
    {
3142
      /* failed to start process */
3566
      /* failed to start process */
3143
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno));
3567
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3144
      return 127;
3568
      return 127;
3145
    }
3569
    }
3146
  return rval;
3570
  return rval;
3147
}
-
 
3148
EOF
3571
EOF
3149
		;;
3572
		;;
3150
	      *)
3573
	      *)
3151
		cat <<EOF
3574
		cat <<"EOF"
3152
  execv ("$lt_newargv0", newargz);
3575
  execv (lt_argv_zero, newargz);
3153
  return rval; /* =127, but avoids unused variable warning */
3576
  return rval; /* =127, but avoids unused variable warning */
3154
}
-
 
3155
EOF
3577
EOF
3156
		;;
3578
		;;
3157
	    esac
3579
	    esac
3158
 
3580
 
3159
	    cat <<"EOF"
3581
	    cat <<"EOF"
-
 
3582
}
3160
 
3583
 
3161
void *
3584
void *
3162
xmalloc (size_t num)
3585
xmalloc (size_t num)
3163
{
3586
{
3164
  void *p = (void *) malloc (num);
3587
  void *p = (void *) malloc (num);
Line 3428... Line 3851...
3428
  va_list ap;
3851
  va_list ap;
3429
  va_start (ap, message);
3852
  va_start (ap, message);
3430
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3853
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3431
  va_end (ap);
3854
  va_end (ap);
3432
}
3855
}
-
 
3856
 
-
 
3857
void
-
 
3858
lt_setenv (const char *name, const char *value)
-
 
3859
{
-
 
3860
  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
-
 
3861
                          (name ? name : "<NULL>"),
-
 
3862
                          (value ? value : "<NULL>")));
-
 
3863
  {
-
 
3864
#ifdef HAVE_SETENV
-
 
3865
    /* always make a copy, for consistency with !HAVE_SETENV */
-
 
3866
    char *str = xstrdup (value);
-
 
3867
    setenv (name, str, 1);
-
 
3868
#else
-
 
3869
    int len = strlen (name) + 1 + strlen (value) + 1;
-
 
3870
    char *str = XMALLOC (char, len);
-
 
3871
    sprintf (str, "%s=%s", name, value);
-
 
3872
    if (putenv (str) != EXIT_SUCCESS)
-
 
3873
      {
-
 
3874
        XFREE (str);
-
 
3875
      }
-
 
3876
#endif
-
 
3877
  }
-
 
3878
}
-
 
3879
 
-
 
3880
char *
-
 
3881
lt_extend_str (const char *orig_value, const char *add, int to_end)
-
 
3882
{
-
 
3883
  char *new_value;
-
 
3884
  if (orig_value && *orig_value)
-
 
3885
    {
-
 
3886
      int orig_value_len = strlen (orig_value);
-
 
3887
      int add_len = strlen (add);
-
 
3888
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-
 
3889
      if (to_end)
-
 
3890
        {
-
 
3891
          strcpy (new_value, orig_value);
-
 
3892
          strcpy (new_value + orig_value_len, add);
-
 
3893
        }
-
 
3894
      else
-
 
3895
        {
-
 
3896
          strcpy (new_value, add);
-
 
3897
          strcpy (new_value + add_len, orig_value);
-
 
3898
        }
-
 
3899
    }
-
 
3900
  else
-
 
3901
    {
-
 
3902
      new_value = xstrdup (add);
-
 
3903
    }
-
 
3904
  return new_value;
-
 
3905
}
-
 
3906
 
-
 
3907
int
-
 
3908
lt_split_name_value (const char *arg, char** name, char** value)
-
 
3909
{
-
 
3910
  const char *p;
-
 
3911
  int len;
-
 
3912
  if (!arg || !*arg)
-
 
3913
    return 1;
-
 
3914
 
-
 
3915
  p = strchr (arg, (int)'=');
-
 
3916
 
-
 
3917
  if (!p)
-
 
3918
    return 1;
-
 
3919
 
-
 
3920
  *value = xstrdup (++p);
-
 
3921
 
-
 
3922
  len = strlen (arg) - strlen (*value);
-
 
3923
  *name = XMALLOC (char, len);
-
 
3924
  strncpy (*name, arg, len-1);
-
 
3925
  (*name)[len - 1] = '\0';
-
 
3926
 
-
 
3927
  return 0;
-
 
3928
}
-
 
3929
 
-
 
3930
void
-
 
3931
lt_opt_process_env_set (const char *arg)
-
 
3932
{
-
 
3933
  char *name = NULL;
-
 
3934
  char *value = NULL;
-
 
3935
 
-
 
3936
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3937
    {
-
 
3938
      XFREE (name);
-
 
3939
      XFREE (value);
-
 
3940
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
-
 
3941
    }
-
 
3942
 
-
 
3943
  lt_setenv (name, value);
-
 
3944
  XFREE (name);
-
 
3945
  XFREE (value);
-
 
3946
}
-
 
3947
 
-
 
3948
void
-
 
3949
lt_opt_process_env_prepend (const char *arg)
-
 
3950
{
-
 
3951
  char *name = NULL;
-
 
3952
  char *value = NULL;
-
 
3953
  char *new_value = NULL;
-
 
3954
 
-
 
3955
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3956
    {
-
 
3957
      XFREE (name);
-
 
3958
      XFREE (value);
-
 
3959
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
-
 
3960
    }
-
 
3961
 
-
 
3962
  new_value = lt_extend_str (getenv (name), value, 0);
-
 
3963
  lt_setenv (name, new_value);
-
 
3964
  XFREE (new_value);
-
 
3965
  XFREE (name);
-
 
3966
  XFREE (value);
-
 
3967
}
-
 
3968
 
-
 
3969
void
-
 
3970
lt_opt_process_env_append (const char *arg)
-
 
3971
{
-
 
3972
  char *name = NULL;
-
 
3973
  char *value = NULL;
-
 
3974
  char *new_value = NULL;
-
 
3975
 
-
 
3976
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3977
    {
-
 
3978
      XFREE (name);
-
 
3979
      XFREE (value);
-
 
3980
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
-
 
3981
    }
-
 
3982
 
-
 
3983
  new_value = lt_extend_str (getenv (name), value, 1);
-
 
3984
  lt_setenv (name, new_value);
-
 
3985
  XFREE (new_value);
-
 
3986
  XFREE (name);
-
 
3987
  XFREE (value);
-
 
3988
}
-
 
3989
 
-
 
3990
void
-
 
3991
lt_update_exe_path (const char *name, const char *value)
-
 
3992
{
-
 
3993
  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-
 
3994
                          (name ? name : "<NULL>"),
-
 
3995
                          (value ? value : "<NULL>")));
-
 
3996
 
-
 
3997
  if (name && *name && value && *value)
-
 
3998
    {
-
 
3999
      char *new_value = lt_extend_str (getenv (name), value, 0);
-
 
4000
      /* some systems can't cope with a ':'-terminated path #' */
-
 
4001
      int len = strlen (new_value);
-
 
4002
      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-
 
4003
        {
-
 
4004
          new_value[len-1] = '\0';
-
 
4005
        }
-
 
4006
      lt_setenv (name, new_value);
-
 
4007
      XFREE (new_value);
-
 
4008
    }
-
 
4009
}
-
 
4010
 
-
 
4011
void
-
 
4012
lt_update_lib_path (const char *name, const char *value)
-
 
4013
{
-
 
4014
  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-
 
4015
                          (name ? name : "<NULL>"),
-
 
4016
                          (value ? value : "<NULL>")));
-
 
4017
 
-
 
4018
  if (name && *name && value && *value)
-
 
4019
    {
-
 
4020
      char *new_value = lt_extend_str (getenv (name), value, 0);
-
 
4021
      lt_setenv (name, new_value);
-
 
4022
      XFREE (new_value);
-
 
4023
    }
-
 
4024
}
-
 
4025
 
-
 
4026
 
3433
EOF
4027
EOF
3434
}
4028
}
3435
# end: func_emit_cwrapperexe_src
4029
# end: func_emit_cwrapperexe_src
3436
 
4030
 
3437
# func_mode_link arg...
4031
# func_mode_link arg...
3438
func_mode_link ()
4032
func_mode_link ()
3439
{
4033
{
3440
    $opt_debug
4034
    $opt_debug
3441
    case $host in
4035
    case $host in
3442
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4036
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
3443
      # It is impossible to link a dll without this setting, and
4037
      # It is impossible to link a dll without this setting, and
3444
      # we shouldn't force the makefile maintainer to figure out
4038
      # we shouldn't force the makefile maintainer to figure out
3445
      # which system we are compiling for in order to pass an extra
4039
      # which system we are compiling for in order to pass an extra
3446
      # flag for every libtool invocation.
4040
      # flag for every libtool invocation.
3447
      # allow_undefined=no
4041
      # allow_undefined=no
Line 3524... Line 4118...
3524
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4118
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
3525
	    func_warning "complete static linking is impossible in this configuration"
4119
	    func_warning "complete static linking is impossible in this configuration"
3526
	  fi
4120
	  fi
3527
	  if test -n "$link_static_flag"; then
4121
	  if test -n "$link_static_flag"; then
3528
	    dlopen_self=$dlopen_self_static
4122
	    dlopen_self=$dlopen_self_static
3529
	    # See comment for -static flag below, for more details.
-
 
3530
	    func_append compile_command " $link_static_flag"
-
 
3531
	    func_append finalize_command " $link_static_flag"
-
 
3532
	  fi
4123
	  fi
3533
	  prefer_static_libs=yes
4124
	  prefer_static_libs=yes
3534
	  ;;
4125
	  ;;
3535
	-static)
4126
	-static)
3536
	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
4127
	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
Line 3814... Line 4405...
3814
 
4405
 
3815
      prevarg="$arg"
4406
      prevarg="$arg"
3816
 
4407
 
3817
      case $arg in
4408
      case $arg in
3818
      -all-static)
4409
      -all-static)
-
 
4410
	if test -n "$link_static_flag"; then
3819
	# The effects of -all-static are defined in a previous loop.
4411
	  # See comment for -static flag below, for more details.
-
 
4412
	  func_append compile_command " $link_static_flag"
-
 
4413
	  func_append finalize_command " $link_static_flag"
-
 
4414
	fi
3820
	continue
4415
	continue
3821
	;;
4416
	;;
3822
 
4417
 
3823
      -allow-undefined)
4418
      -allow-undefined)
3824
	# FIXME: remove this flag sometime in the future.
4419
	# FIXME: remove this flag sometime in the future.
Line 3880... Line 4475...
3880
	;;
4475
	;;
3881
 
4476
 
3882
      -L*)
4477
      -L*)
3883
	func_stripname '-L' '' "$arg"
4478
	func_stripname '-L' '' "$arg"
3884
	dir=$func_stripname_result
4479
	dir=$func_stripname_result
-
 
4480
	if test -z "$dir"; then
-
 
4481
	  if test "$#" -gt 0; then
-
 
4482
	    func_fatal_error "require no space between \`-L' and \`$1'"
-
 
4483
	  else
-
 
4484
	    func_fatal_error "need path for \`-L' option"
-
 
4485
	  fi
-
 
4486
	fi
3885
	# We need an absolute path.
4487
	# We need an absolute path.
3886
	case $dir in
4488
	case $dir in
3887
	[\\/]* | [A-Za-z]:[\\/]*) ;;
4489
	[\\/]* | [A-Za-z]:[\\/]*) ;;
3888
	*)
4490
	*)
3889
	  absdir=`cd "$dir" && pwd`
4491
	  absdir=`cd "$dir" && pwd`
Line 3898... Line 4500...
3898
	  deplibs="$deplibs -L$dir"
4500
	  deplibs="$deplibs -L$dir"
3899
	  lib_search_path="$lib_search_path $dir"
4501
	  lib_search_path="$lib_search_path $dir"
3900
	  ;;
4502
	  ;;
3901
	esac
4503
	esac
3902
	case $host in
4504
	case $host in
3903
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4505
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
3904
	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4506
	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
3905
	  case :$dllsearchpath: in
4507
	  case :$dllsearchpath: in
3906
	  *":$dir:"*) ;;
4508
	  *":$dir:"*) ;;
-
 
4509
	  ::) dllsearchpath=$dir;;
3907
	  *) dllsearchpath="$dllsearchpath:$dir";;
4510
	  *) dllsearchpath="$dllsearchpath:$dir";;
3908
	  esac
4511
	  esac
3909
	  case :$dllsearchpath: in
4512
	  case :$dllsearchpath: in
3910
	  *":$testbindir:"*) ;;
4513
	  *":$testbindir:"*) ;;
-
 
4514
	  ::) dllsearchpath=$testbindir;;
3911
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
4515
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
3912
	  esac
4516
	  esac
3913
	  ;;
4517
	  ;;
3914
	esac
4518
	esac
3915
	continue
4519
	continue
3916
	;;
4520
	;;
3917
 
4521
 
3918
      -l*)
4522
      -l*)
3919
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4523
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
3920
	  case $host in
4524
	  case $host in
3921
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
4525
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
3922
	    # These systems don't actually have a C or math library (as such)
4526
	    # These systems don't actually have a C or math library (as such)
3923
	    continue
4527
	    continue
3924
	    ;;
4528
	    ;;
3925
	  *-*-os2*)
4529
	  *-*-os2*)
3926
	    # These systems don't actually have a C library (as such)
4530
	    # These systems don't actually have a C library (as such)
Line 3993... Line 4597...
3993
	continue
4597
	continue
3994
	;;
4598
	;;
3995
 
4599
 
3996
      -no-install)
4600
      -no-install)
3997
	case $host in
4601
	case $host in
3998
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
4602
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
3999
	  # The PATH hackery in wrapper scripts is required on Windows
4603
	  # The PATH hackery in wrapper scripts is required on Windows
4000
	  # and Darwin in order for the loader to find any dlls it needs.
4604
	  # and Darwin in order for the loader to find any dlls it needs.
4001
	  func_warning "\`-no-install' is ignored for $host"
4605
	  func_warning "\`-no-install' is ignored for $host"
4002
	  func_warning "assuming \`-no-fast-install' instead"
4606
	  func_warning "assuming \`-no-fast-install' instead"
4003
	  fast_install=no
4607
	  fast_install=no
Line 4950... Line 5554...
4950
	  use_static_libs=no
5554
	  use_static_libs=no
4951
	fi
5555
	fi
4952
	if test -n "$library_names" &&
5556
	if test -n "$library_names" &&
4953
	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
5557
	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
4954
	  case $host in
5558
	  case $host in
4955
	  *cygwin* | *mingw*)
5559
	  *cygwin* | *mingw* | *cegcc*)
4956
	      # No point in relinking DLLs because paths are not encoded
5560
	      # No point in relinking DLLs because paths are not encoded
4957
	      notinst_deplibs="$notinst_deplibs $lib"
5561
	      notinst_deplibs="$notinst_deplibs $lib"
4958
	      need_relink=no
5562
	      need_relink=no
4959
	    ;;
5563
	    ;;
4960
	  *)
5564
	  *)
Line 5020... Line 5624...
5020
	    if test -n "$dlname"; then
5624
	    if test -n "$dlname"; then
5021
	      soname="$dlname"
5625
	      soname="$dlname"
5022
	    elif test -n "$soname_spec"; then
5626
	    elif test -n "$soname_spec"; then
5023
	      # bleh windows
5627
	      # bleh windows
5024
	      case $host in
5628
	      case $host in
5025
	      *cygwin* | mingw*)
5629
	      *cygwin* | mingw* | *cegcc*)
5026
		major=`expr $current - $age`
5630
	        func_arith $current - $age
-
 
5631
		major=$func_arith_result
5027
		versuffix="-$major"
5632
		versuffix="-$major"
5028
		;;
5633
		;;
5029
	      esac
5634
	      esac
5030
	      eval soname=\"$soname_spec\"
5635
	      eval soname=\"$soname_spec\"
5031
	    else
5636
	    else
Line 5313... Line 5918...
5313
		    for tmp in $deplibrary_names ; do
5918
		    for tmp in $deplibrary_names ; do
5314
		      depdepl=$tmp
5919
		      depdepl=$tmp
5315
		    done
5920
		    done
5316
		    if test -f "$absdir/$objdir/$depdepl" ; then
5921
		    if test -f "$absdir/$objdir/$depdepl" ; then
5317
		      depdepl="$absdir/$objdir/$depdepl"
5922
		      depdepl="$absdir/$objdir/$depdepl"
5318
		      darwin_install_name=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
5923
		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5319
		      darwin_install_name=`$ECHO $darwin_install_name`
-
 
5320
                      if test -z "$darwin_install_name"; then
5924
                      if test -z "$darwin_install_name"; then
5321
                          darwin_install_name=`otool64 -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
5925
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
5322
                          darwin_install_name=`$ECHO $darwin_install_name`
-
 
5323
                      fi
5926
                      fi
5324
		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5927
		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5325
		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5928
		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5326
		      path=
5929
		      path=
5327
		    fi
5930
		    fi
Line 5584... Line 6187...
5584
	  # a minor version.  But, then there is irix
6187
	  # a minor version.  But, then there is irix
5585
	  # which has an extra 1 added just for fun
6188
	  # which has an extra 1 added just for fun
5586
	  #
6189
	  #
5587
	  case $version_type in
6190
	  case $version_type in
5588
	  darwin|linux|osf|windows|none)
6191
	  darwin|linux|osf|windows|none)
5589
	    current=`expr $number_major + $number_minor`
6192
	    func_arith $number_major + $number_minor
-
 
6193
	    current=$func_arith_result
5590
	    age="$number_minor"
6194
	    age="$number_minor"
5591
	    revision="$number_revision"
6195
	    revision="$number_revision"
5592
	    ;;
6196
	    ;;
5593
	  freebsd-aout|freebsd-elf|sunos)
6197
	  freebsd-aout|freebsd-elf|sunos)
5594
	    current="$number_major"
6198
	    current="$number_major"
5595
	    revision="$number_minor"
6199
	    revision="$number_minor"
5596
	    age="0"
6200
	    age="0"
5597
	    ;;
6201
	    ;;
5598
	  irix|nonstopux)
6202
	  irix|nonstopux)
5599
	    current=`expr $number_major + $number_minor`
6203
	    func_arith $number_major + $number_minor
-
 
6204
	    current=$func_arith_result
5600
	    age="$number_minor"
6205
	    age="$number_minor"
5601
	    revision="$number_minor"
6206
	    revision="$number_minor"
5602
	    lt_irix_increment=no
6207
	    lt_irix_increment=no
5603
	    ;;
6208
	    ;;
5604
	  esac
6209
	  esac
Line 5648... Line 6253...
5648
	none) ;;
6253
	none) ;;
5649
 
6254
 
5650
	darwin)
6255
	darwin)
5651
	  # Like Linux, but with the current version available in
6256
	  # Like Linux, but with the current version available in
5652
	  # verstring for coding it into the library header
6257
	  # verstring for coding it into the library header
5653
	  major=.`expr $current - $age`
6258
	  func_arith $current - $age
-
 
6259
	  major=.$func_arith_result
5654
	  versuffix="$major.$age.$revision"
6260
	  versuffix="$major.$age.$revision"
5655
	  # Darwin ld doesn't like 0 for these options...
6261
	  # Darwin ld doesn't like 0 for these options...
5656
	  minor_current=`expr $current + 1`
6262
	  func_arith $current + 1
-
 
6263
	  minor_current=$func_arith_result
5657
	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6264
	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
5658
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6265
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
5659
	  ;;
6266
	  ;;
5660
 
6267
 
5661
	freebsd-aout)
6268
	freebsd-aout)
Line 5668... Line 6275...
5668
	  versuffix=".$current"
6275
	  versuffix=".$current"
5669
	  ;;
6276
	  ;;
5670
 
6277
 
5671
	irix | nonstopux)
6278
	irix | nonstopux)
5672
	  if test "X$lt_irix_increment" = "Xno"; then
6279
	  if test "X$lt_irix_increment" = "Xno"; then
5673
	    major=`expr $current - $age`
6280
	    func_arith $current - $age
5674
	  else
6281
	  else
5675
	    major=`expr $current - $age + 1`
6282
	    func_arith $current - $age + 1
5676
	  fi
6283
	  fi
-
 
6284
	  major=$func_arith_result
5677
 
6285
 
5678
	  case $version_type in
6286
	  case $version_type in
5679
	    nonstopux) verstring_prefix=nonstopux ;;
6287
	    nonstopux) verstring_prefix=nonstopux ;;
5680
	    *)         verstring_prefix=sgi ;;
6288
	    *)         verstring_prefix=sgi ;;
5681
	  esac
6289
	  esac
5682
	  verstring="$verstring_prefix$major.$revision"
6290
	  verstring="$verstring_prefix$major.$revision"
5683
 
6291
 
5684
	  # Add in all the interfaces that we are compatible with.
6292
	  # Add in all the interfaces that we are compatible with.
5685
	  loop=$revision
6293
	  loop=$revision
5686
	  while test "$loop" -ne 0; do
6294
	  while test "$loop" -ne 0; do
5687
	    iface=`expr $revision - $loop`
6295
	    func_arith $revision - $loop
-
 
6296
	    iface=$func_arith_result
5688
	    loop=`expr $loop - 1`
6297
	    func_arith $loop - 1
-
 
6298
	    loop=$func_arith_result
5689
	    verstring="$verstring_prefix$major.$iface:$verstring"
6299
	    verstring="$verstring_prefix$major.$iface:$verstring"
5690
	  done
6300
	  done
5691
 
6301
 
5692
	  # Before this point, $major must not contain `.'.
6302
	  # Before this point, $major must not contain `.'.
5693
	  major=.$major
6303
	  major=.$major
5694
	  versuffix="$major.$revision"
6304
	  versuffix="$major.$revision"
5695
	  ;;
6305
	  ;;
5696
 
6306
 
5697
	linux)
6307
	linux)
5698
	  major=.`expr $current - $age`
6308
	  func_arith $current - $age
-
 
6309
	  major=.$func_arith_result
5699
	  versuffix="$major.$age.$revision"
6310
	  versuffix="$major.$age.$revision"
5700
	  ;;
6311
	  ;;
5701
 
6312
 
5702
	osf)
6313
	osf)
5703
	  major=.`expr $current - $age`
6314
	  func_arith $current - $age
-
 
6315
	  major=.$func_arith_result
5704
	  versuffix=".$current.$age.$revision"
6316
	  versuffix=".$current.$age.$revision"
5705
	  verstring="$current.$age.$revision"
6317
	  verstring="$current.$age.$revision"
5706
 
6318
 
5707
	  # Add in all the interfaces that we are compatible with.
6319
	  # Add in all the interfaces that we are compatible with.
5708
	  loop=$age
6320
	  loop=$age
5709
	  while test "$loop" -ne 0; do
6321
	  while test "$loop" -ne 0; do
5710
	    iface=`expr $current - $loop`
6322
	    func_arith $current - $loop
-
 
6323
	    iface=$func_arith_result
5711
	    loop=`expr $loop - 1`
6324
	    func_arith $loop - 1
-
 
6325
	    loop=$func_arith_result
5712
	    verstring="$verstring:${iface}.0"
6326
	    verstring="$verstring:${iface}.0"
5713
	  done
6327
	  done
5714
 
6328
 
5715
	  # Make executables depend on our current version.
6329
	  # Make executables depend on our current version.
5716
	  verstring="$verstring:${current}.0"
6330
	  verstring="$verstring:${current}.0"
Line 5727... Line 6341...
5727
	  ;;
6341
	  ;;
5728
 
6342
 
5729
	windows)
6343
	windows)
5730
	  # Use '-' rather than '.', since we only want one
6344
	  # Use '-' rather than '.', since we only want one
5731
	  # extension on DOS 8.3 filesystems.
6345
	  # extension on DOS 8.3 filesystems.
5732
	  major=`expr $current - $age`
6346
	  func_arith $current - $age
-
 
6347
	  major=$func_arith_result
5733
	  versuffix="-$major"
6348
	  versuffix="-$major"
5734
	  ;;
6349
	  ;;
5735
 
6350
 
5736
	*)
6351
	*)
5737
	  func_fatal_configuration "unknown library version type \`$version_type'"
6352
	  func_fatal_configuration "unknown library version type \`$version_type'"
Line 5788... Line 6403...
5788
	# may have been created when compiling PIC objects.
6403
	# may have been created when compiling PIC objects.
5789
	removelist=
6404
	removelist=
5790
	tempremovelist=`$ECHO "$output_objdir/*"`
6405
	tempremovelist=`$ECHO "$output_objdir/*"`
5791
	for p in $tempremovelist; do
6406
	for p in $tempremovelist; do
5792
	  case $p in
6407
	  case $p in
5793
	    *.$objext)
6408
	    *.$objext | *.gcno)
5794
	       ;;
6409
	       ;;
5795
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6410
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
5796
	       if test "X$precious_files_regex" != "X"; then
6411
	       if test "X$precious_files_regex" != "X"; then
5797
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6412
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
5798
		 then
6413
		 then
Line 5859... Line 6474...
5859
      done
6474
      done
5860
 
6475
 
5861
      if test "$build_libtool_libs" = yes; then
6476
      if test "$build_libtool_libs" = yes; then
5862
	if test -n "$rpath"; then
6477
	if test -n "$rpath"; then
5863
	  case $host in
6478
	  case $host in
5864
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
6479
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
5865
	    # these systems don't actually have a c library (as such)!
6480
	    # these systems don't actually have a c library (as such)!
5866
	    ;;
6481
	    ;;
5867
	  *-*-rhapsody* | *-*-darwin1.[012])
6482
	  *-*-rhapsody* | *-*-darwin1.[012])
5868
	    # Rhapsody C library is in the System framework
6483
	    # Rhapsody C library is in the System framework
5869
	    deplibs="$deplibs System.ltframework"
6484
	    deplibs="$deplibs System.ltframework"
Line 5923... Line 6538...
5923
EOF
6538
EOF
5924
	  $opt_dry_run || $RM conftest
6539
	  $opt_dry_run || $RM conftest
5925
	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6540
	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
5926
	    ldd_output=`ldd conftest`
6541
	    ldd_output=`ldd conftest`
5927
	    for i in $deplibs; do
6542
	    for i in $deplibs; do
5928
	      name=`expr $i : '-l\(.*\)'`
6543
	      case $i in
-
 
6544
	      -l*)
5929
	      # If $name is empty we are operating on a -L argument.
6545
		func_stripname -l '' "$i"
5930
	      if test "$name" != "" && test "$name" != "0"; then
6546
		name=$func_stripname_result
5931
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6547
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5932
		  case " $predeps $postdeps " in
6548
		  case " $predeps $postdeps " in
5933
		  *" $i "*)
6549
		  *" $i "*)
5934
		    newdeplibs="$newdeplibs $i"
6550
		    newdeplibs="$newdeplibs $i"
5935
		    i=""
6551
		    i=""
Line 5952... Line 6568...
5952
		    $ECHO "*** shared version of the library, which I believe you do not have"
6568
		    $ECHO "*** shared version of the library, which I believe you do not have"
5953
		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6569
		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
5954
		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6570
		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
5955
		  fi
6571
		  fi
5956
		fi
6572
		fi
-
 
6573
		;;
5957
	      else
6574
	      *)
5958
		newdeplibs="$newdeplibs $i"
6575
		newdeplibs="$newdeplibs $i"
-
 
6576
		;;
5959
	      fi
6577
	      esac
5960
	    done
6578
	    done
5961
	  else
6579
	  else
5962
	    # Error occurred in the first compile.  Let's try to salvage
6580
	    # Error occurred in the first compile.  Let's try to salvage
5963
	    # the situation: Compile a separate program for each library.
6581
	    # the situation: Compile a separate program for each library.
5964
	    for i in $deplibs; do
6582
	    for i in $deplibs; do
5965
	      name=`expr $i : '-l\(.*\)'`
6583
	      case $i in
-
 
6584
	      -l*)
5966
	      # If $name is empty we are operating on a -L argument.
6585
		func_stripname -l '' "$i"
5967
	      if test "$name" != "" && test "$name" != "0"; then
6586
		name=$func_stripname_result
5968
		$opt_dry_run || $RM conftest
6587
		$opt_dry_run || $RM conftest
5969
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6588
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
5970
		  ldd_output=`ldd conftest`
6589
		  ldd_output=`ldd conftest`
5971
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6590
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5972
		    case " $predeps $postdeps " in
6591
		    case " $predeps $postdeps " in
Line 6000... Line 6619...
6000
		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6619
		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6001
		  $ECHO "*** make it link in!  You will probably need to install it or some"
6620
		  $ECHO "*** make it link in!  You will probably need to install it or some"
6002
		  $ECHO "*** library that it depends on before this library will be fully"
6621
		  $ECHO "*** library that it depends on before this library will be fully"
6003
		  $ECHO "*** functional.  Installing it before continuing would be even better."
6622
		  $ECHO "*** functional.  Installing it before continuing would be even better."
6004
		fi
6623
		fi
-
 
6624
		;;
6005
	      else
6625
	      *)
6006
		newdeplibs="$newdeplibs $i"
6626
		newdeplibs="$newdeplibs $i"
-
 
6627
		;;
6007
	      fi
6628
	      esac
6008
	    done
6629
	    done
6009
	  fi
6630
	  fi
6010
	  ;;
6631
	  ;;
6011
	file_magic*)
6632
	file_magic*)
6012
	  set dummy $deplibs_check_method; shift
6633
	  set dummy $deplibs_check_method; shift
6013
	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6634
	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6014
	  for a_deplib in $deplibs; do
6635
	  for a_deplib in $deplibs; do
6015
	    name=`expr $a_deplib : '-l\(.*\)'`
6636
	    case $a_deplib in
-
 
6637
	    -l*)
6016
	    # If $name is empty we are operating on a -L argument.
6638
	      func_stripname -l '' "$a_deplib"
6017
	    if test "$name" != "" && test  "$name" != "0"; then
6639
	      name=$func_stripname_result
6018
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6640
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6019
		case " $predeps $postdeps " in
6641
		case " $predeps $postdeps " in
6020
		*" $a_deplib "*)
6642
		*" $a_deplib "*)
6021
		  newdeplibs="$newdeplibs $a_deplib"
6643
		  newdeplibs="$newdeplibs $a_deplib"
6022
		  a_deplib=""
6644
		  a_deplib=""
Line 6069... Line 6691...
6069
		else
6691
		else
6070
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6692
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6071
		  $ECHO "*** using a file magic. Last file checked: $potlib"
6693
		  $ECHO "*** using a file magic. Last file checked: $potlib"
6072
		fi
6694
		fi
6073
	      fi
6695
	      fi
6074
	    else
6696
	      ;;
-
 
6697
	    *)
6075
	      # Add a -L argument.
6698
	      # Add a -L argument.
6076
	      newdeplibs="$newdeplibs $a_deplib"
6699
	      newdeplibs="$newdeplibs $a_deplib"
-
 
6700
	      ;;
6077
	    fi
6701
	    esac
6078
	  done # Gone through all deplibs.
6702
	  done # Gone through all deplibs.
6079
	  ;;
6703
	  ;;
6080
	match_pattern*)
6704
	match_pattern*)
6081
	  set dummy $deplibs_check_method; shift
6705
	  set dummy $deplibs_check_method; shift
6082
	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6706
	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6083
	  for a_deplib in $deplibs; do
6707
	  for a_deplib in $deplibs; do
6084
	    name=`expr $a_deplib : '-l\(.*\)'`
6708
	    case $a_deplib in
-
 
6709
	    -l*)
6085
	    # If $name is empty we are operating on a -L argument.
6710
	      func_stripname -l '' "$a_deplib"
6086
	    if test -n "$name" && test "$name" != "0"; then
6711
	      name=$func_stripname_result
6087
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6712
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6088
		case " $predeps $postdeps " in
6713
		case " $predeps $postdeps " in
6089
		*" $a_deplib "*)
6714
		*" $a_deplib "*)
6090
		  newdeplibs="$newdeplibs $a_deplib"
6715
		  newdeplibs="$newdeplibs $a_deplib"
6091
		  a_deplib=""
6716
		  a_deplib=""
Line 6120... Line 6745...
6120
		else
6745
		else
6121
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6746
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6122
		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
6747
		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
6123
		fi
6748
		fi
6124
	      fi
6749
	      fi
6125
	    else
6750
	      ;;
-
 
6751
	    *)
6126
	      # Add a -L argument.
6752
	      # Add a -L argument.
6127
	      newdeplibs="$newdeplibs $a_deplib"
6753
	      newdeplibs="$newdeplibs $a_deplib"
-
 
6754
	      ;;
6128
	    fi
6755
	    esac
6129
	  done # Gone through all deplibs.
6756
	  done # Gone through all deplibs.
6130
	  ;;
6757
	  ;;
6131
	none | unknown | *)
6758
	none | unknown | *)
6132
	  newdeplibs=""
6759
	  newdeplibs=""
6133
	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6760
	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
Line 6346... Line 6973...
6346
	  delfiles="$delfiles $export_symbols"
6973
	  delfiles="$delfiles $export_symbols"
6347
	fi
6974
	fi
6348
 
6975
 
6349
	orig_export_symbols=
6976
	orig_export_symbols=
6350
	case $host_os in
6977
	case $host_os in
6351
	cygwin* | mingw*)
6978
	cygwin* | mingw* | cegcc*)
6352
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6979
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6353
	    # exporting using user supplied symfile
6980
	    # exporting using user supplied symfile
6354
	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6981
	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6355
	      # and it's NOT already a .def file. Must figure out
6982
	      # and it's NOT already a .def file. Must figure out
6356
	      # which of the given symbols are data symbols and tag
6983
	      # which of the given symbols are data symbols and tag
Line 6375... Line 7002...
6375
	    cmds=$export_symbols_cmds
7002
	    cmds=$export_symbols_cmds
6376
	    save_ifs="$IFS"; IFS='~'
7003
	    save_ifs="$IFS"; IFS='~'
6377
	    for cmd in $cmds; do
7004
	    for cmd in $cmds; do
6378
	      IFS="$save_ifs"
7005
	      IFS="$save_ifs"
6379
	      eval cmd=\"$cmd\"
7006
	      eval cmd=\"$cmd\"
6380
	      if len=`expr "X$cmd" : ".*"` &&
7007
	      func_len " $cmd"
-
 
7008
	      len=$func_len_result
6381
	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7009
	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6382
		func_show_eval "$cmd" 'exit $?'
7010
		func_show_eval "$cmd" 'exit $?'
6383
		skipped_export=false
7011
		skipped_export=false
6384
	      else
7012
	      else
6385
		# The command line is too long to execute in one step.
7013
		# The command line is too long to execute in one step.
6386
		func_verbose "using reloadable object file for export list..."
7014
		func_verbose "using reloadable object file for export list..."
Line 6479... Line 7107...
6479
	    cmds=$archive_cmds
7107
	    cmds=$archive_cmds
6480
	  fi
7108
	  fi
6481
	fi
7109
	fi
6482
 
7110
 
6483
	if test "X$skipped_export" != "X:" &&
7111
	if test "X$skipped_export" != "X:" &&
6484
	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
7112
	   func_len " $test_cmds" &&
-
 
7113
	   len=$func_len_result &&
6485
	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7114
	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6486
	  :
7115
	  :
6487
	else
7116
	else
6488
	  # The command line is too long to link in one step, link piecewise
7117
	  # The command line is too long to link in one step, link piecewise
6489
	  # or, if using GNU ld and skipped_export is not :, use a linker
7118
	  # or, if using GNU ld and skipped_export is not :, use a linker
6490
	  # script.
7119
	  # script.
Line 6540... Line 7169...
6540
	    output=$firstobj\"$file_list_spec$output\"
7169
	    output=$firstobj\"$file_list_spec$output\"
6541
	  else
7170
	  else
6542
	    if test -n "$save_libobjs"; then
7171
	    if test -n "$save_libobjs"; then
6543
	      func_verbose "creating reloadable object files..."
7172
	      func_verbose "creating reloadable object files..."
6544
	      output=$output_objdir/$output_la-${k}.$objext
7173
	      output=$output_objdir/$output_la-${k}.$objext
-
 
7174
	      eval test_cmds=\"$reload_cmds\"
-
 
7175
	      func_len " $test_cmds"
-
 
7176
	      len0=$func_len_result
-
 
7177
	      len=$len0
-
 
7178
 
6545
	      # Loop over the list of objects to be linked.
7179
	      # Loop over the list of objects to be linked.
6546
	      for obj in $save_libobjs
7180
	      for obj in $save_libobjs
6547
	      do
7181
	      do
-
 
7182
		func_len " $obj"
6548
		eval test_cmds=\"$reload_cmds $objlist $last_robj\"
7183
		func_arith $len + $func_len_result
-
 
7184
		len=$func_arith_result
6549
		if test "X$objlist" = X ||
7185
		if test "X$objlist" = X ||
6550
		   { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-
 
6551
		     test "$len" -le "$max_cmd_len"; }; then
7186
		   test "$len" -lt "$max_cmd_len"; then
6552
		  objlist="$objlist $obj"
7187
		  func_append objlist " $obj"
6553
		else
7188
		else
6554
		  # The command $test_cmds is almost too long, add a
7189
		  # The command $test_cmds is almost too long, add a
6555
		  # command to the queue.
7190
		  # command to the queue.
6556
		  if test "$k" -eq 1 ; then
7191
		  if test "$k" -eq 1 ; then
6557
		    # The first file doesn't have a previous command to add.
7192
		    # The first file doesn't have a previous command to add.
Line 6560... Line 7195...
6560
		    # All subsequent reloadable object files will link in
7195
		    # All subsequent reloadable object files will link in
6561
		    # the last one created.
7196
		    # the last one created.
6562
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7197
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
6563
		  fi
7198
		  fi
6564
		  last_robj=$output_objdir/$output_la-${k}.$objext
7199
		  last_robj=$output_objdir/$output_la-${k}.$objext
6565
		  k=`expr $k + 1`
7200
		  func_arith $k + 1
-
 
7201
		  k=$func_arith_result
6566
		  output=$output_objdir/$output_la-${k}.$objext
7202
		  output=$output_objdir/$output_la-${k}.$objext
6567
		  objlist=$obj
7203
		  objlist=$obj
-
 
7204
		  func_len " $last_robj"
-
 
7205
		  func_arith $len0 + $func_len_result
6568
		  len=1
7206
		  len=$func_arith_result
6569
		fi
7207
		fi
6570
	      done
7208
	      done
6571
	      # Handle the remaining objects by creating one last
7209
	      # Handle the remaining objects by creating one last
6572
	      # reloadable object file.  All subsequent reloadable object
7210
	      # reloadable object file.  All subsequent reloadable object
6573
	      # files will link in the last one created.
7211
	      # files will link in the last one created.
Line 6960... Line 7598...
6960
	  *" $libdir "*) ;;
7598
	  *" $libdir "*) ;;
6961
	  *) perm_rpath="$perm_rpath $libdir" ;;
7599
	  *) perm_rpath="$perm_rpath $libdir" ;;
6962
	  esac
7600
	  esac
6963
	fi
7601
	fi
6964
	case $host in
7602
	case $host in
6965
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
7603
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6966
	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7604
	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
6967
	  case :$dllsearchpath: in
7605
	  case :$dllsearchpath: in
6968
	  *":$libdir:"*) ;;
7606
	  *":$libdir:"*) ;;
-
 
7607
	  ::) dllsearchpath=$libdir;;
6969
	  *) dllsearchpath="$dllsearchpath:$libdir";;
7608
	  *) dllsearchpath="$dllsearchpath:$libdir";;
6970
	  esac
7609
	  esac
6971
	  case :$dllsearchpath: in
7610
	  case :$dllsearchpath: in
6972
	  *":$testbindir:"*) ;;
7611
	  *":$testbindir:"*) ;;
-
 
7612
	  ::) dllsearchpath=$testbindir;;
6973
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
7613
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
6974
	  esac
7614
	  esac
6975
	  ;;
7615
	  ;;
6976
	esac
7616
	esac
6977
      done
7617
      done
Line 7037... Line 7677...
7037
      *cygwin* | *mingw* )
7677
      *cygwin* | *mingw* )
7038
        if test "$build_libtool_libs" != yes; then
7678
        if test "$build_libtool_libs" != yes; then
7039
          wrappers_required=no
7679
          wrappers_required=no
7040
        fi
7680
        fi
7041
        ;;
7681
        ;;
-
 
7682
      *cegcc)
-
 
7683
        # Disable wrappers for cegcc, we are cross compiling anyway.
-
 
7684
        wrappers_required=no
-
 
7685
        ;;
7042
      *)
7686
      *)
7043
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7687
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7044
          wrappers_required=no
7688
          wrappers_required=no
7045
        fi
7689
        fi
7046
        ;;
7690
        ;;
Line 7189... Line 7833...
7189
	    $RM $cwrappersource $cwrapper
7833
	    $RM $cwrappersource $cwrapper
7190
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7834
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7191
 
7835
 
7192
	    func_emit_cwrapperexe_src > $cwrappersource
7836
	    func_emit_cwrapperexe_src > $cwrappersource
7193
 
7837
 
7194
	    # we should really use a build-platform specific compiler
7838
	    # The wrapper executable is built using the $host compiler,
7195
	    # here, but OTOH, the wrappers (shell script and this C one)
7839
	    # because it contains $host paths and files. If cross-
7196
	    # are only useful if you want to execute the "real" binary.
7840
	    # compiling, it, like the target executable, must be
7197
	    # Since the "real" binary is built for $host, then this
7841
	    # executed on the $host or under an emulation environment.
7198
	    # wrapper might as well be built for $host, too.
-
 
7199
	    $opt_dry_run || {
7842
	    $opt_dry_run || {
7200
	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7843
	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7201
	      $STRIP $cwrapper
7844
	      $STRIP $cwrapper
7202
	    }
7845
	    }
7203
 
7846
 
7204
	    # Now, create the wrapper script for func_source use:
7847
	    # Now, create the wrapper script for func_source use:
7205
	    func_ltwrapper_scriptname $cwrapper
7848
	    func_ltwrapper_scriptname $cwrapper
7206
	    $RM $func_ltwrapper_scriptname_result
7849
	    $RM $func_ltwrapper_scriptname_result
7207
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7850
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7208
	    $opt_dry_run || {
7851
	    $opt_dry_run || {
-
 
7852
	      # note: this script will not be executed, so do not chmod.
-
 
7853
	      if test "x$build" = "x$host" ; then
7209
	      $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7854
		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-
 
7855
	      else
-
 
7856
		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-
 
7857
	      fi
7210
	    }
7858
	    }
7211
	  ;;
7859
	  ;;
7212
	  * )
7860
	  * )
7213
	    $RM $output
7861
	    $RM $output
7214
	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7862
	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
Line 7293... Line 7941...
7293
	    *[\ /]"$objbase "*)
7941
	    *[\ /]"$objbase "*)
7294
	      while :; do
7942
	      while :; do
7295
		# Make sure we don't pick an alternate name that also
7943
		# Make sure we don't pick an alternate name that also
7296
		# overlaps.
7944
		# overlaps.
7297
		newobj=lt$counter-$objbase
7945
		newobj=lt$counter-$objbase
7298
		counter=`expr $counter + 1`
7946
		func_arith $counter + 1
-
 
7947
		counter=$func_arith_result
7299
		case " $oldobjs " in
7948
		case " $oldobjs " in
7300
		*[\ /]"$newobj "*) ;;
7949
		*[\ /]"$newobj "*) ;;
7301
		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
7950
		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
7302
		esac
7951
		esac
7303
	      done
7952
	      done
Line 7308... Line 7957...
7308
	    esac
7957
	    esac
7309
	  done
7958
	  done
7310
	fi
7959
	fi
7311
	eval cmds=\"$old_archive_cmds\"
7960
	eval cmds=\"$old_archive_cmds\"
7312
 
7961
 
7313
	if len=`expr "X$cmds" : ".*" 2>/dev/null` &&
7962
	func_len " $cmds"
-
 
7963
	len=$func_len_result
7314
	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7964
	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7315
	  cmds=$old_archive_cmds
7965
	  cmds=$old_archive_cmds
7316
	else
7966
	else
7317
	  # the command line is too long to link in one step, link in parts
7967
	  # the command line is too long to link in one step, link in parts
7318
	  func_verbose "using piecewise archive linking..."
7968
	  func_verbose "using piecewise archive linking..."
7319
	  save_RANLIB=$RANLIB
7969
	  save_RANLIB=$RANLIB
7320
	  RANLIB=:
7970
	  RANLIB=:
7321
	  objlist=
7971
	  objlist=
7322
	  concat_cmds=
7972
	  concat_cmds=
7323
	  save_oldobjs=$oldobjs
7973
	  save_oldobjs=$oldobjs
-
 
7974
	  oldobjs=
7324
	  # Is there a better way of finding the last object in the list?
7975
	  # Is there a better way of finding the last object in the list?
7325
	  for obj in $save_oldobjs
7976
	  for obj in $save_oldobjs
7326
	  do
7977
	  do
7327
	    last_oldobj=$obj
7978
	    last_oldobj=$obj
7328
	  done
7979
	  done
-
 
7980
	  eval test_cmds=\"$old_archive_cmds\"
-
 
7981
	  func_len " $test_cmds"
-
 
7982
	  len0=$func_len_result
-
 
7983
	  len=$len0
7329
	  for obj in $save_oldobjs
7984
	  for obj in $save_oldobjs
7330
	  do
7985
	  do
7331
	    oldobjs="$objlist $obj"
7986
	    func_len " $obj"
7332
	    objlist="$objlist $obj"
7987
	    func_arith $len + $func_len_result
7333
	    eval test_cmds=\"$old_archive_cmds\"
7988
	    len=$func_arith_result
7334
	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
7989
	    func_append objlist " $obj"
7335
	       test "$len" -le "$max_cmd_len"; then
7990
	    if test "$len" -lt "$max_cmd_len"; then
7336
	      :
7991
	      :
7337
	    else
7992
	    else
7338
	      # the above command should be used before it gets too long
7993
	      # the above command should be used before it gets too long
7339
	      oldobjs=$objlist
7994
	      oldobjs=$objlist
7340
	      if test "$obj" = "$last_oldobj" ; then
7995
	      if test "$obj" = "$last_oldobj" ; then
7341
		RANLIB=$save_RANLIB
7996
		RANLIB=$save_RANLIB
7342
	      fi
7997
	      fi
7343
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7998
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7344
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7999
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7345
	      objlist=
8000
	      objlist=
-
 
8001
	      len=$len0
7346
	    fi
8002
	    fi
7347
	  done
8003
	  done
7348
	  RANLIB=$save_RANLIB
8004
	  RANLIB=$save_RANLIB
7349
	  oldobjs=$objlist
8005
	  oldobjs=$objlist
7350
	  if test "X$oldobjs" = "X" ; then
8006
	  if test "X$oldobjs" = "X" ; then
Line 7465... Line 8121...
7465
	  fi
8121
	  fi
7466
	  $RM $output
8122
	  $RM $output
7467
	  # place dlname in correct position for cygwin
8123
	  # place dlname in correct position for cygwin
7468
	  tdlname=$dlname
8124
	  tdlname=$dlname
7469
	  case $host,$output,$installed,$module,$dlname in
8125
	  case $host,$output,$installed,$module,$dlname in
7470
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8126
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
7471
	  esac
8127
	  esac
7472
	  $ECHO > $output "\
8128
	  $ECHO > $output "\
7473
# $outputname - a libtool library file
8129
# $outputname - a libtool library file
7474
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8130
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
7475
#
8131
#