automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing command lines in Makefile.am


From: Pedro Sousa
Subject: Passing command lines in Makefile.am
Date: Fri, 29 Sep 2006 12:22:38 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060922)

Hi,

Currently I'm trying to compile an application in fltk with autotools.

I'm having an problem with my Makefile.am that I can't find solution on
the web. The problem is that fltk must be application that uses fltk API
must be linked against the fltk library, but for this they give an
command line tool that returns the needed compilation/linker options.

For example

fltk2-config --cxxflags  -> gives the compile command options
fltk2-config --ldflags    -> gives the linking command options

For this I supposed that I could make a simple Makefile.am like this
-------------------------------------------------------------------------
FLTK_CXXFLAGS = `fltk2-config --cxxflags`
FLTK_LDFLAGS = `fltk2-config --ldflags`

AM_CPPFLAGS = $(FLTK_CXXFLAGS)

bin_PROGRAMS = demo

demo_SOURCES = demo.cpp

demo_LDADD = $(FLTK_LDFLAGS)
------------------------------------------------------------------------

But this gave me the output
Makefile.am:10: linker flags such as `--ldflags`' belong in `demo_LDFLAGS

If I subtitute the FLTK_LDFLAGS value with the command line output:
-----------------------------------------------------------------------------
FLTK_LDFLAGS = -L/usr/local/lib -lfltk2 -L/usr/X11R6/lib -lX11 -lXi
-lXinerama -lXft -lpthread -lm -lXext -lsupc++
------------------------------------------------------------------------------

I get no problem in linking and compiling my example.

For me, the strange is that I can give the compilation flags in the
normal way, but the in linking problem I get errors. What can I do to
change this?

Thanks in regards
           Pedro Sousa





reply via email to

[Prev in Thread] Current Thread [Next in Thread]