automake

autoconf/automake: conditional compilation based on presence of library?

狂风中的少年 提交于 2019-12-04 08:26:38
问题 I need to conditionally compile some code based on the presence of a library. Seems like this should be easy with autoconf/automake but I can't figure it out. For example, if there is a PNG library present, I want to include code to use it. My configure.ac has: AC_CHECK_LIB([png], [png_create_write_struct_2]) and my Makefile.am has: if USE_LIBPNG libdev_la_SOURCES += png.c endif (which adds png.c to the list of sources for libdev so it gets compiled). An automake conditional like USE_LIBPNG

how to set include paths with autotools

爷,独闯天下 提交于 2019-12-04 07:59:57
问题 I'm working on a C++ project that uses autoconf & automake , and I'm struggling to correctly set up the include paths in *CPPFLAGS . I've read about 3 hours worth of documents, and I can't figure it out yet. I'm not looking for a hack, but for the correct way to do this. Here is my conundrum. As I see it, there are 3 completely different sources for include paths: External libraries that must be installed along with my package, which are configured by configure --with-XXX=<PATH> . Within my

JNI and Java: ant calling make or make calling ant?

我们两清 提交于 2019-12-04 07:01:34
I'm just about to make my first trip into the world of JNI (Java Native Interface) to provide file system change notifications from platform specific C/C++ code to Java. That is unless someone suggest some brilliant library for doing this that I've missed. Being new to JNI I've managed to find much documentation on the interface side of it and library generation side of it, but I've not found much on building the native library. I've got an existing build based on ant for the pre-existing Java source, so I'm trying to work out if I should get ant to call make to create the library or if it's

Autotools cross compilation and generated sources

三世轮回 提交于 2019-12-04 04:48:49
问题 I'm trying to create a library using autotools (autoconf, automake, libtool) as a build system. The library has to be cross-compileable, but one of the steps of building it is to generate sources by executable built from sources during the whole process. The problem is I cannot use automake's system to build the intermediate binary because when it's cross compile it wouldn't run on '--build' to generate sources. One way to work this around it to create separate autools project to build

Autoconf subdirectories with subpackages depending on each other?

主宰稳场 提交于 2019-12-04 04:38:05
I've got a large project on my hand (master) that is split into several components (liba, b, c, d) to ease building and maintenance. When building the whole package, all of the subcomponents must be built in sequence, and some of these packages depend upon each other. In more explicit terms, liba is a prerequisite for b, c and d, and the presence of liba is checked by the configure script. This check is definitely necessary to give user-friendly error messages when building the b distribution on its own. However, when building the master package and all its subpackages, liba is built as a

How do I specify in a Makefile.am script that I only want to compile object .o files?

不问归期 提交于 2019-12-03 17:44:21
问题 I have a Makefile.am which will be responsible for building a final application binary: project/src/Makefile.am Also in the src directory is a sub-directory called ctrnn which contains an additional Makefile.am : project/src/ctrnn/Makefile.am Now, ctrnn/Makefile.am should only generate object .o files with the idea being that the top-level Makefile.am should use the object files generated in subdirectory ctrnn to build the binary. This is the ctrnn/Makefile.am : SOURCES = network.cpp\ neuron

Can't turn off gcc optimizer, Makefile from automake

旧城冷巷雨未停 提交于 2019-12-03 17:36:48
问题 I am trying to get ZBar in a debug session. I am able to do so, but I can't get the optimizer to turn off, so my debug session jumps around unexpectedly and many variables are labeled as optimized-out in Eclipse Indigo. I am running in Ubuntu. I have tried adding -O0 as far right in any gcc call in the Makefiles as possible, since the last -O is the acting one. I used -Q --help=optimizers to find what to be looking for, but its output is a bit odd: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I

编译安装nginx

风流意气都作罢 提交于 2019-12-03 17:27:42
啥是nginx ☆☆☆☆ 官方网址 ☆☆☆☆ Nginx的相关概念: 反向代理: ————————————————————————————————————————————————————— 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。 负载均衡: ————————————————————————————————————————————————————— 负载均衡,英文名称为Load Balance,是指建立在现有网络结构之上,并提供了一种廉价有效透明的方法扩展网络设备和服务器的带宽、增加吞吐量、加强网络数据处理能力、提高网络的灵活性和可用性。其原理就是数据流量分摊到多个服务器上执行,减轻每台服务器的压力,多台服务器共同完成工作任务,从而提高了数据的吞吐量。 安装nginx 依赖介绍: gcc gcc-c++ gcc为GNU Compiler Collection的缩写,可以编译C和C++源代码等,它是GNU开发的C和C++以及其他很多种语言 的编译器(最早的时候只能编译C,后来很快进化成一个编译多种语言的集合,如Fortran、Pascal、Objective-C、Java、Ada、 Go等。)

autotools: force make not to rebuild configure/Makefile

北城余情 提交于 2019-12-03 13:53:55
I have a project with autotools: automake, autoconf. I want to prohibit make from remaking files configure , Makefile.in , etc; just to do compile job. Some of files are edited by hand, and I know that I should not to do this. (Or the project was updated from CVS with all generated files stored in CVS). But at the moment I have no correct version autotools installed. What must be modification times of this files (which must be newer/older): aclocal.m4 configure.in confdb/ax_prefix_config_h.m4 Makefile.am Makefile.in Makefile configure config.status Or: what sequence of touch commands must I do

Header dependency in automake

回眸只為那壹抹淺笑 提交于 2019-12-03 13:38:53
问题 I'd like to create a Makefile.am file which generates one header file mentioned in a xxx.c file. Let's say that xxx.c contains: #include <version.h> ... and that I have a rule to create it at the end of Makefile.am : version.h: echo '#define VERSION "'`hg id`'"' > version.h.tmp cmp version.h.tmp version.h || mv version.h.tmp version.h What do I have to change to make the xxx.c compilation depend on version.h ? I tried nodist_progname_SOURCES=version.h , but that doesn't seem to do it. 回答1: