Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - How to build for Linux amd64?

Reply to topic
Author Message
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
How to build for Linux amd64?
Post Posted: Sun Sep 05, 2010 2:00 pm
Hi,

I couldn't find instructions on how to build for Linux 64 bits. I'm using Debian Squeeze. Simply running 'make' doesn't work (wrong architecture):
otto@debian:~/meka/srcs$ make
./buildupd.exe
gcc -I. -I./tools -I./sound -Ilibs -I../include                                         -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE -DMEKA_SOUND -DMEKA_ZIP -DMEKA_PNG -DMEKA_JOY -DMEKA_Z80_DEBUGGER -Wall -march=pentium -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer  -DMARAT_Z80 -c meka.c -oobj/meka.o
meka.c:1: error: CPU you selected does not support x86-64 instruction set
meka.c:1: error: CPU you selected does not support x86-64 instruction set
make: *** [obj/meka.o] Error 1
otto@debian:~/meka/srcs$


Can anyone help?
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Sep 05, 2010 2:35 pm
Try to remove "-march=pentium" from the Makefile.
I don't think it has ever been tested on a 64-bit architecture so it would likely require other changes.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 2:50 pm
It went further, then failed. Output: http://pastebin.ca/1933362
Some said in this thread he was sucessful on 0.70, but there aren't any comments about it: http://www.smspower.org/forums/viewtopic.php?t=11165
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Sep 05, 2010 2:51 pm
Well for once you don't have Allegro installed.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 3:00 pm
Right.
Now complaining about audio.h.

The sources.txt told me to replace <seal> by <audio> in sound/sound.h, but it was already audio.h.

otto@debian:~/meka/srcs$ make
./buildupd.exe
gcc -I. -I./tools -I./sound -Ilibs -I../include                                         -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE -DMEKA_SOUND -DMEKA_ZIP -DMEKA_PNG -DMEKA_JOY -DMEKA_Z80_DEBUGGER -Wall  -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer  -DMARAT_Z80 -c meka.c -oobj/meka.o
In file included from shared.h:95,
                 from meka.c:11:
./sound/sound.h:18:57: error: audio.h: No such file or directory
In file included from shared.h:95,
                 from meka.c:11:
./sound/sound.h:65: error: expected specifier-qualifier-list before ‘HAC’
In file included from ./sound/sound.h:177,
                 from shared.h:95,
                 from meka.c:11:
./sound/sasound.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘saInitSoundCard’
make: *** [obj/meka.o] Error 1
otto@debian:~/meka/srcs$
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Sep 05, 2010 3:29 pm
Have you installed SEAL ?
Double-check whats the filename is your distribution.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 4:50 pm
Now I do. It didn't help, though.
  View user's profile Send private message
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 8:12 am
Hi

I can compile Meka under Debian amd64, but can't link it because of 32bits asm.
To compile you need to install libseal-dev and libxxf86dga-dev if you don't have it.
Also you need to modify sound/sound.h changing:

#include "audio.h" // Official SEAL distribute name

//#include "seal.h" // Debian package header file was renamed to seal.h

by

//#include "audio.h" // Official SEAL distribute name
#include "seal.h" // Debian package header file was renamed to seal.h

Once this is done, you can compile, but the proccess stops at link time.
 
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 8:18 am
Sorry, I forgot to mention that also you need to modify the Makefile deleting the ocurrences of "-march=pentium"
 
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 10:06 am
Hi again.

Ok, now I have Meka build under Debian amd64, this is how I did it:

- First you need to install this packages if you don't have it:
liballegro4.2-dev
libseal-dev
libxxf86dga-dev

- Modify sound/sound.h changing:
#else
// Uncomment the appropriate:
#include "audio.h" // Official SEAL distribute name
//#include "seal.h" // Debian package header file was renamed to seal.h
// FIXME: Need to automate this of use some Makefile trickery to detect.
#endif

by

#else
// Uncomment the appropriate:
//#include "audio.h" // Official SEAL distribute name
#include "seal.h" // Debian package header file was renamed to seal.h
// FIXME: Need to automate this of use some Makefile trickery to detect.
#endif

- Modify Makefile:
* Change where it says:
#---[ UNIX/GCC ]---------------------------------------

ifeq ($(SYSTEM), unix)

