Porting Axel

Hello;
There is my first attempt to build/compile axel download manager inside haiku machine.
Haiku shredder 1 hrev51074 Apr 7 2017 17:35:32 BePC x86 Haiku
axel-2.4.tar.gz

As far as I could gather axel has no dependencies. So it makes it a good choice for the first attempt.
on first go I get:


axel-2.4> ./configure 
WARNING: Internationalization disabled, you don't have the necessary files
         installed.

The strip option is enabled. This should not be a problem usually, but on some
systems it breaks stuff.

WARNING: This architecture is unknown!

That does not mean Axel will not work, it just means I've never had the chance
to test Axel on it. It'd be a great help if you could send me more information
about your platform so I can add it to the build tools.
You can try to build the program now, if you wish, this default setup might
just work.

Configuration done:
  Internationalization disabled.
  Debugging disabled.
  Binary stripping enabled.
~/Downloads/axel/axel-2.4> make
gcc -c axel.c -o axel.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c conf.c -o conf.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c conn.c -o conn.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c ftp.c -o ftp.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c http.c -o http.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c search.c -o search.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
gcc -c tcp.c -o tcp.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os 
/boot/home/Downloads/axel/axel-2.4/tcp.c: In function `get_if_ip':
/boot/home/Downloads/axel/axel-2.4/tcp.c:95: `SIOCGIFADDR' undeclared (first use in this function)
/boot/home/Downloads/axel/axel-2.4/tcp.c:95: (Each undeclared identifier is reported only once
/boot/home/Downloads/axel/axel-2.4/tcp.c:95: for each function it appears in.)
Makefile:60: recipe for target 'tcp.o' failed
make: *** [tcp.o] Error 1

the function in question in tcp.c :

 int get_if_ip( char *iface, char *ip )
{
	struct ifreq ifr;
	int fd = socket( PF_INET, SOCK_DGRAM, IPPROTO_IP );
	
	memset( &ifr, 0, sizeof( struct ifreq ) );
	
	strcpy( ifr.ifr_name, iface );
	ifr.ifr_addr.sa_family = AF_INET;
	if( ioctl( fd, SIOCGIFADDR, &ifr ) == 0 )
	{
		struct sockaddr_in *x = (struct sockaddr_in *) &ifr.ifr_addr;
		strcpy( ip, inet_ntoa( x->sin_addr ) );
		return( 1 );
	}
	else
	{
		return( 0 );

~> /boot/home/Desktop/axel -V
Axel version 2.3 (Haiku)

Copyright 2001-2002 Wilmer van der Gaast.
~>

Where could I download the axel for haiku? or did you build it yourself?

http://www.fayloobmennik.net/6952279

1 Like

jstln, axel already ported, see here: https://github.com/haikuports/haikuports/tree/master/net-misc/axel
You should install and set up haikuporter, then you can install it like:
# haikuporter axel
If you get any problem, create an issue at the github page.

Umm, it seems the recipe is broken, but i’m already on my way to fix it you…

@extrowerk;Thanks
but the fact remains that is broken!

also; we need to add two Gentoo patches. to solve redirect and other issues in axel.

jstln: it actually not SOOO broken. Some minutes to fix, maybe later you will also get some experience in writing recipes, and then you will be also able to do it, but i do it for now.

Ok, it is here: https://github.com/haikuports/haikuports/pull/1278
Tested only on AMD64, ofc.

Happy? Axel: update to an maintained source by extrowerk · Pull Request #1279 · haikuports/haikuports · GitHub
redirect tested, works

3 Likes

really nice. yes it works :yum:
:beers: for @extrowerk