]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/occ-mingw-makefile.patch
Outline view is able to show control points with debugging mode
[simantics/3d.git] / org.jcae.opencascade / occ-mingw-makefile.patch
1 diff --git a/.gitignore b/.gitignore
2 new file mode 100644
3 index 0000000..f045603
4 --- /dev/null
5 +++ b/.gitignore
6 @@ -0,0 +1,80 @@
7 +.pc
8 +*.o
9 +*.class
10 +*.a
11 +*.dll
12 +ros/adm/mingw/FWOSPlugin/
13 +ros/adm/mingw/PTKernel/
14 +ros/adm/mingw/TKAdvTools/
15 +ros/adm/mingw/TKBO/
16 +ros/adm/mingw/TKBRep/
17 +ros/adm/mingw/TKBin/
18 +ros/adm/mingw/TKBinL/
19 +ros/adm/mingw/TKBinTObj/
20 +ros/adm/mingw/TKBinXCAF/
21 +ros/adm/mingw/TKBool/
22 +ros/adm/mingw/TKCAF/
23 +ros/adm/mingw/TKCDF/
24 +ros/adm/mingw/TKCDLFront/
25 +ros/adm/mingw/TKCPPClient/
26 +ros/adm/mingw/TKCPPExt/
27 +ros/adm/mingw/TKCPPIntExt/
28 +ros/adm/mingw/TKCPPJini/
29 +ros/adm/mingw/TKCSFDBSchema/
30 +ros/adm/mingw/TKDCAF/
31 +ros/adm/mingw/TKDraw/
32 +ros/adm/mingw/TKFeat/
33 +ros/adm/mingw/TKFillet/
34 +ros/adm/mingw/TKG2d/
35 +ros/adm/mingw/TKG3d/
36 +ros/adm/mingw/TKGeomAlgo/
37 +ros/adm/mingw/TKGeomBase/
38 +ros/adm/mingw/TKHLR/
39 +ros/adm/mingw/TKIDLFront/
40 +ros/adm/mingw/TKIGES/
41 +ros/adm/mingw/TKLCAF/
42 +ros/adm/mingw/TKMath/
43 +ros/adm/mingw/TKMesh/
44 +ros/adm/mingw/TKMeshVS/
45 +ros/adm/mingw/TKNIS/
46 +ros/adm/mingw/TKOffset/
47 +ros/adm/mingw/TKOpenGl/
48 +ros/adm/mingw/TKPCAF/
49 +ros/adm/mingw/TKPLCAF/
50 +ros/adm/mingw/TKPShape/
51 +ros/adm/mingw/TKPrim/
52 +ros/adm/mingw/TKSTEP/
53 +ros/adm/mingw/TKSTEP209/
54 +ros/adm/mingw/TKSTEPAttr/
55 +ros/adm/mingw/TKSTEPBase/
56 +ros/adm/mingw/TKSTL/
57 +ros/adm/mingw/TKService/
58 +ros/adm/mingw/TKShHealing/
59 +ros/adm/mingw/TKShapeSchema/
60 +ros/adm/mingw/TKStdLSchema/
61 +ros/adm/mingw/TKStdSchema/
62 +ros/adm/mingw/TKTCPPExt/
63 +ros/adm/mingw/TKTObj/
64 +ros/adm/mingw/TKTObjDRAW/
65 +ros/adm/mingw/TKTopAlgo/
66 +ros/adm/mingw/TKTopTest/
67 +ros/adm/mingw/TKV2d/
68 +ros/adm/mingw/TKV3d/
69 +ros/adm/mingw/TKVRML/
70 +ros/adm/mingw/TKViewerTest/
71 +ros/adm/mingw/TKWOK/
72 +ros/adm/mingw/TKWOKTcl/
73 +ros/adm/mingw/TKXCAF/
74 +ros/adm/mingw/TKXCAFSchema/
75 +ros/adm/mingw/TKXDEDRAW/
76 +ros/adm/mingw/TKXDEIGES/
77 +ros/adm/mingw/TKXDESTEP/
78 +ros/adm/mingw/TKXMesh/
79 +ros/adm/mingw/TKXSBase/
80 +ros/adm/mingw/TKXSDRAW/
81 +ros/adm/mingw/TKXml/
82 +ros/adm/mingw/TKXmlL/
83 +ros/adm/mingw/TKXmlTObj/
84 +ros/adm/mingw/TKXmlXCAF/
85 +ros/adm/mingw/TKjcas/
86 +ros/mingw/
87 diff --git a/ros/adm/mingw/Makefile b/ros/adm/mingw/Makefile
88 new file mode 100644
89 index 0000000..6350613
90 --- /dev/null
91 +++ b/ros/adm/mingw/Makefile
92 @@ -0,0 +1,34 @@
93 +all:
94 +       ./pywok.py
95 +       $(MAKE) -C TKernel
96 +       $(MAKE) -C TKMath
97 +       $(MAKE) -C TKAdvTools
98 +       $(MAKE) -C TKG2d
99 +       $(MAKE) -C TKG3d
100 +       $(MAKE) -C TKGeomBase
101 +       $(MAKE) -C TKBRep
102 +       $(MAKE) -C TKGeomAlgo
103 +       $(MAKE) -C TKTopAlgo
104 +       $(MAKE) -C TKPrim
105 +       $(MAKE) -C TKBO
106 +       $(MAKE) -C TKHLR
107 +       $(MAKE) -C TKMesh
108 +       $(MAKE) -C TKShHealing
109 +       $(MAKE) -C TKBool
110 +       $(MAKE) -C TKXMesh
111 +       $(MAKE) -C TKFillet
112 +       $(MAKE) -C TKFeat
113 +       $(MAKE) -C TKOffset
114 +       $(MAKE) -C TKXSBase
115 +       $(MAKE) -C TKSTEPBase
116 +       $(MAKE) -C TKSTEPAttr
117 +       $(MAKE) -C TKSTEP209
118 +       $(MAKE) -C TKSTEP
119 +       $(MAKE) -C TKIGES
120 +       $(MAKE) -C TKService
121 +       $(MAKE) -C TKV2d
122 +       $(MAKE) -C TKV3d
123 +
124 +clean:
125 +       rm -rf OCCMingw*.class TKernel FWOSPlugin PTKernel TKAdvTools TKBO TKBRep TKBin TKBinL TKBinTObj TKBinXCAF TKBool TKCAF TKCDF TKCDLFront TKCPPClient TKCPPExt TKCPPIntExt TKCPPJini TKCSFDBSchema TKDCAF TKDraw TKFeat TKFillet TKG2d TKG3d TKGeomAlgo TKGeomBase TKHLR TKIDLFront TKIGES TKLCAF TKMath TKMesh TKMeshVS TKNIS TKOffset TKOpenGl TKPCAF TKPLCAF TKPShape TKPrim TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKSTL TKService TKShHealing TKShapeSchema TKStdLSchema TKStdSchema TKTCPPExt TKTObj TKTObjDRAW TKTopAlgo TKTopTest TKV2d TKV3d TKVRML TKViewerTest TKWOK TKWOKTcl TKXCAF TKXCAFSchema TKXDEDRAW TKXDEIGES TKXDESTEP TKXMesh TKXSBase TKXSDRAW TKXml TKXmlL TKXmlTObj TKXmlXCAF TKjcas 
126 +
127 diff --git a/ros/adm/mingw/header.mk b/ros/adm/mingw/header.mk
128 new file mode 100644
129 index 0000000..ee3efb7
130 --- /dev/null
131 +++ b/ros/adm/mingw/header.mk
132 @@ -0,0 +1,40 @@
133 +CC := i586-mingw32msvc-gcc
134 +CXX := i586-mingw32msvc-g++
135 +CASROOT := ../../..
136 +DRV := $(CASROOT)/drv
137 +SRC := $(CASROOT)/src
138 +BIN := $(CASROOT)/mingw/bin
139 +LIB := $(CASROOT)/mingw/lib
140 +CPPFLAGS := -I$(CASROOT)/inc/ -DWNT -D__MATH_WNT_H -DHAVE_NO_DLL
141 +CXXFLAGS := -O2 -march=pentium3 -fno-strict-aliasing
142 +LDFLAGS := -shared -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,-export-all-symbols
143 +TKernelFLAGS := -lwinspool -lws2_32 -lgdi32
144 +TKMathFLAGS := -lTKernel
145 +TKAdvToolsFLAGS := -lTKernel
146 +TKG2dFLAGS := -lTKernel -lTKMath
147 +TKG3dFLAGS := -lTKernel -lTKG2d -lTKMath
148 +TKGeomBaseFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath
149 +TKBRepFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase
150 +TKGeomAlgoFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKBRep
151 +TKTopAlgoFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKGeomAlgo -lTKBRep
152 +TKPrimFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep
153 +TKHLRFLAGS := -lTKernel -lTKGeomBase -lTKG3d -lTKTopAlgo -lTKMath -lTKGeomAlgo -lTKBRep -lTKG2d
154 +TKBOFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep -lTKGeomAlgo
155 +TKMeshFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep -lTKGeomAlgo
156 +TKShHealingFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep -lTKGeomAlgo
157 +TKBoolFLAGS := -lTKernel -lTKGeomAlgo -lTKG3d -lTKShHealing -lTKGeomBase -lTKTopAlgo -lTKMath -lTKBO -lTKG2d -lTKBRep -lTKPrim
158 +TKXMeshFLAGS := -lTKernel -lTKG2d -lTKMath -lTKMesh
159 +TKFilletFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep -lTKGeomAlgo -lTKBool
160 +TKFeatFLAGS := -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKGeomBase -lTKTopAlgo -lTKBRep -lTKGeomAlgo -lTKBO -lTKPrim -lTKBool
161 +TKOffsetFLAGS := -lTKBool -lTKGeomAlgo -lTKernel -lTKGeomBase -lTKTopAlgo -lTKMath -lTKBO -lTKG2d -lTKG3d -lTKBRep -lTKShHealing -lTKFillet -lTKPrim
162 +TKXSBaseFLAGS := -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKShHealing -lTKBRep -lTKGeomBase -lTKTopAlgo
163 +TKSTEPBaseFLAGS := -lTKernel -lTKXSBase -lTKMath
164 +TKSTEPFLAGS := -lTKernel -lTKXSBase -lTKSTEPBase -lTKSTEPAttr -lTKMath -lTKG3d -lTKG2d -lTKShHealing -lTKSTEP209 -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lws2_32
165 +TKIGESFLAGS := -lTKernel -lTKXSBase -lTKSTEPBase -lTKSTEPAttr -lTKMath -lTKG3d -lTKG2d -lTKShHealing -lTKSTEP209 -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool
166 +TKSTEPAttrFLAGS := -lTKSTEPBase -lTKernel -lTKXSBase
167 +TKSTEP209FLAGS := -lTKSTEPBase -lTKernel -lTKXSBase
168 +TKServiceFLAGS := -lTKernel -lTKMath -lgdi32 -lwinspool
169 +TKV2dFLAGS := -lTKernel -lTKService -lTKG3d -lTKTopAlgo -lTKMath -lTKBRep -lTKGeomBase -lTKG2d -lTKHLR -lTKGeomAlgo
170 +TKV3dFLAGS := -lTKernel -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKService -lTKMath -lTKMesh -lTKGeomAlgo -lTKHLR -lTKBRep -lTKG2d -lTKV2d -lcomdlg32 -lgdi32
171 +
172 +
173 diff --git a/ros/adm/mingw/pywok.py b/ros/adm/mingw/pywok.py
174 new file mode 100755
175 index 0000000..3c7bc25
176 --- /dev/null
177 +++ b/ros/adm/mingw/pywok.py
178 @@ -0,0 +1,95 @@
179 +#! /usr/bin/python
180 +
181 +# Use of EXTERNLIB is currently disabled because TKernel/EXTERNLIB
182 +# contains strings which are not libs
183 +
184 +import os
185 +
186 +def parse_list(pdir, key):
187 +    pfile = os.path.join(pdir, key)
188 +    toreturn=[]
189 +    try:
190 +        f = open(pfile)
191 +        for l in f:
192 +            s = l.strip()
193 +            if len(s)>0:
194 +                toreturn.append(s)
195 +        f.close()
196 +    except IOError:
197 +        pass
198 +    return toreturn
199 +
200 +def to_ld_param(libs):
201 +    toreturn=[]
202 +    for l in libs:
203 +        toreturn.append(" -l"+l)
204 +    return " ".join(toreturn)
205 +
206 +def create_makefile(name, packages, externlibs):
207 +    try:
208 +        os.mkdir(name)
209 +    except OSError:
210 +        pass
211 +
212 +    out=open(os.path.join(name, "Makefile"), "w")
213 +
214 +    try:
215 +        packages.remove("Xw")
216 +    except ValueError:
217 +        pass
218 +
219 +    try:
220 +        packages.remove("ImageUtility")
221 +    except ValueError:
222 +        pass
223 +
224 +    out.write("include ../header.mk\n")
225 +
226 +    for p in packages:
227 +        out.write("""
228 +objects += $(patsubst %%.cxx,%%.o,$(notdir $(wildcard $(SRC)/%s/*.cxx)))
229 +objects += $(patsubst %%.c,%%.o,$(notdir $(wildcard $(SRC)/%s/*.c)))
230 +objects += $(patsubst %%.cxx,%%.o,$(notdir $(wildcard $(DRV)/%s/*.cxx)))
231 +objects += $(patsubst %%.c,%%.o,$(notdir $(wildcard $(DRV)/%s/*.c)))
232 +""" % (p,p,p,p))
233 +
234 +    for p in packages:
235 +        out.write("""
236 +%%.o : $(SRC)/%s/%%.cxx
237 +       $(CXX) $(CPPFLAGS) -I$(DRV)/%s -I$(SRC)/%s  -c $(CXXFLAGS) -o $@ $<
238 +%%.o : $(DRV)/%s/%%.cxx
239 +       $(CXX) $(CPPFLAGS) -I$(DRV)/%s -I$(SRC)/%s  -c $(CXXFLAGS) -o $@ $<
240 +%%.o : $(SRC)/%s/%%.c
241 +       $(CC)  $(CPPFLAGS) -I$(DRV)/%s -I$(SRC)/%s  -c $(CFLAGS) -o $@ $<
242 +%%.o : $(DRV)/%s/%%.c
243 +       $(CC)  $(CPPFLAGS) -I$(DRV)/%s -I$(SRC)/%s  -c $(CFLAGS) -o $@ $<
244 +""" % (p,p,p, p,p,p, p,p,p, p,p,p))
245 +
246 +    out.write("""
247 +$(BIN)/%s.dll : $(objects)
248 +       mkdir -p $(LIB) $(BIN)
249 +       $(CXX) $(LDFLAGS) -L$(LIB) -o $@ $^ $(%sFLAGS) -Wl,--out-implib,$(LIB)/lib%s.a
250 +""" % (name, name, name))
251 +    out.close();
252 +
253 +def search_libs(package, libdict):
254 +    try:
255 +        l=libdict[package]
256 +    except KeyError:
257 +        l=[]
258 +    toreturn=[]
259 +    toreturn.extend(l)
260 +    for p in l:
261 +        toreturn.extend(search_libs(p, libdict))
262 +    return toreturn
263 +
264 +externlibs={}
265 +packages={}
266 +for dir in os.listdir("../../src"):
267 +    pdir = os.path.join("../../src", dir)
268 +    packages[dir]=parse_list(pdir, "PACKAGES")
269 +    externlibs[dir]=parse_list(pdir, "EXTERNLIB")
270 +
271 +for dir, plist in packages.iteritems():
272 +    if len(plist)>0:
273 +        create_makefile(dir, plist, search_libs(dir, externlibs))