From: Charles Wilson Date: Thu, 13 Mar 2008 04:46:08 +0000 (+0000) Subject: * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src) [file X-Git-Tag: v2.2.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2de89c6093a2e2f47416718223585c3e1bd202f;p=thirdparty%2Flibtool.git * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src) [file scope]: additional #includes and #defines to support... (func_emit_cwrapperexe_src) [main]: ensure stdout is set to binary mode for cygwin|mingw builds. Ensure temporary script file is written in binary mode for cygwin|mingw builds. (func_mode_link) [cygwin|mingw]: cross-build support - only use cwrapper to generate shell wrapper if building native; otherwise use func_emit_wrapper() --- diff --git a/ChangeLog b/ChangeLog index 9418c568a..150a1e746 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-03-12 Charles Wilson + + * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src) [file + scope]: additional #includes and #defines to support... + (func_emit_cwrapperexe_src) [main]: ensure stdout is set to + binary mode for cygwin|mingw builds. Ensure temporary script + file is written in binary mode for cygwin|mingw builds. + (func_mode_link) [cygwin|mingw]: cross-build support - only + use cwrapper to generate shell wrapper if building native; + otherwise use func_emit_wrapper() + 2008-03-12 Henning Nielsen Lund * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index ade8b4505..9ccb0203b 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -2517,6 +2517,7 @@ EOF #ifdef _MSC_VER # include # include +# include #else # include # include @@ -2527,6 +2528,7 @@ EOF #include #include #include +#include #include #if defined(PATH_MAX) @@ -2560,6 +2562,7 @@ EOF #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif @@ -2581,6 +2584,17 @@ EOF # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ @@ -2646,6 +2660,15 @@ main (int argc, char *argv[]) { if (strcmp (argv[i], dumpscript_opt) == 0) { +EOF + case "$host" in + *mingw* | *cygwin* ) + # make stdout use "unix" line endings + echo " _setmode(1,_O_BINARY);" + ;; + esac + + cat < $func_ltwrapper_scriptname_result + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi } ;; * )