~ubuntu-branches/ubuntu/saucy/libyaml/saucy-updates

« back to all changes in this revision

Viewing changes to config/ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Anders Kaseorg
  • Date: 2009-10-04 14:07:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091004140718-xbxdh75o5isjgq51
Tags: 0.1.3-1
* New upstream version 0.1.3.
  + This release fixes non-standard structure initialization and a
    streaming-related issue.
* Bump priority from extra to optional.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Generated from ltmain.m4sh.
2
2
 
3
 
# ltmain.sh (GNU libtool) 2.2.4
 
3
# ltmain.sh (GNU libtool) 2.2.6
4
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
5
 
6
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
65
65
#       compiler:               $LTCC
66
66
#       compiler flags:         $LTCFLAGS
67
67
#       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
69
69
#       automake:               $automake_version
70
70
#       autoconf:               $autoconf_version
71
71
#
73
73
 
74
74
PROGRAM=ltmain.sh
75
75
PACKAGE=libtool
76
 
VERSION="2.2.4 Debian-2.2.4-0ubuntu4"
 
76
VERSION="2.2.6 Debian-2.2.6a-1ubuntu1"
77
77
TIMESTAMP=""
78
 
package_revision=1.2976
 
78
package_revision=1.3012
79
79
 
80
80
# Be Bourne compatible
81
81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
805
805
 
806
806
 
807
807
  case $host in
808
 
    *cygwin* | *mingw* | *pw32*)
 
808
    *cygwin* | *mingw* | *pw32* | *cegcc*)
809
809
      # don't eliminate duplications in $postdeps and $predeps
810
810
      opt_duplicate_compiler_generated_deps=:
811
811
      ;;
893
893
# determined imposters.
894
894
func_lalib_p ()
895
895
{
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
898
899
}
899
900
 
900
901
# func_lalib_unsafe_p file
907
908
func_lalib_unsafe_p ()
908
909
{
909
910
    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
911
912
        for lalib_p_l in 1 2 3 4
912
913
        do
913
914
            read lalib_p_line
1275
1276
 
1276
1277
    # On Cygwin there's no "real" PIC flag so we must build both object types
1277
1278
    case $host_os in
1278
 
    cygwin* | mingw* | pw32* | os2*)
 
1279
    cygwin* | mingw* | pw32* | os2* | cegcc*)
1279
1280
      pic_mode=default
1280
1281
      ;;
1281
1282
    esac
2046
2047
              'exit $?'
2047
2048
          tstripme="$stripme"
2048
2049
          case $host_os in
2049
 
          cygwin* | mingw* | pw32*)
 
2050
          cygwin* | mingw* | pw32* | cegcc*)
2050
2051
            case $realname in
2051
2052
            *.dll.a)
2052
2053
              tstripme=""
2152
2153
 
2153
2154
        # Do a test to see if this is really a libtool program.
2154
2155
        case $host in
2155
 
        *cygwin*|*mingw*)
 
2156
        *cygwin* | *mingw*)
2156
2157
            if func_ltwrapper_executable_p "$file"; then
2157
2158
              func_ltwrapper_scriptname "$file"
2158
2159
              wrapper=$func_ltwrapper_scriptname_result
2358
2359
              $RM $export_symbols
2359
2360
              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2360
2361
              case $host in
2361
 
              *cygwin* | *mingw* )
 
2362
              *cygwin* | *mingw* | *cegcc* )
2362
2363
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2363
2364
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2364
2365
                ;;
2370
2371
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2371
2372
              eval '$MV "$nlist"T "$nlist"'
2372
2373
              case $host in
2373
 
                *cygwin | *mingw* )
 
2374
                *cygwin | *mingw* | *cegcc* )
2374
2375
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2375
2376
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2376
2377
                  ;;
2426
2427
} lt_dlsymlist;
2427
2428
"
2428
2429
          case $host in
2429
 
          *cygwin* | *mingw* )
 
2430
          *cygwin* | *mingw* | *cegcc* )
