Yes, quite possible. F16s' source codes were given to Turkey recently, we can integrate our own national wepons and sub-systems without wasting time with bureaucracy.
I don't know if there will be any legal difficulties since i don't remember in what terms US sold F16s to pakistan but after that, we can do the integration by a fairly simple procedure.
About JF17, I don't think we have any knowledge on chinese software. You can either buy the missiles and introduce them to JF17s' avionics by yourselves or you can do as the Ir. Tab. suggested