How to build windres to run on OS X

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to build windres to run on OS X

Tom Bishop, Wenlin Institute
Could anyone please explain how to build windres to run on OS X (or  
Darwin)? I downloaded and installed binutils-2.16.1, which includes  
windres.c, but windres is still not built or installed. The docs for  
windres say:

"Warning: windres is not always built as part of the binary utilities,  
since it is only useful for Windows targets."

What I'm trying to do is cross-compile the MS-Windows version of an  
application, using a Macintosh. I've followed the instructions for  
"Installing and Using the MinGW Cross-Compiler on Mac OS X" using  
DarwinPorts

(URL:  
http://landonf.bikemonkey.org/code/win32/ 
MinGW.20041207231336.1583.sulu.html).

It all seems fine except for no windres. I hope it's as simple as  
adding an option to the "configure" script for binutils, but it's  
awfully complicated; for example, I don't know what's going on in this  
line:

        if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then

Below that is this line:

        ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.

That "override" comment looks promising, if only I knew what it meant.

Thanks in advance for any help.

Best wishes,

Tom Bishop

文林 Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: [hidden email]     Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)


Reply | Threaded
Open this post in threaded view
|

Re: How to build windres to run on OS X

Daniel Jacobowitz-2
On Sat, Jun 18, 2005 at 11:45:22AM -0700, Wenlin Institute wrote:

> Could anyone please explain how to build windres to run on OS X (or  
> Darwin)? I downloaded and installed binutils-2.16.1, which includes  
> windres.c, but windres is still not built or installed. The docs for  
> windres say:
>
> "Warning: windres is not always built as part of the binary utilities,  
> since it is only useful for Windows targets."
>
> What I'm trying to do is cross-compile the MS-Windows version of an  
> application, using a Macintosh. I've followed the instructions for  
> "Installing and Using the MinGW Cross-Compiler on Mac OS X" using  
> DarwinPorts

Try configuring binutils for the right target:
--target=i686-pc-mingw32.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: How to build windres to run on OS X

Tom Bishop, Wenlin Institute

On Jun 18, 2005, at 14:46, Daniel Jacobowitz wrote:

> On Sat, Jun 18, 2005 at 11:45:22AM -0700, Wenlin Institute wrote:
>> Could anyone please explain how to build windres to run on OS X (or
>> Darwin)? I downloaded and installed binutils-2.16.1, which includes
>> windres.c, but windres is still not built or installed. The docs for
>> windres say:
>>
>> "Warning: windres is not always built as part of the binary utilities,
>> since it is only useful for Windows targets."
>>
>> What I'm trying to do is cross-compile the MS-Windows version of an
>> application, using a Macintosh. I've followed the instructions for
>> "Installing and Using the MinGW Cross-Compiler on Mac OS X" using
>> DarwinPorts
>
> Try configuring binutils for the right target:
> --target=i686-pc-mingw32.

Thanks, I just tried that, but now I get an error message when I run  
"make". Here's what I did:

        cd /binutils-2.16.1
        ./configure --target=i686-pc-mingw32

-- that seems to run OK, but then when I ran "make", here is what  
appeared:

------------------------------------------------------------------------
-------------
Configuring in libiberty
configure: loading cache ./config.cache
configure: error: `target_alias' has changed since the previous run:
configure:   former value:  powerpc-apple-darwin7.9.0
configure:   current value: i686-pc-mingw32
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and  
start over
make: *** [configure-libiberty] Error 1
------------------------------------------------------------------------
-------------

So, I ran "make distclean", which produced this output:

------------------------------------------------------------------------
-------------
rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
rm -f Makefile config.status config.cache mh-frag mt-frag
rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp
if [ "i686-pc-mingw32" != "." ]; then \
   rm -rf i686-pc-mingw32; \
else true; fi
rm -rf build-powerpc-apple-darwin7.9.0
if [ "." != "." ]; then \
   rm -rf .; \
else true; fi
rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
rm -f texinfo/doc/Makefile texinfo/po/POTFILES
rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
make: [local-distclean] Error 1 (ignored)
rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
make: [local-distclean] Error 1 (ignored)
rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
make: [local-distclean] Error 1 (ignored)
------------------------------------------------------------------------
-------------

I also ran "rm ./config.cache", but at this point the result was "rm:  
./config.cache: No such file or directory".

Repeating the sequence of commands just keeps giving the same results.

I don't really understand the meaning of "target" here. I'm trying to  
compile windres on OS X, so that I can run windres on OS X. Doesn't  
that mean the "host" and "target" are both OS X? Notwithstanding the  
fact that windres itself will be used to compile an application that  
will run on MS-Windows?

Best Wishes,

Tom

文林 Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: [hidden email]     Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)


Reply | Threaded
Open this post in threaded view
|

Re: How to build windres to run on OS X

Daniel Jacobowitz-2
On Sat, Jun 18, 2005 at 03:23:35PM -0700, Wenlin Institute wrote:
> cd /binutils-2.16.1
> ./configure --target=i686-pc-mingw32
>
> -- that seems to run OK, but then when I ran "make", here is what  
> appeared:

Create a new clean source directory.  Start from scratch.

> I don't really understand the meaning of "target" here. I'm trying to  
> compile windres on OS X, so that I can run windres on OS X. Doesn't  
> that mean the "host" and "target" are both OS X? Notwithstanding the  
> fact that windres itself will be used to compile an application that  
> will run on MS-Windows?

No.  Compile on is --build, run on is --host, generate code for is
--target.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: How to build windres to run on OS X

Tom Bishop, Wenlin Institute

On Jun 18, 2005, at 16:16, Daniel Jacobowitz wrote:

> On Sat, Jun 18, 2005 at 03:23:35PM -0700, Wenlin Institute wrote:
>> cd /binutils-2.16.1
>> ./configure --target=i686-pc-mingw32
>> ...

> Create a new clean source directory.  Start from scratch.

That seems to have worked. Thank you very much!

(By the way, a note for those like me to whom it's not obvious: the
result is "/opt/local/bin/i386-mingw32-windres".)

>  Compile on is --build, run on is --host, generate code for is
> --target.

Thanks for explaining that!

Best wishes,

Tom

> --
> Daniel Jacobowitz
> CodeSourcery, LLC
>
>

文林 Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: [hidden email]     Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)