[PATCH] avoid non-portable "which" to detect installed programs