bug-autoconf
[Top][All Lists]
Advanced

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

[sr #110369] AC_PROG_CC_C99 is not recognized as empty macro


From: Sergei Trofimovich
Subject: [sr #110369] AC_PROG_CC_C99 is not recognized as empty macro
Date: Wed, 11 Nov 2020 03:22:43 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

URL:
  <https://savannah.gnu.org/support/?110369>

                 Summary: AC_PROG_CC_C99 is not recognized as empty macro
                 Project: Autoconf
            Submitted by: slyfox
            Submitted on: Ср 11 ноя 2020 08:22:41
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None

    _______________________________________________________

Details:

The configure error originally observed on libzmq project
https://github.com/zeromq/libzmq/blob/master/configure.ac#L67

Here is the minimal single file example:

$ cat configure.ac
AC_PREREQ(2.61)

AC_INIT([zeromq],[4.3.3])

  #
===========================================================================
  #  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
  #
===========================================================================
  # ...
  #serial 6

  AC_DEFUN([AX_CHECK_COMPILE_FLAG],
  [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
  AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
  AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
    ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
    _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
    AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
      [AS_VAR_SET(CACHEVAR,[yes])],
      [AS_VAR_SET(CACHEVAR,[no])])
    _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
  AS_VAR_IF(CACHEVAR,yes,
    [m4_default([$2], :)],
    [m4_default([$3], :)])
  AS_VAR_POPDEF([CACHEVAR])dnl
  ])dnl AX_CHECK_COMPILE_FLAGS

  # End of
https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html

# Checks for programs.
AC_PROG_CC
AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"],
[AC_PROG_CC_C99])

AC_OUTPUT


Trying to use it fails as:

$ autoconf
configure.ac:31: warning: The macro `' is obsolete.
configure.ac:31: You should run autoupdate.
./lib/autoconf/c.m4:1493: AC_PROG_CC_C99 is expanded from...
lib/m4sugar/m4sh.m4:673: AS_IF is expanded from...
configure.ac:11: AX_CHECK_COMPILE_FLAG is expanded from...
configure.ac:31: the top level

$ ./configure --host=x86_64-pc-linux-gnu
...
checking whether C compiler accepts -std=gnu11... yes
./configure: line 3145: syntax error near unexpected token `fi'
./configure: line 3145: `fi'

There `[AC_PROG_CC_C99]` gets expanded to empty shell text instead of `:`.

Looks like `AC_PROG_CC_C99` definition is not considered to be empty by
`AX_CHECK_COMPILE_FLAG`. I'm not sure if it's a `AX_CHECK_COMPILE_FLAG` macro
bug or deficiency in `AC_PROG_CC_C99` definition.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110369>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.gnu.org/




reply via email to

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