FAQ Database Discussion Community


Link static library with static library

c,linker,autotools,automake
I have a Makefile.am with two noinst_LIBRARIES, and one of them needs to link with the other. Adding it to the CFLAGS throws a compiler warning, but as far as I know, automake likes to freak out about using LDADD with libraries, since they are not complete programs. How can...

build process that generates headers in autotools

linux,autotools,automake
I'm porting a home-baked makefile setup into the autotools suite. I've run into a problem for which I haven't yet found a suitable answer. It may be that I'm just not using the correct terms in my searches. Being a complete neophyte to autotools, I probably just don't know enough...

Autotools Setup for Static and Shared Libraries

makefile,autotools
We have a large code base that I'm converting to autotools to help target multiple platforms / configurations. Basically, we have: |-- configure.ac |-- Makefile.am |-- dependency1 | `-- Makefile.am |-- dependency2 | `-- Makefile.am `-- dependency3 `-- Makefile.am The dependency folders are common across many projects, so The Makefile.am...

Internal dependencies for automake build system

autotools,automake
I've following structure of my project: | |---libs | |---lib1 | |---lib2 | |---lib3 And dependencies: lib1 depends on lib3 lib3 depends on lib2 So automake should build libraries in the following order: lib2, lib3, lib1 My question is(I know that this library should be redesigned first, but assume, it...

How to specify multiple source files in Makefile.am

c,makefile,autotools,automake
New to using autoconf and automake, I am following this to learn them. I have a question regarding Makefile.am file. For a simple helloworld program below Makefile.am works: AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = helloworld helloworld_SOURCES = hello.c How do we specify multiple source files (if there are multiple source files...

Building only a small subset of project using autotools

make,autotools,autoconf
I have a large project using autotools that contains some code that builds into a utility library. The project has quite a few dependencies and I would like to compile a specific subset of that utility library for mobile environments (Android/iOS). I expect a lot of dependencies to be unnecessary...

Make autotools add --std=C11 to CFLAGS

c,autotools,c11
There is no mention of a AC_PROG_CC_C11 analogue to AC_PROG_CC_C99. How can I get my autotools project to put --std=C11 into CFLAGS?...

automake - how to change permissions to an installed binary

autotools,automake
I have this Makefile.am: AUTOMAKE_OPTIONS = subdir-objects sbin_PROGRAMS = foo foo_SOURCES = foo.c install-exec-hook: chmod +s $(sbindir)/foo everything works well except for the target distcheck which gives this error: > make distcheck ... ... ... Making install in sub-module make[2]: Entering directory '/home/users/a/myproj/_build/sub-module' make[3]: Entering directory '/home/users/a/myproj/_build/sub-module' ../../install-sh -c -d...

How can I tell autogen.sh to generate files(m4 and object files) in separate folder?

c,unix,make,autotools
I am using ./autogen.sh --prefix=/usr/ to build a c project and all files created by the configuration process (and later the compiling and linking steps) are located in my source folder. I would like to tell to use a different folder (say ./build like cmake projects usually do). How can...

autotools syntax error with ax_check_compile_flag

c++,linux,autotools,configure
I am using autotools for building my C++ application. In my configure.ac I have the following line: AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"]) which causes the following error when executing ./configure (after running autoreconf -i): ./configure: line 3825: syntax error near unexpected token `-Wall,' ./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")' My system: Linux...

needed packages to run autoreconf and configure on debian wheezy

linux,autotools,autoreconf
What are the .deb packages needed to run these commands on a debian wheezy Linux? cd software_that_builds_with_autotools autoreconf --install &&\ ./configure --prefix=/opt/foo/bar &&\ make && make install I tried installing the following, but it still says it is lacking aclocal: apt-get install binutils make csh g++ sed gawk autoconf autotools-dev...

How to set compiler-specific flags with autotools

