Changing a Unix project

Hello,
I am trying to compile a project (without changes at first) that originated in Unix. It uses the header unistd.h and that pulls in a bunch of other files I don't have. It also uses #ifdef __GNUC_ to generate a compile time error that I don't have the guc u compiler. Does anyone know how I could port this to windows and get it compiled? The locaion of the source is: http://sourceforge.net/project/downloading.php?groupname=pearpc&filename=pearpc-0.4.tar.bz2&use_mirror=voxel (or http://pearpc.net/pearpc_net_package.php for the pre-comiled project). Also, this is a power PC emulator and my purpose in changing it it to enable it to restart (currently gives a warning and shuts off when reset.)

So far I've deleted the pathnames in the header files (#include "sys/io/header1.h" to #include "header1.h") and added the files and include paths to my project in VS 2008

Thanks for your interest!

enduser000
Last edited on
It will be a major effort to compile with VC++. (You would have to rewrite a significant portion of the emulator.)

You are better off just getting the GCC and using that.
Go to http://www.mingw.org/
Click on "Getting Started" (left side menu) and get the automated installer. Run it and get everything you can. Install it in the default location (C:\MinGW).

Next, click on "MSYS" (left side menu) and follow all the instructions there. (You might get away without installing updated versions of autoconf, etc.)

Finally, you'll need to get and install NASM. http://nasm.sourceforge.net/
Get the Win32 binary (2.03.01 --highlighted in green) and unzip it. Copy all the files in the new directory (nasm-2.03.01) to C:\MinGW\bin. Don't forget to copy the nasm-2.03.01\rdoff directory to C:\MinGW\bin\rdoff.

Finally, start the MSYS (accessible from the Start->Programs->MSYS menu). You are now in a linux shell. cd to the directory containing the pearpc emulator. For example, if you unzipped the emulator to D:\emulator\pearpc-0.4, type
cd /d/emulator/pearpc-0.4
Finally, to compile type:
1
2
./configure
make

If you want to install it under the MSYS emulator, also type make install.

Phew. Sorry, but this really is the easiest way to get your Mac emulator compiled.

Good luck!
Wow, that's alot. Thanks, it's cool to get bash on my computer. So I got everything in the right directories and all that except "msysCORE-1.0.11-2007.01.19-1" EDIT - got it...

when I extracted it it didn't give me anything. And the error I'm getting (./configure works fine) is after I do make
It says:
make[3]: ***[ppc.exe] Error 1
make[2]: ***[all-recursive] Error 1
make[1]: ***[all-recursive] Error 1
make: ***[all] Error

I'll keep trying to get the CORE part of msys from different locations... got it, trying again

got the same thing... any ideas :D?

If I try using a modified pearpc project (just fixed the headers, removed the path) then I get this:
make[4]: *** [ppc_alu.o] Error 1
make[4]: Leaving directory `/c/pearpc-0.4/src/cpu/cpu_jitc_x86'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/c/pearpc-0.4/src/cpu'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/c/pearpc-0.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/pearpc-0.4'
make: *** [all] Error 2
Last edited on
The default make that comes with GCC is broken under Cygwin. You have to use the special MinGW version.

The MSYS installer should have complained if you didn't have the right one...

Delete the make.exe you currently have in C:\MinGW\bin\ and then go back to http://www.mingw.org/node/19 and get the mingw32-make and install it. Once it is in there make a copy of it and name the copy make.exe. (All these belong in the C:\MinGW\bin\ directory.)

Sorry, I should have warned you about that.

You need to install MSYS from the command line. If you are just double-clicking the icon it won't work. (I should have warned you about that too...)

Let me know how you do.
Last edited on
Alright,

got the new make file, copied (replaced the old one)
and copied again (renamed make.exe)

havent installed msys from cmd, it only provides installers. how do you do this?

I'm getting fewer errors though (these):
make
make[3]: *** [ppc.exe] Error 1
make[3]: Leaving directory `c:/pearpc-0.4/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `c:/pearpc-0.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `c:/pearpc-0.4'
make: *** [all] Error 2
make install
make[2]: *** [install-man1] Error 1
make[2]: Leaving directory `c:/pearpc-0.4/doc'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `c:/pearpc-0.4/doc'
make: *** [install-recursive] Error 1

Thanks again, getting closer...
Last edited on
Hmm... at this point I'm not sure what's wrong. I'll have to download NASM and try compiling PearPC myself. Give me a day (or two...)
Okay thanks, I'll be internet-less for a couple days, then a week. but I'll still be working on it. Thanks for the help so far. Once I get it compiled I'll be looking at how they do things so I can modify it to restart... Till later,

... I'm back, little early but that's ok. What did you mean by I should install msys by command line? All they had is installers and it seemed to work. It questioned me about the location of MinGW in commnd line after I installed it...

I havent gotten it to work yet, but I think I can get it to reset afterwards. when it restarst now (SYSTEM_RESET i think) it just shuts down the cpu, that might send an indicator to close the window and clean up, so it might need to be "shut down" a different way before it is turned on again. Otherwise, I'll just try ppc_cpu_run(). Later,

enduser000
Last edited on
Topic archived. No new replies allowed.