[Top][All Lists]

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

BUILD_OBJEXT in ax_prog_cc_for_build is broken

From: Kang-Che Sung
Subject: BUILD_OBJEXT in ax_prog_cc_for_build is broken
Date: Mon, 18 Jun 2018 14:48:42 +0800

Hi, Autoconf Archive maintainers.

I'm not sure where to report this bug, so I CC'd both the Autoconf mailing list
and the Autoconf Archive one.

The BUILD_OBJEXT variable (and perhaps BUILD_EXEEXT too) in
AX_PROG_CC_FOR_BUILD are broken in the modern Autoconf (2.69).

I found this when I'm trying to improve Flex's (the lexer generator's) build
system, and it had troubled me when I make the correct use of BUILD_OBJEXT and
BUILD_EXEEXT variables.

Here are the steps to reproduce the bug:

cd flex && git checkout v2.6.4
./configure --build=x86_64-buildpc-linux-gnu --host=$(gcc -dumpmachine)
grep 'BUILD_OBJEXT *=' src/Makefile

For the last line of output I expect 'BUILD_OBJEXT = o' or
'obj', but the actual result is empty.

This would cause a further build error if I start a custom build rule such as:

# Simplified example
EXTRA_PROGRAMS = build-flex
build_flex_OBJECTS = build-scan.$(BUILD_OBJEXT) ...
build-scan.o: scan.c
$(AM_V_CC)$(CC_FOR_BUILD) ... -o $@ $<
build-scan.obj: scan.c
  $(AM_V_CC)$(CC_FOR_BUILD) ... -o $@ $<

The above will produce a "no rule to make 'build-scan.'" error or something
like that..

I have read the ax_prog_cc_for_build.m4 code, and the bug might be something to
do with AC_EXEEXT being obsolete (it expands to empty). And as the result
there's no check and $ac_build_exeext and $ac_build_objext become empty.
(It's valid for $ac_build_exeext to be empty, but not for $ac_build_objext.)

There's no easy workaround for users' side.

How to fix this problem other than avoiding BUILD_OBJEXT and BUILD_EXEEXT

Thank you.
Kang-Che Sung

reply via email to

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