automake
[Top][All Lists]
Advanced

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

Nested Packages: multiple dependencies among autoconfiscated packages


From: Vítor Moscon
Subject: Nested Packages: multiple dependencies among autoconfiscated packages
Date: Wed, 6 Jul 2011 13:09:47 -0700 (PDT)

Hi,
I am facing a problem with nested packages which have mutual library and
header dependencies. 
I will try to explain my problem based on some changes of the arm and hand
example, in 7.4 Nesting Packages, from GNU. Suppose that instead of having
arm and hand packages my project application has body as main package and
trunk, arm and leg as subpackages (autoconfiscated). The packages arm and
leg call functions from trunk subpackage, so they have library and header
dependencies on trunk. Here comes my question. How can I pass library and
header paths to configure and compile my subpackages arm and leg? If it is
possible, please, show me what I have to change in the files configure.ac
and Makefile.am bellow:


directory hierarchy:

body 
|--> trunk
|--> arm
|--> leg


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 from 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 = arm leg trunk
     
# 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


Thanks,
Vítor Moscon.
-- 
View this message in context: 
http://old.nabble.com/Nested-Packages%3A-multiple-dependencies-among-autoconfiscated-packages-tp32006824p32006824.html
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.




reply via email to

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