Building with cygwin
Salter, Thomas A
Thomas.Salter at unisys.com
Tue Jan 12 16:11:10 UTC 2010
Since you've posted links to the binary form of make.exe that works with OpenJDK, can you find out from whoever built that what the right settings are for building it? As you say, I shouldn't have needed to tweek anything so I probably got something wrong. The instructions ought to be included with OpenJDK readme or some similarly accessible place.
-----Original Message-----
From: Kelly.Ohair at Sun.COM [mailto:Kelly.Ohair at Sun.COM]
Sent: Monday, January 11, 2010 4:47 PM
To: Salter, Thomas A
Cc: build-dev at openjdk.java.net
Subject: Re: Building with cygwin
Great that you got it to work.
Salter, Thomas A wrote:
> Thanks for all your help. I seem to be making progress now.
>
> In order to use GNU MAKE with CYGWIN, I built it from the source at cygwin, as follows:
> 1. Followed the instructions for generic Unix builds instead of those in README.W32.
Yes, that makes sense, I don't think README.W32 is for CYGWIN.
> 2. After running configure, defined HAVE_DOS_PATHS in config.h to handle the drive letter issues.
That makes sense.
> 3. Made a minor fix to job.c where it implicitly assumed that HAVE_DOS_PATHS would not be set unless WINDOWS32 was also set.
Humm... interesting tweek, seems like you should not have needed to do that,
but maybe WINDOWS32 and HAVE_DOS_PATHS both need to be set globally?
> 4. Ran make from a bash prompt.
CYGWIN bash prompt, right?
>
> I'm now able to build the JDK to the point of getting familiar errors dealing with wrong paths and the wrong kind of slashes. I'm also finding occasional places where my own syntax errors were tolerated by MKS or Make 3.80, but are caught by CYGWIN and Make 3.81.
>
In general I have found that CYGWIN is pickier, but more accurate, at least
with regards to things like file permissions etc.
> One other stumbling block was that since we work primarily on Windows, \r characters frequently get into our files. I was able to solve this for the most part by setting SHELLOPTS=igncr before starting bash and adding \r to the IFS variable.
>
I don't think I ever had to do that, but I usually do my editing with
vi or in NetBeans.
Also, when I install CYGWIN, I always pick "Default Text File Type" of "Unix/Binary"
which is what they recommend.
-kto
> Tom
>
>
> -----Original Message-----
> From: Kelly.Ohair at Sun.COM [mailto:Kelly.Ohair at Sun.COM]
> Sent: Monday, January 11, 2010 11:30 AM
> To: Salter, Thomas A
> Cc: build-dev at openjdk.java.net
> Subject: Re: Building with cygwin
>
> That makes sense. The CYGWIN build will be specific to CYGWIN, and should be built
> with the gcc that comes with CYGWIN. I'm pretty sure that it's critical that all the
> CYGWIN tools share the same runtime and are built the same way.
>
> The MKS build of GNU make that I have done used the Visual Studio C/C++ compiler
> and needs to be built more as a Windows exe.
>
> -kto
>
> Salter, Thomas A wrote:
>> From what I have determined the make that works with CYGWIN requires the run time libraries CYGINTL-3.DLL and CYGWIN1.DLL. These appear to be the C runtime libraries. There is nothing in the build instructions for GNU MAKE that suggests how to build with these, in particular which compiler and linker are required. The CYGWIN files I've downloaded only include .a files, not .lib files, so I presume GCC is required rather than MSVC.
>>
>>
>>
>> -----Original Message-----
>> From: build-dev-bounces at openjdk.java.net [mailto:build-dev-bounces at openjdk.java.net] On Behalf Of Salter, Thomas A
>> Sent: Saturday, January 09, 2010 12:32 PM
>> To: Kelly.Ohair at Sun.COM
>> Cc: build-dev at openjdk.java.net
>> Subject: RE: Building with cygwin
>>
>> I've narrowed it down to make. There is definitely something different about the make.exe that I downloaded from your link, http://cr.openjdk.java.net/~ohair/MakeBinaries/cygwin-windows-i586/ and the one I'm trying to build from GNU Make source. I did a simple sanity test from the base OpenJDK source and your make.exe works, but mine does not. So I guess I now need instructions on how to build make.exe correctly.
>>
>>
>>
>>
>> -----Original Message-----
>> From: build-dev-bounces at openjdk.java.net [mailto:build-dev-bounces at openjdk.java.net] On Behalf Of Salter, Thomas A
>> Sent: Saturday, January 09, 2010 11:52 AM
>> To: Kelly.Ohair at Sun.COM
>> Cc: build-dev at openjdk.java.net
>> Subject: RE: Building with cygwin
>>
>> I've built gnu make for both 3.80 and 3.81 with these defined in config.h.W32:
>> HAVE_DOS_PATHS
>> HAVE_CYGWIN_SHELL
>>
>> I've previously run using MKS with 3.80 with HAVE_MKS_SHELL instead of HAVE_CYGWIN_SHELL and had no problems.
>>
>>
>> I've downloaded executable forms of cygwin, but I built my own gnu make. I don't use the make that comes with cygwin. The gnu make build doesn't have any compile-time dependency on cygwin. The make.exe you referenced requires a cygwin dll. I'm not sure what all this means.
>>
>>
>>
>> -----Original Message-----
>> From: Kelly.Ohair at Sun.COM [mailto:Kelly.Ohair at Sun.COM]
>> Sent: Friday, January 08, 2010 5:14 PM
>> To: Salter, Thomas A
>> Cc: build-dev at openjdk.java.net
>> Subject: Re: Building with cygwin
>>
>>
>> Salter, Thomas A wrote:
>>> Actually, I can't just run with that one. I've a minor change to make related to tabs that's needed in my environment. Is that make any different than the version from GNU with the CYGWIN option turned on? I've tried that combination.
>>>
>> Don;t know what to say on that. I haven't actually built make on cygwin.
>> I did build it for Linux. Solaris, and MKS, but not cygwin.
>>
>>> I suspect I need to back up and try to build the open jdk source as-is, without changes, using cygwin. I was trying to skip directly from using MKS, while leaving private changes in the make files and source.
>>>
>> If it built with MKS, I'd be puzzled as to why cygwin would be a problem.
>>
>>> That said, the problems I'm seeing do look like quote problems.
>>>
>> Yup.
>>
>>> By the way, the readme at http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html#gmake still says to avoid gmake 3.81.
>>>
>> The issue with 3.81 on Windows was that the one provided in cygwin did not accept
>> the drive letter paths, e.g. C:/path, and we need that. As far as I know it's the
>> way the make is built that allows for C:/ paths.
>> As long as you have a 3.81 that accepts C:/, 3.81 is fine.
>>
>> However, what I found out was that 3.81 has some problems with MKS and quoting.
>> These jdk changes: http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/bf6b160b455d
>> was essentially a workaround for MKS and make 3.81 on Windows.
>> The openjdk7 makefiles will soon be requiring GNU make 3.81.
>>
>> The alternative was what was described in the README.W32 file of the source
>> distribution, I found this online copy:
>> http://www.opensource.apple.com/source/gnumake/gnumake-119/make/README.W32
>> See the section on BATCH_MODE_ONLY_SHELL.
>>
>>> What about the cygwin version? The readme just says 1.5.12 or newer. I'm using 1.7.1, which seems to be quite new.
>>>
>> Haven't seen any issues with 1.7 cygwin, but haven't used it much either.
>>
>> Again, I have not seen any issues with using the cygwin make 3.81 from
>> http://www.cmake.org/files/cygwin/make.exe
>>
>> I get the feeling that cygwin 1.7 requires a recompile, I see that there
>> is a cygwin 1.7 version at:
>> http://www.cmake.org/files/cygwin/make.exe-cygwin1.7
>>
>> I'll try and find out the formula for building GNU make 3.81 on cygwin
>> so that it accepts c:/ paths and let you know.
>>
>> -kto
>>
>>> -----Original Message-----
>>> From: Kelly.Ohair at Sun.COM [mailto:Kelly.Ohair at Sun.COM]
>>> Sent: Friday, January 08, 2010 1:21 PM
>>> To: Salter, Thomas A
>>> Cc: build-dev at openjdk.java.net
>>> Subject: Re: Building with cygwin
>>>
>>> OK. Humm...
>>>
>>> I know that GNU make 3.81 has some shell problems with MKS, but I thought
>>> cygwin was fine. And the problem was around the way the bash shell does quotes.
>>>
>>> Can you try the GNU make at
>>> http://cr.openjdk.java.net/~ohair/MakeBinaries/cygwin-windows-i586/
>>>
>>> Which should be the same as: http://www.cmake.org/files/cygwin/make.exe
>>>
>>> -kto
>>>
>>>
>>>
>>> Salter, Thomas A wrote:
>>>> That wasn't it. The path I'm using is:
>>>> Visual Studio (several directories)
>>>> GNU Make
>>>> usr/bin
>>>> JDK/bin
>>>> Windows & Windows/System
>>>>
>>>> The only echo.exe on my system is in cygwin/bin.
>>>> In any case the Windows echo is built-in to the cmd shell.
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Kelly.Ohair at Sun.COM [mailto:Kelly.Ohair at Sun.COM]
>>>> Sent: Thursday, January 07, 2010 7:22 PM
>>>> To: Salter, Thomas A
>>>> Cc: build-dev at openjdk.java.net
>>>> Subject: Re: Building with cygwin
>>>>
>>>> On both these problems I would suspect that somehow you have the
>>>> wrong "echo", and maybe it thinks it's the windows cmd echo?
>>>>
>>>> So check your PATH setting and make sure that /usr/bin is
>>>> before any Windows version of echo.
>>>>
>>>> -kto
>>>>
>>>>
>>>> Salter, Thomas A wrote:
>>>>> I've been building the JDK for years through the Sun partner program
>>>>> using MKS. Now I'm trying to build it using cygwin. I've gotten
>>>>> through the obvious path errors to the point that the make starts to
>>>>> run. I'm getting a lot of errors, but two in particular seem like they
>>>>> should be easy to diagnose. I'm sure I'm missing something simple.
>>>>>
>>>>> 1. Errors that seem related to parameter parsing by gnumake or bash:
>>>>>
>>>>> C:/Java/Jdkdrive/cygwin/bin/tr: missing operand after `[A-Z] [a-z]'
>>>>> Two strings must be given when translating.
>>>>> Try `C:/Java/Jdkdrive/cygwin/bin/tr --help' for more information.
>>>>>
>>>>> This translate pattern only seems to appear once in the various JDK make
>>>>> files:
>>>>>
>>>>> jdk\make\common\shared\Defs-control.gmk:
>>>>> BUNDLE_DATE := $(shell $(DATE) '+%d_%b_%Y' | $(TR) "[A-Z]" "[a-z]")
>>>>>
>>>>> It seems as though two parameters were collapsed into one.
>>>>>
>>>>>
>>>>> 2. Problem with printf in make files:
>>>>>
>>>>> This string appears in the output many times:
>>>>> n%-60.60snn#####
>>>>>
>>>>> This seems to originate from this or similar code in make\Defs-internal.gmk:
>>>>>
>>>>> define MakeStart
>>>>> $(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n" \
>>>>> "########################################################################" \
>>>>> "########################################################################" \
>>>>> "Entering $1 for target $2" \
>>>>> "########################################################################"
>>>>> endef
>>>>>
>>>>>
>>>>>
>>>>> Any ideas what I might have done wrong?
>>>>>
>>>>> Software versions:
>>>>>
>>>>> * latest cygwin, version 1.7.1, which I just downloaded this week.
>>>>> * GNU Make is version 3.80, source downloaded from GNU a long time
>>>>> ago. Rebuilt this week setting the cygwin option instead of the
>>>>> mks option.
>>>>> * Windows 7, 64-bit OS. (but I'm using 32-bit versions of the
>>>>> utilities).
>>>>>
>>>>>
>>>>>
>>>>>
More information about the build-dev
mailing list