gcc,clang,autotools,compiler-options
We use autotools as our build infrastructure, and we use clang and gcc as compilers. Recently we hit a gcc warning that needed --param max-vartrack-size=100000000 to silence (without completey disabling gcc's vartracking). Clang doesn't accept that option and produces argument unused during compilation: '--param max-vartrack-size=100000000' To silence that, clang needs...

Separate build directory for autotools projects not designed to use one

build,autotools
... Sorry, this has to be a duplicate, but I'm just running across answers for people who are making their own projects and can change the build system setup. Can I always compile a program in a separate build directory, or must it be supported by the program's build system?...

How to specify different feedback for different platforms if AC_CHECK_HEADER fails in autoconf/configure.ac?

linux,autotools,autoconf,m4
I have a check for a header file in configure.ac in the source root AC_CHECK_HEADER(log4c.h, [], [AC_MSG_ERROR([Couldn't find or include log4c.h])]) and I'd like to give different feedback on different platform to reflect different most straight forward ways of providing the header: on Debian it should error with the message...

Makefile process different files in different steps

c++,makefile,gnu,autotools,tntnet
I have the following makefile using GNU autotools: AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = app app_SOURCES = \ core/main.cpp nodist_app_SOURCES = \ index.cpp \ index.ecpp.js.cpp AM_INCLUDES = -I$(top_srcdir)/src index.cpp: index.ecpp $(ECPPC) index.ecpp -o index.cpp index.ecpp.js.cpp: index.ecpp.js $(ECPPC) -b index.ecpp.js index.ecpp: vulcanize -o index.ecpp core/view/index.html --inline --strip --csp What happens (in this...

How to reuse objects between Automake program and tests targets?

autotools,automake,libtool
I have a non-recursive Makefile.am with something like the following: SHARED_SRCS = src/bar.cpp src/baz.cpp bin_PROGRAMS = foo foo_SOURCES = src/main.cpp $(SHARED_SRCS) foo_CXXFLAGS = -I$(srcdir)/src $(SOME_CFLAGS) foo_LDADD = $(SOME_LIBS) check_PROGRAMS = test1 test2 test3 TESTS = test1 test2 test3 test1_SOURCES = tests/test1.cpp $(SHARED_SRCS) test2_SOURCES = tests/test2.cpp $(SHARED_SRCS) test3_SOURCES = tests/test3.cpp $(SHARED_SRCS)...

AC_SUBST does not expand variable

autotools,autoconf,automake,m4
Ok, so I am trying to make a project with Autotools, and I am trying to generate parts of my .conf file. The program needs to read from $(pkgdatadir), but I know that it is initialized in Makefile.in, so I instead substitued datadir and PACKAGE. configure.ac: AC_PREREQ([2.69]) AC_INIT([foo], [1.0.0], [[email protected]])...

Disable optimizations for a specific file with autotools

makefile,autotools
I'm working on setting up autotools for a large code base that was once just a bash script compile and later just hand written Makefiles. We have a set of files that require that compiler optimizations be turned off. These files are already in their own subdirectory, so they will...

Tesseract 3.03: 'boxchar.lo' is not a valid libtool object

gcc,tesseract,autotools,libtool
I have been trying to compile Tesseract 3.03 rc1 these days. I have tried Cygwin, MinGW+MSYS, MSYS2+MinGW-w64. And now I am using the Xubuntu 15.04. The 3.03 rc1 source is downloaded from here. I have successfully compiled the tesseract with make install. But when I trying to compile the training...

How to compile libusb as shared library?

gcc,shared-libraries,ld,autotools,libusb-1.0
I am trying to build libusb as shared library as follows. Following are two steps. 1. Configure 2. Make. I pass "--enable-shared" to configure script assuming it will generate the shared .so file Configure ./configure CC=/mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc --host=arm-linux --enable-udev=no --enable-shared checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment...

Error installing thrift on mac yosemite

qt,osx-yosemite,thrift,autotools
I followed these steps to install thrift on MAC Yosemite : Downloaded and unzipped the package from : http://archive.apache.org/dist/thrift/0.9.0/ Followed the steps on this page : https://thrift.apache.org/docs/install/os_x But I am facing the following error, after I run ./configure command : ./configure: line 17810: syntax error near unexpected token QT,' ./configure:...

autotools: compiling with code from another directory

c,autotools,automake
I have the following structure: +Makefile.am +-common | +-common.c | +-common.h | +-module1 | +module1.c | +Makefile.am | +-module2 | +module2.c | +Makefile.am where each moduleX is actually made of many C and header files, and therefore deserve their own subdirectory. I want to compile each moduleX with the common.c...