Add libffi prerequisites support

Change-Id: I66c3659ab0f33772d7a51c8961a37e32c65354c2