[PATCH] Make win32 compiler built with cygwin be running in plain Win32 environment

Igor Shevlyakov igor@windriver.com
Tue Jun 6 16:01:00 GMT 2000


Hi folks,

We are building our compilers using CYGWIN environment but customers want to
use plain Win32 shell. Sometimes it causes problems. For example dependency
generation will sometimes produce posix style path names. So I made a patch to
i386/xm-cygwin.h with which we could control style of path names by defining
FORCE_DOS_PATH_STYLE to 1.
I hope that would be useful for people building their cmpilers under Win32.

diff:

*** xm-cygwin.h	Tue Dec 28 08:36:09 1999
--- xm-cygwin.h.new	Tue Jun  6 15:45:27 2000
*************** Boston, MA 02111-1307, USA. */
*** 34,56 ****
  #define DIR_SEPARATOR '/'
  #define DIR_SEPARATOR_2 '\\'

! /* Convert win32 style path lists to POSIX style for consistency. */
  #undef GET_ENV_PATH_LIST
  #define GET_ENV_PATH_LIST(VAR,NAME)					\
  do {									\
    char *_epath;								\
!   char *_posixepath;							\
!   _epath = _posixepath = getenv (NAME);					\
!   /* if we have a posix path list, convert to posix path list */	\
!   if (_epath != NULL && *_epath != 0					\
!       && ! cygwin_posix_path_list_p (_epath))				\
!     {									\
!       char *p;								\
!       _posixepath = (char *) xmalloc					\
! 	(cygwin_win32_to_posix_path_list_buf_size (_epath));		\
!       cygwin_win32_to_posix_path_list (_epath, _posixepath);		\
!     }									\
!   (VAR) = _posixepath;							\
  } while (0)

  #define PATH_SEPARATOR ':'
--- 34,68 ----
  #define DIR_SEPARATOR '/'
  #define DIR_SEPARATOR_2 '\\'

! /* Get path lists and convert it to Posix or Win32 style.  */
! /* Posix is default unless FORCE_DOS_PATH_STYLE defined.   */
!
! #ifndef FORCE_DOS_PATH_STYLE
! #define FORCE_DOS_PATH_STYLE 0
! #endif
!
  #undef GET_ENV_PATH_LIST
  #define GET_ENV_PATH_LIST(VAR,NAME)					\
  do {									\
    char *_epath;								\
!   char *_resultepath;							\
!   _epath = _resultepath = getenv (NAME);				\
!   if (_epath != NULL && *_epath != 0)					\
!       if (FORCE_DOS_PATH_STYLE)						\
!         if ( cygwin_posix_path_list_p (_epath))				\
!           {								\
!             _resultepath = (char *) xmalloc				\
! 	      (cygwin_posix_to_win32_path_list_buf_size (_epath));	\
!             cygwin_posix_to_win32_path_list (_epath, _resultepath);	\
!           }								\
!       else 								\
!         if ( !cygwin_posix_path_list_p (_epath))			\
!           {								\
!             _resultepath = (char *) xmalloc				\
! 	      (cygwin_win32_to_posix_path_list_buf_size (_epath));	\
!             cygwin_win32_to_posix_path_list (_epath, _resultepath);	\
!           }								\
!   (VAR) = _resultepath;							\
  } while (0)

  #define PATH_SEPARATOR ':'

======================================
ChangeLog:

2000-06-06  Igor Shevlyakov <igor@windriver.com>
	* config/i386/xm-ctgwin.h: (GET_ENV_PATH_LIST): redefine
      to use FORCE_DOS_PATH_STYLE and convert in both ways (Posix & Win32).


Regards,
Igor Shevlyakov



More information about the Gcc-patches mailing list