automake
[Top][All Lists]
Advanced

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

Nested Packages: header and library dependencies among autoconfiscated p


From: Vítor da Rosa
Subject: Nested Packages: header and library dependencies among autoconfiscated packages.
Date: Thu, 7 Jul 2011 15:14:47 -0300

I am facing a problem with library and header dependencies among
autoconfiscated packages.

I will explain my problem based on a modified version of "arm and hand"
example package I got from "GNU Automake Manual", chapter 7.4 Nesting
Packages. Suppose that instead of having arm and hand packages, this example
has body as main package and trunk, arm and leg as subpackages
(autoconfiscated), such as described by the following directory hierarchy:

body (main package)
|--> trunk (autoconfiscated package)
|--> arm (autoconfiscated package)
|--> leg (autoconfiscated package)

(Note that these autoconfiscated packages are into body package because they
are still in development. In this way, getting the advantages of using
nested packages features from autotools!)

The problem is that packages arm and leg have calls to functions in trunk
subpackage, so they have library and header dependencies on trunk. Here
comes my question:

* What is the best way to set library and header paths in the autotools
files bellow?

body's configure.ac:

AC_PREREQ([2.67])
AC_INIT([body], [1.0])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])

# Call ./configure script recursively of trunk, arm and leg.
AC_CONFIG_SUBDIRS([
trunk
arm
leg
])
AC_OUTPUT

body's Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
# Build the library in the arm, leg and trunk subdirectory first.
SUBDIRS = trunk arm leg

# Include headers from arm, leg and trunk when compiling this directory.
AM_CPPFLAGS = -I$(srcdir)/arm -I$(srcdir)/leg -I$(srcdir)/trunk

lib_LTLIBRARIES = libbody.la
libbody_la_SOURCES = src/body.c
# link with the arm, leg and trunk library.
libbody_la_LIBLDADD = arm/libarm.la leg/libleg.la trunk/libtrunk.la


Now here is trunk's trunk/configure.ac:

AC_INIT([trunk], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

and its trunk/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libtrunk.la

Now here is arm's arm/configure.ac:

AC_INIT([arm], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

and its arm/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libarm.la
libarm_la_SOURCES = src/arm.c


Now here is leg's leg/configure.ac:

AC_INIT([leg], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

and its leg/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libleg.la
libleg_la_SOURCES = src/leg.c


Regards,
Vitor Moscon.


reply via email to

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