2010-10-29 10:22 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* include/hb_io.h
  * include/hbthread.h
  * include/hbsetup.h
  * src/vm/thread.c
  * src/vm/dynlibhb.c
  * src/common/hbgete.c
  * src/common/hbprintf.c
  * src/rtl/gttrm/Makefile
  * src/rtl/hbsocket.c
  * src/rtl/filesys.c
  * src/rtl/hbcom.c
  * config/global.mk
  - config/win/cygwin.mk
  + config/cygwin
  + config/cygwin/libs.mk
  + config/cygwin/gcc.mk
  + config/cygwin/global.mk
    + Applied cygwin patch from Tamas Tevesz.
      The goal is to migrate win/cygwin to cygwin/gcc, IOW to make cygwin
      a distinct platform (which is primarily unixy with option to access 
      winapi) as it should be.
      Changes made by me compared to original patch:
        - Fixed to HB_HOST_PLAT stay 'win'. Cygwin is not a host platform.
        - Fixed to set HB_COMPILER to gcc and HB_PLATFORM to cygwin when cygwin
          is detected on win platform.
        - Consequently some changes in global.mk could be dropped.
        - Deleted hbcom patches not related to cygwin.
        - Removed hbmk2 patch until we solve the 'plat $ 'cygwin' problem.
This commit is contained in:
Viktor Szakats
2010-10-29 08:24:01 +00:00
parent 1d88e6f2f5
commit df3b848bf6
16 changed files with 136 additions and 54 deletions

View File

@@ -16,6 +16,36 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-10-29 10:22 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/hb_io.h
* include/hbthread.h
* include/hbsetup.h
* src/vm/thread.c
* src/vm/dynlibhb.c
* src/common/hbgete.c
* src/common/hbprintf.c
* src/rtl/gttrm/Makefile
* src/rtl/hbsocket.c
* src/rtl/filesys.c
* src/rtl/hbcom.c
* config/global.mk
- config/win/cygwin.mk
+ config/cygwin
+ config/cygwin/libs.mk
+ config/cygwin/gcc.mk
+ config/cygwin/global.mk
+ Applied cygwin patch from Tamas Tevesz.
The goal is to migrate win/cygwin to cygwin/gcc, IOW to make cygwin
a distinct platform (which is primarily unixy with option to access
winapi) as it should be.
Changes made by me compared to original patch:
- Fixed to HB_HOST_PLAT stay 'win'. Cygwin is not a host platform.
- Fixed to set HB_COMPILER to gcc and HB_PLATFORM to cygwin when cygwin
is detected on win platform.
- Consequently some changes in global.mk could be dropped.
- Deleted hbcom patches not related to cygwin.
- Removed hbmk2 patch until we solve the 'plat $ 'cygwin' problem.
2010-10-29 09:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qtcore/hbqt_misc.prg
* Changed to not RTE when connecting to an already connected event.

View File

@@ -33,9 +33,9 @@ ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -g
endif
RC := $(HB_CCPATH)$(HB_CCPREFIX)windres
RC_OUT := -o$(subst x,x, )
RCFLAGS += -O coff
#RC := $(HB_CCPATH)$(HB_CCPREFIX)windres
#RC_OUT := -o$(subst x,x, )
#RCFLAGS += -O coff
ifneq ($(filter $(HB_BUILD_STRIP),all lib),)
ARSTRIP = && ${HB_CCPATH}${HB_CCPREFIX}strip -S $(LIB_DIR)/$@
@@ -48,15 +48,6 @@ endif
LD := $(CC)
LD_OUT := -o
ifneq ($(HB_HAS_PCRE),)
ifeq ($(HB_HAS_PCRE_LOCAL),)
SYSLIBS += pcre
endif
endif
ifeq ($(HB_HAS_ZLIB_LOCAL),)
SYSLIBS += z
endif
LIBPATHS := -L$(LIB_DIR)
LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib))

View File

@@ -0,0 +1,18 @@
#
# $Id$
#
all : first
BIN_EXT := .exe
DYN_EXT := .dll
HB_GT_LIBS += gttrm
ifneq ($(filter $(HB_BUILD_STRIP),all lib),)
ARSTRIP = && strip -S $(LIB_DIR)/$@
endif
ifneq ($(filter $(HB_BUILD_STRIP),all bin),)
LDSTRIP := -s
DYSTRIP := -s
endif

