Menu
  • HOME
  • TAGS

Error installing thrift on mac yosemite

qt,osx-yosemite,thrift,autotools

Ok. It seems the pkg-config installed on my machine was not brew installed pkg-config. So, uninstalled and installed pkg-config using brew. This resolved the above issue. After that, I also found that automake installed on my machine was 1.15 and I need automake 1.12 to install thrift 0.9.0.

How to compile libusb as shared library?

gcc,shared-libraries,ld,autotools,libusb-1.0

The .so file is built in libusb/.libs/ Its not very obvious by looking at the build logs though.

Automake config cannot compile my unit test

autotools,glib,automake,gobject

You should start by looking at the error carefully: collect2: error: ld returned 1 exit status This tells you it's a linker error (ld is the linker). src/.libs/libfoobar.so: undefined reference to `g_intern_static_string' The linker cannot find a symbol in src/.libs/libfoobar.so (a shared library) which you are linking to your test...

Automake Combine two static libraries into one

static-libraries,autotools,automake

It might be easier to do something like this than to use libtool since you're basically just adding a few object files to the original static lib. In this example, I'm assuming WRAPPER_LDFLAGS is the static lib you want to add objects to (e.g. ../../../external/xerces-c-3.1.1-x86_64-linux-gcc-3.4/lib/libxerces-c.a): lib_LIBRARIES = lib_xml_wrapper.a # List...

Library defined but no canonical name

autotools,automake

_LDFLAGS isn't valid for a static library, only for an executable or a shared library. You may want _LIBADD instead. It seems to me that the error message could be improved.

Internal dependencies for automake build system

autotools,automake

If you're sticking with a recursive directory structure, you can control the order of descent with the SUBDIRS variable. This is fine for things like separate library and test directories; the "Recursive Make Considered Harmful" catch-all overstates the case. In this case, though, it's sound advice. You obviously realise this...

autotools: compiling with code from another directory

c,autotools,automake

WHATS HAPPENS: To resolve "common.h" not being found issue for foobar.tar I've added EXTRA_DIST = common/common.h foo/foo.h bar/bar.h to the top Makefile.am. After that, the command ./bootstrap && ./configure && make dist will include *.h files into foobar-0.1.tar.gz. Next, ./bootstrap && ./configure && make distcheck fails with Makefile:204: ../common/.deps/foo-common.Po: No...

Autotools Setup for Static and Shared Libraries

makefile,autotools

It seems my issue is with the libretto_la_LDFLAGS line. Leaving that out and using make install gives both the .a and .so files in the prefix specified.

build process that generates headers in autotools

linux,autotools,automake

You're not supposed to write rules which depend on the order things are listed in the Makefile. There's no reason to have this rule at all (I understand it's a direct translation of your old Makefile -- which was also wrong): all-local: header.csv.h because header.csv.h is not a build product...

automake - how to change permissions to an installed binary

autotools,automake

You didn't say how you configured or the exact command you used for make install. This matters for two reasons: Automake supports renaming files at install time via configure's --program-prefix and related options; Automake supports setting DESTDIR at installation-time. So maybe one of these is having an effect. Fixing the...

automake: exclude intermediary source file from “dist” tarballs

autotools,automake

The solution is actually quite simple nodist_foobar_SOURCES = foobar.c BUILT_SOURCES = foobar.c This way automake knows that foobar.c is generated at build time, and since it's in nodist_ it won't be redistributed. Although depending on what kind of string you're talking about a common way to solve it is to...

adding platform specific flags in makefile

linux,windows,makefile,mingw,autotools

You should add the check to your configure.ac, something like this: AC_CANONICAL_HOST case $host_os in *mingw*) mingw=true ;; *) mingw=false ;; esac AM_CONDITIONAL([MINGW], [test x$mingw = xtrue]) Then in Makefile.am, you can do if MINGW AM_LDFLAGS += -lws2_32 AM_LDFLAGS += -Xlinker --allow-multiple-definition endif Make sure you don't indent the body...

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

c,unix,make,autotools

This isn't possible as far as I know. autogen is a strange beast; the files it creates are necessary to build the project (configure and Makefile.am). That means autogen is more part of the "unpack sources" than the "compile source code into product" step. After you have run autogen, you...

autoconf: variable substitution for “configure --help”

autotools,autoconf,m4

Define the string as an M4 macro: m4_define([FOOBAR_HELP_STR], [Turn on the foobar features]) AC_ARG_ENABLE([foobar], [AS_HELP_STRING([--enable-foobar], [FOOBAR_HELP_STR])]) ...

Difference between autoconf and autoreconf

autotools,autoconf,autoreconf

autoconf generates the configure script from various input files, some of which are created using other tools like aclocal, automake, etc. autoreconf is a helper that knows how to call all these tools in the right order You'll usually just call autoreconf yourself and let it deal with all the...

OSX autotools: `aclocal.m4' not being output by `autom4te'

