Author Topic: Process of porting?  (Read 367 times)

UberN00b

  • Hero Member
  • *****
  • Posts: 529
  • Reputation: 23
  • Perfection is a process.
  • Computers: em250-kav60 netbook
  • iDevices: iPhone 4
Process of porting?
« on: August 30, 2012, 01:06:00 am »
All the talk I've seen on this forum is about compiling all the necessary files of whatever the project is and 9/10 google links gives me "porting Siri to iOS"

1. So what is the process of successfully porting to iOS?
2. What has been the shortest and longest length in time its taken you(whomever) to port an app, program or whatever?
3. What determines the manhours needed to port something? By this mean like the size of the program or whatever.

Sorry if any of this is unclear, I don't have the terminology to ask this in a more technical manner.

Edit: Somehow I missed "help porting programs to iDevice" like 6 topics down. Im reading now, but if someone would like to condense the 20 pages I have infront of me into a summary, please do. I think think the last 2 questions I asked above are still valid to continue this topic.
« Last Edit: August 30, 2012, 01:35:56 am by UberN00b »
A million strands of spiderwebs weaved to make my vest!

Trcx528

  • Haxor
  • Hero Member
  • *****
  • Posts: 4502
  • Reputation: 166
  • Google it!
    • iNinjas
  • Badges:
  • Computers: 13" 2011 Macbook Pro, 120 GB SSD and 16 GB of Ram
  • iDevices: None
Re: Process of porting?
« Reply #1 on: August 30, 2012, 01:39:49 am »
Well porting command line stuff really is described best as a branch of compiling software from source.  As expected this requires a tool chain with a compiler (gcc) headers, and libraries.  Headers are nothing more than a "what this library" is capable of type reference, and is written in C, and Libraries are binaries that are pre programmed "tasks" to automate otherwise receptive tasks. 

That being said, compiling most *niz software boils down to a few steps. 

Code: [Select]
./configure
make
make install

Some projects also come with a test suite to ensure that the program compiled correctly.  This is typically invoked with
Code: [Select]
make check

Now to dive into what this is,
./configure runs a script to set all kinds of environmental variables to help ensure successful compilation of the package, typically by creating a Makefile.  Additionally the configure script will point out missing dependencies.  A verbose log of what configure is doing is saved as config.log. 

Make reads a Makefile, and runs gcc with the options to compile the source code into the binaries, keeping all files in the local directory, or sub directory. 

Make install tells make to copy all the binaries to the standard location for binaries on the system (typically /usr/bin or /usr/local/bin)

The final (optional) step is to run make check, which run the newly compiled binaries through a test system to ensure they are working properly. 

That all is compiling, a break down of something not working at any one of those steps is when the process turns into porting. 


I will happily expand on this response if you provide more direction...hopefully this provides you with enough terminology to ask your question effectively.   

LankAsif

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2392
  • Reputation: 90
  • Forum pride 8)
  • Badges:
  • Computers: i7 with bits and pieces
  • iDevices: iPod Touch 1G (Basically storage for iNinja tools), iPhone 5
Re: Process of porting?
« Reply #2 on: August 30, 2012, 01:47:15 am »
WOW, I love this thread. Thanks guys.

Education is never achieved by wise men. it is only believed to have been achieved by fools

UberN00b

  • Hero Member
  • *****
  • Posts: 529
  • Reputation: 23
  • Perfection is a process.
  • Computers: em250-kav60 netbook
  • iDevices: iPhone 4
Re: Process of porting?
« Reply #3 on: August 30, 2012, 02:48:47 am »
Great explanation! +1
Reading through Boo's wine port was like a roller coaster ride! So porting is the trial and error process of editing the disagreeable files to make the program compile correctly. If my understanding is correct, kernels are "how this system runs" software. So you use compilers to determine the dependicies required to make programs not meant for Darwin to run crossplatformed? (it's late and I think I'm talking in circles now)
A million strands of spiderwebs weaved to make my vest!

Trcx528

  • Haxor
  • Hero Member
  • *****
  • Posts: 4502
  • Reputation: 166
  • Google it!
    • iNinjas
  • Badges:
  • Computers: 13" 2011 Macbook Pro, 120 GB SSD and 16 GB of Ram
  • iDevices: None
Re: Process of porting?
« Reply #4 on: August 30, 2012, 09:38:56 am »
Great explanation! +1
Reading through Boo's wine port was like a roller coaster ride! So porting is the trial and error process of editing the disagreeable files to make the program compile correctly. If my understanding is correct, kernels are "how this system runs" software. So you use compilers to determine the dependicies required to make programs not meant for Darwin to run crossplatformed? (it's late and I think I'm talking in circles now)

You are correct, porting is the trial and error process of getting software to compile on unsupported or unusual platforms.  On iOS one of the biggest problems when porting is a lack of valid headers. Thankfully iOS is similar enough to OS X that we can borrow headers from there. 

The kernel is the very core of the system.  It is a layer of hardware abstraction to a degree, meaning that one can write software to use kernel features, rather than writing software specific to the hardware.  All *nix kernels support the same base functions, which allows for one to support *nix as a platform rather than saying "this software will only run on a Dell 790"

Darwin is the internal name of the iOS/OS X kernel.  Linux system kernels are called Linux, and the software that runs on top of the linux kernel is called GNU.  Thus the full name of linux systems is Linux/GNU.  Gnu runs on most *nix style systems. 

Don't like seeing ads? Click here to register!

UberN00b

  • Hero Member
  • *****
  • Posts: 529
  • Reputation: 23
  • Perfection is a process.
  • Computers: em250-kav60 netbook
  • iDevices: iPhone 4
Re: Process of porting?
« Reply #5 on: August 30, 2012, 03:31:29 pm »
Thanks! So someone with no programming knowledge could a program as long as they search and find the right headers?
A million strands of spiderwebs weaved to make my vest!

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4018
  • Reputation: 217
  • Badges:
Re: Process of porting?
« Reply #6 on: August 30, 2012, 03:53:54 pm »
Yeah. That works well most of the time

Trcx528

  • Haxor
  • Hero Member
  • *****
  • Posts: 4502
  • Reputation: 166
  • Google it!
    • iNinjas
  • Badges:
  • Computers: 13" 2011 Macbook Pro, 120 GB SSD and 16 GB of Ram
  • iDevices: None
Re: Process of porting?
« Reply #7 on: August 30, 2012, 10:55:47 pm »
Thanks! So someone with no programming knowledge could a program as long as they search and find the right headers?
Well programming knowledge helps of course, but I had only very basic knowledge of C when I started porting, but still most times the errors are pretty easily identified.  A file not found error for net/route.h tends to indicate that route.h is missing from the /usr/include/net folder.  Stuff like that.