2010-11-05 00:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* config/cygwin/gcc.mk
  * include/hbwmain.c
  * src/vm/Makefile
  * src/vm/mainwin.c
  * src/vm/hvm.c
  * src/vm/cmdarg.c
  * src/vm/mainstd.c
  * utils/hbmk2/hbmk2.prg
    + Finalizing cygwin/gcc entry point.
    ; Patch by Tamas.
    + Added hbmainstd for shared cygwin/gcc builds.

  * utils/hbrun/hbrun.hbp
    + Enabled header inclusion also in hbmk2 make file.
This commit is contained in:
Viktor Szakats
2010-11-04 23:59:06 +00:00
parent 47952c23b3
commit 97bc5b9ea3
9 changed files with 49 additions and 54 deletions

View File

@@ -16,6 +16,22 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-11-05 00:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* config/cygwin/gcc.mk
* include/hbwmain.c
* src/vm/Makefile
* src/vm/mainwin.c
* src/vm/hvm.c
* src/vm/cmdarg.c
* src/vm/mainstd.c
* utils/hbmk2/hbmk2.prg
+ Finalizing cygwin/gcc entry point.
; Patch by Tamas.
+ Added hbmainstd for shared cygwin/gcc builds.
* utils/hbrun/hbrun.hbp
+ Enabled header inclusion also in hbmk2 make file.
2010-11-04 22:44 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/hbjson.c
* src/rtl/hblpp.c

View File

@@ -51,6 +51,13 @@ LD_OUT := -o
LIBPATHS := -L$(LIB_DIR)
LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib))
# Add the standard C entry
ifneq ($(HB_LINKING_RTL),)
ifeq ($(HB_MAIN),)
LDLIBS += -lhbmainstd
endif
endif
LDFLAGS += $(LIBPATHS)
AR := $(HB_CCPATH)$(HB_CCPREFIX)ar

View File

@@ -63,7 +63,7 @@ static char * s_argv[ HB_MAX_ARGS ];
# define HB_LPSTR LPSTR
#endif
#if defined( HB_VM_STARTUP ) && !defined( HB_OS_CYGWIN )
#if defined( HB_VM_STARTUP )
extern void hb_winmainArgInit( HANDLE hInstance, HANDLE hPrevInstance, int iCmdShow ); /* Set WinMain() parameters */
#endif
@@ -131,15 +131,7 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */
#endif
#if defined( HB_VM_STARTUP )
#if !defined( HB_OS_CYGWIN )
hb_winmainArgInit( hInstance, hPrevInstance, iCmdShow );
#else
HB_SYMBOL_UNUSED( hInstance );
HB_SYMBOL_UNUSED( hPrevInstance );
HB_SYMBOL_UNUSED( iCmdShow );
#endif
hb_winmainArgInit( hInstance, hPrevInstance, iCmdShow );
hb_cmdargInit( s_argc, s_argv );
hb_vmInit( HB_TRUE );

View File

@@ -46,22 +46,22 @@ ifeq ($(HB_PLATFORM),win)
DIRS := mainstd mainwin maindllh maindllp
else
ifeq ($(HB_PLATFORM),cygwin)
C_MAIN := mainstd.c
DIRS := mainstd maindllh maindllp
else
ifeq ($(HB_PLATFORM),wce)
C_MAIN := mainwin.c
DIRS := mainstd mainwin maindllh maindllp
else
ifeq ($(HB_PLATFORM),wce)
C_MAIN := mainwin.c
DIRS := mainstd mainwin maindllh maindllp
ifeq ($(HB_PLATFORM),os2)
C_MAIN := mainstd.c
DIRS := mainstd maindllh
else
ifeq ($(HB_PLATFORM),os2)
C_MAIN := mainstd.c
DIRS := mainstd maindllh
else
C_MAIN := main.c
endif
C_MAIN := main.c
endif
endif
endif
endif
ifeq ($(HB_HVM_ALL),yes)

View File

