Code Technicalities. A PAM module's source code should include . In order to use some of the functions, it must define certain macros before including this file - these will be shown where appropriate. The module's source file should be compiled as a shared library, in the following way: gcc -fPIC -c a_pam_module.c gcc -Wl,x -shared -o a_pam_module.so a_pam_module.o -lpam