This line:
DEF_OS = -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE

By this one:
DEF_OS = -DARCH_UNIX -DX86_64 -DASM_SYMBOLS_REQUIRE_UNDERSCORE

* Change:
En
CFLAGS += -Wall -march=pentium -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer
by
CFLAGS += -Wall -march=x86-64 -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer

* Change:
OTYPE = elf
by
OTYPE = elf64

* And finally change:
En
OBJ_BLIT = $(OD)/blit.o $(OD)/blitintf.o $(OD)/eagle.o $(OD)/hq2x.o $(OD)/hq2x16.o $(OD)/hq2x32.o

By
OBJ_BLIT = $(OD)/blit.o $(OD)/blitintf.o $(OD)/eagle.o $(OD)/hq2x.o

This last change removes the hq2x16 and hq2x32 support. This is because hq2x16.asm and hq2x32.asm does not compile under 64bits, so we need to make one more change:
* In file srcs/blit.c, change:
Cambios en blit.c
void Blit_Fullscreen_HQ2X (void)
{
// Perform HQ2X into double buffer
// FIXME-OPT: Apply on full width.
hq2x_16(
(unsigned char *)((u16 *)screenbuffer->line[blit_cfg.src_sy] + 0),
(unsigned char *)((u16 *)Blit_Buffer_Double->line[blit_cfg.src_sy * 2] + 0),
MAX_RES_X+32, cur_drv->y_res, (MAX_RES_X+32)*4);
Blit_Fullscreen_Misc();
Blit_Fullscreen_CopyStretch(Blit_Buffer_Double, 2, 2);
}

por
void Blit_Fullscreen_HQ2X (void)
{
Blit_Fullscreen_Eagle();
}

This will make the HQ2X blit work as if it were Eagle.

I hope this can help.
 
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Oct 03, 2010 11:09 am
Thanks for the info.
Does it works well? (under a 64-bits architecture, I mean)
  View user's profile Send private message Visit poster's website
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 4:23 pm
Hi Bock.

Bock wrote
Thanks for the info.
Does it works well? (under a 64-bits architecture, I mean)


ok, with sound (Linux Voxware) it is so slow that is impossible to test nothing.
With no sound It works really fine, but some systems do not work.
I have tested ColecoVision, SG1000, Master System and Game Gear, the first two works really fine except for the lack of sound. Master and GameGear do not work, I get only color screens and meka writes to console in a bucle:
Quote

video_c.c::Decode_Tile_C() is empty,
tiles will not be showing.


If you give me an e-mail, I will send you some screenshots.

Greetings
jamf
gelide.sf.net
 
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Oct 03, 2010 6:25 pm
Hi, thanks for answering.

