Discussion:
autoconf not passing all the flags needed to g++
Robert Stolarz
2015-06-24 16:48:16 UTC
Permalink
I'm trying to adapt the library soil2 to work with autoconf.
http://pastebin.ca/raw/3035774 is what I have so far. My g++ invocation
reads `g++ -I/usr/include/libdrm -Wall -v -g -O2 -lGLEW -lGLU -lGL -lglfw
-lm -o giants src/main.o` and `pkg-config --libs soil2` yields
"-L/usr/lib/linux -lsoil2". Why aren't the soil2 flags showing up in my g++
invocation?
Gavin Smith
2015-06-24 18:12:22 UTC
Permalink
Post by Robert Stolarz
I'm trying to adapt the library soil2 to work with autoconf.
http://pastebin.ca/raw/3035774 is what I have so far. My g++ invocation
reads `g++ -I/usr/include/libdrm -Wall -v -g -O2 -lGLEW -lGLU -lGL -lglfw
-lm -o giants src/main.o` and `pkg-config --libs soil2` yields
"-L/usr/lib/linux -lsoil2". Why aren't the soil2 flags showing up in my g++
invocation?
You do

AM_CXXFLAGS = @gllibs_CFLAGS@ -Wall -v
AM_LDFLAGS = @gllibs_LIBS@ -lm

and

PKG_CHECK_MODULES([gllibs], [gl glew glfw3 >= 3.0])
PKG_CHECK_MODULES([soil2], [soil2])

i.e. you use the result of the gllibs check but not the result of the
soil2 check. It should rather be

AM_CXXFLAGS = @gllibs_CFLAGS@ @soil2_CFLAGS@ -Wall -v
AM_LDFLAGS = @gllibs_LIBS@ @soil2_CFLAGS@ -lm

Loading...