First phase of porting. pterm now compiles and runs under Linux+gtk.