@@ -68,28 +68,18 @@
#include <os2.h>
#endif
#if defined( HB_OS_CYGWIN )
#include <sys/cygwin.h>
#endif
#if defined( HB_OS_WIN ) || defined( HB_OS_CYGWIN )
#include <windows.h>
#endif
/* Command line argument management */
static int s_argc = 0;
static char ** s_argv = NULL;
#if !defined( HB_OS_WIN )
static char s_szAppName[ HB_PATH_MAX ];
#if defined( HB_OS_CYGWIN )
static char s_lpAppName[ MAX_PATH ];
#endif
static char s_szAppName[ HB_PATH_MAX ];
#else
#include <windows.h>
static char s_szAppName[ MAX_PATH ];
static TCHAR s_lpAppName[ MAX_PATH ];
@@ -157,30 +147,16 @@ void hb_cmdargUpdate( void )
if( s_argc > 0 )
{
#if defined( HB_OS_WIN ) || defined( HB_OS_CYGWIN )
#if defined( HB_OS_WIN )
/* NOTE: Manually setup the executable name in Windows,
because in console apps the name may be truncated
in some cases, and in GUI apps it's not filled
at all. [vszakats] */
if( GetModuleFileName( NULL, s_lpAppName, HB_SIZEOFARRAY( s_lpAppName ) ) != 0 )
{
#if defined( HB_OS_WIN )
HB_TCHAR_COPYFROM( s_szAppName, s_lpAppName, HB_SIZEOFARRAY( s_szAppName ) - 1 );
s_argv[ 0 ] = s_szAppName;
#else /* HB_OS_CYGWIN */
ssize_t pathlen;
pathlen = cygwin_conv_path( CCP_WIN_A_TO_POSIX|CCP_ABSOLUTE, s_lpAppName, NULL, 0 );
if( pathlen > 0 &&
pathlen <= HB_SIZEOFARRAY( s_szAppName ) &&
cygwin_conv_path( CCP_WIN_A_TO_POSIX|CCP_ABSOLUTE, s_lpAppName, s_szAppName,
HB_SIZEOFARRAY( s_szAppName ) ) != -1 )
s_argv[ 0 ] = s_szAppName;
#endif
}
#elif defined( HB_OS_OS2 )

View File

@@ -11915,9 +11915,8 @@ HB_LANG_REQUEST( HB_LANG_DEFAULT )
#undef HB_FORCE_LINK_MAIN
#if ( !defined( HB_DYNLIB ) && defined( HB_OS_WIN ) && \
( defined( __DMC__ ) || defined( __WATCOMC__ ) || defined( __MINGW32__ ) ) ) || \
defined( HB_OS_CYGWIN )
#if !defined( HB_DYNLIB ) && defined( HB_OS_WIN ) && \
( defined( __DMC__ ) || defined( __WATCOMC__ ) || defined( __MINGW32__ ) )
# define HB_FORCE_LINK_MAIN hb_forceLinkMainWin

View File

@@ -55,13 +55,12 @@
#if !( defined( HB_DYNLIB ) && defined( __WATCOMC__ ) )
#if defined( HB_OS_WIN ) || defined( HB_OS_CYGWIN )
#if defined( HB_OS_WIN )
#define HB_VM_STARTUP
#include "hbwmain.c"
#if ( !defined( HB_DYNLIB ) && ( defined( __DMC__ ) || defined( __WATCOMC__ ) || defined( __MINGW32__ ) ) ) || \
defined( HB_OS_CYGWIN )
#if !defined( HB_DYNLIB ) && ( defined( __DMC__ ) || defined( __WATCOMC__ ) || defined( __MINGW32__ ) )
HB_EXTERN_BEGIN
void hb_forceLinkMainWin( void ) {}
HB_EXTERN_END

View File

@@ -3337,6 +3337,10 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/local/lib" )
ENDIF
IF hbmk[ _HBMK_cPLAT ] == "cygwin"
l_aLIBSHAREDPOST := { "hbmainstd" }
ENDIF
CASE ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ;
( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "mingw" ) .OR. ;
( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "mingw64" ) .OR. ;

View File

@@ -4,6 +4,8 @@
-q0 -w3 -es2 -kmo -l
-DHBRUN_WITH_HEADERS
-ldflag={allmsvc}-nxcompat
-ldflag={allmsvc}-dynamicbase
-ldflag={allmsvc}-fixed:no