问题标签 [gnu]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
linux - 所有用户名的后缀别名?
有什么东西可以放在 /etc/aliases 中,让 postfix 将所有邮件发送给一个用户,不管用户名是什么?
makefile - 在非常简单的 gtk2 c 应用程序中,设置 gnu 构建工具的问题
更新:第一个问题解决了,第二个在这篇文章的底部描述。
UPDATE2:第二个问题也解决了。
我正在尝试学习如何为一个非常简单的 GTK+2 C 应用程序设置 GNU 构建工具(autoconf/automake)。我已经按照这个教程和这个处理子目录的教程,但是我遇到了一个问题,我的源目录(在 src 子目录中)没有生成 Makefile,尽管父目录的 Makefile 正在生成。
首先,这是我的文件夹结构:
以下是重要文件的内容:
应用程序/configure.ac:
应用程序/Makefile.am:
应用程序/src/Makefile.am:
Here is what happens when I run the following commands:
When I check, the main app folder gets a Makefile and Makefile.in, but the src folder still only has the Makefile.am. Any ideas?
UPDATE: I made the changes mentioned by adl, namely, I removed the square brackets and comma from the AC_CONFIG_FILES command and removed the app name/version from the AM_INIT_AUTOMAKE command. I also changed the app_LDADD command in src/Makefile.am to app_LDFLAGS. This has fixed my initial problem of not getting through a configure, but now it isn't looking for the gtk libraries. When I do a make I get something like the following:
Here is what I get with pkg-config:
I'm pretty sure I'm doing something wrong in my src/Makefile.am, but I don't know what. If it helps, my configure script does not appear to be looking for any gtk libs.
UPDATE2:
So the basic solution for the problem in update1 seems to be that I needed to add the following check to my configure.ac file:
This gets added to the checks for programs section under AC_PROG_CC. What this does is tell configure to check for the gtk+-2.0 library. The upper case GTK seems to be an arbitrary variable name, and the CFLAGS, LIBS, and LDFLAGS (and probably more) gets added to it dynamically so that you can generate the PACKAGE_* variables. The AC_SUBST seems to make it so you can access the PACKAGE* variables in your Makefile.am's. FYI, the -export-dynamic flag is added so that you can use glade/gtkbuilder files (I'm sure there are other reasons, but I'm still at a very basic level of understanding).
In src/Makefile.am, you should have:
This seems to be all you need for a basic gtk+-2.0 C app. It has actually inspired me to write a simple tutorial for setting up a C gtk app that uses autotools. There is a definite lack of recent beginner documentation/information in this field.
firefox - 构建 GNU make 的 Cygwin 版本
我想在 GNU make 中添加几个日志记录选项,这样我就可以看到在构建 FireFox 和朋友时发生了什么。
我有 make-3.80 源代码和完整的工作 Cygwin 构建环境。从 ./configure 和 Make 开始,我得到了预期的工作可执行文件。
问题:需要什么配置才能以与 Moztools 中捆绑的 make.exe 相同的方式执行可执行文件?
背景:
如果未定义HAVE_CYGWIN_SHELL
,则使用
一旦碰到 Mozilla 配置脚本的这一部分,就制作 barfs
谢谢
makefile - 空目标规则是否可以替代 GNU Make 中的 .DEFAULT_GOAL?
GNU Make 版本 3.81 引入了一个名为 .DEFAULT_GOAL 的特殊变量,如果在命令行上没有指定目标,它可以用来告诉 Make 应该构建哪个目标(或目标)。否则 Make 将简单地生成它遇到的第一个目标。
考虑:
使用上面假设的 Makefile,运行make
会构建“bar”,因为它是 Make 遇到的第一个目标。但是如果我们添加.DEFAULT_GOAL,像这样......
...如果我们只运行make
.
我发现这个 .DEFAULT_GOAL 变量在我构建的模块化、可重复使用的 Makefile“框架”中非常有用。但是,我发现许多系统仍然具有 GNU Make 3.80 或更早版本,并且它们不支持此变量。
在玩弄东西时,我注意到简单地指定一个空的目标规则似乎与 .DEFAULT_GOAL 具有相同的效果,即使在 GNU Make 的 3.81 之前的版本上也是如此:
我知道通过以这种方式指定其他目标规则来添加到目标的规则和/或先决条件是有效且合法的。但是,我想知道这样做是否会引入一些在使用 .DEFAULT_GOAL 时不会发生的潜在不良副作用。
我想我想知道为什么要引入 .DEFAULT_GOAL 如果您可以使用简单的空目标规则来实现相同的目标。这让我怀疑它们可能不会导致完全相同的行为。
所以底线问题是:使用 .DEFAULT_GOAL 与空目标规则之间是否存在外部可检测的差异?
c++ - 在 mac osx 上使用 gnu/c getline() 编译 c++ 代码?
我试图在我的 mac osx leopard 机器上编译一个预先存在的 c++ 包,并得到以下错误:
这可能是因为 getline() 是 GNU 特定的扩展。
我可以以某种方式使 osx 默认 g++ 编译器识别此类 GNU 特定扩展吗?
(如果没有,我总是可以提供我自己的实现或 GNU 的原始实现,但如果可能的话,我更喜欢有一个“更清洁”的解决方案)
makefile - 如何设置 automake 和 autoconf 以有条件地构建程序(测试或其他)
我目前在我的 autotoolset 项目中有 10 个测试。每当我对我的一个 src/ 文件进行更改并重新编译时,都会重新构建和链接每个测试。这开始对我的开发时间产生相当大的影响。
使用 GNU autotoolset 有条件地构建二进制程序、测试或其他方式的最佳方法是什么?例如,如果我在 test/check_curl_requestheaders.cc 中工作,并且我进行了更改,我只想重新编译库,然后重新编译一个测试,而不需要重新编译其他二进制文件。
我看到有人提到使用 automake 条件(如 WANTS_XXX),但我不能 100% 确定这是我正在寻找的,也不确定 autoconf 将如何配置它。
我有点希望最终会看起来像这样:
或者
指针?
编辑我没有在每次制作之前进行配置。check_curl_requestheaders
如果我对, only进行更改,check_curl_requestheaders
则会按预期进行重建。问题是,如果我正在处理库的 RequestHeaders 部分,并更改为 src/curl/requestheaders.cc,则所有测试和其他二进制文件都会重新构建,而不仅仅是check_curl_requestheaders
. 这花费的时间太长了,而这正是我试图避免的。如果我有十几个二进制文件,有没有办法只重建其中一个?
makefile - 如何调用使用 define 创建的 GNU make 宏?
在我的 Makefile 中调用 GREP 的两种方式有什么区别吗?有什么理由我应该使用其中一个吗?两者似乎产生相同的结果。
iphone - 什么是“尝试查找错误 IP 地址的主机条目”错误?
检查此错误,请帮助我。
我正在运行 objC 代码以在 GNU for Windows 上访问 Web 服务。
为什么会出现这个错误?
c++ - 使用gprof显示模板化方法的调用图的参数格式?
使用 gprof 显示模板类中方法的函数调用图的命令行格式是什么?
对于简单的 C 方法,您可以像这样指定它:
如何parse
从以下指定方法:
c++ - 在哪里下载 GNU C++ 编译器
谁能建议我在哪里下载 GNU c++ 编译器,我可以在 Ubuntu 和带有 Netbeans IDE 的 Windows 以及 GNU 工具上使用它。