bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] Makefile.devel


From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] Makefile.devel
Date: Fri, 19 May 2023 18:20:56 +0200

Hi Mike,

> Other than that, the only other patch that I am having to make is for
> Makefile.devel
> because we don't have gcc on z/OS, only variations of clang and IBM
> proprietary C
> compilers.

OK, I figure there are three possible ways to code the Makefile.devel:

  * Allow any 'make' program but require gcc. (This is what is does now.)

  * Require GNU make but allow any C compiler.

  * Allow any 'make' program and any C compiler, but duplicate each
    compilation command like this:
      _CC_ = $${CC:-gcc -Wall}
      _CFLAGS_ = $${CFLAGS:--O}
      ...
        @echo $(_CC_) $(_CFLAGS_) lib/genflags.c -o genflags
        @$(_CC_) $(_CFLAGS_) lib/genflags.c -o genflags

Since GNU make is easier to port to random platforms than GCC, the
second option is better than the first one. I don't like the third one,
because it makes the Makefile.devel hard to maintain (code duplication).

> As such, I have to do:
> diff --git a/Makefile.devel b/Makefile.devel
> index 5535acc..37a25b8 100644
> --- a/Makefile.devel
> +++ b/Makefile.devel
> @@ -9,8 +9,8 @@ AUTOHEADER = autoheader
>  AUTOMAKE = automake-1.16
>  ACLOCAL = aclocal-1.16
>  GPERF = gperf
> -CC = gcc -Wall
> -CFLAGS = -O
> +CC ?= gcc -Wall
> +CFLAGS ?= -O
>  MAN2HTML = groff -mandoc -Thtml
>  CP = cp
>  RM = rm -f

This patch is broken. It never uses "gcc -Wall" and "-O" as defaults. It
always uses "cc" and "" as defaults.

I've committed a patch that works.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]