Search code examples
macosfirefoxnpapi

compile npapi plugin in Mac OSX?


I only have ssh access to a Mac OSX 10.6 computer, so, Xcode is out of scope. Currently, I have trouble to figure out the right format of g++ output: do I need to append -shared and -fPIC, or -dynamiclib or other magic flag in order to get a firefox recognizable binary?


Solution

  • I use the following:

    • -dynamiclib
    • -fPIC
    • -arch foo as needed
    • -DXP_MAC=1, -DXP_MACOSX=1 etc.
    • -framework UsedFrameWork as needed
    • -mmacosx-version-min=10.x if needed

    Also remember to put it all in a plugin bundle and to include a suitable plist.