From: Grzegorz J. <ja...@he...> - 2003-11-10 01:55:09
|
Hi Marc, Thanks much for your contribution. I fully agree with your point of view about separation of driver from the rest of the code. In fact the existing solution is not perfect even on Unix, because different platforms handle shared and dlopenable modules differently. I am currently working on this issue trying to leave only translation to occ and push all other jobs to the wrapper shell script that calls libtool. I recently checked the wrapper solution into the branch 'sandbox_jakacki_frontend1'. This is not the way to go on Windows however, since as I understand the requirement is that occ runs at compiles under vanila VC++ with no bash etc. One solution i have been thinking of was translating the script into C with a tool (sh2c), but I am not sure if details really work out. Another solution is the one that you are proposig. The main problem however is that nobody is currently maintaining OpenC++ on Windows. Windows is very different that oter unix-like systems---for many platforms we can build and test on CompileFarm, unfortunately not for VC++. To wrap it up, I cannot reliably apply your patch, because I cannot reliably test the code afterwards. Would you find time to apply the patch and test yourself? Testing may require installing cygwin (bash). Will you be interested in maintaining the VC++ build afterwards? Best regards Grzegorz On Fri, 7 Nov 2003, Marc Ordinas i Llopis wrote: > Alexandre Tolmos wrote: > > > Hi Marc, > > > > There is already a driver for Win32 called "driver2.cpp" in "src" but > > I don't know if it's up to date and suitable for VS.NET. > > > No, it's not up to date, unfortunately. > > > Btw, which version of OpenC++ did you use ? I commited a patch on the > > 1st of November which completes the MacOS X port and upgrades the > > garbage collector to version 6.3alpha2. I recommend you to upgrade to > > the latest HEAD revision. > > > Yes, I'm aware of your patches, and I generated the patch with CVS. > > The point is that in Win32 you need to generate the DLLs for the > compile-time classes in a very different way from Unix. And in Visual > Studio you can't just tell it to call occ.exe instead of cl.exe (MS' > compiler). So you need a different Metaclass implementation and a > different driver. Fortunately, it's easy to separate concerns: > > The library > 1) Parses C++. > 2) Transforms it according to some metaclasses. > > And the driver > a) Provides a way of creating metaclasses. > b) Loads those and passes them to the library (when the library demands > them). > c) Offers some kind of interface to the outside, be it substituting the > usual call to the compiler, be it another different way. > > Of course, a and b can be independent, as long as there is a common > protocol. It's possible to create a driver that has all metaclasses > already compiled in, for example. Or the driver could use some scripting > language to implement the metaclasses. > > Anyway, I think patching driver2.cpp so that it works under Win32 is > wrong, what should be done is separating concerns and allowing an easier > way to create drivers. Of course, occ should be kept as the included > driver, because it works perfectly on Unix as a command-line substitute > of gcc. > > Regards, > > Marc Ordinas i Llopis > > > Alex > > > > Le jeudi, 6 nov 2003, =E0 16:42 Europe/Paris, Marc Ordinas i Llopis a > > =E9crit : > > > >> Hi, > >> > >> We are going to use OpenC++ in a project, but we need to have a > >> working Win32 version. Creating a driver for use in VisualStudio.NET > >> is not easy, as the editor does not allow changing the compiler > >> executable. So I've had to separate OpenC++ in two parts, a library > >> and a driver. This requires very small modifications to the project, > >> and can be a step towards having a more modular code organization. > >> > >> I send you a patch (taken using cvs diff -u) with the required > >> changes, and I plan on having a Windows driver in short time. > >> > >> Regards, > >> > >> Marc Ordinas i Llopis > > > > > > -----------------------------------------------------------------------= - > > - > > Alexandre Tolmos > > E: ktulu at free.fr > > ICQ: 92964905 > > -----------------------------------------------------------------------= - > > - > > "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn." > > -----------------------------------------------------------------------= - > > - > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2003 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |