To bKgu

This particular forum is archives, bug reports should be made at https://github.com/visualboyadvance-m/v ... e-m/issues


mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

To bKgu

Post by mudlord »

I noticed the Makefile was deleted. How does one build the following?

 

VBA-M SDL for UNIX from UNIX

VBA-M SDL for UNIX from UNIX using x86 assembly

VBA-M SDL for Windows from Windows

VBA-M SDL for Windows from UNIX

 

Thanks.

bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

To bKgu

Post by bgK »

So, to build VBA-M SDL from Unix :

In the source code tree, run :

cmake .

make

make install

 

The ASM core can't be built from Unix, because the asm code is not compatible with newer GCCs. However, the ASM scalers will be used if nasm is found.

 

To build VBA-M SDL from Windows, you have to use a msys environment (with all the dependencies), and install cmake from http://www.cmake.org/

Then it builds exactly the same way as under Unix

 

You can't build VBA-M SDL with the ASM core from Windows, that's a limitation of the cmake script. I'll try to fix that.

 

I can restore the old Makefile if you want.

Nach
Junior Member
Posts: 31
Joined: Tue Mar 18, 2008 10:02 am

To bKgu

Post by Nach »

The ASM core can't be built from Unix, because the asm code is not compatible with newer GCCs. However, the ASM scalers will be used if nasm is found.

So if NASM is found, it will link HQXx in assembly, and otherwise C? I can't have fine control of that? (I regularly have systems with NASM installed that aren't x86, or situations where it is x86, but I want to test without it).

 

To build VBA-M SDL from Windows, you have to use a msys environment (with all the dependencies), and install cmake from http://www.cmake.org/

Then it builds exactly the same way as under Unix

I find that to be ridiculous :ashamed:

 

You also didn't answer the last question:

 

VBA-M SDL for Windows from UNIX

Last edited by Nach on Thu Jun 05, 2008 2:43 am, edited 1 time in total.
bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

To bKgu

Post by bgK »

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

The ASM core can't be built from Unix, because the asm code is not compatible with newer GCCs. However, the ASM scalers will be used if nasm is found.

So if NASM is found, it will link HQXx in assembly, and otherwise C? I can't have fine control of that? (I regularly have systems with NASM installed that aren't x86, or situations where it is x86, but I want to test without it).

</div></blockquote>

I'm sorry, I was mistaken, the ASM scalers will only be used if you call cmake with :

cmake USEASM=1 .

 

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

To build VBA-M SDL from Windows, you have to use a msys environment (with all the dependencies), and install cmake from http://www.cmake.org/

Then it builds exactly the same way as under Unix

I find that to be ridiculous :ashamed:

</div></blockquote>

I'm sorry if it is the standard way to build Unix programs under Windows. Most programs use the autotools wich require msys. I consider cmake as just another package for mingw.

 

You also didn't answer the last question:

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

VBA-M SDL for Windows from UNIX

</div></blockquote>

I'm no specialist of cross compilation. I guess it can be done in a similar way to the old Makefile.

Nach
Junior Member
Posts: 31
Joined: Tue Mar 18, 2008 10:02 am

To bKgu

Post by Nach »

I'm sorry, I was mistaken, the ASM scalers will only be used if you call cmake with :

cmake USEASM=1 .

Okay, thank you.

 

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

To build VBA-M SDL from Windows, you have to use a msys environment (with all the dependencies), and install cmake from http://www.cmake.org/

Then it builds exactly the same way as under Unix

I find that to be ridiculous :ashamed:

</div></blockquote>

I'm sorry if it is the standard way to build Unix programs under Windows. Most programs use the autotools wich require msys. I consider cmake as just another package for mingw.

</div></blockquote>

We didn't require autotools or msys to build the SDL port on Windows before. I don't mind requiring cmake, but if we're requiring cmake, and it needs to be used through msys, I think that is getting out of hand.

 

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

You also didn't answer the last question:

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

VBA-M SDL for Windows from UNIX

</div></blockquote>

I'm no specialist of cross compilation. I guess it can be done in a similar way to the old Makefile.

</div></blockquote>

So can we setup cross compilation somehow with cmake? Because I have no idea how to use cmake. It just means we have to change the calls to GCC and NASM, and a couple of flags.

bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

To bKgu

Post by bgK »

We didn't require autotools or msys to build the SDL port on Windows before. I don't mind requiring cmake, but if we're requiring cmake, and it needs to be used through msys, I think that is getting out of hand.

Oh, I just thought about it: you can generate VS projects using cmake. It has a nice GUI for Windows to do so. I've not tested it though.

 

So can we setup cross compilation somehow with cmake? Because I have no idea how to use cmake. It just means we have to change the calls to GCC and NASM, and a couple of flags.

I just found that :

http://www.cmake.org/Wiki/CMake_Cross_Compiling

It looks like all you have to do is creating a "toolchain file" corresponding to the target platform.

Nach
Junior Member
Posts: 31
Joined: Tue Mar 18, 2008 10:02 am

To bKgu

Post by Nach »

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

We didn't require autotools or msys to build the SDL port on Windows before. I don't mind requiring cmake, but if we're requiring cmake, and it needs to be used through msys, I think that is getting out of hand.

Oh, I just thought about it: you can generate VS projects using cmake. It has a nice GUI for Windows to do so. I've not tested it though.

</div></blockquote>

Last thing I want is a VS project. I'd like a Makefile for MinGW, and a Makefile for cl.exe

 

<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="114" data-ipsquote-contentclass="forums_Topic"><div>

So can we setup cross compilation somehow with cmake? Because I have no idea how to use cmake. It just means we have to change the calls to GCC and NASM, and a couple of flags.

I just found that :

http://www.cmake.org/Wiki/CMake_Cross_Compiling

It looks like all you have to do is creating a "toolchain file" corresponding to the target platform.

</div></blockquote>

Can you give me a hand in making such a thing?

Nach
Junior Member
Posts: 31
Joined: Tue Mar 18, 2008 10:02 am

To bKgu

Post by Nach »

Well, I went to install cmake, 20MB, why so huge?

 

Well, I just tried to edit this, I made these changes:

 

Code: Select all

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 557)
+++ CMakeLists.txt      (working copy)
@@ -3,6 +3,12 @@
INCLUDE(CMakeScripts/CMakeDetermineASMCompiler.cmake)
INCLUDE(CMakeScripts/CMakeASMInformation.cmake)

+IF ( WINCROSS )
+    SET( CMAKE_C_COMPILER i586-mingw32-gcc )
+    SET( CMAKE_CXX_COMPILER i586-mingw32-g++ )
+    SET( WIN32 1 )
+ENDIF ( WINCROSS )
+
PROJECT(VBA-M ASM C CXX)

FIND_PACKAGE ( ZLIB REQUIRED )
@@ -44,7 +50,11 @@

ADD_DEFINITIONS (-DVERSION='"${VERSION}"' -DPKGDATADIR='"${PKGDATADIR}"' -DPACKAGE='')

-SET( CMAKE_ASM_FLAGS "-Isrc/hq/asm/ -O1 -DELF")
+IF ( WIN32 )
+    SET( CMAKE_ASM_FLAGS "-Isrc/hq/asm/ -O1")
+ELSE ( WIN32 )
+    SET( CMAKE_ASM_FLAGS "-Isrc/hq/asm/ -O1 -DELF")
+ENDIF ( WIN32 )
SET( CMAKE_C_FLAGS "-O3 -Wall")
SET( CMAKE_CXX_FLAGS "-O3 -Wall")

And ran with "cmake WINCROSS=1 .", and it still builds the exact same file. It's not using the compilers I told it to.

 

Furthermore, is there anyway I can see what it's actually doing? This percentage thing instead of build commands is EXTREMELY annoying.

Last edited by Nach on Thu Jun 05, 2008 8:53 pm, edited 1 time in total.
bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

To bKgu

Post by bgK »

To display all the commands :

make VERBOSE=1

(set CMAKE_VERBOSE_MAKEFILE to 1 to enable it by default)

 

To pass an argument :

cmake -DWINCROSS=1 .

 

To generate a MinGW Makefile :

cmake -G "MinGW Makefiles" .

 

To generate a NMake Makefile :

cmake -G "NMake Makefile" .

Last edited by bgK on Fri Jun 06, 2008 4:39 am, edited 1 time in total.
Nach
Junior Member
Posts: 31
Joined: Tue Mar 18, 2008 10:02 am

To bKgu

Post by Nach »

Okay, I changed how I ran cmake, it's still using /usr/bin/c++ as opposed to i586-mingw32-g++, why is this? Thanks for the other info.

Post Reply