... WriteMakefile( NAME => 'XML::Parser::Expat', C => ['Expat.c'], LIBS => $libs, XSPROTOARG => '-noprototypes', VERSION_FROM => 'Expat.pm', LDDLFLAGS => $Config{lddlflags}." -Wl,-rpath,$ENV{ORIGIN}/../lib", # <-- add this @extras );