I think what you're asking about is called "cross-compiling".
When you compile C code, you're creating machine instructions for a given hardware platform. The default for gcc is to create binaries for the hardware it's currently running on. You can pass it options to generate binaries for other hardware platforms. See "man gcc" for more details. Not sure if it's the same thing, but GNU/Linux on x86 uses ELF binaries (which, I think, is the "format" of the binary gcc produces -- how the code is actually laid out in the binary file). Macs (well, PPC macs at least) don't use ELF.
Now, the matter of linking to libraries is a different animal. It's complicated on a Mac -- OS X is built upon FreeBSD (well, I think it's actually a BSD compatibility layer upon Mach -- not sure), so they should use regular .so and .a libs, but they also have this totally separate and distinct OS X- (NeXT- ?) style thing where libs are named ".dylib"... well, it's complicated.
I'd suggest, either just do your development on the Mac to make Mac software, or else look into the possibility of making your app web-based, run it on a GNU/Linux server, then just access it from the Mac. Of course, you could still dig in and learn some more about getting gcc to do what you want. The newsgroup gnu.gcc.help (
http://groups.google.com/group/gnu.gcc.help ) may be of some assistance if you go that route.