porting: Linux to Freebsd

Charlie Kester corky1951 at comcast.net
Mon Oct 4 00:47:55 UTC 2010


On Fri 01 Oct 2010 at 23:42:30 PDT Chetan Shukla wrote:
>Hi,
>Could someone please outline the steps needed in porting a general
>application from Linux to FreeBSD.

As others have already pointed out, there are no shortcuts to the
righthand side of the learning curve.

For most apps, the usual "configure; make; make install" works.  It's
when it doesn't that you need to be able to draw on the kind of
experience that puts you on the righthand side of the curve.  In some
cases, you really do need to be able to debug and write some code
yourself.

Apps written in Python or Perl tend to port fairly easily, because the
folks who have ported the languages and their main libraries have
already done most of the hard work.  

C and C++ apps, on the other hand, are more likely to surface
differences in the Linux and FreeBSD API's.  If you're porting one of
those, you need to be willing and able to dig in and research those
APIs. 

For a good grounding in the UNIX API's, I'd recommend the Stevens/Rago
book "Advanced Programming in the UNIX Environment".  

The Avoiding Linuxisms article also has a lot of useful information.  

The Porter's Handbook contains most of what you'll need to know once
you've got the app built and running OK and you want to add it to the
portstree.  (I say "most" because you'll still need to have some
profiency with BSD makefiles, and the Handbook doesn't teach you that.)


More information about the freebsd-ports mailing list