You cannot use get_libdir() in global scope. Move it to src_prepare()