[m-rev.] for review: Check availability of getopt() directly.
Julien Fischer
jfischer at opturion.com
Fri May 31 19:26:02 AEST 2019
On Fri, 31 May 2019, Peter Wang wrote:
> configure.ac:
> Mmake.common.in:
> Check for availability of getopt() in the C library,
> setting the HAVE_GETOPT variable as appropriate.
>
> Delete GETOPT_H_AVAILABLE variable.
>
> util/Mmakefile:
> Use getopt() if available. This can be true even without getopt.h
> as getopt() is declared in <unistd.h> according to POSIX.
>
> util/getopt.h:
> 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
> PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
> SRC=$(PROGS:%=%.c)
>
> -# 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.
Julien.
More information about the reviews
mailing list