Thread: Porting to FreeBSD

  1. #1

    Porting to FreeBSD


    I would like to port some software that was made to compile under both Win32 and Linux systems to FreeBSD 4.8. Can anyone provide me with online information to help me do this?

    So far, I've had to use GNU make, because the provided makefile only runs under that (some info as to why this is would be nice). I've modified any ifdef statements and such to detect freebsd by using the '__FreeBSD__' constant instead of 'linux', so the code is unchanged in that it still processes the Linux code. These changes still don't let me compile successfully - the last time I compiled I received mostly syntax errors before keywords like 'int' and 'void' where a capitalized constant was being used (NEW_DLL_FUNCTIONS), but I don't know where that capitalized thing (typedef for something, I guess) is being defined - none of the sources file have it. I don't even want DLL stuff in my code - it's not windows here.

    Anyway, I'm having many issues here. I'm a complete newb to porting. I can't find any overall tutorials on what to look for when porting, and how to resolve common errors. Nor have I been able to find any reference regarding which headers to use when the header being looked for doesn't exist on my system.

    Thanks for any input!

  2. #2
    I am using gmake (GNU Make). Yes, the NEW_DLL_FUNCTIONS declaration is specific to the code I'm porting. Actually it's the only thing keeping the code from compiling as far as I can tell. It is *not* defined anywhere in the source I have, however, so I don't know what to do with it. Logic would assume that I must not have all the source, but I'm positive I do have it all.

    gcc -E... I'll try that. Is there any way to have GCC list any #define'd constants? For instance, it took me a while to figure out that __FreeBSD__ was defined under FreeBSD systems. I'd like to know if there are any other goodies like this that GCC can tell me through a special flag or something?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FreeBSD redirect messes up IP
    By trinli in forum Networking/Device Communication
    Replies: 3
    Last Post: 04-07-2009, 10:12 AM
  2. [Need Help] serial port programming on freeBSD
    By Hermisky in forum Networking/Device Communication
    Replies: 2
    Last Post: 07-13-2006, 06:51 PM
  3. freebsd and redhat dual boot.
    By xddxogm3 in forum Linux Programming
    Replies: 1
    Last Post: 05-09-2004, 06:06 PM
  4. Linux To FreeBSD Porting Compile Problems
    By DeepBlackMagic in forum Linux Programming
    Replies: 4
    Last Post: 03-17-2004, 08:17 AM
  5. FreeBSD
    By confuted in forum Tech Board
    Replies: 10
    Last Post: 09-16-2003, 07:05 PM