20000501-17:42 GMT+1 Victor Szakats <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
2000-05-01 15:48:24 +00:00
parent 778c316fa5
commit d2a2b542ea
8 changed files with 213 additions and 141 deletions

View File

@@ -1,3 +1,22 @@
20000501-17:42 GMT+1 Victor Szakats <info@szelvesz.hu>
* source/vm/cmdarg.c
* source/common/hbver.c
* include/hbcomp.h
* source/compiler/harbour.c
* source/compiler/cmdcheck.c
+ Added /BUILD option for the compiler.
This option will now also print the platform and Harbour versions.
! Fixed check for /CREDIT switch.
* source/compiler/hbgenerr.c
* Some small cleanups on the error texts.
* makefile.bc
- Removed duplicated and Borland only default language selection.
This feature is already built in to HBSETUP.H, so there's no
point to duplicate it. Or I'm missing something obvious.
20000501-16:08 GMT+1 Victor Szakats <info@szelvesz.hu>
* include/hbpcode.h

View File

@@ -339,6 +339,7 @@ extern char * hb_comp_szAnnounce;
extern PHB_FNAME hb_comp_pOutPath;
extern BOOL hb_comp_bCredits;
extern BOOL hb_comp_bBuildInfo;
extern BOOL hb_comp_bLogo;
extern BOOL hb_comp_bSyntaxCheckOnly;
extern int hb_comp_iLanguage;

View File

@@ -59,9 +59,7 @@ ARFLAGS = /P32
!if !$d(BCC_NOOPTIM)
CFLAGS = -O2 $(CFLAGS)
!endif
!if !$d(HB_LANG_DEFAULT)
HB_LANG_DEFAULT=EN
!endif
#
# Directory macros. These should never have to change.
#
@@ -85,7 +83,7 @@ HBPP_DIR = utils\hbpp
# C compiler definition and C flags. These should never have to change.
#
CFLAGS = -I$(INCLUDE_DIR) -d $(C_USR) $(CFLAGS) -DHB_LANG_DEFAULT=$(HB_LANG_DEFAULT)
CFLAGS = -I$(INCLUDE_DIR) -d $(C_USR) $(CFLAGS)
CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS)
CLIBFLAGSDEBUG = -v $(CLIBFLAGS)
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)

View File

