automake
[Top][All Lists]
Advanced

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

LDADD contra LDFLAGS; various `*-config` programs


From: Martin Henne
Subject: LDADD contra LDFLAGS; various `*-config` programs
Date: Mon, 17 Nov 2003 14:51:44 +0100
User-agent: KMail/1.5.4

Hi all,

I am new to the GNU autotools and I only have basic knowledge
about how to use them. But in other NG's I was pointed to this
mailinglist with my problem, so it might or might not be the right
place for this question :-(

In my application, I have to use an external API, that comes with
a config-program, that produces flags for compiling and linking.
There are various such programs on the net, like gtk-config,
cs-config (crystal space 3d api), fltk-config (fltk GUI Toolkit)....

Most of those programs produce the -L and the -l flags in 
one line when called with '--libs'. E.g. `gtk-config --libs`
produces on my system:

-L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule \
        -lglib -ldl -lXi -lXext -lX11 -lm

and `cs-config --libs` (which is the one I actually need here) gives:

-L/opt/CS/./out/linuxx86/optimize/libs/cssys -L/opt/CS/./out/linuxx86/ \
        optimize/libs/csutil -L/opt/CS/./out/linuxx86/optimize/libs/cstool \
        -L/opt/CS/./out/linuxx86/optimize/libs/csengine \
        -L/opt/CS/./out/linuxx86/optimize/libs/csgfx \
        -L/opt/CS/./out/linuxx86/optimize/libs/csgeom \
        -L/opt/CS/./out/linuxx86/optimize/libs/csws -lcstool -lcsgfx  \
        -lcssys -lcsutil -lcssys -lcsgeom -lcstool -lcsgfx  -lcssys -lcsutil \
        -lcssys -lcsgeom -lcstool -lcsgfx  -lcssys -lcsutil -lcssys -lcsgeom \
        -lpthread  -lm -ldl -lnsl

According to an autoconf manual, that I found on the net, in my
Makefile.am I have to use LDFLAGS for the -L parameters and
LDADD for adding the libraries with -l. 

Unfortunately, the config-programs only produce both in one line, which
should be completely o.k., according to the automake manual, which
says, that LDADD can be used for -l and -L switches.

But if I try this, the call to 'automake' produces an error message:

src/Makefile.am:15: linker flags such as `--libs`' belong in \
        `carriercommander_LDFLAGS

What can I do, to solve this?

I'm using automake-1.7 and autoconf-2.58 on a debian sid.
Here's my configure.in, Makefile.am and autogen.sh:

// configure.in

AC_INIT(src/main.cpp)
AM_INIT_AUTOMAKE(carriercommander,0.1)
AM_CONFIG_HEADER(config.h)
AC_PROG_CXX
AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile)

// Makefile.am

AUTOMAKE_OPTIONS = foreign
SUBDIRS = src

// src/Makefile.am

AUTOMAKE_OPTIONS = foreign
INCLUDES = `cs-config --cxxflags`
CPPFLAGS = -ansi -Wall
bin_PROGRAMS = carriercommander

carriercommander_SOURCES = carriercommander.cpp carriercommander.h \
        clparser.cpp clparser.h crystalbase.cpp crystalbase.h csincludes.h \
        debug.h exceptions.h eye.cpp eye.h globalaccess.cpp globalaccess.h \
        ...... many *.cpp and *.h sources here ......

# cs-config --libs produces -L and -l stuff:
carriercommander_LDADD = `cs-config --libs`

// autogen.sh

#!/bin/sh

aclocal
autoheader
automake --foreign --add-missing
autoconf
exit 0



Tnx in advance for helping me.

Martin


-- 
address@hidden
http://www.martinhenne.de





reply via email to

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