automake

How do I access a user defined variable as defined at the top of a Makefile.am file?

萝らか妹 提交于 2019-12-23 20:14:22
问题 Specifically, I want to do something along the following lines. For a Makefile.am script that defines how a library file should be built, I want to be able to access a common library name throughout. For example, assuming I want the name of the library to be called 'name', I might start with the following variable: LIBNAME = name Then I might have something like this: lib_LTLIBRARIES = lib$(LIBNAME).la But then automake starts to complain when I want to do something like the following: lib$

How to get shell script output into Makefile.am at make time?

无人久伴 提交于 2019-12-23 18:09:22
问题 I am working on an autotools project, and am a newbie to the autotools world. For various reasons, detailed at the bottom for completeness, I have a shell script from which I want to get the output for use in my makefile. I have a situation similar to the following. Autoconf generates a script from an AC_CONFIG_FILES command. e.g. AC_CONFIG_FILES([thescript], [chmod +x thescript]) thescript.in #!/bin/sh # -*- sh -*- # @configure_input@ echo @abs_top_builddir@/bar/foo What I really want to do

Query pkg-config variable through autotools

☆樱花仙子☆ 提交于 2019-12-23 16:18:46
问题 To install a catalog file, I'd like to get the directory for Glade (an UI designer) like so: $ pkg-config --variable=catalogdir gladeui-2.0 /usr/share/glade/catalogs but in a variable inside my Makefile.am. Is there a (portable) way to do this? 回答1: Get this value in configure.ac . I think the latest version of pkg-config is 0.28. Let's assume that 0.25 or above is good enough: configure.ac ... PKG_PROG_PKG_CONFIG([0.25]) # check and set $PKG_CONFIG PKG_CHECK_MODULES([GLADEUI],[gladeui-2.0],

Is there a way to tell automake not to interpret part of the automakefile?

你。 提交于 2019-12-23 09:49:21
问题 Is there a way to tell automake not to interpret part of the Makefile.am? Specifically, I am trying to encode a Makefile conditional in a Makefile.am. As other people have noticed, this doesn't work because automake interprets the endif construct. Is there any way to escape or quote strings in Makefile.am files so that automake copies them verbatim into the destination Makefile? Specifically I don't want it to interpret the endif in something like: ifeq "$(SOMEVAR)" "" SOMEVAR="default_value"

How to get absolute path to top build directory in autoconf configure.ac?

爱⌒轻易说出口 提交于 2019-12-23 07:49:41
问题 I am working on a project which requires a subproject which has its own makefile and configure.ac. The subproject is a program which is used to generate source files for the main project. There is an option to disable the building of this project and attempt to use an installed version instead. In either case I create a variable which is used in my Makefile.am containing the path to the program. My question is, When using the local version of the project, how can I get its location for use in

Using the pkg-config macro PKG_CHECK_MODULES failing

强颜欢笑 提交于 2019-12-23 07:27:15
问题 I'm sure this is a fairly simple problem. I have a very simple configure.ac file which I am using to just learn how autoconf & pkg-config work together. The confgure.ac file looks like: AC_PREREQ(2.61) AC_INIT(autoconf_test, 1.0, nowhere@dev.null) PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.4) I can then execute autoconf from the command line and it does produce a configure script. However, when I run the configure script, I get the following error: ./configure: line 1618: syntax error

automake and custom rpath

非 Y 不嫁゛ 提交于 2019-12-22 12:17:36
问题 I have to ship a third-party library with an application. Because I don't want to set LD_LIBRARY_PATH by hand or require any wrapper script I want automake to set a custom rpath . Unfortunately libtool has its own -rpath option and adding -Wl,-rpath,/foo/bar to LDFLAGS only results in g++: unrecognized option '-rpath' because libtool seems to get confused with the command line options. The same happens with the alternative form -Wl,-rpath -Wl,/foo/bar . Is there any way to specify a custom

autoconf-generated Makefile does not pass flags for library headers when using PKG_CHECK_MODULES

笑着哭i 提交于 2019-12-21 20:55:16
问题 My project depends upon a library (more precisely, GTK+) so I added the following configurations in my configure.ac : PKG_CHECK_MODULES([GTK], [gtk+-2.0]) AC_SUBST([GTK_CFLAGS]) AC_SUBST([GTK_LIBS]) My Makefile.am is: bin_PROGRAMS = secretary secretary_SOURCES = secretary.c For its turn, my secretary.c is as follows: #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main();

Autotools - tar This does not look like a tar archive

守給你的承諾、 提交于 2019-12-21 03:27:25
问题 After running make distcheck I get the message that I have successfully built the package and is ready for distribution. If I untar the tar.gz with tar -zxvf hello-0.2.tar.gz it successfully extracts all of its contents. However, when I try to extract them in different machines I get: tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors The weird thing is that it was working before. On the machine I'm trying to build

手动安装m4, autoconf, automake, libtool

こ雲淡風輕ζ 提交于 2019-12-20 20:53:49
安装m4 wget http://mirrors.kernel.org/gnu/m4/m4-1.4.18.tar.gz && tar -xzvf m4-1.4.18.tar.gz && cd m4-1.4.18 && ./configure --prefix=/usr/local make && make install cd … 安装autoconf wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.gz && tar -xzvf autoconf-2.69.tar.gz && cd autoconf-2.69 && ./configure --prefix=/usr/local make && make install cd … 安装automake wget http://mirrors.kernel.org/gnu/automake/automake-1.16.1.tar.gz && tar xzvf automake-1.16.1.tar.gz && cd automake-1.16.1 && ./configure --prefix=/usr/local make && make install cd … 安装libtool wget http://mirrors.kernel.org/gnu