porting linux ./configure make programs

8 posts / 0 new
Last post
billt
billt's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2011-02-04 18:54
porting linux ./configure make programs

A lot of open-source stuff from Linux uses the untar then ./configure then make method of compiling to install. When porting such things to AmigaOS, does one use an Amiga configure program/script, or does that part go away? If it is used, does one have to rewrite the program's configure information for ./configure to use, or should it work with Amiga's ./configure setup as it is? Does one need to use abc-shell for that?

I'm just trying to get some basics sorted out for this stuff, and I appreciate all the help until I'm useful. I'm sure there's plenty more I'll be asking about... :)

P.S. Are answers available for both OS4-native coding/compiling as well as for cross-compiling from Linux on my laptop, as my laptop is what I'll mostly be able to access and use? (I do plan to get my XE running a VNC server soon though)

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: porting linux ./configure make programs

I personally have no idea, as I've never been good at porting stuff. However SpotUP has written a good guide on how to port stuff. SpotUP is responsible for porting a large number of apps that are currently available on os4depot (click here for the list), so he certainly knows how it's done.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

kas1e
kas1e's picture
Offline
Last seen: 3 months 6 days ago
Joined: 2010-11-30 15:30
@Billt A lot of open-source

@Billt


A lot of open-source stuff from Linux uses the untar then ./configure then make method of compiling to install. When porting such things to AmigaOS, does one use an Amiga configure program/script, or does that part go away?

How unpacking archive (by untar or by zip or by bzip) just depens of how archive packed, so all those "tar -zxvf archive.tar.gz" its not 100% necessary, but yep, you can unpack it in the same manner from the shell, or by unarc, not so matter.

About "./configure and make" - in some cases software will have it, in some will have other deps (cmake, scons, makeconf and other stuff), or just bunch of source files , and it will be your work to find out how to compile and build all of this.


If it is used, does one have to rewrite the program's configure information for ./configure to use, or should it work with Amiga's ./configure setup as it is?

To make "configure" works for any more or less normal project (not very small one), you will need to play a bit with configure itself, check on the stage of configuring error log, and add correct deps , if aos4 not grabs them automatically by any of reassons.


Does one need to use abc-shell for that?

In most cases plain amiga shell are enough , but when is not, then abc-shell.


P.S. Are answers available for both OS4-native coding/compiling as well as for cross-compiling from Linux on my laptop, as my laptop is what I'll mostly be able to access and use? (I do plan to get my XE running a VNC server soon though)

If you have plans to do porting from unix world, then you better to setup cross-compiler for a numeric reassons:
1. It will be fast
2. There will be no problems with "./configure" at all, and in most cases its all will be automatically, all what you will need its add something like "./configure -host=cygwin -target=ppc-amigaos".
3. Cygwin will have all those "cmake, autoconf and stuff", which not available on aos4 natively (and because of it, some unix projects possible normally to compile only on cross-compiller setup).

Through, its all not that easy as someone can think, its too simplicifyed by users , and everyone start to think that ports its only ./configure; make, while is not. Usually you will need to add some work (and sometime quite a lot work) into the code of porting programm itself, to make all of this works as should, like amiga-kind path, adding stack cookie, removing of forks, porting of necessary 3d party libs for making final linking, fixing endianes issues if they present, rewriting some parts of code in case of limitations in some areas and so on.

Thematic
Thematic's picture
Offline
Last seen: 3 years 11 months ago
Joined: 2011-10-25 02:51
Paths can often be taken care

Paths can often be taken care of automatically, linking with -lunix. It just doesn't take care of the case, where the program gets the idea of looking for user home directory, so at that point you change some code.

configure scripts when compiling natively are tricky in that it's often not clear whether using them is worth the effort. If it's a really verbose script (like those pesky GNU projects have), at least manual editing could be a lot of work. On the other hand, if the project is neat and doesn't have a lot of options in its dependencies, it can be better to just do a Makefile.os4, especially if you update the program from time to time and the source structure doesn't dramatically change. Such makefiles have the benefit of being much more human readable, than unix shell scripts or makefiles generated by them.

afxgroup
afxgroup's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2011-02-03 15:26
I've ported a lot of linux

I've ported a lot of linux stuff using macosx, linux and windows using cywing.
You have to set up a correct enviroment to work without any problem.
Regard the port itself, well, this depends from the project. You could port a simply library without any problem. Just specify the prefix and the host in the configure command:

./configure --prefix=/usr/local/amiga/ppc-amigaos/SDK/local/newlib --host=ppc-amigaos

and this is the trick. But if the project is a large project you will have to change a lot of things.
Keep in mind that actually cygwin is the slower enviroment.. maybe you should try to set up a mingw enviroment instead of the cygwin one, but cygwin is more complete and unix scripts will work without any problems

Antikken
Antikken's picture
Offline
Last seen: 12 years 5 months ago
Joined: 2011-05-19 22:37
How do you make configure

How do you make configure file when all you have is:
configure.ac
autogen.sh
Makefile.am

Trying to do this from os4 btw.

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: porting linux ./configure make programs

How do you make configure file when all you have is:
configure.ac
autogen.sh
Makefile.am

Trying to do this from os4 btw.

That requires automake/autoconf, which unfortunately doesn't work properly on AmigaOS. Your best bet is to install a cross-compiler environment on Linux, and use autoconf there. You have to tell it that the target is AmigaOS. Don't ask me how, as I've never actually done this. Others here have though.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

kas1e
kas1e's picture
Offline
Last seen: 3 months 6 days ago
Joined: 2010-11-30 15:30
@Antikken On os4 you out of

@Antikken

On os4 you out of luck (only if you will try to mimik all what autogen.sh do, but that will be hell of boring work). The only good and easy way is as Hans say: crosscompiler. I usually do those steps: after unpacking stuff on crosscompiler, i run ./autogen.sh (without any options), and that create for me usually "configure" and/or "makefile" (sometime both, sometime one of them). At this moment there is nothing about os4 of course. And then, if configure creates i go classic way like

  1. # ./configure --build=i686-pc-cygwin --host=ppc-amigaos

And then adapt makefile if need it, or, if makefile done after autogen, then configure again, or manual modication of makefile.

By that way i build for example games like teewords, warzone2100, epiar and some others, and if you also want to works with automake/autoconf stuff, then crosscompiler is only real way.

Log in or register to post comments