Why would the following automake configuration build successfully on Debian Sid and not Ubuntu 14.04? I'm getting undefined reference errors, but the linker flags are set...

ACLOCAL_AMFLAGS = -I m4 --install
dist_doc_DATA = README.md

noinst_LIBRARIES = libtib.a libliberti.a
bin_PROGRAMS = liberti tibencode tibdecode

libtib_a_SOURCES = src/tibeval.c src/tiberr.c src/tibexpr.c src/tibchar.c \
                   src/tiblst.c src/tibtranscode.c src/tibtype.c
libtib_a_CFLAGS = -Wall -Wextra -Wunreachable-code -ftrapv -std=c89 \
                  $(gsl_CFLAGS)

libliberti_a_SOURCES = src/command.c
libliberti_a_CFLAGS = -Wall -Wextra -Wunreachable-code -ftrapv -std=c89

liberti_SOURCES = src/liberti.c
liberti_CFLAGS = -Wall -Wextra -Wunreachable-code -ftrapv -std=c89 \
                 $(sdl2_CFLAGS)
liberti_LDADD = $(sdl2_LIBS) $(gsl_LIBS) libtib.a libliberti.a

tibencode_SOURCES = src/tibencode.c
tibencode_CFLAGS = -Wall -Wextra -Wunreachable-code -ftrapv -std=c89
tibencode_LDADD = $(gsl_LIBS) libtib.a

tibdecode_SOURCES = src/tibdecode.c
tibdecode_CFLAGS = -Wall -Wextra -Wunreachable-code -ftrapv -std=c89
tibdecode_LDADD = $(gsl_LIBS) libtib.a

AM_CFLAGS = $(DEPS_CFLAGS)
AM_LIBS = $(DEPS_LIBS)

The _LIBS variables are set by autoconf from these lines:

PKG_CHECK_MODULES([sdl2], [sdl2])
PKG_CHECK_MODULES([gsl], [gsl])
share|improve this question
    
What do you mean by 'the linker flags are set'? Do you mean that they appear in the output of the configure script and you actually see them printed on the command line that is failing, or do you mean that PKG_CHECK_MODULES was invoked in configure.ac? This is probably a pkg-config issue, but then I'm biased against PKG_CHECK_MODULES and generally assume that the problem you are having is that you are relying on it. – William Pursell Jun 21 '15 at 13:42
    
I have checked the output of the relevant pkg-config calls and determined that they are correct and should link with the right libraries for the functions I use. It's the same output as on Debian. It must be something to do with the argument order, because I just tested with make CC=clang, and it worked fine, and I know that clang seems to be more lenient with CLI argument ordering. – 2mac Jun 21 '15 at 18:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.