add getopt_long implementation and detection