View File

@@ -0,0 +1,35 @@
#
# $Id$
#
SYSLIBPATHS :=
ifneq ($(HB_LINKING_RTL),)
ifeq ($(HB_LIBNAME_CURSES),)
HB_LIBNAME_CURSES := ncurses
endif
ifneq ($(HB_HAS_CURSES),)
SYSLIBS += $(HB_LIBNAME_CURSES)
endif
ifneq ($(HB_HAS_SLANG),)
SYSLIBS += slang
endif
ifneq ($(HB_HAS_X11),)
SYSLIBS += X11
endif
ifneq ($(HB_HAS_PCRE),)
ifeq ($(HB_HAS_PCRE_LOCAL),)
SYSLIBS += pcre
endif
endif
ifeq ($(HB_HAS_ZLIB_LOCAL),)
SYSLIBS += z
endif
SYSLIBS += rt dl
# Don't seem to be needed here, but added it for reference to move/copy it to *nix platforms where this is required
ifneq ($(HB_LINKING_VMMT),)
SYSLIBS += pthread
endif
endif
SYSLIBS += m

View File

@@ -774,7 +774,8 @@ ifeq ($(HB_COMPILER),)
endif
endif
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := cygwin
HB_COMPILER := gcc
HB_PLATFORM := cygwin
ifneq ($(wildcard $(dir $(HB_COMP_PATH))i686-pc-cygwin-gcc-3.4*),)
HB_COMPILER_VER := 34
endif
@@ -993,7 +994,7 @@ ifeq ($(HB_COMPILER),)
endif
endif
else
ifneq ($(filter $(HB_PLATFORM),hpux bsd beos qnx),)
ifneq ($(filter $(HB_PLATFORM),hpux bsd beos qnx cygwin),)
HB_COMP_PATH := $(call find_in_path,gcc)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := gcc
@@ -1131,17 +1132,22 @@ ifeq ($(HB_PLATFORM_UNIX),)
DYN_DIR := $(BIN_DIR)
IMP_DIR := $(LIB_DIR)
else
DYN_DIR := $(LIB_DIR)
IMP_DIR :=
ifeq ($(HB_LD_PATH_SET),)
ifneq ($(HB_SRC_ROOTPATH),)
export LD_LIBRARY_PATH := $(HB_SRC_ROOTPATH)lib/$(PLAT_COMP):$(LD_LIBRARY_PATH)
else
export LD_LIBRARY_PATH := $(abspath $(DYN_DIR)):$(LD_LIBRARY_PATH)
endif
export HB_LD_PATH_SET := yes
ifneq ($(LD_LIBRARY_PATH),)
$(info ! LD_LIBRARY_PATH: $(LD_LIBRARY_PATH))
ifeq ($(HB_PLATFORM),cygwin)
DYN_DIR := $(BIN_DIR)
IMP_DIR := $(LIB_DIR)
else
DYN_DIR := $(LIB_DIR)
IMP_DIR :=
ifeq ($(HB_LD_PATH_SET),)
ifneq ($(HB_SRC_ROOTPATH),)
export LD_LIBRARY_PATH := $(HB_SRC_ROOTPATH)lib/$(PLAT_COMP):$(LD_LIBRARY_PATH)
else
export LD_LIBRARY_PATH := $(abspath $(DYN_DIR)):$(LD_LIBRARY_PATH)
endif
export HB_LD_PATH_SET := yes
ifneq ($(LD_LIBRARY_PATH),)
$(info ! LD_LIBRARY_PATH: $(LD_LIBRARY_PATH))
endif
endif
endif
endif
@@ -1650,7 +1656,11 @@ ifneq ($(HB_INSTALL_PREFIX),)
ifeq ($(HB_PLATFORM_UNIX),)
export HB_INSTALL_DYN := $(HB_INSTALL_BIN)
else
export HB_INSTALL_DYN := $(HB_INSTALL_LIB)
ifeq ($(HB_PLATFORM),cygwin)
export HB_INSTALL_DYN := $(HB_INSTALL_BIN)
else
export HB_INSTALL_DYN := $(HB_INSTALL_LIB)
endif
endif
endif
# Standard name: INCLUDEDIR