2430
2431
            $ECHO >> "$output_objdir/$my_dlsyms" "\
2431
2432
/* DATA imports from DLLs on WIN32 con't be const, because
2432
2433
   runtime relocations are performed -- see ld's documentation
2512
2513
        # Transform the symbol file into the correct name.
2513
2514
        symfileobj="$output_objdir/${my_outputname}S.$objext"
2514
2515
        case $host in
2515
 
        *cygwin* | *mingw* )
 
2516
        *cygwin* | *mingw* | *cegcc* )
2516
2517
          if test -f "$output_objdir/$my_outputname.def"; then
2517
2518
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2518
2519
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2691
2692
 
2692
2693
 
2693
2694
 
2694
 
# func_emit_wrapper arg
2695
 
#
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 ()
 
2695
# func_emit_wrapper_part1 [arg=no]
 
2696
#
 
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.
 
2700
func_emit_wrapper_part1 ()
2709
2701
{
2710
 
        func_emit_wrapper_arg1=no
 
2702
        func_emit_wrapper_part1_arg1=no
2711
2703
        if test -n "$1" ; then
2712
 
          func_emit_wrapper_arg1=$1
 
2704
          func_emit_wrapper_part1_arg1=$1
2713
2705
        fi
2714
2706
 
2715
2707
        $ECHO "\
2794
2786
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2795
2787
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2796
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 "\
2797
2806
 
2798
2807
  # Usually 'no', except on cygwin/mingw when embedded into
2799
2808
  # the cwrapper.
2800
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
 
2809
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2801
2810
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2802
2811
    # special case for '.'
2803
2812
    if test \"\$thisdir\" = \".\"; then
2888
2897
"
2889
2898
        case $host in
2890
2899
        # Backslashes separate directories on plain windows
2891
 
        *-*-mingw | *-*-os2*)
 
2900
        *-*-mingw | *-*-os2* | *-cegcc*)
2892
2901
          $ECHO "\
2893
2902
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2894
2903
"
2914
2923
fi\
2915
2924
"
2916
2925
}
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.
 
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
2918
3127
 
2919
3128
# func_emit_cwrapperexe_src
2920
3129
# emit the source code for a wrapper executable on stdout
2951
3160
# include <stdint.h>
2952
3161
# ifdef __CYGWIN__
2953
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
2954
3169
# endif
2955
3170
#endif
2956
3171
#include <malloc.h>
3057
3272
int check_executable (const char *path);
3058
3273
char *strendzap (char *str, const char *pat);
3059
3274
void lt_fatal (const char *message, ...);
3060
 
 
3061
 
static const char *script_text =
3062
 
EOF
3063
 
 
3064
 
            func_emit_wrapper yes |
 
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);
 
3283
 
 
3284
static const char *script_text_part1 =
 
3285
EOF
 
3286
 
 
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 |
3065
3296
                $SED -e 's/\([\\"]\)/\\\1/g' \
3066
3297
                     -e 's/^/  "/' -e 's/$/\\n"/'
3067
3298
            echo ";"
3068
3299
 
3069
3300
            cat <<EOF
3070
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 */
3071
3361
 
3072
3362
int
3073
3363
main (int argc, char *argv[])
3074
3364
{
3075
3365
  char **newargz;
 
3366
  int  newargc;
3076
3367
  char *tmp_pathspec;
3077
3368
  char *actual_cwrapper_path;
3078
 
  char *shwrapper_name;
 
3369
  char *actual_cwrapper_name;
 
3370
  char *target_name;
 
3371
  char *lt_argv_zero;
3079
3372
  intptr_t rval = 127;
3080
 
  FILE *shwrapper;
3081
3373
 
3082
 
  const char *dumpscript_opt = "--lt-dump-script";
3083
3374
  int i;
3084
3375
 
3085
3376
  program_name = (char *) xstrdup (base_name (argv[0]));
3099
3390
                ;;
3100
3391
              esac
3101
3392
 
3102
 
            cat <<EOF
3103
 
          printf ("%s", script_text);
 
3393
            cat <<"EOF"
 
3394
          printf ("%s", script_text_part1);
 
3395
          printf ("%s", script_text_part2);
3104
3396
          return 0;
3105
3397
        }
3106
3398
    }
3107
3399
 
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);
3134
3401
  tmp_pathspec = find_executable (argv[0]);
3135
3402
  if (tmp_pathspec == NULL)
3136
3403
    lt_fatal ("Couldn't find %s", argv[0]);
