Git 为AC_INIT创建一个版本号

Git 为AC_INIT创建一个版本号,git,autotools,autoconf,Git,Autotools,Autoconf,我读了这篇文章:这对我没有帮助 我的configure.ac中有这一行: AC_INIT([some library], m4_esyscmd(echo $(git describe)$(git status --porcelain | awk '{if ($1 == "M") {print "-dirty";exit}}')), [email@address.xx], [], [www.website.com]) 使用“echo…”表达式,我想获得git de

我读了这篇文章:这对我没有帮助

我的configure.ac中有这一行:

AC_INIT([some library],
    m4_esyscmd(echo $(git describe)$(git status --porcelain | awk '{if ($1 == "M") {print "-dirty";exit}}')),
    [email@address.xx],
    [],
    [www.website.com])
使用“echo…”表达式,我想获得git descripe提供的字符串,如果存在修改过的文件,则附加一个
-dirty

我得到警告:

configure.ac:8: warning: AC_INIT: not a literal: ver0.1-6-g3153e9f

我试过使用方括号和引号,也试过不使用方括号和引号。我没有主意了…

我只是用
m4\u esyscmd\u s
而不是
m4\u esyscmd
解决了这个问题