| |
 |
|
|
Linux Forum Index » Linux Development - Applications » Inserting variables into a Makefile using Autotools....
Page 2 of 2 Goto page Previous 1, 2
|
| Author |
Message |
| YourSurrogateGod... |
Posted: Mon Aug 18, 2008 12:39 am |
|
|
|
Guest
|
On Aug 18, 12:55 am, William Pursell <bill.purs... at (no spam) gmail.com> wrote:
Quote: On 17 Aug, 23:08, YourSurrogateGod <andrew.shv... at (no spam) gmail.com> wrote:
On Aug 16, 3:43 am, William Pursell <bill.purs... at (no spam) gmail.com> wrote:
-I tells the pre-processor where to find the headers, but it doesn't
inform the linker about the libraries. You probably want to set
LIBS via a call to AC_CHECK_LIBS or PKG_CHECK_MODULES
(in configure.ac) If you're not using pkg-check for your library,
you'll have to
use AC_CHECK_LIBS, but you probably want to start using
pkg-check. I've found that it's biggest advantage is that it
doesn't spoil configure caches. Using AC_CHECK_LIBS while
developing in an environment where libraries that are in use are
constantly being installed/uninstalled causes configure caches to be
totally useless without pkg-config.
Thing is, I disabled all of that checking in the configure.ac file. Is
there a way to set it in Makefile.am?
Doing the checks in configure.ac is the easiest way to get
the proper -l and -L flags into the Makefile.
I'm looking at this from the
below link:
=================================> > SUBDIRS = wrapper
XFLAIM_INCLUDE=-I$(srcdir)/..
noinst_LTLIBRARIES = libxfjni.la
libxfjni_la_SOURCES = \
jbackup.cpp \
jdatavector.cpp \
jdb.cpp \
jdbsystem.cpp \
jdomnode.cpp \
jistream.cpp \
jniftk.cpp \
jniftk.h \
jnirestore.cpp \
jnirestore.h \
jnistatus.cpp \
jnistatus.h \
jostream.cpp \
jquery.cpp
libxfjni_la_CPPFLAGS =\
$(XFLAIM_INCLUDE) $(FTK_INCLUDE)
==================================http://www.freesoftwaremagazine.com/books/agaal/autotools_example
Can I set noinst_LTLIBRARIES to do it for me?
I'm not sure I understand your question. Specifying
noinst_LTLIBRARIES tells
automake that your Makefile should include rules to create a
particular
library, but it doesn't pass any information to the linker about the
location
of other libraries. Are you having trouble linking an application
against
a convenience library that you are using, or are you having trouble
linking an application against a library that is external to this
particular
project?
CPPFLAGS will only provide the -I (eye) flags, but you need -l (el)
and -L as well.
If you do the check in configure.ac using AC_CHECK_LIBS, you need
do nothing in your Makefile.am. Or you can specify LIBS at configure
time
or in configure.ac. Or, if you are not interested in ever using the
software
on a different platform or a different configuration (libraries
installed in
other locations than they are today on your maching) you can probably
get away with hardcoding AM_LDFLAGS in Makefile.am, but **this is
usually
a bad idea**.
The libraries are internal to the project. They're simply in a
different directory. |
|
|
| Back to top |
|
| YourSurrogateGod... |
Posted: Mon Aug 18, 2008 12:48 am |
|
|
|
Guest
|
On Aug 18, 6:39 am, YourSurrogateGod <andrew.shv... at (no spam) gmail.com> wrote:
Quote: On Aug 18, 12:55 am, William Pursell <bill.purs... at (no spam) gmail.com> wrote:
On 17 Aug, 23:08, YourSurrogateGod <andrew.shv... at (no spam) gmail.com> wrote:
On Aug 16, 3:43 am, William Pursell <bill.purs... at (no spam) gmail.com> wrote:
-I tells the pre-processor where to find the headers, but it doesn't
inform the linker about the libraries. You probably want to set
LIBS via a call to AC_CHECK_LIBS or PKG_CHECK_MODULES
(in configure.ac) If you're not using pkg-check for your library,
you'll have to
use AC_CHECK_LIBS, but you probably want to start using
pkg-check. I've found that it's biggest advantage is that it
doesn't spoil configure caches. Using AC_CHECK_LIBS while
developing in an environment where libraries that are in use are
constantly being installed/uninstalled causes configure caches to be
totally useless without pkg-config.
Thing is, I disabled all of that checking in the configure.ac file. Is
there a way to set it in Makefile.am?
Doing the checks in configure.ac is the easiest way to get
the proper -l and -L flags into the Makefile.
I'm looking at this from the
below link:
=================================> > > SUBDIRS = wrapper
XFLAIM_INCLUDE=-I$(srcdir)/..
noinst_LTLIBRARIES = libxfjni.la
libxfjni_la_SOURCES = \
jbackup.cpp \
jdatavector.cpp \
jdb.cpp \
jdbsystem.cpp \
jdomnode.cpp \
jistream.cpp \
jniftk.cpp \
jniftk.h \
jnirestore.cpp \
jnirestore.h \
jnistatus.cpp \
jnistatus.h \
jostream.cpp \
jquery.cpp
libxfjni_la_CPPFLAGS =\
$(XFLAIM_INCLUDE) $(FTK_INCLUDE)
==================================http://www.freesoftwaremagazine.com/books/agaal/autotools_example
Can I set noinst_LTLIBRARIES to do it for me?
I'm not sure I understand your question. Specifying
noinst_LTLIBRARIES tells
automake that your Makefile should include rules to create a
particular
library, but it doesn't pass any information to the linker about the
location
of other libraries. Are you having trouble linking an application
against
a convenience library that you are using, or are you having trouble
linking an application against a library that is external to this
particular
project?
CPPFLAGS will only provide the -I (eye) flags, but you need -l (el)
and -L as well.
If you do the check in configure.ac using AC_CHECK_LIBS, you need
do nothing in your Makefile.am. Or you can specify LIBS at configure
time
or in configure.ac. Or, if you are not interested in ever using the
software
on a different platform or a different configuration (libraries
installed in
other locations than they are today on your maching) you can probably
get away with hardcoding AM_LDFLAGS in Makefile.am, but **this is
usually
a bad idea**.
The libraries are internal to the project. They're simply in a
different directory.
Yeh, as I re-read it, I didn't mean noinst_LIBRARIES. Ooops. But the
reason for specifying the libraries in AM_LDFLAGS is that the
executable is in a different directory than the files. The files are
part of the project, so if they go at one point, on a different
machine, then we'll obviously need to re-write them. |
|
|
| Back to top |
|
| |
Page 2 of 2 Goto page Previous 1, 2
All times are GMT - 5 Hours
The time now is Fri Nov 21, 2008 8:37 pm
|
|