title: Emscripten with module loaders
body: <p>I'm trying to use Emscripten to turn a C library into a portable JavaScript module, that will be loaded by an AMD (such as Require.JS) and provide access to its functions and things:</p>
  
  <pre><code>require("vendor/mylib.js", function(mylib) {
      mylib.function1();
  });
  </code></pre>
  
  <p>However, I've seen that Emscripten pollutes the global namespace with lots of variables, which is against the premise that modules should be independent and not collide with other loaded modules.</p>
  
  <p>So the question is: <strong>What's the best way to use Emscrpiten with AMDs?</strong></p>
  
  <p>Is there a way I can tell Emscripten to not leak anything to <code>global</code>?</p>