AM_LDFLAGS和LDFLAGS有什么区别 [英] what is the difference between AM_LDFLAGS and LDFLAGS

查看:451
本文介绍了AM_LDFLAGS和LDFLAGS有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道AM_LDFLAGS和LDFLAGS有什么区别,因为我遇到了错误

I want to know what is the difference between AM_LDFLAGS and LDFLAGS, as I've faced an error

error: AM_LDFLAGS must be set with '=' before using '+='

在foreach循环中使用AM_LDFLAGS时 我的make文件代码如下所示:

while I was using AM_LDFLAGS in a foreach loop my make file code is as shown below:

program_INCLUDE_DIRS := /usr/bin/PR__bin

program_LIBRARY_DIRS := /usr/lib/PR__lib

CFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir))

AM_LDFLAGS += $(foreach librarydir,$(program_LIBRARY_DIRS),-L$(librarydir))

推荐答案

如果该错误抱怨它说的是什么(我根本不确定为什么会/应该如此),那么我会认为解决方案就像添加一样简单

If that error is complaining about what it says it is complaining about (and I'm not at all sure why it would/should be) then I would think the solution would be as simple as just adding

AM_LDFLAGS =

作为使用+=的foreach循环上方的行.

as the line above the foreach loop that uses +=.

来自 8.7 Variables used when building a program GNU Automake手册:

From section 8.7 Variables used when building a program of the GNU Automake manual:

AM_LDFLAGS

AM_LDFLAGS

这是Makefile.am作者可以用来传递其他链接器标志的变量.在某些情况下,它不使用,而不是按可执行文件(或按库)_LDFLAGS.

This is the variable the Makefile.am author can use to pass in additional linker flags. In some situations, this is not used, in preference to the per-executable (or per-library) _LDFLAGS.

这篇关于AM_LDFLAGS和LDFLAGS有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