<tfoot id='0D7IA'></tfoot>
      <i id='0D7IA'><tr id='0D7IA'><dt id='0D7IA'><q id='0D7IA'><span id='0D7IA'><b id='0D7IA'><form id='0D7IA'><ins id='0D7IA'></ins><ul id='0D7IA'></ul><sub id='0D7IA'></sub></form><legend id='0D7IA'></legend><bdo id='0D7IA'><pre id='0D7IA'><center id='0D7IA'></center></pre></bdo></b><th id='0D7IA'></th></span></q></dt></tr></i><div id='0D7IA'><tfoot id='0D7IA'></tfoot><dl id='0D7IA'><fieldset id='0D7IA'></fieldset></dl></div>
    1. <legend id='0D7IA'><style id='0D7IA'><dir id='0D7IA'><q id='0D7IA'></q></dir></style></legend>
        <bdo id='0D7IA'></bdo><ul id='0D7IA'></ul>

        <small id='0D7IA'></small><noframes id='0D7IA'>

        使用 automake/autoconf 条件生成文件

        时间:2023-08-30

        <legend id='M4TFX'><style id='M4TFX'><dir id='M4TFX'><q id='M4TFX'></q></dir></style></legend>

      1. <tfoot id='M4TFX'></tfoot>

            <small id='M4TFX'></small><noframes id='M4TFX'>

            • <bdo id='M4TFX'></bdo><ul id='M4TFX'></ul>
                  <tbody id='M4TFX'></tbody>
                <i id='M4TFX'><tr id='M4TFX'><dt id='M4TFX'><q id='M4TFX'><span id='M4TFX'><b id='M4TFX'><form id='M4TFX'><ins id='M4TFX'></ins><ul id='M4TFX'></ul><sub id='M4TFX'></sub></form><legend id='M4TFX'></legend><bdo id='M4TFX'><pre id='M4TFX'><center id='M4TFX'></center></pre></bdo></b><th id='M4TFX'></th></span></q></dt></tr></i><div id='M4TFX'><tfoot id='M4TFX'></tfoot><dl id='M4TFX'><fieldset id='M4TFX'></fieldset></dl></div>

                  本文介绍了使用 automake/autoconf 条件生成文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  谁能告诉我是否有办法向 Makefile.am 插入条件块,以便将其进一步传递给由 autotools 创建的 Makfile?

                  can anybody tell me if there is a way to insert a conditional block to Makefile.am so that it will be passed further to a Makfile created by autotools?

                  这是一个例子:

                  ifeq "$(SOMEVAR)" ""
                  SOMEVAR="default_value"
                  endif
                  

                  这似乎是 Makefile 做有条件的事情的常用方法.Automake 会切断 endif 行并最终导致失败,并显示如下消息:

                  This seems to be a usual Makefile way of doing conditional things. Automake cuts endif line off and make fails eventually with a message like this:

                  Makefile:390: * 缺少 `endif'.停下来.

                  Makefile:390: * missing `endif'. Stop.

                  有什么想法吗?

                  推荐答案

                  由于它也被标记为 Autoconf,如果可能的话,我建议将条件放在 configure.ac 中.类似这样:

                  Since it's tagged as Autoconf also, I suggest putting the condition in configure.ac, if that is possible. Similar to so:

                  AM_CONDITIONAL([CONDITION_NAME], [test x"${SOMEVAR}" != x])
                  

                  然后,您的 Makefile.am 将包含

                  Then, your Makefile.am would contain

                  if CONDITION_NAME
                  <conditional code>
                  else
                  <else :)>
                  endif
                  

                  更新

                  问题与

                  python setup.py --root=$(DESTDIR) --prefix=$(DESTDIR)$(prefix)
                  

                  从某个地方被调用.如果 DESTDIR 为空,则前缀可能会扩展为相对路径,这不是您想要的.您已确认它是从您的 Makefile.am 调用的.那么你可以做两件事.

                  being called from somewhere. If DESTDIR is empty, the prefix may expand to a relative path, which is not what you want. You have confirmed it is being called from your Makefile.am. Then there's two things you can do.

                  1. 将上述命令改为python setup.py --root=${DESTDIR}///--prefix=${DESTDIR}///$(prefix).三斜线可能是必要的,因为 AFAIK,POSIX 允许双斜线具有特殊含义,但不允许三个或更多连续斜线.

                  1. Change the above command to python setup.py --root=${DESTDIR}/// --prefix=${DESTDIR}///$(prefix). Triple slashes may be necessary since, AFAIK, POSIX allows for double slashes to have a special meaning, but not for three or more consecutive slashes.

                  把上面的命令改成DESTDIR=${DESTDIR:-//

                  1. <small id='snaP4'></small><noframes id='snaP4'>

                    • <bdo id='snaP4'></bdo><ul id='snaP4'></ul>

                      <tfoot id='snaP4'></tfoot>

                            <tbody id='snaP4'></tbody>
                          <legend id='snaP4'><style id='snaP4'><dir id='snaP4'><q id='snaP4'></q></dir></style></legend>
                        • <i id='snaP4'><tr id='snaP4'><dt id='snaP4'><q id='snaP4'><span id='snaP4'><b id='snaP4'><form id='snaP4'><ins id='snaP4'></ins><ul id='snaP4'></ul><sub id='snaP4'></sub></form><legend id='snaP4'></legend><bdo id='snaP4'><pre id='snaP4'><center id='snaP4'></center></pre></bdo></b><th id='snaP4'></th></span></q></dt></tr></i><div id='snaP4'><tfoot id='snaP4'></tfoot><dl id='snaP4'><fieldset id='snaP4'></fieldset></dl></div>