autoconf
[Top][All Lists]
Advanced

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

Shell functions pointlessly specialized on _AC_LANG_ABBREV


From: Zack Weinberg
Subject: Shell functions pointlessly specialized on _AC_LANG_ABBREV
Date: Mon, 16 Sep 2013 11:52:17 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

While poking at something else, I happened to notice that we seem to be defining redundant copies of many shell functions, one for each language under test. Concretely, if you do this:

    AC_INIT([test], [0.0.0])
    AC_CONFIG_HEADERS([config.h])

    AC_PROG_CC
    AC_PROG_CXX

    AC_LANG([C])
    AC_CHECK_HEADERS([stddef.h])
    AC_LANG([C++])
    AC_CHECK_HEADERS([cstddef])

    AC_OUTPUT

the generated configure script will contain functions named 'ac_fn_c_check_header_compile' and 'ac_fn_cxx_check_header_compile' (and also 'ac_fn_c_try_compile' and 'ac_fn_cxx_try_compile') whose bodies are character-for-character identical, and both of which depend on the variables set and reset by AC_LANG to control the compiler actually in use. It looks like it has been this way since the shell functions were introduced back in 2008.

What was the intention, here? Right now it seems to me that it would make most sense to remove _AC_LANG_ABBREV from the function names (so there would be just one of each, and it would still depend on the current AC_LANG setting).

zw



reply via email to

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