[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Nested Packages: dependencies between autoconfiscated packages
From: |
Vítor da Rosa |
Subject: |
Nested Packages: dependencies between autoconfiscated packages |
Date: |
Sat, 9 Jul 2011 22:45:17 -0300 |
Hello,
I am facing a problem with subpackages (autoconfiscated) which have
library and header dependencies between them. I will try to explain my
problem based on a nested package example similiar to the arm and hand
example, described in 7.4 Nesting Packages from GNU Automake Manual.
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 packages), such as the following
directory hierarchy:
body
|--> trunk
|--> arm
|--> leg
The packages arm and leg call functions from trunk subpackage, so they
have library and header dependencies on trunk. Here comes my question.
What should be set in configure.ac or Makefile.am from body package to
to 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:
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,
Vitor Moscon
- Nested Packages: dependencies between autoconfiscated packages,
Vítor da Rosa <=