Fix build errors with -DPACKAGE_BUILD=ON