ó RÑÕfc@s¬dZddlZddlZdejd dZdejdejdd Zd Zedd„Zd„ZdZ dZ e d„Z d„Z e dkr¨e ƒndS(sEnm2def.py Helpers to extract symbols from Unix libs and auto-generate Windows definition files from them. Depends on nm(1). Tested on Linux and Solaris only (-p option to nm is for Solaris only). By Marc-Andre Lemburg, Aug 1998. Additional notes: the output of nm is supposed to look like this: acceler.o: 000001fd T PyGrammar_AddAccelerators U PyGrammar_FindDFA 00000237 T PyGrammar_RemoveAccelerators U _IO_stderr_ U exit U fprintf U free U malloc U printf grammar1.o: 00000000 T PyGrammar_FindDFA 00000034 T PyGrammar_LabelRepr U _PyParser_TokenNames U abort U printf U sprintf ... Even if this isn't the default output of your nm, there is generally an option to produce this format (since it is the original v7 Unix format). iÿÿÿÿNt libpythonis.atPythoniis.dlls nm -p -g %stTtCtDc CsÌtjt|ƒjƒ}g|D]}|jƒ^q }i}x‡|D]}t|ƒdksEd|kroqEn|jƒ}t|ƒdkr“qEn|\}}} ||kr´qEn||f|| $s