[m-rev.] for review: Check availability of getopt() directly.
jfischer at opturion.com
Fri May 31 19:26:02 AEST 2019
On Fri, 31 May 2019, Peter Wang wrote:
> Check for availability of getopt() in the C library,
> setting the HAVE_GETOPT variable as appropriate.
> Delete GETOPT_H_AVAILABLE variable.
> Use getopt() if available. This can be true even without getopt.h
> as getopt() is declared in <unistd.h> according to POSIX.
> Add a comment.
> diff --git a/util/Mmakefile b/util/Mmakefile
> index 8ccce6a91..d8e22ee08 100644
> --- a/util/Mmakefile
> +++ b/util/Mmakefile
> @@ -30,8 +30,10 @@ PROGS=mkinit mkinit_erl mdemangle mfiltercc info_to_mdb
> -# Only if getopt.h doesn't exist do we link in a version of getopt.
> -ifeq ("$(GETOPT_H_AVAILABLE)","no")
> +# Link in local copy of getopt() only if required.
> +# XXX The files in runtime/GETOPT may not compile cleanly with modern
> +# compilers. We should replace it with another implementation.
We need to replace them (certainly the one in runtime/mercury_getopt.c)
for licensing reasons anyway.
The diff is fine.
More information about the reviews