Making costum module


I’m currently working on trying to make a custom module. So i downloaded the asterisk 1.8.18 source as I’m currently using the 1.818.210.58-1 distro and made a new app c file and then compiled. But when I try to load that module I get:
[2013-02-01 11:10:14] WARNING[10687]: loader.c:795 inspect_module: Module ‘’ was not compiled with the same compile-time options as this version of Asterisk.
[2013-02-01 11:10:14] WARNING[10687]: loader.c:796 inspect_module: Module ‘’ will not be initialized as it may cause instability.
[2013-02-01 11:10:14] WARNING[10687]: loader.c:883 load_resource: Module ‘app_mymoduleso’ could not be loaded.

So short of roiling my own distro which i really don’t want to do, how can set up the source properly to match asterisk from the distro so i can compile the modules?