• Allison Karlitskaya's avatar
    GOption: stop calling getopt() · 817f82da
    Allison Karlitskaya authored
    We called getopt() to try to find out of the platform on which we are
    running defaults to strict POSIX-style argument handling (ie: flags
    following the first filename are considered as further filenames rather
    than flags).
    This is the default case on BSDs, for example.  It is also the case on
    GNU systems with the POSIXLY_CORRECT environment variable set.
    Unfortunately many of our tools rely on being able to accept commandline
    arguments in the non-strict ordering and the code for making these calls
    is spread widely (for example in Makefile fragments invoking some of our
    build tools).
    For this reason we need to revert the getopt() check and only enable
    strict POSIX mode in the case that the application explicitly opts into
    it using the _set_strict_posix() API.
    This also fixs a failure to build on Windows due to missing getopt().
goption.c 74.8 KB