View File

@@ -56,7 +56,7 @@
#if defined( HB_OS_UNIX ) || \
( defined( __GNUC__ ) && ! defined( __MINGW32__ ) )
#include <unistd.h>
#if defined( __DJGPP__ ) || defined( __CYGWIN__ ) || defined( __EMX__ )
#if defined( __DJGPP__ ) || defined( __EMX__ )
#include <io.h>
#endif
#elif !defined( HB_OS_WIN_CE )

View File

@@ -328,7 +328,7 @@
#endif
#ifndef HB_OS_WIN
#if defined( WINNT ) || defined( _Windows ) || defined( __NT__ ) || defined( _WIN32 ) || defined( _WINDOWS_ ) || defined( __WINDOWS_386__ ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
#if defined( WINNT ) || defined( _Windows ) || defined( __NT__ ) || defined( _WIN32 ) || defined( _WINDOWS_ ) || defined( __WINDOWS_386__ ) || defined( __WIN32__ )
#define HB_OS_WIN
#endif
#endif
@@ -410,6 +410,12 @@
#endif
#endif
#ifndef HB_OS_CYGWIN
#if defined( __CYGWIN__ )
#define HB_OS_CYGWIN
#endif
#endif
#ifndef HB_OS_UNIX
#if defined( HB_OS_LINUX ) || \
defined( HB_OS_DARWIN ) || \
@@ -419,7 +425,8 @@
defined( HB_OS_QNX ) || \
defined( HB_OS_VXWORKS ) || \
defined( HB_OS_BEOS ) || \
defined( HB_OS_SYMBIAN )
defined( HB_OS_SYMBIAN ) || \
defined( HB_OS_CYGWIN )
#define HB_OS_UNIX
#endif
#endif
@@ -455,7 +462,7 @@
#define HB_OS_PATH_DELIM_CHR_LIST "\\/:"
#define HB_OS_ALLFILE_MASK "*.*"
#define HB_OS_DRIVE_DELIM_CHR ':'
#if defined( HB_OS_WIN_CE ) || defined( __CYGWIN__ )
#if defined( HB_OS_WIN_CE )
#undef HB_OS_HAS_DRIVE_LETTER
#else
#define HB_OS_HAS_DRIVE_LETTER

View File

