From 8dd8acc035c080fe894b74923eb1af4c08640d58 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 19 Jan 2015 14:51:21 +0100 Subject: [PATCH] WIP recipe for OpenWatcom 2 --- sys-devel/openwatcom/openwatcom-1.9.0.recipe | 4 +- sys-devel/openwatcom/openwatcom-2.0.0.recipe | 49 + .../patches/openwatcom-2.0.0.patchset | 855 ++++++++++++++++++ 3 files changed, 906 insertions(+), 2 deletions(-) create mode 100644 sys-devel/openwatcom/openwatcom-2.0.0.recipe create mode 100644 sys-devel/openwatcom/patches/openwatcom-2.0.0.patchset diff --git a/sys-devel/openwatcom/openwatcom-1.9.0.recipe b/sys-devel/openwatcom/openwatcom-1.9.0.recipe index 784ab4f95..f501bccd7 100644 --- a/sys-devel/openwatcom/openwatcom-1.9.0.recipe +++ b/sys-devel/openwatcom/openwatcom-1.9.0.recipe @@ -13,9 +13,9 @@ ARCHITECTURES="" if [ $effectiveTargetArchitecture != x86_gcc2 ]; then # x86_gcc2 is fine as primary target architecture as long as we're building # for a different secondary architecture. - ARCHITECTURES="$ARCHITECTURES !x86_gcc2" + ARCHITECTURES="$ARCHITECTURES x86_gcc2" fi -SECONDARY_ARCHITECTURES="!x86" +SECONDARY_ARCHITECTURES="x86" SRC_URI="ftp://ftp.openwatcom.org/source/open_watcom_$portVersion-src.tar.bz2" CHECKSUM_SHA256="6d303327988ee2dda60cfabebf3f45a9758aee4da117d41cf3153fccb7e5e4bf" diff --git a/sys-devel/openwatcom/openwatcom-2.0.0.recipe b/sys-devel/openwatcom/openwatcom-2.0.0.recipe new file mode 100644 index 000000000..014681a49 --- /dev/null +++ b/sys-devel/openwatcom/openwatcom-2.0.0.recipe @@ -0,0 +1,49 @@ +SUMMARY="C/C++ compiler targetting DOS and Win16/32 machines" +DESCRIPTION=" +Open Watcom is a project of the open source community to maintain and enhance \ +the Watcom C, C++, and Fortran cross compilers and tools. An Open Source \ +license from Sybase allows free commercial and non-commercial use of Open\ +Watcom." +HOMEPAGE="https://github.com/open-watcom/open-watcom-v2" +LICENSE="Open Watcom Public Licence v1.0" +COPYRIGHT="Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved." +REVISION="1" + +ARCHITECTURES="" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +SRC_URI="git@github.com:open-watcom/open-watcom-v2.git#7d23ba88ff2a81660b2a48e4b73d2fcbcb36b837" +PATCHES="openwatcom-$portVersion.patchset" + +PROVIDES=" + openwatcom$secondaryArchSuffix = $portVersion +" + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:awk + cmd:cc$secondaryArchSuffix + cmd:make + cmd:which +" + +BUILD() +{ + . ./setvars.sh + ./build.sh +} + +INSTALL() +{ + false +} + +TEST() +{ + false +} diff --git a/sys-devel/openwatcom/patches/openwatcom-2.0.0.patchset b/sys-devel/openwatcom/patches/openwatcom-2.0.0.patchset new file mode 100644 index 000000000..75452c70d --- /dev/null +++ b/sys-devel/openwatcom/patches/openwatcom-2.0.0.patchset @@ -0,0 +1,855 @@ +From d7a38595716dc02a6cc991acc3c1d4b700c15632 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 12:57:37 +0200 +Subject: let wasm know about Haiku. + + +diff --git a/bld/wasm/c/main.c b/bld/wasm/c/main.c +index 6fbcd0b..424341b 100644 +--- a/bld/wasm/c/main.c ++++ b/bld/wasm/c/main.c +@@ -1065,6 +1065,8 @@ static bool set_build_target( void ) + SetTargName( "QNX", 3 ); + #elif defined(__LINUX__) + SetTargName( "LINUX", 5 ); ++#elif defined(__HAIKU__) ++ SetTargName( "HAIKU", 5 ); + #elif defined(__BSD__) + SetTargName( "BSD", 3 ); + #elif defined(__OSX__) || defined(__APPLE__) +-- +1.8.3.4 + + +From 48aeab747fe564d9ddc88f712707cc60650cdb67 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 18:54:26 +0200 +Subject: Rename sched.h to avoid conflict with haiku headers. + + +diff --git a/bld/cg/c/dumpschd.c b/bld/cg/c/dumpschd.c +index 63d486c..9ec4504 100644 +--- a/bld/cg/c/dumpschd.c ++++ b/bld/cg/c/dumpschd.c +@@ -38,7 +38,7 @@ + #include "memout.h" + #include "procdef.h" + #include "freelist.h" +-#include "sched.h" ++#include "inssched.h" + #include "dumpio.h" + + extern void DumpIns(instruction *); +diff --git a/bld/cg/c/inssched.c b/bld/cg/c/inssched.c +index dce35bd..3cb288e 100644 +--- a/bld/cg/c/inssched.c ++++ b/bld/cg/c/inssched.c +@@ -36,7 +36,7 @@ + #include "spawn.h" + #include "memout.h" + #include "freelist.h" +-#include "sched.h" ++#include "inssched.h" + #include "zoiks.h" + #include "data.h" + #include "x87.h" +diff --git a/bld/cg/h/inssched.h b/bld/cg/h/inssched.h +new file mode 100644 +index 0000000..f44a87a +--- /dev/null ++++ b/bld/cg/h/inssched.h +@@ -0,0 +1,54 @@ ++/**************************************************************************** ++* ++* Open Watcom Project ++* ++* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. ++* ++* ======================================================================== ++* ++* This file contains Original Code and/or Modifications of Original ++* Code as defined in and that are subject to the Sybase Open Watcom ++* Public License version 1.0 (the 'License'). You may not use this file ++* except in compliance with the License. BY USING THIS FILE YOU AGREE TO ++* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is ++* provided with the Original Code and Modifications, and is also ++* available at www.sybase.com/developer/opensource. ++* ++* The Original Code and all software distributed under the License are ++* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER ++* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM ++* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF ++* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR ++* NON-INFRINGEMENT. Please see the License for the specific language ++* governing rights and limitations under the License. ++* ++* ======================================================================== ++* ++* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE ++* DESCRIBE IT HERE! ++* ++****************************************************************************/ ++ ++ ++typedef struct FU_entry { ++ unsigned short good_fu; ++ byte unit_stall; ++ byte opnd_stall; ++} FU_entry; ++ ++typedef struct data_dag { ++ struct data_dag *prev; ++ instruction *ins; ++ struct dep_list_entry *deps; ++ struct data_dag *ready; ++ unsigned stallable : 8; ++ unsigned visited : 1; ++ unsigned scheduled : 1; ++ instruction_id height; ++ instruction_id anc_count; ++} data_dag; ++ ++typedef struct dep_list_entry { ++ struct dep_list_entry *next; ++ data_dag *dep; ++} dep_list_entry; +diff --git a/bld/cg/h/sched.h b/bld/cg/h/sched.h +deleted file mode 100644 +index f44a87a..0000000 +--- a/bld/cg/h/sched.h ++++ /dev/null +@@ -1,54 +0,0 @@ +-/**************************************************************************** +-* +-* Open Watcom Project +-* +-* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. +-* +-* ======================================================================== +-* +-* This file contains Original Code and/or Modifications of Original +-* Code as defined in and that are subject to the Sybase Open Watcom +-* Public License version 1.0 (the 'License'). You may not use this file +-* except in compliance with the License. BY USING THIS FILE YOU AGREE TO +-* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is +-* provided with the Original Code and Modifications, and is also +-* available at www.sybase.com/developer/opensource. +-* +-* The Original Code and all software distributed under the License are +-* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +-* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM +-* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF +-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR +-* NON-INFRINGEMENT. Please see the License for the specific language +-* governing rights and limitations under the License. +-* +-* ======================================================================== +-* +-* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE +-* DESCRIBE IT HERE! +-* +-****************************************************************************/ +- +- +-typedef struct FU_entry { +- unsigned short good_fu; +- byte unit_stall; +- byte opnd_stall; +-} FU_entry; +- +-typedef struct data_dag { +- struct data_dag *prev; +- instruction *ins; +- struct dep_list_entry *deps; +- struct data_dag *ready; +- unsigned stallable : 8; +- unsigned visited : 1; +- unsigned scheduled : 1; +- instruction_id height; +- instruction_id anc_count; +-} data_dag; +- +-typedef struct dep_list_entry { +- struct dep_list_entry *next; +- data_dag *dep; +-} dep_list_entry; +diff --git a/bld/cg/intel/c/386funit.c b/bld/cg/intel/c/386funit.c +index 3761e0f..e6b9bb5 100644 +--- a/bld/cg/intel/c/386funit.c ++++ b/bld/cg/intel/c/386funit.c +@@ -34,7 +34,7 @@ + #include "coderep.h" + #include "indvars.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + + enum { + F_NONE = 0x0000, +diff --git a/bld/cg/risc/axp/c/axpfunit.c b/bld/cg/risc/axp/c/axpfunit.c +index c4541f5..3f15bb4 100644 +--- a/bld/cg/risc/axp/c/axpfunit.c ++++ b/bld/cg/risc/axp/c/axpfunit.c +@@ -34,7 +34,7 @@ + #include "coderep.h" + #include "indvars.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + + enum { + F_NONE = 0x0000, +diff --git a/bld/cg/risc/mps/c/mpsfunit.c b/bld/cg/risc/mps/c/mpsfunit.c +index 6474dbd..d23f170 100644 +--- a/bld/cg/risc/mps/c/mpsfunit.c ++++ b/bld/cg/risc/mps/c/mpsfunit.c +@@ -33,7 +33,7 @@ + #include "coderep.h" + #include "indvars.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + + enum { + F_NONE = 0x0000, +diff --git a/bld/cg/risc/ppc/c/ppcfunit.c b/bld/cg/risc/ppc/c/ppcfunit.c +index 732f73b..1365b02 100644 +--- a/bld/cg/risc/ppc/c/ppcfunit.c ++++ b/bld/cg/risc/ppc/c/ppcfunit.c +@@ -34,7 +34,7 @@ + #include "coderep.h" + #include "indvars.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + + enum { + F_NONE = 0x0000, +diff --git a/bld/cg/s37/c/s37funit.c b/bld/cg/s37/c/s37funit.c +index 658ad95..15c7e6a 100644 +--- a/bld/cg/s37/c/s37funit.c ++++ b/bld/cg/s37/c/s37funit.c +@@ -35,7 +35,7 @@ + #include "indvars.h" + #include "opcodes.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + #include "funits.h" + #include "pattern.h" + +-- +1.8.3.4 + + +From 4e304b0ff86d62f71615cc5dc7d61f4ddd5ebc6c Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 18:56:03 +0200 +Subject: Implement cmdname for haiku. + +The default implementation can't work when /proc is not available, +because it then fallbacks to _argv but is called before that is +initialised (eg in wlink). + +diff --git a/bld/watcom/c/clibext.c b/bld/watcom/c/clibext.c +index 9eec4d6..26d8f20 100644 +--- a/bld/watcom/c/clibext.c ++++ b/bld/watcom/c/clibext.c +@@ -1264,6 +1264,17 @@ char *_cmdname( char *name ) + return( name ); + } + ++#elif defined (__HAIKU__) ++ ++#include ++ ++char *_cmdname( char *name ) ++{ ++ image_info info; ++ get_image_info( 0, &info ); ++ return( strcpy( name, info.name ) ); ++} ++ + #elif defined( __UNIX__ ) + + char *_cmdname( char *name ) +-- +1.8.3.4 + + +From 31f32a11b8b69fe294a35c9a08fe880baabc4e56 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 18:58:53 +0200 +Subject: Let cc know about Haiku. + + +diff --git a/bld/cc/c/coptions.c b/bld/cc/c/coptions.c +index f0e9f41..8fbe651 100644 +--- a/bld/cc/c/coptions.c ++++ b/bld/cc/c/coptions.c +@@ -282,6 +282,8 @@ local void SetTargSystem( void ) + _SetConstTarg( "qnx" ); + #elif defined( __LINUX__ ) + _SetConstTarg( "linux" ); ++ #elif defined( __HAIKU__ ) ++ _SetConstTarg( "haiku" ); + #elif defined( __SOLARIS__ ) || defined( __sun__ ) + _SetConstTarg( "solaris" ); + #elif defined( __OSX__ ) || defined( __APPLE__ ) +-- +1.8.3.4 + + +From 274e3144905cb02dbafa193b79bb596ba67c9fa4 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 19:39:16 +0200 +Subject: Replace "local" with "static". + + +diff --git a/bld/cc/c/cexpr.c b/bld/cc/c/cexpr.c +index 9cbb2cf..2333caf 100644 +--- a/bld/cc/c/cexpr.c ++++ b/bld/cc/c/cexpr.c +@@ -50,26 +50,26 @@ struct mathfuncs { + { NULL, 0, 0 } + }; + +-local TREEPTR GenNextParm(TREEPTR,TYPEPTR **); +-local TREEPTR StartFunc(TREEPTR,TYPEPTR **); +-local TREEPTR GetExpr(void); +-local TREEPTR ExprId(void); +-local TREEPTR ExprOpnd(void); +-local TREEPTR SizeofOp(TYPEPTR); +-local TREEPTR ScalarExpr(TREEPTR); +-local TREEPTR UnaryPlus(TREEPTR); +-local TREEPTR TernOp(TREEPTR,TREEPTR,TREEPTR); +-local TREEPTR ColonOp(TREEPTR); +-local TREEPTR StartTernary(TREEPTR); +-local TREEPTR NotOp(TREEPTR); +-local TREEPTR AndAnd(TREEPTR); +-local TREEPTR OrOr(TREEPTR); +-local TREEPTR GenFuncCall(TREEPTR); +-local TREEPTR IndexOp(TREEPTR,TREEPTR); +-local TREEPTR SegOp(TREEPTR,TREEPTR); +-local void PopNestedParms( TYPEPTR **plistptr ); +-local void IncSymWeight( SYMPTR sym ); +-local void AddCallNode( TREEPTR tree ); ++static TREEPTR GenNextParm(TREEPTR,TYPEPTR **); ++static TREEPTR StartFunc(TREEPTR,TYPEPTR **); ++static TREEPTR GetExpr(void); ++static TREEPTR ExprId(void); ++static TREEPTR ExprOpnd(void); ++static TREEPTR SizeofOp(TYPEPTR); ++static TREEPTR ScalarExpr(TREEPTR); ++static TREEPTR UnaryPlus(TREEPTR); ++static TREEPTR TernOp(TREEPTR,TREEPTR,TREEPTR); ++static TREEPTR ColonOp(TREEPTR); ++static TREEPTR StartTernary(TREEPTR); ++static TREEPTR NotOp(TREEPTR); ++static TREEPTR AndAnd(TREEPTR); ++static TREEPTR OrOr(TREEPTR); ++static TREEPTR GenFuncCall(TREEPTR); ++static TREEPTR IndexOp(TREEPTR,TREEPTR); ++static TREEPTR SegOp(TREEPTR,TREEPTR); ++static void PopNestedParms( TYPEPTR **plistptr ); ++static void IncSymWeight( SYMPTR sym ); ++static void AddCallNode( TREEPTR tree ); + + extern int64 LongValue64( TREEPTR leaf ); + +@@ -298,7 +298,7 @@ TREEPTR LongLeaf( target_long value ) + return( leaf ); + } + +-local TREEPTR EnumLeaf( ENUMPTR ep ) ++static TREEPTR EnumLeaf( ENUMPTR ep ) + { + DATA_TYPE decl_type; + TREEPTR leaf; +@@ -439,7 +439,7 @@ TREEPTR SymLeaf( void ) + } + + +-local void IncSymWeight( SYMPTR sym ) ++static void IncSymWeight( SYMPTR sym ) + { + static int LoopWeights[] = { 1, 0x10, 0x100, 0x1000 }; + +@@ -499,7 +499,7 @@ static bool IsCallValue( TREEPTR tree ) + } + + // This RVALUE thing is backwards -mjc +-local TREEPTR TakeRValue( TREEPTR tree, int void_ok ) ++static TREEPTR TakeRValue( TREEPTR tree, int void_ok ) + { + TYPEPTR typ; + sym_flags symb_flags; +@@ -953,7 +953,7 @@ FIELDPTR SearchFields( TYPEPTR *class_typ, target_size *field_offset, const char + } + + +-local TYPEPTR Ptr2Struct( TYPEPTR typ ) ++static TYPEPTR Ptr2Struct( TYPEPTR typ ) + { + if( typ->decl_type != TYPE_POINTER ) { + return( NULL ); +@@ -1170,7 +1170,7 @@ TREEPTR SingleExpr( void ) + } + + +-local TREEPTR GetExpr( void ) ++static TREEPTR GetExpr( void ) + { + TREEPTR tree, op1; + TYPEPTR typ; +@@ -1454,7 +1454,7 @@ local TREEPTR GetExpr( void ) + } + + +-local TREEPTR ExprOpnd( void ) ++static TREEPTR ExprOpnd( void ) + { + TREEPTR tree; + TYPEPTR typ; +@@ -1617,7 +1617,7 @@ local TREEPTR ExprOpnd( void ) + } + + +-local bool IsMacroDefined( void ) ++static bool IsMacroDefined( void ) + { + MEPTR mentry; + +@@ -1634,7 +1634,7 @@ local bool IsMacroDefined( void ) + } + + +-local TREEPTR ExprId( void ) ++static TREEPTR ExprId( void ) + { + TREEPTR tree; + int value; +@@ -1691,7 +1691,7 @@ local TREEPTR ExprId( void ) + + + #if 0 +-local bool LValueArray( TREEPTR tree ) ++static bool LValueArray( TREEPTR tree ) + { + TYPEPTR typ; + +@@ -1710,7 +1710,7 @@ local bool LValueArray( TREEPTR tree ) + } + #endif + +-local TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) + { + TYPEPTR typ; + op_flags tree_flags; +@@ -1774,14 +1774,14 @@ local TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) + return( tree ); + } + +-local TREEPTR ArrayIndex( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR ArrayIndex( TREEPTR tree, TREEPTR index_expr ) + { + tree = GenIndex( tree, index_expr ); + return( tree ); + } + + +-local TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) + { + TYPEPTR typ; + +@@ -1810,7 +1810,7 @@ local TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) + return( tree ); + } + +-local void AddCallNode( TREEPTR tree ) ++static void AddCallNode( TREEPTR tree ) + // if a function call has no prototype wait till end + // to check it out + { +@@ -1852,7 +1852,7 @@ static int ParmNum( void ) + return( parm_count ); + } + +-local TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) ++static TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) + { + TYPEPTR *plist; + TYPEPTR typ; +@@ -1923,7 +1923,7 @@ local TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) + } + + +-local bool IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, size_t len, SYMPTR sym ) ++static bool IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, size_t len, SYMPTR sym ) + { + size_t j; + +@@ -1946,7 +1946,7 @@ local bool IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, size_t len, SYMPTR sy + #else + #define REG_SIZE 4 + #endif +-local TREEPTR GenVaStartNode( TREEPTR last_parm ) ++static TREEPTR GenVaStartNode( TREEPTR last_parm ) + { + // there should be 3 parms __builtin_va_start( list, parm_name, stdarg ) + // - first parm should be name of va_list +@@ -1999,7 +1999,7 @@ local TREEPTR GenVaStartNode( TREEPTR last_parm ) + return( tree ); + } + +-local TREEPTR GenAllocaNode( TREEPTR size_parm ) ++static TREEPTR GenAllocaNode( TREEPTR size_parm ) + { + // there should be 1 parm __builtin_alloca( size ) + TREEPTR tree; +@@ -2016,7 +2016,7 @@ local TREEPTR GenAllocaNode( TREEPTR size_parm ) + #endif + + #if _CPU == _PPC +-local TREEPTR GenVaArgNode( TREEPTR last_parm ) ++static TREEPTR GenVaArgNode( TREEPTR last_parm ) + { + // there should be 2 parms __builtin_varg( list, type_arg ) + // - first parm should be name of va_list +@@ -2049,7 +2049,7 @@ local TREEPTR GenVaArgNode( TREEPTR last_parm ) + } + #endif + +-local TREEPTR GenFuncCall( TREEPTR last_parm ) ++static TREEPTR GenFuncCall( TREEPTR last_parm ) + { + expr_level_type i; + expr_level_type n; +@@ -2201,7 +2201,7 @@ done_call: + return( tree ); + } + +-local void PopNestedParms( TYPEPTR **plistptr ) ++static void PopNestedParms( TYPEPTR **plistptr ) + { + struct nested_parm_lists *npl; + +@@ -2231,7 +2231,7 @@ static TREEPTR DummyFuncName( void ) + return( tree ); + } + +-local TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) ++static TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) + { + TYPEPTR typ; + TYPEPTR orig_typ; +@@ -2378,7 +2378,7 @@ local TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) + } + + +-local TREEPTR OrOr( TREEPTR tree ) ++static TREEPTR OrOr( TREEPTR tree ) + { + // This routine is called when || token is found + if( tree->op.opr == OPR_PUSHINT ) { +@@ -2391,7 +2391,7 @@ local TREEPTR OrOr( TREEPTR tree ) + } + + +-local TREEPTR AndAnd( TREEPTR tree ) ++static TREEPTR AndAnd( TREEPTR tree ) + { + // This routine is called when && token is found + if( tree->op.opr == OPR_PUSHINT ) { +@@ -2439,7 +2439,7 @@ TREEPTR BoolExpr( TREEPTR tree ) + } + + +-local TREEPTR NotOp( TREEPTR tree ) ++static TREEPTR NotOp( TREEPTR tree ) + { + TREEPTR opnd; + FLOATVAL *flt; +@@ -2492,14 +2492,14 @@ local TREEPTR NotOp( TREEPTR tree ) + } + + +-local TREEPTR StartTernary( TREEPTR tree ) ++static TREEPTR StartTernary( TREEPTR tree ) + { + tree = BoolExpr( tree ); + return( tree ); + } + + +-local TREEPTR ColonOp( TREEPTR true_part ) ++static TREEPTR ColonOp( TREEPTR true_part ) + { + if( Class[ExprLevel] != TC_TERNARY ) { + CErr1( ERR_MISSING_QUESTION_OR_MISPLACED_COLON ); +@@ -2574,7 +2574,7 @@ static TREEPTR TernOp( TREEPTR expr1, TREEPTR true_part, TREEPTR false_part ) + } + + +-local TREEPTR UnaryPlus( TREEPTR tree ) ++static TREEPTR UnaryPlus( TREEPTR tree ) + { + TYPEPTR typ; + +@@ -2627,7 +2627,7 @@ TREEPTR ScalarExpr( TREEPTR tree ) + } + + +-local TREEPTR SizeofOp( TYPEPTR typ ) ++static TREEPTR SizeofOp( TYPEPTR typ ) + { + TREEPTR tree; + target_size size; +@@ -2658,7 +2658,7 @@ local TREEPTR SizeofOp( TYPEPTR typ ) + return( tree ); + } + +-local TREEPTR SegOp( TREEPTR seg, TREEPTR offset ) ++static TREEPTR SegOp( TREEPTR seg, TREEPTR offset ) + { + TREEPTR tree; + TYPEPTR typ; +diff --git a/bld/cc/c/cmac2.c b/bld/cc/c/cmac2.c +index 232b456..bea45a7 100644 +--- a/bld/cc/c/cmac2.c ++++ b/bld/cc/c/cmac2.c +@@ -51,8 +51,8 @@ static void CLine( void ); + static void CError( void ); + static void CIdent( void ); + +-local void GrabTokens( mac_parm_count parm_count, macro_flags mflags, MPPTR formal_parms, const char *mac_name, source_loc *src_loc ); +-local mac_parm_count FormalParm( MPPTR formal_parms ); ++static void GrabTokens( mac_parm_count parm_count, macro_flags mflags, MPPTR formal_parms, const char *mac_name, source_loc *src_loc ); ++static mac_parm_count FormalParm( MPPTR formal_parms ); + + struct preproc { + char *directive; +@@ -107,7 +107,7 @@ static void PPFlush2EOL( void ) + } + + +-local void ChkEOL( void ) ++static void ChkEOL( void ) + { + if( CurToken != T_EOF ) { + ExpectingToken( T_NULL ); +@@ -115,7 +115,7 @@ local void ChkEOL( void ) + } + + +-local void WantEOL( void ) ++static void WantEOL( void ) + { + if( CompFlags.extensions_enabled ) { + if( CurToken != T_NULL && CurToken != T_EOF ) { +@@ -129,7 +129,7 @@ local void WantEOL( void ) + } + + +-local void IncLevel( bool value ) ++static void IncLevel( bool value ) + { + struct cpp_info *cpp; + +@@ -150,7 +150,7 @@ local void IncLevel( bool value ) + } + + +-local void CUnknown( void ) ++static void CUnknown( void ) + { + if( NestLevel == SkipLevel ) { + CErr2p( ERR_UNKNOWN_DIRECTIVE, Buffer ); +@@ -244,18 +244,18 @@ TOKEN ChkControl( void ) + } + + +-local void CSkip( void ) ++static void CSkip( void ) + { + } + + +-local void CSkipIf( void ) ++static void CSkipIf( void ) + { + IncLevel( FALSE ); + } + + +-local void CIdent( void ) ++static void CIdent( void ) + { + if( !CompFlags.extensions_enabled ) { + CUnknown(); +@@ -319,7 +319,7 @@ void CInclude( void ) + } + + +-local void CDefine( void ) ++static void CDefine( void ) + { + MPPTR mp; + MPPTR prev_mp; +@@ -406,7 +406,7 @@ local void CDefine( void ) + } + + +-local void GrabTokens( mac_parm_count parm_count, macro_flags mflags, MPPTR formal_parms, const char *mac_name, source_loc *loc ) ++static void GrabTokens( mac_parm_count parm_count, macro_flags mflags, MPPTR formal_parms, const char *mac_name, source_loc *loc ) + { + MEPTR mentry; + size_t len; +@@ -524,7 +524,7 @@ local void GrabTokens( mac_parm_count parm_count, macro_flags mflags, MPPTR form + } + + +-local mac_parm_count FormalParm( MPPTR formal_parms ) ++static mac_parm_count FormalParm( MPPTR formal_parms ) + { + mac_parm_count i; + +@@ -539,7 +539,7 @@ local mac_parm_count FormalParm( MPPTR formal_parms ) + } + + +-local void CIfDef( void ) ++static void CIfDef( void ) + { + MEPTR mentry; + +@@ -561,7 +561,7 @@ local void CIfDef( void ) + } + + +-local void CIfNDef( void ) ++static void CIfNDef( void ) + { + MEPTR mentry; + +@@ -582,7 +582,7 @@ local void CIfNDef( void ) + } + + +-local bool GetConstExpr( void ) ++static bool GetConstExpr( void ) + { + bool value; + bool useful_side_effect; +@@ -603,7 +603,7 @@ local bool GetConstExpr( void ) + return( value ); + } + +-local void CIf( void ) ++static void CIf( void ) + { + bool value; + +@@ -616,7 +616,7 @@ local void CIf( void ) + } + + +-local void CElif( void ) ++static void CElif( void ) + { + bool value; + +@@ -646,7 +646,7 @@ local void CElif( void ) + } + + +-local void CElse( void ) ++static void CElse( void ) + { + if( ( NestLevel == 0 ) || ( CppStack->cpp_type == PRE_ELSE ) ) { + CErr1( ERR_MISPLACED_ELSE ); +@@ -668,7 +668,7 @@ local void CElse( void ) + } + + +-local void CEndif( void ) ++static void CEndif( void ) + { + if( NestLevel == 0 ) { + CErr1( ERR_MISPLACED_ENDIF ); +@@ -733,7 +733,7 @@ bool MacroDel( const char *name ) + } + + +-local void CUndef( void ) ++static void CUndef( void ) + { + + PPNextToken(); +@@ -745,7 +745,7 @@ local void CUndef( void ) + } + + +-local void CLine( void ) ++static void CLine( void ) + { + FNAMEPTR flist; + unsigned src_line; +@@ -791,7 +791,7 @@ local void CLine( void ) + } + + +-local void CError( void ) ++static void CError( void ) + { + size_t len; + bool save; +diff --git a/bld/cc/master.mif b/bld/cc/master.mif +index 45a69b5..0ac6a97 100644 +--- a/bld/cc/master.mif ++++ b/bld/cc/master.mif +@@ -53,7 +53,7 @@ pre_obj_deps += code$(target_cpu).gh + # + # C compiler options + # +-extra_cpp_flags = -Dlocal=static ++extra_cpp_flags = -Dlocal="static" + !ifneq cc_dll 1 + extra_cpp_flags += -DIDE_PGM + !endif +-- +1.8.3.4 + + +From 6470c82af223c0c5e912e1ef0218155971e6bd8e Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 18 Jan 2015 15:35:30 +0100 +Subject: Adjust setvars.sh to Haiku build environment. + + +diff --git a/setvars.sh b/setvars.sh +index a64d135..30bce44 100755 +--- a/setvars.sh ++++ b/setvars.sh +@@ -6,14 +6,14 @@ + # modify it as necessary for your own use!! + + # Change this to point your Open Watcom source tree +-export OWROOT=/home/ow/ow ++export OWROOT=/sources/openwatcom-2.0.0 + + # Subdirectory to be used for building OW build tools + export OWOBJDIR=binbuild + + # Set this entry to identify your toolchain used by build process + # supported values are WATCOM GCC CLANG +-export OWTOOLS=WATCOM ++export OWTOOLS=GCC + + # Documentation related variables + +-- +1.8.3.4 +