@@ -395,3 +395,143 @@ char * hb_verHarbour( void )
return pszVersion;
}
void hb_verBuildInfo( void )
{
hb_conOutErr( "Harbour Build Info", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "---------------------------", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
{
char * pszVersion = hb_verHarbour();
hb_conOutErr( "Version: ", 0 );
hb_conOutErr( pszVersion, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_xfree( pszVersion );
}
{
char * pszVersion = hb_verPlatform();
hb_conOutErr( "Platform: ", 0 );
hb_conOutErr( pszVersion, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_xfree( pszVersion );
}
{
char * pszVersion = hb_verCompiler();
hb_conOutErr( "Compiler: ", 0 );
hb_conOutErr( pszVersion, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_xfree( pszVersion );
}
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Harbour extensions: ", 0 );
#if defined( HB_EXTENSION )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.2e undocumented: ", 0 );
#if defined( HB_C52_UNDOC )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.2e strict compatibility: ", 0 );
#if defined( HB_C52_STRICT )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.3x compatible extensions: ", 0 );
#if defined( HB_COMPAT_C53 )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Alaska Xbase++ compatible extensions: ", 0 );
#if defined( HB_COMPAT_XPP )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Visual Objects compatible extensions: ", 0 );
#if defined( HB_COMPAT_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Multisoft Flagship compatible extensions: ", 0 );
#if defined( HB_FLAGSHIP_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Microsoft FoxPro compatible extensions: ", 0 );
#if defined( HB_FOXPRO_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "dBase compatible extensions: ", 0 );
#if defined( HB_DBASE_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Object file generation support: ", 0 );
#if defined( HARBOUR_OBJ_GENERATION )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "ANSI C usage: ", 0 );
#if defined( HARBOUR_STRICT_ANSI_C )
hb_conOutErr( "Strict", 0 );
#else
hb_conOutErr( "Non strict", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Compiler YACC debug mode: ", 0 );
#if defined( HARBOUR_YYDEBUG )
hb_conOutErr( "On", 0 );
#else
hb_conOutErr( "Off", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
{
char buffer[ 64 ];
sprintf( buffer, "Maximum symbol name length: %i", HB_SYMBOL_NAME_LEN );
hb_conOutErr( buffer, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
}
hb_conOutErr( "---------------------------", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
}

View File

@@ -194,30 +194,43 @@ void hb_compChkEnvironVar( char * szSwitch )
case 'b':
case 'B':
hb_comp_bDebugInfo = TRUE;
hb_comp_bLineNumbers = TRUE;
{
unsigned int i = 0;
char * szOption = hb_strupr( hb_strdup( s ) );
while( i < strlen( szOption ) && !HB_ISOPTSEP( szOption[ i ] ) )
i++;
szOption[ i ] = '\0';
if( strcmp( szOption, "BUILD" ) == 0 )
hb_comp_bBuildInfo = TRUE;
else
{
hb_comp_bDebugInfo = TRUE;
hb_comp_bLineNumbers = TRUE;
}
free( szOption );
}
break;
case 'c':
case 'C':
{
unsigned int i = 0;
char * szCredits = hb_strupr( hb_strdup( s ) );
while( i < strlen( szCredits ) && !HB_ISOPTSEP( szCredits[ i ] ) )
char * szOption = hb_strupr( hb_strdup( s ) );
while( i < strlen( szOption ) && !HB_ISOPTSEP( szOption[ i ] ) )
i++;
szCredits[ i ] = '\0';
szOption[ i ] = '\0';
if( strcmp( szCredits, "CREDITS" ) ||
strcmp( szCredits, "CREDIT" ) ||
strcmp( szCredits, "CREDI" ) ||
strcmp( szCredits, "CRED" ) )
{
if( strcmp( szOption, "CREDITS" ) == 0 ||
strcmp( szOption, "CREDIT" ) == 0 ||
strcmp( szOption, "CREDI" ) == 0 ||
strcmp( szOption, "CRED" ) == 0 )
hb_comp_bCredits = TRUE;
}
else
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, szCredits, NULL );
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, szOption, NULL );
free( szCredits );
free( szOption );
}
break;

View File

@@ -111,6 +111,7 @@ int hb_comp_iStaticCnt; /* number of defined stat
int hb_comp_iVarScope; /* holds the scope for next variables to be defined */
PHB_FNAME hb_comp_pOutPath = NULL;
BOOL hb_comp_bCredits = FALSE; /* print credits */
BOOL hb_comp_bBuildInfo = FALSE; /* print build info */
BOOL hb_comp_bLogo = TRUE; /* print logo */
BOOL hb_comp_bSyntaxCheckOnly = FALSE; /* syntax check only */
int hb_comp_iLanguage = LANG_C; /* default Harbour generated output language */
@@ -153,6 +154,13 @@ int main( int argc, char * argv[] )
if( hb_comp_bLogo )
hb_compPrintLogo();
if( hb_comp_bBuildInfo )
{
printf( "\n" );
hb_verBuildInfo();
return iStatus;
}
if( hb_comp_bCredits )
{
hb_compPrintCredits();
@@ -374,6 +382,18 @@ void hb_xfree( void * pMem ) /* frees fixed memory */
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_MEMFREE, NULL, NULL );
}
void hb_conOutErr( char * pStr, ULONG ulLen )
{
HB_SYMBOL_UNUSED( ulLen );
printf( pStr );
}
char * hb_conNewLine( void )
{
return "\n";
}
/* ------------------------------------------------------------------------- */
/** ACTIONS **/
/* ------------------------------------------------------------------------- */

View File

@@ -64,8 +64,8 @@ char * hb_comp_szErrors[] =
"Formal parameters already declared",
"Invalid %s from within of SEQUENCE code",
"Unterminated array index",
"Could not allocate [%s] bytes",
"Could not re-allocate [%s] bytes",
"Could not allocate %s byte(s)",
"Could not reallocate %s byte(s)",
"Freeing a NULL memory pointer",
"Syntax error: \"%s at \'%s\'\"",
"Jump offset too long",
@@ -102,8 +102,8 @@ char * hb_comp_szWarnings[] =
"3Incompatible operand type: \'%s\' expected: \'%s\'",
"3Incompatible operand types: \'%s\' and: \'%s\'",
"3Suspicious type in assignment to: \'%s\' expected: \'%s\'",
"3Suspicious operand type: \'UnKnown\' expected: \'%s\'",
"3Can\'t use array index with NON Array",
"3Suspicious operand type: \'unknown\' expected: \'%s\'",
"3Can\'t use array index with non-array",
"3Incompatible return value: \'%s\' expected: \'%s\'",
"3Invalid number of parameters: \'%s\' expected: \'%s\'",
"3Incompatible parameter # %s expected: \'%s\'",

View File

@@ -282,125 +282,6 @@ void hb_cmdargProcessVM( void )
}
if( hb_cmdargCheck( "BUILD" ) )
{
hb_conOutErr( "Harbour Compiler Build Info", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "---------------------------", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
{
char * pszVersion = hb_verCompiler();
hb_conOutErr( "Compiler: ", 0 );
hb_conOutErr( pszVersion, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
hb_xfree( pszVersion );
}
hb_conOutErr( "Harbour extensions: ", 0 );
#if defined( HB_EXTENSION )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.2e undocumented: ", 0 );
#if defined( HB_C52_UNDOC )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.2e strict compatibility: ", 0 );
#if defined( HB_C52_STRICT )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Clipper 5.3x compatible extensions: ", 0 );
#if defined( HB_COMPAT_C53 )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Alaska Xbase++ compatible extensions: ", 0 );
#if defined( HB_COMPAT_XPP )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "CA-Visual Objects compatible extensions: ", 0 );
#if defined( HB_COMPAT_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Multisoft Flagship compatible extensions: ", 0 );
#if defined( HB_FLAGSHIP_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Microsoft FoxPro compatible extensions: ", 0 );
#if defined( HB_FOXPRO_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "dBase compatible extensions: ", 0 );
#if defined( HB_DBASE_VO )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Object file generation support: ", 0 );
#if defined( HARBOUR_OBJ_GENERATION )
hb_conOutErr( "Yes", 0 );
#else
hb_conOutErr( "No", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "ANSI C usage: ", 0 );
#if defined( HARBOUR_STRICT_ANSI_C )
hb_conOutErr( "Strict", 0 );
#else
hb_conOutErr( "Non strict", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Compiler YACC debug mode: ", 0 );
#if defined( HARBOUR_YYDEBUG )
hb_conOutErr( "On", 0 );
#else
hb_conOutErr( "Off", 0 );
#endif
hb_conOutErr( hb_conNewLine(), 0 );
{
char buffer[ 64 ];
sprintf( buffer, "Maximum symbol name length: %i", HB_SYMBOL_NAME_LEN );
hb_conOutErr( buffer, 0 );
hb_conOutErr( hb_conNewLine(), 0 );
}
hb_conOutErr( "---------------------------", 0 );
hb_conOutErr( hb_conNewLine(), 0 );
}
hb_verBuildInfo();
}