##
gcc -c "-I/path/to/perl/lib/CORE" module.c
gcc module.o -o module.so
## ##
gcc -c `perl -MConfig -e 'print join(" ", @Config{qw(ccflags optimize cccdlflags)}, "-I$Config{archlib}/CORE")'` example.c example_wrap.c
gcc `perl -MConfig -e 'print @Config{qw(lddlflags)}'` example.o example_wrap.o -o example.so