Texas has enacted a law that will make border crossings illegal and punishable with jail time, one of the toughest immigration laws passed by any US state in modern times.