Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:08:59+00:00 2026-06-02T18:08:59+00:00

I have a sub-package setup in my autotools repository, in which several related projects

  • 0

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

Aside from the compilation ordering, easily done via AC_CONFIG_SUBDIRS() macro, there is the need to export headers and library locations required between these excessively coupled sub-projects.

--- 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

Regrouping these packages as one is not an option, unfortunately. I tried exporting variables using AC_SUBST() and/or make’s export command, for no avail.

The only way I could get these flags available into every sub-project Makefile was passing CPPFLAGS and LDFLAGS into the root configure invocation (via command-line). However, I’d hope if there is a way to keep these values inside autotools stuff, instead of having to create a separate script for them.

PS: similar to automake and project dependencies

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:09:00+00:00Added an answer on June 2, 2026 at 6:09 pm

    The autotools are not really designed to be a package management system, so this is an awkward usage, but it is possible to reference relative paths outside of the build tree in the sub-projects. In other words, in subprojN/Makefile.am, you can add:

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

    In this scenario, if subprojN/configure is trying to find libsubprojX, it will fail unless you instead add ../subprojX/{include,lib} to CPPFLAGS and LDFLAGS for configure, which can be done in configure.ac:

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

    If the configure scripts of the subprojects are not checking for the libraries in the coupled subprojects, it would probably be cleaner to specify LDADD in Makefile.am to get the necessary libraries linked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these two modules : package G1; sub new { my $class =
I have list of categories , some have sub-category and some have sub-sub-category which
I have a sub-classed CAOpenGLLayer class which overrides drawInCGLContext there I draw a rectangle
I have a sub named lookup which does a lookup in a hash for
I'm using android version 2.2 and I cant find android.bluetooth.IBluetoothA2dp in the bluetooth sub-package
I have such structure: setup.py package __init__.py sub_package ___init__.py sub_package2 __init__.py If I install
I have a library which has root package scala, and now I have a
I have a current build process which does a .NET build using MSBuild and
I have put together a little test case to demonstrate my problem: package P1;
I have the following code :- package A; sub new{ //constructor for A }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.