Source

ebloom / rebar.config

{port_sources, ["c_src/*.cpp"]}.
{so_name, "ebloom_nifs.so"}.

{port_envs, [
             %% Make sure to link -lstdc++ on linux or solaris
             {"(linux|solaris)", "LDFLAGS", "$LDFLAGS -lstdc++"},

             %% Solaris specific flags
             {"solaris.*-64$", "CXXFLAGS", "-D_REENTRANT -m64"},
             {"solaris.*-64$", "LDFLAGS", "$LDFLAGS -m64"},

             %% OS X Leopard flags for 64-bit
             {"darwin9.*-64$", "CXXFLAGS", "-m64"},
             {"darwin9.*-64$", "LDFLAGS", "-arch x86_64 -lstdc++"},

             %% OS X Snow Leopard flags for 32-bit
             {"darwin10.*-32$", "CXXFLAGS", "-m32"},
             {"darwin10.*-32$", "LDFLAGS", "-arch i386"}
             ]}.