Since it's not really working well for now and the installing process isn't that simple (some of those packages aren't in the official repos), I'll wait a bit more to test again.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Oct 04, 2010 3:34 am
The Decode_Tile_C function has to be created based on the X86 assembly version. It is a pretty trivial function to implement. You can give it a look or I will someday.
  View user's profile Send private message Visit poster's website
jamf
  • Guest
Reply with quote
Post Posted: Mon Oct 04, 2010 7:27 am
I installed those packages from the official Debian repos.

Sorry, I can help with asm, long timesince the last time I programmed in assembly.

Anyway if I have time, I will give it a try.

Greetings
jamf
gelide.sf.net
 
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Mon Oct 04, 2010 10:46 pm
libseal-dev isn't.At least not for squeeze.
  View user's profile Send private message
jamf
  • Guest
Reply with quote
Post Posted: Tue Oct 05, 2010 1:40 pm
Otto wrote
libseal-dev isn't.At least not for squeeze.


You are right, It is in lenny:
packages.debian.org/lenny/libseal-dev

Greetings
jamf
 
  • Joined: 07 Aug 2007
  • Posts: 220
  • Location: Yach, Germany
Reply with quote
Post Posted: Sat Nov 20, 2010 3:06 pm
How about making another Meka release once all the Linux compilation issues have bee fixed?

Philipp
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Nov 21, 2010 1:14 am
I am taking patches if any (but wouldn't be able to test them for Linux).
  View user's profile Send private message Visit poster's website
  • Joined: 23 Feb 2015
  • Posts: 4
  • Location: Pelotas,Brazil
Reply with quote
trouble compiling svn repository to Linux Mint Debian 64 bits
Post Posted: Mon Feb 23, 2015 12:33 am
Hi guys

Anyone knows how to solve this kind of error?

g_widget.c:762:2: error: cannot convert ‘const char*’ to ‘__va_list_tag*’ for argument ‘1’ to ‘void __builtin_va_start(__va_list_tag*, ...)’
va_start(fmt, args);
^
make: ** [obj/g_widget.o] Erro 1

It seems to me something about compiling meka under 64 bits. I Found one thread in stackoverflow that has a similar problem, but dont know how to solve it. Maybe using some cast?

I couldnt insert the link, the title of the thread is "va_args and 64 bits"

Thanks for the help.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Feb 23, 2015 1:20 am
The function was incorrect (and currently unused).
I have updated SVN with a fix.

Thanks!
(the two parameters were in the wrong order)
  View user's profile Send private message Visit poster's website
  • Joined: 23 Feb 2015
  • Posts: 4
  • Location: Pelotas,Brazil
Reply with quote
Post Posted: Mon Feb 23, 2015 3:04 am
Hi Bock

Thanks for the response.
I had updated svn and could almost compile meka, but i had problems now with the function "al_init_ttf_addon":

obj/meka.o: In function `main':
meka.c:(.text.startup+0x51b): undefined reference to `al_init_ttf_addon'

I searched this function and found it on /usr/include/allegro5/allegro_ttf.h:

ALLEGRO_TTF_FUNC(bool, al_init_ttf_addon, (void));

I tried to put an include for this file on the meka main.c but the compilation did not work. Commenting this function on main.c the compilation completes, but MEKA does not run because of "Error loading font: "fonts/ProggyTinySZ.ttf""

Can be something with my installation, or is something with the code? Can I help in some way?
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Feb 23, 2015 8:52 am
You need to link with the ttf aadon library. The makefile is probably not up to date with the libraries to link with. Look out for the -l parameters in the Makefile.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Feb 2015
  • Posts: 4
  • Location: Pelotas,Brazil
Reply with quote
Post Posted: Mon Mar 02, 2015 1:45 pm
Hi Bock

Thanks for the tip. I was able to compile meka for Linux Mint 17 and for LMDE by changing the Makefile from:

ifeq ($(SYSTEM), unix)
LIB_ALLEG = `pkg-config --cflags --libs allegro-5.0 allegro_image-5.0 allegro_audio-5.0 allegro_font-5.0 allegro_primitives-5.0`
endif

to

ifeq ($(SYSTEM), unix)
LIB_ALLEG = `pkg-config --cflags --libs allegro-5.0 allegro_image-5.0 allegro_audio-5.0 allegro_font-5.0 allegro_primitives-5.0 allegro_ttf-5.0`
endif

Hope this helps.
  View user's profile Send private message
  • Joined: 01 Feb 2004
  • Posts: 1464
  • Location: Sunny ol Tamworth, New England NSW AU
Reply with quote
Post Posted: Mon Jan 25, 2016 11:48 am
lucianoloder wrote
Hi Bock

Thanks for the tip. I was able to compile meka for Linux Mint 17....


I assume you compiled this under Linux Mint 17.3 Cinnamon? I am on kernel 3.19.0-32 generic. And I assume you just need:

libs allegro-5.0
allegro_image-5.0
allegro_audio-5.0
allegro_font-5.0
allegro_primitives-5.0
allegro_ttf-5.0`

Are you able to provide specific instructions on how you compiled the software?
mint_info_jacko.png (31.79 KB)
mint_info_jacko.png

  View user's profile Send private message Visit poster's website
  • Joined: 23 Feb 2015
  • Posts: 4
  • Location: Pelotas,Brazil
Reply with quote
Post Posted: Mon Jan 25, 2016 11:07 pm
Hi Jacko

its been a while since i compiled meka, so i dont remember all the problems i had encountered.

Anyway, i compiled from the svn repo, and i just did a "svn diff > meka.txt", so all the changings i did are in this diff file, which i put here as attachment.

Reading it i noticed that the main problems i had was with relative paths in Makefile and the way allegro was included in the main file. Maybe this solves for you.

If you need anything else, i would be glad to help.
meka.txt (16.04 KB)

  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!