Need help with error compiling webgl-port

I’m compiling the webgl-port branch like this when I get the following errors. It seems the build system was overhauled since I last compiled this. After setting up the environment, I do this:

python2 makepanda/ --nothing --static
export PATH=$PATH:~/projects/panda3d/built/bin:~/projects/panda3d/built/lib
python2 makepanda/ --nothing --no-png --use-egg --use-zlib --no-freetype --use-bullet --no-openssl --use-python --use-direct --use-pview --use-gles2 --use-openal --use-vorbis --optimize 4 --outputdir embuilt --target emscripten --no-eg

And get this error:

WARNING: file depends on Python but is not in an ABI-specific directory: embuilt/bin/deploy-stub.js
[ 12%] Building C++ object embuilt/tmp/cpython-27mu/libp3dtoolbase_igate.bc

embuilt/tmp/libp3dtoolbase_igate.cxx:2666:62: error: use of undeclared identifier ‘Dtool_DTOOL_SUPER_BASE’
Dtool_NeverFreeMemory._PyType.tp_base = (PyTypeObject *)&Dtool_DTOOL_SUPER_BASE;
embuilt/tmp/libp3dtoolbase_igate.cxx:3079:57: error: use of undeclared identifier ‘Dtool_DTOOL_SUPER_BASE’
Dtool_TypeHandle._PyType.tp_base = (PyTypeObject *)&Dtool_DTOOL_SUPER_BASE;
embuilt/tmp/libp3dtoolbase_igate.cxx:3340:59: error: use of undeclared identifier ‘Dtool_DTOOL_SUPER_BASE’
Dtool_TypeRegistry._PyType.tp_base = (PyTypeObject *)&Dtool_DTOOL_SUPER_BASE;
embuilt/tmp/libp3dtoolbase_igate.cxx:3613:58: error: use of undeclared identifier ‘Dtool_DTOOL_SUPER_BASE’
Dtool_TypedObject._PyType.tp_base = (PyTypeObject *)&Dtool_DTOOL_SUPER_BASE;
embuilt/tmp/libp3dtoolbase_igate.cxx:3641:3: error: use of undeclared identifier ‘RegisterRuntimeTypedClass’
embuilt/tmp/libp3dtoolbase_igate.cxx:3672:30: error: use of undeclared identifier ‘Dtool_AddToDictionary’
{“Dtool_AddToDictionary”, &Dtool_AddToDictionary, METH_VARARGS, “Used to add items into a tp_dict”},
7 warnings and 6 errors generated.

The following command returned a non-zero value: em++ -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o embuilt/tmp/cpython-27mu/libp3dtoolbase_igate.bc -Iembuilt/tmp -Iembuilt/include -Ithirdparty/emscripten-libs/python/include -Ithirdparty/emscripten-libs/python/include/python2.7 -Idtool/src/dtoolbase -fvisibility=hidden -s WARN_ON_UNDEFINED_SYMBOLS=1 -s NO_FILESYSTEM=1 -fno-exceptions -s DISABLE_EXCEPTION_CATCHING=1 -fno-strict-aliasing -fno-unsafe-math-optimizations -O1 -D_DEBUG -Wall -Wno-unused-function -Wno-reorder embuilt/tmp/libp3dtoolbase_igate.cxx

I have no idea how to approach the file “embuilt/bin/deploy-stub.js” warning nor if it’s important. About Dtool_AddToDictionary, It seems to be declared in ./targetroot/usr/include/panda3d/py_panda.h. I’ve tried every combination of “-I” argument I can think of, but nothing works. I noticed #include "py_panda.h" is in libp3dtoolbase_igate.cxx twice. So, I wonder if it’s picking up one that doesn’t have the declarations.