@@ -65,7 +65,7 @@
defined( HB_OS_SUNOS ) || defined( HB_OS_HPUX ) || \
defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \
defined( HB_OS_QNX ) || defined( HB_OS_VXWORKS ) || \
defined( HB_OS_SYMBIAN )
defined( HB_OS_SYMBIAN ) || defined( HB_OS_CYGWIN )
# include <pthread.h>
# define HB_PTHREAD_API
# if defined( HB_OS_VXWORKS )
@@ -185,11 +185,10 @@ HB_EXTERN_BEGIN
typedef CRITICAL_SECTION HB_RAWCRITICAL_T;
typedef HANDLE HB_OSCOND_T;
# if ( defined( HB_OS_WIN_CE ) && \
( ( defined( __MINGW32CE__ ) && !defined( __MSVCRT__ ) ) || \
defined( __POCC__ ) ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) ) ) || \
defined( __CYGWIN__ )
# if defined( HB_OS_WIN_CE ) && \
( ( defined( __MINGW32CE__ ) && !defined( __MSVCRT__ ) ) || \
defined( __POCC__ ) ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
# define HB_THREAD_RAWWINAPI
# endif

View File

@@ -216,7 +216,8 @@ HB_BOOL hb_setenv( const char * szName, const char * szValue )
defined( __WATCOMC__ ) || defined( __DJGPP__ ) || \
defined( HB_OS_SUNOS ) || defined( HB_OS_BSD ) || \
defined( HB_OS_DARWIN ) || defined( HB_OS_BEOS ) || \
defined( HB_OS_QNX ) || defined( HB_OS_VXWORKS )
defined( HB_OS_QNX ) || defined( HB_OS_VXWORKS ) || \
defined( HB_OS_CYGWIN )
if( szValue )
return setenv( szName, szValue, 1 ) == 0;

View File

@@ -163,7 +163,7 @@ optimized.
# define _MODFD( x, p ) modf( x, p )
# else
# define _x_long_dbl long double
# if defined( __WATCOMC__ ) || defined( __MINGW32CE__ ) || defined( __CYGWIN__ ) || \
# if defined( __WATCOMC__ ) || defined( __MINGW32CE__ ) || defined( HB_OS_CYGWIN ) || \
defined( HB_OS_BEOS ) || defined( HB_OS_IPHONE ) || defined( HB_OS_SYMBIAN ) || \
defined( __OpenBSD__ ) || defined( __NetBSD__ ) || defined( __DragonFly__ ) || \
( defined( HB_OS_WIN_CE ) && defined( __POCC__ ) )

View File

@@ -155,9 +155,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#if defined( __CYGWIN__ )
#include <io.h>
#elif defined( __DJGPP__ )
#if defined( __DJGPP__ )
#include <dir.h>
#include <utime.h>
#include <time.h>
@@ -899,7 +897,7 @@ int hb_fsSetDevMode( HB_FHANDLE hFileHandle, int iDevMode )
HB_TRACE(HB_TR_DEBUG, ("hb_fsSetDevMode(%p, %d)", ( void * ) ( HB_PTRDIFF ) hFileHandle, iDevMode));
#if defined( __BORLANDC__ ) || defined( __IBMCPP__ ) || defined( __DJGPP__ ) || \
defined( __CYGWIN__ ) || defined( __WATCOMC__ ) || defined( HB_OS_OS2 )
defined( __WATCOMC__ ) || defined( HB_OS_OS2 )
{
int iRet = -1;

View File

@@ -24,9 +24,6 @@ endif
ifeq ($(HB_PLATFORM),os2)
HB_SUPPORTED := no
endif
ifeq ($(HB_COMPILER),cygwin)
HB_SUPPORTED := yes
endif
ifeq ($(HB_COMPILER),djgpp)
HB_SUPPORTED := yes
endif

View File

@@ -189,7 +189,7 @@ static const char * hb_comGetName( PHB_COM pCom, char * buffer, int size )
hb_snprintf( buffer, size, "/dev/tty%02d", pCom->port );
# elif defined( HB_OS_DARWIN )
hb_snprintf( buffer, size, "/dev/cuaa%d", pCom->port - 1 );
# else /* defined( HB_OS_LINUX ) || ... */
# else /* defined( HB_OS_LINUX ) || defined( HB_OS_CYGWIN ) || ... */
hb_snprintf( buffer, size, "/dev/ttyS%d", pCom->port - 1 );
# endif
/* other OS-es:

View File

@@ -114,7 +114,7 @@
# define _XOPEN_SOURCE_EXTENDED
#endif
#if defined( HB_OS_UNIX ) && ! defined( __CYGWIN__ )
#if defined( HB_OS_UNIX )
# define HB_HAS_UNIX
# if !defined( __WATCOMC__ )
# define HB_HAS_INET_ATON
@@ -186,7 +186,7 @@
#endif
#if defined( HB_OS_WIN ) && ! defined( __CYGWIN__ )
#if defined( HB_OS_WIN )
# include <winsock2.h>
# include <ws2tcpip.h>
#else
@@ -236,10 +236,6 @@
# endif
#endif
#if defined( __CYGWIN__ )
#undef HB_OS_WIN
#endif
#if defined( HB_OS_OS2 ) || defined( HB_OS_WIN ) || defined( HB_OS_DOS ) || \
defined( HB_OS_VXWORKS )
# define socklen_t int

View File

@@ -82,7 +82,7 @@
( ( defined( HB_OS_LINUX ) && !defined( __WATCOMC__ ) ) || \
defined( HB_OS_SUNOS ) || defined( HB_OS_DARWIN ) || \
defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \
defined( HB_OS_QNX ) || \
defined( HB_OS_QNX ) || defined( HB_OS_CYGWIN ) || \
( defined( __DJGPP__ ) && \
( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) )
# define HB_HAS_DLFCN

View File

@@ -252,7 +252,7 @@ void hb_threadReleaseCPU( void )
hb_taskSleep( 20 );
#elif defined( HB_OS_WIN ) || defined( __CYGWIN__ )
#elif defined( HB_OS_WIN )
/* Forfeit the remainder of the current time slice. */
Sleep( 20 );