Changeset 52b649e in mod_gnutls for config/ltmain.sh


Ignore:
Timestamp:
Jan 11, 2013, 12:57:39 AM (7 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, upstream
Children:
4e539d3, 66b608e
Parents:
4ecf14f
Message:

Imported Upstream version 0.5.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • config/ltmain.sh

    r4ecf14f r52b649e  
    11# Generated from ltmain.m4sh.
    22
    3 # ltmain.sh (GNU libtool) 2.2.4
     3# ltmain.sh (GNU libtool) 2.2.6
    44# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    55
     
    6666#       compiler flags:         $LTCFLAGS
    6767#       linker:         $LD (gnu? $with_gnu_ld)
    68 #       $progname:              (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4
     68#       $progname:              (GNU libtool) 2.2.6 Debian-2.2.6a-1ubuntu1
    6969#       automake:               $automake_version
    7070#       autoconf:               $autoconf_version
     
    7474PROGRAM=ltmain.sh
    7575PACKAGE=libtool
    76 VERSION="2.2.4 Debian-2.2.4-0ubuntu4"
     76VERSION="2.2.6 Debian-2.2.6a-1ubuntu1"
    7777TIMESTAMP=""
    78 package_revision=1.2976
     78package_revision=1.3012
    7979
    8080# Be Bourne compatible
     
    806806
    807807  case $host in
    808     *cygwin* | *mingw* | *pw32*)
     808    *cygwin* | *mingw* | *pw32* | *cegcc*)
    809809      # don't eliminate duplications in $postdeps and $predeps
    810810      opt_duplicate_compiler_generated_deps=:
     
    894894func_lalib_p ()
    895895{
    896     $SED -e 4q "$1" 2>/dev/null \
    897       | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
     896    test -f "$1" &&
     897      $SED -e 4q "$1" 2>/dev/null \
     898        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
    898899}
    899900
     
    908909{
    909910    lalib_p=no
    910     if test -r "$1" && exec 5<&0 <"$1"; then
     911    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
    911912        for lalib_p_l in 1 2 3 4
    912913        do
     
    12761277    # On Cygwin there's no "real" PIC flag so we must build both object types
    12771278    case $host_os in
    1278     cygwin* | mingw* | pw32* | os2*)
     1279    cygwin* | mingw* | pw32* | os2* | cegcc*)
    12791280      pic_mode=default
    12801281      ;;
     
    20472048          tstripme="$stripme"
    20482049          case $host_os in
    2049           cygwin* | mingw* | pw32*)
     2050          cygwin* | mingw* | pw32* | cegcc*)
    20502051            case $realname in
    20512052            *.dll.a)
     
    21532154        # Do a test to see if this is really a libtool program.
    21542155        case $host in
    2155         *cygwin*|*mingw*)
     2156        *cygwin* | *mingw*)
    21562157            if func_ltwrapper_executable_p "$file"; then
    21572158              func_ltwrapper_scriptname "$file"
     
    23592360              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
    23602361              case $host in
    2361               *cygwin* | *mingw* )
     2362              *cygwin* | *mingw* | *cegcc* )
    23622363                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
    23632364                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
     
    23712372              eval '$MV "$nlist"T "$nlist"'
    23722373              case $host in
    2373                 *cygwin | *mingw* )
     2374                *cygwin | *mingw* | *cegcc* )
    23742375                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
    23752376                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
     
    24272428"
    24282429          case $host in
    2429           *cygwin* | *mingw* )
     2430          *cygwin* | *mingw* | *cegcc* )
    24302431            $ECHO >> "$output_objdir/$my_dlsyms" "\
    24312432/* DATA imports from DLLs on WIN32 con't be const, because
     
    25132514        symfileobj="$output_objdir/${my_outputname}S.$objext"
    25142515        case $host in
    2515         *cygwin* | *mingw* )
     2516        *cygwin* | *mingw* | *cegcc* )
    25162517          if test -f "$output_objdir/$my_outputname.def"; then
    25172518            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
     
    26922693
    26932694
    2694 # func_emit_wrapper arg
     2695# func_emit_wrapper_part1 [arg=no]
    26952696#
    2696 # emit a libtool wrapper script on stdout
    2697 # don't directly open a file because we may want to
    2698 # incorporate the script contents within a cygwin/mingw
    2699 # wrapper executable.  Must ONLY be called from within
    2700 # func_mode_link because it depends on a number of variable
    2701 # set therein.
    2702 #
    2703 # arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
    2704 # variable will take.  If 'yes', then the emitted script
    2705 # will assume that the directory in which it is stored is
    2706 # the '.lib' directory.  This is a cygwin/mingw-specific
    2707 # behavior.
    2708 func_emit_wrapper ()
     2697# Emit the first part of a libtool wrapper script on stdout.
     2698# For more information, see the description associated with
     2699# func_emit_wrapper(), below.
     2700func_emit_wrapper_part1 ()
    27092701{
    2710         func_emit_wrapper_arg1=no
     2702        func_emit_wrapper_part1_arg1=no
    27112703        if test -n "$1" ; then
    2712           func_emit_wrapper_arg1=$1
     2704          func_emit_wrapper_part1_arg1=$1
    27132705        fi
    27142706
     
    27952787    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
    27962788  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.
     2798func_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 "\
    27972806
    27982807  # Usually 'no', except on cygwin/mingw when embedded into
    27992808  # the cwrapper.
    2800   WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
     2809  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
    28012810  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
    28022811    # special case for '.'
     
    28892898        case $host in
    28902899        # Backslashes separate directories on plain windows
    2891         *-*-mingw | *-*-os2*)
     2900        *-*-mingw | *-*-os2* | *-cegcc*)
    28922901          $ECHO "\
    28932902      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
     
    29152924"
    29162925}
    2917 # 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.
     2943func_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.
     2978func_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.
     3049func_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
    29183127
    29193128# func_emit_cwrapperexe_src
     
    29523161# ifdef __CYGWIN__
    29533162#  include <io.h>
     3163#  define HAVE_SETENV
     3164#  ifdef __STRICT_ANSI__
     3165char *realpath (const char *, char *);
     3166int putenv (char *);
     3167int setenv (const char *, const char *, int);
     3168#  endif
    29543169# endif
    29553170#endif
     
    30583273char *strendzap (char *str, const char *pat);
    30593274void lt_fatal (const char *message, ...);
    3060 
    3061 static const char *script_text =
     3275void lt_setenv (const char *name, const char *value);
     3276char *lt_extend_str (const char *orig_value, const char *add, int to_end);
     3277void lt_opt_process_env_set (const char *arg);
     3278void lt_opt_process_env_prepend (const char *arg);
     3279void lt_opt_process_env_append (const char *arg);
     3280int lt_split_name_value (const char *arg, char** name, char** value);
     3281void lt_update_exe_path (const char *name, const char *value);
     3282void lt_update_lib_path (const char *name, const char *value);
     3283
     3284static const char *script_text_part1 =
    30623285EOF
    30633286
    3064             func_emit_wrapper yes |
     3287            func_emit_wrapper_part1 yes |
    30653288                $SED -e 's/\([\\"]\)/\\\1/g' \
    30663289                     -e 's/^/  "/' -e 's/$/\\n"/'
    30673290            echo ";"
     3291            cat <<EOF
     3292
     3293static const char *script_text_part2 =
     3294EOF
     3295            func_emit_wrapper_part2 yes |
     3296                $SED -e 's/\([\\"]\)/\\\1/g' \
     3297                     -e 's/^/  "/' -e 's/$/\\n"/'
     3298            echo ";"
    30683299
    30693300            cat <<EOF
    30703301const char * MAGIC_EXE = "$magic_exe";
     3302const char * LIB_PATH_VARNAME = "$shlibpath_var";
     3303EOF
     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
     3308const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
     3309EOF
     3310            else
     3311              cat <<"EOF"
     3312const char * LIB_PATH_VALUE   = "";
     3313EOF
     3314            fi
     3315
     3316            if test -n "$dllsearchpath"; then
     3317              func_to_host_pathlist "$dllsearchpath:"
     3318              cat <<EOF
     3319const char * EXE_PATH_VARNAME = "PATH";
     3320const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
     3321EOF
     3322            else
     3323              cat <<"EOF"
     3324const char * EXE_PATH_VARNAME = "";
     3325const char * EXE_PATH_VALUE   = "";
     3326EOF
     3327            fi
     3328
     3329            if test "$fast_install" = yes; then
     3330              cat <<EOF
     3331const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
     3332EOF
     3333            else
     3334              cat <<EOF
     3335const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
     3336EOF
     3337            fi
     3338
     3339
     3340            cat <<"EOF"
     3341
     3342#define LTWRAPPER_OPTION_PREFIX         "--lt-"
     3343#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
     3344
     3345static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
     3346static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
     3347
     3348static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
     3349
     3350static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
     3351static 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
     3354static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
     3355static 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
     3358static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
     3359static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
     3360  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
    30713361
    30723362int
     
    30743364{
    30753365  char **newargz;
     3366  int  newargc;
    30763367  char *tmp_pathspec;
    30773368  char *actual_cwrapper_path;
    3078   char *shwrapper_name;
     3369  char *actual_cwrapper_name;
     3370  char *target_name;
     3371  char *lt_argv_zero;
    30793372  intptr_t rval = 127;
    3080   FILE *shwrapper;
    3081 
    3082   const char *dumpscript_opt = "--lt-dump-script";
     3373
    30833374  int i;
    30843375
     
    31003391              esac
    31013392
    3102             cat <<EOF
    3103           printf ("%s", script_text);
     3393            cat <<"EOF"
     3394          printf ("%s", script_text_part1);
     3395          printf ("%s", script_text_part2);
    31043396          return 0;
    31053397        }
    31063398    }
    31073399
    3108   newargz = XMALLOC (char *, argc + 2);
    3109 EOF
    3110 
    3111             if test -n "$TARGETSHELL" ; then
    3112               # no path translation at all
    3113               lt_newargv0=$TARGETSHELL
    3114             else
    3115               case "$host" in
    3116                 *mingw* )
    3117                   # awkward: cmd appends spaces to result
    3118                   lt_sed_strip_trailing_spaces="s/[ ]*\$//"
    3119                   lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`
    3120                   case $lt_newargv0 in
    3121                     *.exe | *.EXE) ;;
    3122                     *) lt_newargv0=$lt_newargv0.exe ;;
    3123                   esac
    3124                   ;;
    3125                 * ) lt_newargv0=$SHELL ;;
    3126               esac
    3127             fi
    3128 
    3129                 cat <<EOF
    3130   newargz[0] = (char *) xstrdup ("$lt_newargv0");
    3131 EOF
    3132 
    3133             cat <<"EOF"
     3400  newargz = XMALLOC (char *, argc + 1);
    31343401  tmp_pathspec = find_executable (argv[0]);
    31353402  if (tmp_pathspec == NULL)
     
    31433410  XFREE (tmp_pathspec);
    31443411
    3145   shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path));
    3146   strendzap (actual_cwrapper_path, shwrapper_name);
    3147 
    3148   /* shwrapper_name transforms */
    3149   strendzap (shwrapper_name, ".exe");
    3150   tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) +
    3151                                  strlen ("_ltshwrapperTMP") + 1));
    3152   strcpy (tmp_pathspec, shwrapper_name);
    3153   strcat (tmp_pathspec, "_ltshwrapperTMP");
    3154   XFREE (shwrapper_name);
    3155   shwrapper_name = tmp_pathspec;
     3412  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
     3413  strendzap (actual_cwrapper_path, actual_cwrapper_name);
     3414
     3415  /* wrapper name transforms */
     3416  strendzap (actual_cwrapper_name, ".exe");
     3417  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
     3418  XFREE (actual_cwrapper_name);
     3419  actual_cwrapper_name = tmp_pathspec;
    31563420  tmp_pathspec = 0;
    3157   LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",
    3158                           shwrapper_name));
     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
     3430  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
     3431                          target_name));
    31593432EOF
    31603433
    31613434            cat <<EOF
    3162   newargz[1] =
     3435  newargz[0] =
    31633436    XMALLOC (char, (strlen (actual_cwrapper_path) +
    3164                     strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));
    3165   strcpy (newargz[1], actual_cwrapper_path);
    3166   strcat (newargz[1], "$objdir");
    3167   strcat (newargz[1], "/");
    3168   strcat (newargz[1], shwrapper_name);
     3437                    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
     3438  strcpy (newargz[0], actual_cwrapper_path);
     3439  strcat (newargz[0], "$objdir");
     3440  strcat (newargz[0], "/");
    31693441EOF
    31703442
     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;
     3454EOF
    31713455
    31723456            case $host_os in
     
    31753459  {
    31763460    char* p;
    3177     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)
    31783466      {
    31793467        *p = '/';
     
    31853473
    31863474            cat <<"EOF"
    3187   XFREE (shwrapper_name);
     3475  XFREE (target_name);
    31883476  XFREE (actual_cwrapper_path);
    3189 
    3190   /* always write in binary mode */
    3191   if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0)
     3477  XFREE (actual_cwrapper_name);
     3478
     3479  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
     3480  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
     3481  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
     3482  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
     3483
     3484  newargc=0;
     3485  for (i = 1; i < argc; i++)
    31923486    {
    3193       lt_fatal ("Could not open %s for writing", newargz[1]);
     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 ... */
     3547      newargz[++newargc] = xstrdup (argv[i]);
    31943548    }
    3195   fprintf (shwrapper, "%s", script_text);
    3196   fclose (shwrapper);
    3197 
    3198   make_executable (newargz[1]);
    3199 
    3200   for (i = 1; i < argc; i++)
    3201     newargz[i + 1] = xstrdup (argv[i]);
    3202   newargz[argc + 1] = NULL;
    3203 
    3204   for (i = 0; i < argc + 1; i++)
     3549  newargz[++newargc] = NULL;
     3550
     3551  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
     3552  for (i = 0; i < newargc; i++)
    32053553    {
    3206       LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, newargz[i]));
     3554      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
    32073555    }
    32083556
     
    32113559            case $host_os in
    32123560              mingw*)
    3213                 cat <<EOF
     3561                cat <<"EOF"
    32143562  /* execv doesn't actually work on mingw as expected on unix */
    3215   rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);
     3563  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
    32163564  if (rval == -1)
    32173565    {
    32183566      /* failed to start process */
    3219       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));
    32203568      return 127;
    32213569    }
    32223570  return rval;
    3223 }
    32243571EOF
    32253572                ;;
    32263573              *)
    3227                 cat <<EOF
    3228   execv ("$lt_newargv0", newargz);
     3574                cat <<"EOF"
     3575  execv (lt_argv_zero, newargz);
    32293576  return rval; /* =127, but avoids unused variable warning */
    3230 }
    32313577EOF
    32323578                ;;
     
    32343580
    32353581            cat <<"EOF"
     3582}
    32363583
    32373584void *
     
    35073854  va_end (ap);
    35083855}
     3856
     3857void
     3858lt_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
     3880char *
     3881lt_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
     3907int
     3908lt_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
     3930void
     3931lt_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
     3948void
     3949lt_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
     3969void
     3970lt_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
     3990void
     3991lt_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
     4011void
     4012lt_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
    35094027EOF
    35104028}
     
    35164034    $opt_debug
    35174035    case $host in
    3518     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
     4036    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    35194037      # It is impossible to link a dll without this setting, and
    35204038      # we shouldn't force the makefile maintainer to figure out
     
    39604478        func_stripname '-L' '' "$arg"
    39614479        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
    39624487        # We need an absolute path.
    39634488        case $dir in
     
    39784503        esac
    39794504        case $host in
    3980         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
     4505        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    39814506          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
    39824507          case :$dllsearchpath: in
    39834508          *":$dir:"*) ;;
     4509          ::) dllsearchpath=$dir;;
    39844510          *) dllsearchpath="$dllsearchpath:$dir";;
    39854511          esac
    39864512          case :$dllsearchpath: in
    39874513          *":$testbindir:"*) ;;
     4514          ::) dllsearchpath=$testbindir;;
    39884515          *) dllsearchpath="$dllsearchpath:$testbindir";;
    39894516          esac
     
    39964523        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
    39974524          case $host in
    3998           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
     4525          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
    39994526            # These systems don't actually have a C or math library (as such)
    40004527            continue
     
    40734600      -no-install)
    40744601        case $host in
    4075         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
     4602        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
    40764603          # The PATH hackery in wrapper scripts is required on Windows
    40774604          # and Darwin in order for the loader to find any dlls it needs.
     
    50335560           { test "$use_static_libs" = no || test -z "$old_library"; }; then
    50345561          case $host in
    5035           *cygwin* | *mingw*)
     5562          *cygwin* | *mingw* | *cegcc*)
    50365563              # No point in relinking DLLs because paths are not encoded
    50375564              notinst_deplibs="$notinst_deplibs $lib"
     
    51035630              # bleh windows
    51045631              case $host in
    5105               *cygwin* | mingw*)
     5632              *cygwin* | mingw* | *cegcc*)
    51065633                func_arith $current - $age
    51075634                major=$func_arith_result
     
    58856412        for p in $tempremovelist; do
    58866413          case $p in
    5887             *.$objext)
     6414            *.$objext | *.gcno)
    58886415               ;;
    58896416            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
     
    59566483        if test -n "$rpath"; then
    59576484          case $host in
    5958           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
     6485          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
    59596486            # these systems don't actually have a c library (as such)!
    59606487            ;;
     
    64556982        orig_export_symbols=
    64566983        case $host_os in
    6457         cygwin* | mingw*)
     6984        cygwin* | mingw* | cegcc*)
    64586985          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
    64596986            # exporting using user supplied symfile
     
    70807607        fi
    70817608        case $host in
    7082         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
     7609        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    70837610          testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
    70847611          case :$dllsearchpath: in
    70857612          *":$libdir:"*) ;;
     7613          ::) dllsearchpath=$libdir;;
    70867614          *) dllsearchpath="$dllsearchpath:$libdir";;
    70877615          esac
    70887616          case :$dllsearchpath: in
    70897617          *":$testbindir:"*) ;;
     7618          ::) dllsearchpath=$testbindir;;
    70907619          *) dllsearchpath="$dllsearchpath:$testbindir";;
    70917620          esac
     
    71577686        fi
    71587687        ;;
     7688      *cegcc)
     7689        # Disable wrappers for cegcc, we are cross compiling anyway.
     7690        wrappers_required=no
     7691        ;;
    71597692      *)
    71607693        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
     
    73097842            func_emit_cwrapperexe_src > $cwrappersource
    73107843
    7311             # we should really use a build-platform specific compiler
    7312             # here, but OTOH, the wrappers (shell script and this C one)
    7313             # are only useful if you want to execute the "real" binary.
    7314             # Since the "real" binary is built for $host, then this
    7315             # wrapper might as well be built for $host, too.
     7844            # The wrapper executable is built using the $host compiler,
     7845            # because it contains $host paths and files. If cross-
     7846            # compiling, it, like the target executable, must be
     7847            # executed on the $host or under an emulation environment.
    73167848            $opt_dry_run || {
    73177849              $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
     
    75988130          tdlname=$dlname
    75998131          case $host,$output,$installed,$module,$dlname in
    7600             *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
     8132            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
    76018133          esac
    76028134          $ECHO > $output "\
Note: See TracChangeset for help on using the changeset viewer.