Author Topic: A few questions I didn't see any obvious answers for.  (Read 3517 times)

trashHeap (OP)

  • *
  • Posts: 33
A few questions I didn't see any obvious answers for.
« on: August 25, 2013, 09:19:59 pm »
Ive dabbled in a bit of GNU/Linux development with SDL 1.2 before and was thinking of playing around with the GCW Zero. Ive caught on to a little talk in the forums about making sure one has the "correct" make files for working with SDL and etc. Is autotools sufficient for this sort of thing, or is there some difference on OpenDingux from the GNU/Linux distros I am used to which requires additional tweaking?

Is there any recommended guides for building OPK packages? I have noticed a lot of how to guides on installing applications just seem to instruct the user to just drag and drop OPK packages to an Apps folder on the GCW Zero itself. What actually performs the install / uninstall of the packages (assuming OPK is analogous to deb or rpm.)

I am looking forward to possibly owning and developing for a GCW Zero in the future.

Surkow

  • * Administrator
  • Posts: 592
Re: A few questions I didn't see any obvious answers for.
« Reply #1 on: August 25, 2013, 11:25:59 pm »
OPK files are squashfs images which include binaries, assets and .desktop files. They are mounted read only by gmenu2x after being added to the apps directory.

Packaging documentation: https://github.com/gcwnow/buildroot/wiki/Package-file-format

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: A few questions I didn't see any obvious answers for.
« Reply #2 on: August 25, 2013, 11:30:19 pm »
If you want a GUI OPK packager, get Open Package Creator from here: https://docs.google.com/folderview?id=0B9EgGumkJaabSE9TaEdFbVVBSlU

It runs on Windows or with Mono. For mono, also grab the the mono winforms and the squashfs-tools packages.
The package creator will create the required .desktop file and then package it into an OPK.

If you prefer to not use a gui application, you may create the .desktop file yourself and use mksquashfs (part of squashfs-tools) to pack it. For a sample .desktop file, it's probably easiest to unpack one of the existing OPKs with unsquashfs.

An OPK is just the game and its data packed with some metadata. After transferring it to the Zero, it will automatically show up in the menu.

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #3 on: August 26, 2013, 12:09:19 am »
Ah, thats very slick and it means every app can bundle the relevant libraries it needs within the same OPK. I was confusing it with the opkg format because they use the same file extension and also are also associated with embedded GNU/Linux distros.


zear

  • * Moderator
  • Posts: 2379
Re: A few questions I didn't see any obvious answers for.
« Reply #4 on: August 26, 2013, 12:14:46 am »
I was confusing it with the opkg format because they use the same file extension and also are also associated with embedded GNU/Linux distros.
I thought opkg uses .ipk extensions.

DiegoSLTS

  • *
  • Posts: 365
Re: A few questions I didn't see any obvious answers for.
« Reply #5 on: August 26, 2013, 12:38:09 am »
Ive caught on to a little talk in the forums about making sure one has the "correct" make files for working with SDL and etc. Is autotools sufficient for this sort of thing, or is there some difference on OpenDingux from the GNU/Linux distros I am used to which requires additional tweaking?
I've never used autotools, but if it lets you choose a toolchain for you're makefile then it should be OK.

OpenDingux is just like any other distribution, it uses all standard gcc and sdl stuffs, but since you'll be building the binaries for the GCW using another machine, the makefiles need to point to the OD toolchain binaries instead of the default ones. It's not a hard thing to do, you just need to point to the correct binaries... if a line of a make file says "gcc", when you run the "make" command it'll execute the "gcc" binary from your machine, but if it says "<some_directory>/gcc" it'll execute that gcc binary instead. The same goes for including libraries like SDL, make sure to include the ones on the toolchain instead of the default.

Take a look at some makefiles from any emulator available to see how it's handled.

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #6 on: August 26, 2013, 01:08:59 am »
I thought opkg uses .ipk extensions.

