[PATCH] Make apm buildable without legacy pm