3142
3409
                          actual_cwrapper_path));
3143
3410
  XFREE (tmp_pathspec);
3144
3411
 
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;
3156
 
  tmp_pathspec = 0;
3157
 
  LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",
3158
 
                          shwrapper_name));
 
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;
 
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
 
 
3430
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
 
3431
                          target_name));
3159
3432
EOF
3160
3433
 
3161
3434
            cat <<EOF
3162
 
  newargz[1] =
 
3435
  newargz[0] =
3163
3436
    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);
3169
 
EOF
3170
 
 
 
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], "/");
 
3441
EOF
 
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
3171
3455
 
3172
3456
            case $host_os in
3173
3457
              mingw*)
3174
3458
            cat <<"EOF"
3175
3459
  {
3176
3460
    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)
3178
3466
      {
3179
3467
        *p = '/';
3180
3468
      }
3184
3472
            esac
3185
3473
 
3186
3474
            cat <<"EOF"
3187
 
  XFREE (shwrapper_name);
 
3475
  XFREE (target_name);
3188
3476
  XFREE (actual_cwrapper_path);
3189
 
 
3190
 
  /* always write in binary mode */
3191
 
  if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0)
3192
 
    {
3193
 
      lt_fatal ("Could not open %s for writing", newargz[1]);
3194
 
    }
3195
 
  fprintf (shwrapper, "%s", script_text);
3196
 
  fclose (shwrapper);
3197
 
 
3198
 
  make_executable (newargz[1]);
3199
 
 
 
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;
3200
3485
  for (i = 1; i < argc; i++)
3201
 
    newargz[i + 1] = xstrdup (argv[i]);
3202
 
  newargz[argc + 1] = NULL;
 
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 ... */
 
3547
      newargz[++newargc] = xstrdup (argv[i]);
 
3548
    }
 
3549
  newargz[++newargc] = NULL;
3203
3550
 
3204
 
  for (i = 0; i < argc + 1; i++)
 
3551
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
 
3552
  for (i = 0; i < newargc; i++)
3205
3553
    {
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>")));
3207
3555
    }
3208
3556
 
3209
3557
EOF
3210
3558
 
3211
3559
            case $host_os in
3212
3560
              mingw*)
3213
 
                cat <<EOF
 
3561
                cat <<"EOF"
3214
3562
  /* 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);
3216
3564
  if (rval == -1)
3217
3565
    {
3218
3566
      /* 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));
3220
3568
      return 127;
3221
3569
    }
3222
3570
  return rval;
3223
 
}
3224
3571
EOF
3225
3572
                ;;
3226
3573
              *)
3227
 
                cat <<EOF
3228
 
  execv ("$lt_newargv0", newargz);
 
3574
                cat <<"EOF"
 
3575
  execv (lt_argv_zero, newargz);
3229
3576
  return rval; /* =127, but avoids unused variable warning */
3230
 
}
3231
3577
EOF
3232
3578
                ;;
3233
3579
            esac
3234
3580
 
3235
3581
            cat <<"EOF"
 
3582
}
3236
3583
 
3237
3584
void *
3238
3585
xmalloc (size_t num)
3506
3853
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3507
3854
  va_end (ap);
3508
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
 
3509
4027
EOF
3510
4028
}
3511
4029
# end: func_emit_cwrapperexe_src
3515
4033
{
3516
4034
    $opt_debug
3517
4035
    case $host in
3518
 
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
4036
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
3519
4037
      # It is impossible to link a dll without this setting, and
3520
4038
      # we shouldn't force the makefile maintainer to figure out
3521
4039
      # which system we are compiling for in order to pass an extra
3959
4477
      -L*)
3960
4478
        func_stripname '-L' '' "$arg"
3961
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
3962
4487
        # We need an absolute path.
3963
4488
        case $dir in
3964
4489
        [\\/]* | [A-Za-z]:[\\/]*) ;;
3977
4502
          ;;
3978
4503
        esac
3979
4504
        case $host in
3980
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
4505
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
3981
4506
          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
3982
4507
          case :$dllsearchpath: in
3983
4508
          *":$dir:"*) ;;
 
4509
          ::) dllsearchpath=$dir;;
3984
4510
          *) dllsearchpath="$dllsearchpath:$dir";;
