How can I distribute automatic variables in subpackage setup?

I have a subpackage setup in my autotools repository in which several related projects are glued together using master configure.ac and Makefile.am.

In addition to streamlining compilation that is easy to do with the AC_CONFIG_SUBDIRS () macro, you must export the library headers and locations needed between these overly related subprojects.

--- configure.ac
 |- Makefile.am
 |- subproj1 --- configure.ac
 |            |- Makefile.am
 |            |- src
 |            \- include
 [...]
 |
 \- subprojN --- configure.ac // requires -I${top_srcdir}/subprojX/include and
              |- Makefile.am  // -L${top_srcdir}/subprojX/src
              |- src
              \- include

Rearrangement of these packages, unfortunately, is not an option. I tried to export the variables using the AC_SUBST () command and / or to do the export command, but to no avail.

, Makefile, CPPFLAGS LDFLAGS root configure ( ). , , autotools, , script.

PS: automake

+3
2

Autotools , , . , subprojN/Makefile.am :

AM_CPPFLAGS = -I$(srcdir)/../subprojX/include
AM_LDFLAGS = -L$(srcdir)/../subprojX/lib

, subprojN/configure libsubprojX, , ../subprojX/{include,lib} CPPFLAGS LDFLAGS configure, configure.ac:

CPPFLAGS="$CPPFLAGS -I${srcdir}/../subprojX/include
LDFLAGS="$LDFLAGS -L${srcdir}/../subprojX/lib"

configure , , LDADD Makefile.am, .

+2

CPPFLAGS LDFLAGS ( ), config.site. ${prefix}/share/config.site $CONFIG_SITE (.. $HOME/config.site CONFIG_SITE = $HOME/config.site , configure) script . , " autotool", , config.site . LDFLAGS CPPFLAGS - , script , , , autotools. (, , - . , gcc LIBRARY_PATH CPATH.)

0

All Articles