Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 1 Nov 2002 13:46:53 -0800 (PST) From: "Peter A. Castro" To: Christophe Dupre cc: "cygwin AT cygwin DOT com" Subject: Re: Cygwin, GNU make and VC++ ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463811071-660104087-1036187213=:23333" ---1463811071-660104087-1036187213=:23333 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 29 Oct 2002, Christophe Dupre wrote: > Can you share this script with us ? You know, one of these days I'm going to have to actually check my facts before I go and open my mouth :) I've reviewed my little scripts cl & link (wrote them a while ago and just now actually *looked* at what they do :). They are much more basic than I remembered and have a few assumptions. I've attached them for your perusal. These assumptions are as follows: 1) The compiler and linker can handle "/" as a directory separator (this is true for VC++ 5 but not widely known, (I think)), as well as handle "-" as a switch character (also true for VC++ 5). 2) Use real, non-cygwin specific, paths (is: no symlinks and no mount points) in the include path specifiers (eg: "-IC:/users/pcastro/include" instead of "-I/home/pcastro/include"). This isn't such a difficult thing to do, depending on how your makefiles are designed, but if you are in a mixed environment it can be a pain. 3) The scripts are earlier in the PATH than the compiler is. The attached scripts check for VC++ 5 env vars which are usually set thus: export MSDEVDIR=C:/DevStudio/SharedIDE export MSVCDIR=C:/DevStudio/VC export VCOSDIR=WINNT The real goal of the scripts was to set INCLUDE and LIB and PATH correctly and just invoke the compiler. We couldn't do this in our makefiles because our build infrastructure had already claimed these as macros (which were being exported by make :-( and thus caused the compiler & linker to fail to find standard includes and linklibs. Since our build environment required a source home root to be defined and used for all other file/path references (eg: SRCHOME=C:/users/pcastro) it wasn't difficult to simply use it in our compile statements. eg: cl -c -Fofoo.obj -Ox -Oy- -Z7 -I. -I$(SRCHOME)/include foo.c link /debug /debugtype:both /pdb:none /out:$(SRCHOME)/bin/foo.exe \ /MAP /LIBPATH:$(SRCHOME)/lib /NOD foo.obj kernel32.lib advapi32.lib \ user32.lib msvcrt.lib oldnames.lib winmm.lib This has worked pretty well for us, but then we use a fairly ridged development process. Anyway, updating the script to actually parse the command line and look for -I wouldn't be too difficult to do either. Sorry if this isn't what you are looking for. > On Tue, 29 Oct 2002, Peter A. Castro wrote: > > > On Mon, 28 Oct 2002, Christophe Dupre wrote: > > > > > Hello everyone, > > > I'm trying to recompile a homegrown program that was originaly > > > developped for Unix under Windows. We were successful in compiling this > > > program with the cygwin-supplied gcc using our current Makefile. > > > > > > Now we'd like to recompile with the 'native' compiler, cl.exe provided > > > with Visual Studio, as some believe the native compile would produce > > > faster binaries (it's a long-running analysis code - even 5% speedup > > > would be significant). Also, the gcc binary can't seem to be able to > > > allocate more than 1024MB of memory, even though the machine has 4GB > > > physical (this is under Windows 2000). Even then, we had to modify a > > > registry key to be able to use more than 256MB, which is not great for > > > end-users. > > > > > > Anyway, we're making progress in being able to compile with CL.EXE, but > > > we're having trouble with include files. We use the flag > > > '-I/home/user/dg/include' to point to the include directory, but it > > > can't find it. If we use '-I../include' it works, but for many reasons > > > we need to be able to specify absolute paths for include files. > > > > > > Has anyone done that ? I was not able to find anything relevant in the > > > archives. > > > > I had this same problem to contend with at work. I'd solved it by > > writing a wrapper script around cl that massaged the include list to > > match Windows syntax and then invoke the real cl. It was a but tricky. > > I ended up putting the path with my wrapper earlier in $PATH and calling > > cl.exe explicitly. Had to do the same thing with link and lib commands > > too. > > > > > Thanks. > > > > -- > > Peter A. Castro or > > "Cats are just autistic Dogs" -- Dr. Tony Attwood > > -- > Christophe Dupre > System Administrator, Scientific Computation Research Center > Rensselaer Polytechnic Institute > Troy, NY USA > Phone: (518) 276-2578 - Fax: (518) 276-4886 -- Peter A. Castro or "Cats are just autistic Dogs" -- Dr. Tony Attwood ---1463811071-660104087-1036187213=:23333 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=cl Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: cl Content-Disposition: attachment; filename=cl IyEvYmluL3NoDQojDQojICRIZWFkZXI6JA0KIw0KIyBjbA0KIw0KIyAgQ29w eXJpZ2h0IChjKSBPcmFjbGUgQ29ycG9yYXRpb24gMjAwMC4gQWxsIFJpZ2h0 cyBSZXNlcnZlZC4NCiMNCiMgICAgTkFNRQ0KIyAgICAgIGNsIC0gVmlzdWFs IEMrKyBjb21waWxlciB3cmFwcGVyDQojDQojICAgIERFU0NSSVBUSU9ODQoj ICAgICAgVXNlZCB3aXRoIHRoZSBDeWdXaW4gZW52aXJvbm1lbnQgb24gV2lu TlQuICBJdCBpcyBuZWVkZWQgdG8gc2V0dXANCiMgICAgICB0aGUgY29tcGls ZXIgZW52aXJvbm1lbnQuICBUaGlzIHJlc2V0cyBzb21lIGVudmlyb25tZW50 YWwNCiMgICAgICB2YXJpYWJsZXMgd2hpY2ggYXJlIHRyYXNoZWQgaW4gbWFr ZWZpbGVzLg0KIw0KIyAgICBOT1RFUw0KIyAgICAgIEZvciBWQyA1LCBzZXQg TVNWQ0RJUiwgTVNERVZESVIgYW5kIFZDT1NESVINCiMgICAgICBGb3IgVkMg NCwgc2V0IE1TREVWRElSIGFuZCBWQ09TRElSDQojICAgICAgVGhlc2Ugc2hv dWxkIGJlIERPUyBwYXRocywgbm90IFVuaXggcGF0aHMhDQojDQojICAgIE1P RElGSUVEICAgIChNTS9ERC9ZWSkNCiMgICAgcGNhc3RybyAgICAgMTAvMTIv MjAwMSAtIGNyZWF0ZWQNCg0KaWYgWyAiWCRNU1ZDRElSIiAhPSAiWCIgXQ0K dGhlbg0KICAjIFZDKysgNS4wIGNvbXBpbGVyDQogIGV4cG9ydCBJTkNMVURF PSIkTVNWQ0RJUi9pbmNsdWRlOyRNU1ZDRElSL21mYy9pbmNsdWRlOyRNU1ZD RElSL2FsdC9pbmNsdWRlOyRPVEhFUklOQ0xVREUiDQogIG1zdmNwYXRoPWBj eWdwYXRoIC11IC1wICIkTVNWQ0RJUi9iaW47JE1TVkNESVIvYmluLyRWQ09T RElSOyRNU0RFVkRJUi9iaW47JE1TREVWRElSL2Jpbi9pZGUiYA0KICBleHBv cnQgUEFUSD0iJG1zdmNwYXRoOiRQQVRIIg0KICAjIGludm9rZSByZWFsIGNv bXBpbGVyDQogIGNsICQqDQplbHNlDQogaWYgWyAiWCRNU0RFVkRJUiIgIT0g IlgiIF0NCiB0aGVuDQojIFZDKysgNC4yIGNvbXBpbGVyDQogIGV4cG9ydCBJ TkNMVURFPSIkTVNERVZESVIvaW5jbHVkZTskTVNERVZESVIvbWZjL2luY2x1 ZGU7JE1TREVWRElSL2FsdC9pbmNsdWRlOyRPVEhFUklOQ0xVREUiDQogIG1z dmNwYXRoPWBjeWdwYXRoIC11IC1wICIkTVNERVZESVIvYmluOyRNU0RFVkRJ Ui9iaW4vJFZDT1NESVIiYA0KICBleHBvcnQgUEFUSD0iJG1zdmNwYXRoOiRQ QVRIIg0KIyBpbnZva2UgcmVhbCBjb21waWxlcg0KICBjbCAkKg0KIGVsc2UN CiAgZWNobyAiUGxlYXNlIHNldCBjb21waWxlciBlbnZpcm9ubWVudCINCiAg ZXhpdCAxDQogZmkNCmZpDQpleGl0ICQ/DQo= ---1463811071-660104087-1036187213=:23333 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=link Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: link Content-Disposition: attachment; filename=link IyEvYmluL3NoDQojDQojICRIZWFkZXI6JA0KIw0KIyBsaW5rDQojDQojICBD b3B5cmlnaHQgKGMpIE9yYWNsZSBDb3Jwb3JhdGlvbiAyMDAwLiBBbGwgUmln aHRzIFJlc2VydmVkLg0KIw0KIyAgICBOQU1FDQojICAgICAgbGluayAtIFZp c3VhbCBDKysgbGlua2VyIHdyYXBwZXINCiMNCiMgICAgREVTQ1JJUFRJT04N CiMgICAgICBVc2VkIHdpdGggdGhlIEN5Z1dpbiBlbnZpcm9ubWVudCBvbiBX aW5OVC4gI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IvbWZjL2luY2x1ZGU7JE1TREVWRElSL2FsdC9pbmNsdWRl OyRPVEhFUklOQ0xVREUiDQogIG1zdmNwYXRoPWBjeWdwYXRoIC11IC1wICIk TVNERVZESVIvYmluOyRNU0RFVkRJUi9iaW4vJFZDT1NESVIiYA0KICBleHBv cnQgUEFUSD0iJG1zdmNwYXRoOiRQQVRIIg0KIyBpbnZva2UgcmVhbCBsaW5r ZXINCiAgbGluayAkKg0KIGVsc2UNCiAgZWNobyAiUGxlYXNlIHNldCBjb21w aWxlciBlbnZpcm9ubWVudCINCiAgZXhpdCAxDQogZmkNCmZpDQpleGl0ICQ/ DQo= ---1463811071-660104087-1036187213=:23333 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=dumpbin Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: dumpbin Content-Disposition: attachment; filename=dumpbin IyEvYmluL3NoDQojDQojICRIZWFkZXI6JA0KIw0KIyBkdW1wYmluDQojDQoj ICBDb3B5cmlnaHQgKGMpIE9yYWNsZSBDb3Jwb3JhdGlvbiAyMDAwLiBBbGwg UmlnaHRzIFJlc2VydmVkLg0KIw0KIyAgICBOQU1FDQojICAgICAgZHVtcGJp biAtIGR1bXBiaW4gd3JhcHBlcg0KIw0KIyAgICBERVNDUklQVElPTg0KIyAg ICAgIFVzZWQgd2l0aCB0aGUgQ3lnV2luIGVudmlyb25tZW50IG9uIFdpbk5U LiAgSXQgaXMgbmVlZGVkIHRvIHNldHVwDQojICAgICAgdGhlIGNvbXBpbGVy IGVudmlyb25tZW50LiAgVGhpcyByZXNldHMgc29tZSBlbnZpcm9ubWVudGFs DQojICAgICAgdmFyaWFibGVzIHdoaWNoIGFyZSB0cmFzaGVkIGluIG1ha2Vm aWxlcy4NCiMNCiMgICAgTk9URVMNCiMgICAgICBGb3IgVkMgNSwgc2V0IE1T VkNESVIsIE1TREVWRElSIGFuZCBWQ09TRElSDQojICAgICAgRm9yIFZDIDQs IHNldCBNU0RFVkRJUiBhbmQgVkNPU0R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mkNCmV4aXQgJD8NCg== ---1463811071-660104087-1036187213=:23333 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ ---1463811071-660104087-1036187213=:23333--