3985
4511
          esac
3986
4512
          case :$dllsearchpath: in
3987
4513
          *":$testbindir:"*) ;;
 
4514
          ::) dllsearchpath=$testbindir;;
3988
4515
          *) dllsearchpath="$dllsearchpath:$testbindir";;
3989
4516
          esac
3990
4517
          ;;
3995
4522
      -l*)
3996
4523
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
3997
4524
          case $host in
3998
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 
4525
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
3999
4526
            # These systems don't actually have a C or math library (as such)
4000
4527
            continue
4001
4528
            ;;
4072
4599
 
4073
4600
      -no-install)
4074
4601
        case $host in
4075
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
 
4602
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4076
4603
          # The PATH hackery in wrapper scripts is required on Windows
4077
4604
          # and Darwin in order for the loader to find any dlls it needs.
4078
4605
          func_warning "\`-no-install' is ignored for $host"
5032
5559
        if test -n "$library_names" &&
5033
5560
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
5034
5561
          case $host in
5035
 
          *cygwin* | *mingw*)
 
5562
          *cygwin* | *mingw* | *cegcc*)
5036
5563
              # No point in relinking DLLs because paths are not encoded
5037
5564
              notinst_deplibs="$notinst_deplibs $lib"
5038
5565
              need_relink=no
5102
5629
            elif test -n "$soname_spec"; then
5103
5630
              # bleh windows
5104
5631
              case $host in
5105
 
              *cygwin* | mingw*)
 
5632
              *cygwin* | mingw* | *cegcc*)
5106
5633
                func_arith $current - $age
5107
5634
                major=$func_arith_result
5108
5635
                versuffix="-$major"
5884
6411
        tempremovelist=`$ECHO "$output_objdir/*"`
5885
6412
        for p in $tempremovelist; do
5886
6413
          case $p in
5887
 
            *.$objext)
 
6414
            *.$objext | *.gcno)
5888
6415
               ;;
5889
6416
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
5890
6417
               if test "X$precious_files_regex" != "X"; then
5955
6482
      if test "$build_libtool_libs" = yes; then
5956
6483
        if test -n "$rpath"; then
5957
6484
          case $host in
5958
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
 
6485
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
5959
6486
            # these systems don't actually have a c library (as such)!
5960
6487
            ;;
5961
6488
          *-*-rhapsody* | *-*-darwin1.[012])
6454
6981
 
6455
6982
        orig_export_symbols=
6456
6983
        case $host_os in
6457
 
        cygwin* | mingw*)
 
6984
        cygwin* | mingw* | cegcc*)
6458
6985
          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6459
6986
            # exporting using user supplied symfile
6460
6987
            if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
7079
7606
          esac
7080
7607
        fi
7081
7608
        case $host in
7082
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
7609
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7083
7610
          testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7084
7611
          case :$dllsearchpath: in
7085
7612
          *":$libdir:"*) ;;
 
7613
          ::) dllsearchpath=$libdir;;
7086
7614
          *) dllsearchpath="$dllsearchpath:$libdir";;
7087
7615
          esac
7088
7616
          case :$dllsearchpath: in
7089
7617
          *":$testbindir:"*) ;;
 
7618
          ::) dllsearchpath=$testbindir;;
7090
7619
          *) dllsearchpath="$dllsearchpath:$testbindir";;
7091
7620
          esac
7092
7621
          ;;
7156
7685
          wrappers_required=no
7157
7686
        fi
7158
7687
        ;;
 
7688
      *cegcc)
 
7689
        # Disable wrappers for cegcc, we are cross compiling anyway.
 
7690
        wrappers_required=no
 
7691
        ;;
7159
7692
      *)
7160
7693
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7161
7694
          wrappers_required=no
7308
7841
 
7309
7842
            func_emit_cwrapperexe_src > $cwrappersource
7310
7843
 
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.
7316
7848
            $opt_dry_run || {
7317
7849
              $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7318
7850
              $STRIP $cwrapper
7597
8129
          # place dlname in correct position for cygwin
7598
8130
          tdlname=$dlname
7599
8131
          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 ;;
7601
8133
          esac
7602
8134
          $ECHO > $output "\
7603
8135
# $outputname - a libtool library file