osx,shell,macports,autotools,m4

GNU Autotools does not support execution over a working directory stored on a FAT32 file system. It results in spurious m4trace debug messages being output to the generated configure script. It is unknown why this is, but may be related to the reliance on the sleep command to check whether...

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

gcc,tesseract,autotools,libtool

I followed this thread and turn to compile tesseract 3.03.03, it compiles OK so far. I will continue update my progress.

autotools syntax error with ax_check_compile_flag

c++,linux,autotools,configure

autoreconf isn't magic (though I encounter package maintainers who obviously believe this). When you ran autoreconf, it failed to find the AX_CHECK_COMPILE_FLAG macro, and produced a corrupt configure script. Usually that produces an error/diagnostic message at the same time. 'AX_CHECK_COMPILE_FLAG` comes from the autoconf archive project, and Debian has a...

needed packages to run autoreconf and configure on debian wheezy

linux,autotools,autoreconf

Just use sudo apt-get install binutils make csh g++ sed gawk autoconf automake autotools-dev ...

Autotools and OpenSSL MD5/RAND_bytes undefined

c++,gcc,autotools

Remove -lssl -lcrypto from the LDFLAGS for your libraries; the way the link editor works, LDFLAGS are passed before the object files, and that means they are discarded; in at least some version of the link editor, the libraries passed before object files are also "blacklisted", or to be precise,...

How to specify multiple source files in Makefile.am

c,makefile,autotools,automake

All you have to do is add them to the hellworld_SOURCES each file is delimited by a space. AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = helloworld helloworld_SOURCES = hello.c x.c y.c b.c ...

How to build gperftools as a static library?

configure,autotools,gperftools

You might try something like this: ./configure --disable-shared CXXFLAGS=-g && make It depends on several factors, including your platform, compiler and gperftools version. You can refer to the documentation here: gperftools README gperftools INSTALL ...

Determining Architecture In Makefile.am using Automake

autotools,automake,computer-architecture

Selecting the CPU and OS is better handled in configure.ac, which has AC_CANONICAL_HOST which parses the output from uname and puts it in a standard format: configure.ac ... AC_CANONICAL_HOST WRAPPER_CPPFLAGS="" AS_CASE([$host_os], [linux*], [ WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -DLINUX" AS_CASE([$host_cpu], [x86_64], [ WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -DAMD64 -I../../../external/xerces-c-3.1.1-x86_64-linux-gcc-3.4/include" ], [i?86], [ WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -I../../../external/xerces-c-3.1.1-x86-linux-gcc-3.4/include" ]) ],...

AC_SEARCH_LIBS is not finding my library

c,autotools,glib

After a bit of searching, I found that I needed to use PKG_CHECK_MODULES as shown below: AC_INIT([myproject], [123], [[email protected]]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.3.0]) AC_SUBST([GLIB_CFLAGS]) AC_SUBST([GLIB_LIBS]) AM_INIT_AUTOMAKE AC_PROG_CC AC_OUTPUT([Makefile src/Makefile]) Then the GLIB variables needed to be added to src/Makefile.am: bin_PROGRAMS = helloworld helloworld_SOURCES = main.c helloworld_LDADD = @[email protected] helloworld_CFLAGS =...

Unable to pass LDFLAGS to autoconf test (AC_LINK_IFELSE)

autotools,autoconf

You You need to pass the -L option to LDFLAGS, not just a path; I also suggest to pass the variable to ./configure rather than as environment: $ ./configure --prefix="${PWD}/../target/cpp" LDFLAGS="-L${PWD}/../target/cpp/lib" Alternatively, you can pass it to LIBS too, as the search path can be passed in either variables correctly...

Link static library with static library

c,linker,autotools,automake

You can't do it. Actually, what you are trying to do doesn't really make sense. Static libraries are just archives containing object files and a table of contents. Put simply, you can think of a static library as a .zip containing .o files. The linking phase only takes place when...

How to set compiler-specific flags with autotools

gcc,clang,autotools,compiler-options

AM_CXXFLAGS isn't something you should AC_SUBST. It is reserved for use by automake. If you look at the Makefile generated for a C++ target, you will find definitions for CXXCOMPILE and LTCXXCOMPILE, which always include the AM_CXXFLAGS variable. You want to add the (conditional) compiler flag to AM_CXXFLAGS or to...

AC_SUBST does not expand variable

autotools,autoconf,automake,m4

Unfortunately, you can't substitute Makefile variables like datadir at configure-time, since they aren't fully expanded. (See the documentation here.) The unfortunate solution if you want to do both configure-time and build-time substitutions is to do a two-step substitution, from foo.conf.in.in to foo.conf.in at configure time, and foo.conf.in to foo.conf at...

How to deal with autoconf warning “'%'-style pattern rules are a GNU make extension”

makefile,autotools,autoconf

Replace %.o: %.c with .c.o: That's a suffix rule doing the same thing, and it's more portable. If your rule involves a suffix that is not known to make, list it in the prerequisites for the special .SUFFIXES target: .SUFFIXES: .hack .win .hack.win: # build a .win file from a...

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

linux,autotools,autoconf,m4

Your configure.ac is almost ok. The only problem is space between AS_IF and the parenthesis. No whitespace is allowed between a macro name and the opening parenthesis in m4 scripts. This is correct syntax: AC_CHECK_HEADER(check.h, [], [ AS_IF(test "$(lsb_release -cs)" = "vivid", [echo aaaaaa], [echo bbbbbb]) ]) If you are...

Building only a small subset of project using autotools

make,autotools,autoconf

If you want to conditionally compile something with automake using a regular make command with no arguments, you have to use automake conditionals (the if HAVE_MINI thing you refer to); there is no other way. However, what you can do, alternatively, is to create an extra target (say, build_mini) in...

Disable optimizations for a specific file with autotools

makefile,autotools

I went with Brett Hale's comment to use subpackages. I was able to insert : ${CFLAGS="-O0"} before AC_PROG_CC, which sets the appropriate optimization. The other solutions do not work, since the -g -O2 was getting added very last. You can never get another -O variable after it....

Makefile process different files in different steps

c++,makefile,gnu,autotools,tntnet

You can use either Suffix rules or Pattern rules. In your case, both should do the job equally well. The only difference is that Pattern rules are GNU-Make-specific (not compatible with Unix make), though the GNU manual I linked to discourages the use of the Suffix rules, probably because its...

Why autoconf preset output variables for directories are written in small letters?

makefile,autotools

I don't know the original reason why Automake and Autoconf do this, but probably because some people were using this convention in their Makefiles before Automake was written. If you use Automake, then you have to follow this convention. A somethingdir variable has a special meaning, it tells Automake where...

Make autotools add --std=C11 to CFLAGS

c,autotools,c11

Most simply by putting CFLAGS+=" -std=c11" into your configure.ac (in addition to AC_PROG_CC). configure.ac is a template for a shell script, so you can simply put shell code in it. In fact, all the AC_FOO_BAR m4 macros expand to shell code themselves. Caveat: This will not check whether your compiler...

Separate build directory for autotools projects not designed to use one

build,autotools

Out-of-tree building is a feature of Autotools that requires both Autoconf and Automake. Vim and Git both only use Autoconf and not Automake, so they can't take advantage of that feature. As a more general answer to your question: simple Autotools projects should work with out-of-tree builds automatically. When using...

Autotools: top_srcdir and abs_top_srcdir are empty

autotools,autoconf,libtool

You should not use srcdir as a variable to determine the path to a built object. Use $(top_builddir) instead. To use Makefile variables you need to use brackets either $() or ${}....

Build a project without “Makefile.am”, just using Autoconf & Autoscan?

build,makefile,autotools,autoconf,automake

As the link says, Makefile.in is the template for Makefile which would just have @[email protected] macros for configure (via AC_CONFIG_FILES) to substitute. If the project is really simple, I can imagine it would work OK without automake. All autoscan and autoheader do is help you build primitive configure.ac and config.h...

define a variable in configure.ac as output of a command

autotools

I don't think you can do what you seem to want in configure.ac alone. This code: $(shell svnversion -n .) seems to be for when make is actually run. When configure calls AC_OUTPUT all your AC_DEFINEs are written into config.h at that time. Which is before make, so anything written...

Autodetect source for automake

c++,c,makefile,autotools,automake

So I have found a workaround, I use a sed to change the Makefile.am during the configure. # Source + dependency. files=`find ./src/ -type f | grep -E '\.h$$|\.hpp$$|\.c$$|\.cpp$$' | sed 's/\/src//g'` sed -i '/.*_SOURCES.*/c\'"$soft"'_SOURCES = '"$files"'' src/Makefile.am It's work fine, when we add sources, we just need to do...

Library versions string in autoconf

c++,autotools,autoconf,automake

The .so version should always start at 0:0:0. It should not be tied to your project's software version number. Libtool version numbers are referred to as current:revision:age and don't necessarily map to the .so file's suffix on any particular platform. Here is a summary of the explanation given at this...

How to reuse objects between Automake program and tests targets?

autotools,automake,libtool

No, there's not. The point is that you're not rebuilding the sources, you're rebuilding binaries. What you can do is build an intermediate .o consisting only of the shared sources, and then use that in your tests, and binaries....

what does it mean? configure.ac: warning: missing AC_CHECK_FUNCS(gettimeofday)

autotools,autoconf

autoscan is telling you that because gettimeofday is a potential portability issue, you should have a configure check for it. So what you would need to do is add AC_CHECK_FUNCS(gettimeofday) to configure.ac, rerun autoreconf, and then decorate your C code with #ifdef HAVE_GETTIMEOFDAY That's the general process. Personally, I think...