opkg is descended from ipkg but does now seem to use its own opk extension. How to guides for making opkg compliant packages reference the 'opk' extension. The Wikipedia Opk article also redirects to opkg.
« Last Edit: August 26, 2013, 01:11:39 am by trashHeap »

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #7 on: August 26, 2013, 01:18:15 am »
I've never used autotools, but if it lets you choose a toolchain for you're makefile then it should be OK.

I know it supports switching compilers based on target architectures, but ive never really done cross compiling before. I think the hardest part would be getting it to link against the correct set of libraries.

The same goes for including libraries like SDL, make sure to include the ones on the toolchain instead of the default.

Is there a specific build of SDL one should be using from the SDK? I downloaded the SDK from 2013/7/6 but it doesn't seem to have any SDL libraries or headers in it.

« Last Edit: August 26, 2013, 01:34:01 am by trashHeap »

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #8 on: August 26, 2013, 01:27:37 am »
Ah, never mind I see SDL is hiding under ./usr/mipsel-gcw0-linux-uclibc/sysroot

zear

  • * Moderator
  • Posts: 2379
Re: A few questions I didn't see any obvious answers for.
« Reply #9 on: August 26, 2013, 01:36:56 am »
Ah, never mind I see SDL is hiding under ./usr/mipsel-gcw0-linux-uclibc/sysroot
Correct, and you want to pass -I/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/ to the compiler and  -L/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/ to the linker so they won't try to look in your host /usr/

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #10 on: August 26, 2013, 01:49:02 am »
Correct, and you want to pass -I/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/ to the compiler and  -L/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/ to the linker so they won't try to look in your host /usr/

Right, im just musing if there is a way to get one set of build scripts (something like autotools) to target both x86 and mips/GCW0. For example it would be ideal to say build whatever program one is working on in GNU/Linux with some sort of flag like --target=i686 (or whatever) and  then when one is ready to test against real hardware build it with a --target=mips-gcw0 (or whatever). #ifdef statements in the code should be able to handle changes in  things like SDL keycodes, etc.

My understanding is that cross compiling toolchains in Debian tend to support something like this out of the box w/ autotools. However Debian's mips toolchain looks incompatible with the one for GCW Zero due to different libc implementations.

I am wondering if I can integrate the existing SDK with autotools though. However, as I said Ive never actually done cross compiling before.
« Last Edit: August 26, 2013, 01:51:05 am by trashHeap »

johnnyonflame

  • *
  • Posts: 212
Re: A few questions I didn't see any obvious answers for.
« Reply #11 on: August 26, 2013, 01:53:37 am »
Correct, and you want to pass -I/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/ to the compiler and  -L/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/ to the linker so they won't try to look in your host /usr/

Right, im just musing if there is a way to get one set of build scripts (something like autotools) to target both x86 and mips/GCW0. For example it would be ideal to say build whatever program one is working on in GNU/Linux with some sort of flag like --target=i686 (or whatever) and  then when one is ready to test against real hardware build it with a --target=mips-gcw0 (or whatever). #ifdef statements in the code should be able to handle changes in  things like SDL keycodes, etc.

My understanding is that cross compiling toolchains in Debian tend to support something like this out of the box w/ autotools. However Debian's mips toolchain looks incompatible with the one for GCW Zero due to different libc implementations.

I am wondering if I can integrate the existing SDK with autotools though. However, as I said Ive never actually done cross compiling before.

you mean ./configure --host=mipsel-linux?

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #12 on: August 26, 2013, 01:55:19 am »
you mean ./configure --host=mipsel-linux?

Exactly that, but how does one get it to find the headers / libraries in the SDK, automatically?

trashHeap (OP)

  • *
  • Posts: 33
Re: A few questions I didn't see any obvious answers for.
« Reply #13 on: August 26, 2013, 02:09:45 am »
What I keep seeing online is examples of folks just setting the various include and library environmental variable before calling autogen / configure / make. I would have thought there would be a cleaner way to switch back and forth via parameters but I am just not seeing it. Ill have to play around with it.

 

Post a new topic
Post a new topic